index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
  3. :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
  4. :moreParameters="moreParameters">
  5. <div class="cartographer_big">
  6. <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
  7. <zj-page-container v-if="formBool">
  8. <zj-page-fill class="neibuview">
  9. <zj-form-container ref="formRef" :form-data="formData" :formAttributes="{ 'label-position': 'top' }">
  10. <zj-form-module title="费用信息" :form-data="formData" :form-items="formItems">
  11. </zj-form-module>
  12. <zj-form-module v-if="formBool && formData.payType !== 'WECHAT'" title="审批信息" :form-data="formData"
  13. :form-items="spFormItems">
  14. <div v-if="openType === 1" style="text-align:right">
  15. <el-button size="mini" type="danger" plain @click="WAITfun">确定</el-button>
  16. </div>
  17. </zj-form-module>
  18. </zj-form-container>
  19. </zj-page-fill>
  20. </zj-page-container>
  21. </el-dialog>
  22. </div>
  23. </template-page>
  24. </template>
  25. <script>
  26. import TemplatePage from '@/components/template/template-page-1.vue'
  27. import import_mixin from '@/components/template/import_mixin.js'
  28. import operation_mixin from '@/components/template/operation_mixin.js'
  29. import { enginMaterialList, enginMaterialListExport, enginMaterialDetail, enginMaterialExamine } from "@/api/applicationWithoutFee.js"
  30. import { required } from '@/components/template/rules_verify.js'
  31. import feel from "../mixins/feel.js"
  32. export default {
  33. components: {
  34. TemplatePage,
  35. },
  36. mixins: [import_mixin, operation_mixin, feel],
  37. data() {
  38. return {
  39. formBool: false,
  40. // 表格属性
  41. tableAttributes: {
  42. // 启用勾选列
  43. selectColumn: false,
  44. },
  45. // 表格事件
  46. tableEvents: {
  47. 'selection-change': this.selectionChange
  48. },
  49. formData: {
  50. examineStatus: "",
  51. examineRemark: "",
  52. },
  53. openType: 0
  54. }
  55. },
  56. computed: {
  57. moreParameters() {
  58. return [
  59. {
  60. name: '状态',
  61. key: 'examineStatus',
  62. value: '',
  63. conditions: [
  64. { label: "全部", value: "" },
  65. { label: "待审核", value: "WAIT" },
  66. { label: "审核通过", value: "OK" },
  67. { label: "驳回", value: "FAIL" },
  68. { label: "取消", value: "NO" },
  69. { label: "已支付", value: "PAID" },
  70. { label: "未支付", value: "NO_PAID" },
  71. ]
  72. }
  73. ]
  74. },
  75. spFormItems() {
  76. return [{
  77. name: 'el-radio',
  78. md: 24,
  79. options: [{ value: "OK", label: "审批通过" }, { value: "FAIL", label: "审批驳回" }],
  80. attributes: { disabled: this.openType == 0 },
  81. formItemAttributes: { label: '审批状态', prop: 'examineStatus', rules: [...required] },
  82. }, {
  83. name: 'el-input',
  84. md: 24,
  85. attributes: { disabled: this.openType == 0, type: "textarea", placeholder: '' },
  86. formItemAttributes: { label: '审批备注', prop: 'examineRemark' },
  87. }]
  88. }
  89. },
  90. methods: {
  91. // 列表请求函数
  92. getList(p, cb) {
  93. try {
  94. var pam = JSON.parse(JSON.stringify(p))
  95. pam.params.push({ "param": "is_all_fee", "compare": "=", "value": "NO" })
  96. if (pam.examineStatus) {
  97. pam.params.push({ "param": "examine_status", "compare": "=", "value": pam.examineStatus })
  98. }
  99. if (this.$route.query.rpProjectRepairId) {
  100. pam.params.push({ "param": "rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
  101. }
  102. cb && cb(pam)
  103. return enginMaterialList(pam)
  104. } catch (err) {
  105. console.log(err)
  106. }
  107. },
  108. // 列表导出函数
  109. exportList: enginMaterialListExport,
  110. // 表格列解析渲染数据更改
  111. columnParsing(item, defaultData) {
  112. return defaultData
  113. },
  114. // 监听勾选变化
  115. selectionChange(data) {
  116. this.recordSelected = data
  117. },
  118. operation() {
  119. return this.operationBtn({
  120. detail: {
  121. click: ({ row, index, column }) => {
  122. enginMaterialDetail({
  123. id: row.orderId
  124. }).then(res => {
  125. this.openType = 0
  126. this.formData = res.data
  127. this.$nextTick(() => {
  128. this.formBool = true
  129. })
  130. })
  131. }
  132. },
  133. examine: {
  134. conditions: ({ row, index, column }) => {
  135. return row.examineStatus == "WAIT"
  136. },
  137. click: ({ row, index, column }) => {
  138. enginMaterialDetail({
  139. id: row.orderId
  140. }).then(res => {
  141. this.openType = 1
  142. this.formData = res.data
  143. this.$nextTick(() => {
  144. this.formBool = true
  145. })
  146. })
  147. }
  148. },
  149. })
  150. },
  151. handleClose() {
  152. this.$refs.formRef.$refs.inlineForm.clearValidate()
  153. this.formData = {}
  154. this.formBool = false
  155. },
  156. WAITfun() {
  157. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  158. if (valid) {
  159. enginMaterialExamine({
  160. id: this.formData.orderId,
  161. examineStatus: this.formData.examineStatus,
  162. examineRemark: this.formData.examineRemark
  163. }).then(res => {
  164. this.$refs.pageRef.refreshList()
  165. this.handleClose()
  166. })
  167. }
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .neibuview {
  175. box-sizing: border-box;
  176. padding-left: 16px;
  177. ::v-deep &>.zj-page-fill-scroll {
  178. box-sizing: border-box;
  179. padding-right: 16px;
  180. &>div:nth-child(1) {
  181. margin-top: 20px;
  182. }
  183. }
  184. }
  185. </style>