移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

193 行
6.5 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar left-arrow fixed placeholder @click-left="goBack">
  4. <template #title>
  5. <p style="font-weight: bold;">资金审批申请详情</p>
  6. </template>
  7. <template #right>
  8. <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="goFlow"/>
  9. </template>
  10. </van-nav-bar>
  11. <van-form readonly>
  12. <div class="main_box">
  13. <van-field v-model="form.cashAt" label="申请日期" placeholder="请选择申请日期"
  14. required :rules="[{ required: true }]"
  15. input-align="right" right-icon="arrow-down"
  16. readonly clickable @click="showCashAt = true" />
  17. <van-popup v-model="showCashAt" position="bottom">
  18. <van-datetime-picker
  19. :value="currentDate"
  20. type="date"
  21. title="请选择申请日期"
  22. :min-date="minDate"
  23. :max-date="maxDate"
  24. @confirm="onConfirmCashAt"
  25. @cancel="showCashAt = false"
  26. />
  27. </van-popup>
  28. <van-field v-model="form.cashAmount" label="申请金额(元)" placeholder="请输入申请金额(元)"
  29. required :rules="[{ required: true }]" input-align="right" type="number" />
  30. <van-field v-model="capitalExpenditureType" label="资金支出类别" placeholder="请选择资金支出类别"
  31. required :rules="[{ required: true }]"
  32. input-align="right" right-icon="arrow-down"
  33. readonly clickable @click="showType = true" />
  34. <van-popup v-model="showType" position="bottom">
  35. <van-picker
  36. show-toolbar
  37. :columns="capitalExpenditureTypeOptions"
  38. value-key="dictLabel"
  39. @confirm="onConfirmType"
  40. @cancel="showType = false"
  41. />
  42. </van-popup>
  43. <van-field v-model="form.cashRemarks" label="支款说明" placeholder="请输入支款说明"
  44. required :rules="[{ required: true }]" input-align="right" maxlength="200" />
  45. <van-field v-model="form.cashierNo" label="付款账号" placeholder="请输入付款账号"
  46. input-align="right" maxlength="50" />
  47. <van-field v-model="form.cashierName" label="付款单位" placeholder="请输入付款单位"
  48. input-align="right" maxlength="150" />
  49. <van-field v-model="form.payeeName" label="收款方名称" placeholder="请输入收款方名称"
  50. input-align="right" maxlength="150" />
  51. <van-field v-model="form.payeePhone" label="收款方电话" placeholder="请输入收款方电话"
  52. input-align="right" maxlength="20" />
  53. <van-field v-model="approvalTemplateName" label="审批流程" placeholder="请选择审批流程"
  54. required :rules="[{ required: true }]"
  55. input-align="right" right-icon="arrow-down"
  56. readonly clickable @click="showTemplate = true"
  57. />
  58. <van-popup v-model="showTemplate" position="bottom">
  59. <van-picker
  60. show-toolbar
  61. :columns="templateList"
  62. value-key="name"
  63. @confirm="onConfirmTemplate"
  64. @cancel="showTemplate = false"
  65. />
  66. </van-popup>
  67. </div>
  68. </van-form>
  69. </div>
  70. </template>
  71. <script>
  72. import { selectApprovalByTemplateId, listTemplate } from "@/api/onlineHome/bankAgriculture/paymentApproval";
  73. import { getCashExpense } from "@/api/onlineHome/bankAgriculture/cashExpense";
  74. export default {
  75. name: "cashExpenseDetail",
  76. data() {
  77. return {
  78. showCashAt: false,
  79. minDate: new Date(1978, 0, 1),
  80. maxDate: new Date(2100, 11, 31),
  81. currentDate: new Date(),
  82. form: {},
  83. capitalExpenditureType: null,
  84. capitalExpenditureTypeOptions:[],
  85. showType: false,
  86. approvalTemplateName: null,
  87. showTemplate:false,
  88. templateList:[],
  89. };
  90. },
  91. created() {
  92. this.reset();
  93. this.getDicts("capital_expenditure_type").then((res) => {
  94. this.capitalExpenditureTypeOptions = res.data;
  95. });
  96. listTemplate({ type: '10' }).then(response => {
  97. this.templateList = response.rows;
  98. });
  99. this.getDetail();
  100. },
  101. methods: {
  102. goBack(){
  103. this.$router.push({path:'/yinnong/cashExpenseList'})
  104. },
  105. onConfirmCashAt(data) {
  106. this.form.cashAt = this.format(data, 'yyyy-MM-dd');
  107. this.showCashAt = false;
  108. },
  109. onConfirmType(value){
  110. this.form.capitalExpenditureType = value.dictValue;
  111. this.capitalExpenditureType = value.dictLabel;
  112. this.showType = false;
  113. },
  114. // 表单重置
  115. reset() {
  116. this.form = {
  117. id: null,
  118. bookId: null,
  119. deptId: null,
  120. bookName: null,
  121. cashAt: null,
  122. cashAmount: null,
  123. cashRemarks: null,
  124. capitalExpenditureType: null,
  125. cashierNo: null,
  126. cashierName: null,
  127. payeeName: null,
  128. payeePhone: null,
  129. approvalTemplateId: null,
  130. auditStatus: null,
  131. auditbatchNo: null,
  132. createBy: null,
  133. createTime: null,
  134. updateBy: null,
  135. updateTime: null
  136. };
  137. },
  138. getDetail(){
  139. getCashExpense(this.$route.query.id).then(response => {
  140. this.form = response.data;
  141. this.capitalExpenditureType = this.selectDictLabel(this.capitalExpenditureTypeOptions, response.data.capitalExpenditureType);
  142. const template = this.templateList.find(item => item.id === response.data.approvalTemplateId);
  143. this.approvalTemplateName = template.name;
  144. });
  145. },
  146. onConfirmTemplate(data) {
  147. selectApprovalByTemplateId(data.id).then(res => {
  148. this.showTemplate = false;
  149. if (res.approvalDetails.length > 0) {
  150. this.approvalTemplateName = data.name
  151. this.form.approvalTemplateId = data.id
  152. } else {
  153. this.approvalTemplateName = null;
  154. this.form.approvalTemplateId = null;
  155. this.$notify({type: 'danger', message: '此流程无节点,无法选择!'});
  156. }
  157. });
  158. },
  159. goFlow(){
  160. this.$router.push({path: '/yinnong/cashExpenseProcess', query: { id: this.form.id, templateId: this.form.approvalTemplateId }});
  161. },
  162. }
  163. }
  164. </script>
  165. <style scoped lang="scss">
  166. .app-container {
  167. padding: 2% 0;
  168. }
  169. .main_box {
  170. width: 96%;
  171. margin: 0 auto;
  172. border-radius: 6px;
  173. box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
  174. overflow: hidden;
  175. background-color: #FFF;
  176. }
  177. .submitButton {
  178. width: 80%;
  179. margin: 0 auto;
  180. background-color: #1D6FE9;
  181. }
  182. </style>