index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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_cp: "",
  51. examineStatus: "",
  52. examineRemark: "",
  53. },
  54. openType: 0
  55. }
  56. },
  57. computed: {
  58. moreParameters() {
  59. return [
  60. {
  61. name: '状态',
  62. key: 'examineStatus',
  63. value: '',
  64. conditions: [
  65. { label: "全部", value: "" },
  66. { label: "待审核", value: "WAIT" },
  67. { label: "审核通过", value: "OK" },
  68. { label: "驳回", value: "FAIL" },
  69. { label: "取消", value: "NO" },
  70. { label: "已支付", value: "PAID" },
  71. { label: "未支付", value: "NO_PAID" },
  72. ]
  73. }
  74. ]
  75. },
  76. spFormItems() {
  77. return [{
  78. name: 'el-radio',
  79. md: 24,
  80. options: [{ value: "OK", label: "审批通过" }, { value: "FAIL", label: "审批驳回" }],
  81. attributes: { disabled: this.openType == 0 },
  82. formItemAttributes: { label: '审批状态', prop: 'examineStatus_cp', rules: [...required] },
  83. }, {
  84. name: 'el-input',
  85. md: 24,
  86. attributes: { disabled: this.openType == 0, type: "textarea", placeholder: '' },
  87. formItemAttributes: { label: '审批备注', prop: 'examineRemark' },
  88. }]
  89. }
  90. },
  91. created() {
  92. if (this.$route.query.id) {
  93. this.formType = 0
  94. this.getDetail(this.$route.query.id)
  95. }
  96. },
  97. methods: {
  98. // 列表请求函数
  99. getList(p, cb) {
  100. try {
  101. var pam = JSON.parse(JSON.stringify(p))
  102. pam.params.push({ "param": "is_all_fee", "compare": "=", "value": "NO" })
  103. if (pam.examineStatus) {
  104. pam.params.push({ "param": "examine_status", "compare": "=", "value": pam.examineStatus })
  105. }
  106. if (this.$route.query.rpProjectRepairId) {
  107. pam.params.push({ "param": "rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
  108. }
  109. cb && cb(pam)
  110. return enginMaterialList(pam)
  111. } catch (err) {
  112. console.log(err)
  113. }
  114. },
  115. // 列表导出函数
  116. exportList: enginMaterialListExport,
  117. // 表格列解析渲染数据更改
  118. columnParsing(item, defaultData) {
  119. return defaultData
  120. },
  121. // 监听勾选变化
  122. selectionChange(data) {
  123. this.recordSelected = data
  124. },
  125. getDetail(id) {
  126. enginMaterialDetail({
  127. id
  128. }).then(res => {
  129. this.openType = 0
  130. this.formData = { ...res.data, examineStatus_cp: res.data.examineStatus }
  131. this.$nextTick(() => {
  132. this.formBool = true
  133. })
  134. })
  135. },
  136. operation() {
  137. return this.operationBtn({
  138. detail: {
  139. click: ({ row, index, column }) => {
  140. this.getDetail(row.orderId)
  141. }
  142. },
  143. examine: {
  144. conditions: ({ row, index, column }) => {
  145. return row.examineStatus == "WAIT"
  146. },
  147. click: ({ row, index, column }) => {
  148. enginMaterialDetail({
  149. id: row.orderId
  150. }).then(res => {
  151. this.openType = 1
  152. this.formData = { ...res.data, examineStatus_cp: res.data.examineStatus }
  153. this.$nextTick(() => {
  154. this.formBool = true
  155. })
  156. })
  157. }
  158. },
  159. })
  160. },
  161. handleClose() {
  162. this.$refs.formRef.$refs.inlineForm.clearValidate()
  163. this.formData = {}
  164. this.formBool = false
  165. },
  166. WAITfun() {
  167. this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
  168. if (valid) {
  169. enginMaterialExamine({
  170. id: this.formData.orderId,
  171. examineStatus: this.formData.examineStatus_cp,
  172. examineRemark: this.formData.examineRemark
  173. }).then(res => {
  174. this.$refs.pageRef.refreshList()
  175. this.handleClose()
  176. })
  177. }
  178. })
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .neibuview {
  185. box-sizing: border-box;
  186. padding-left: 16px;
  187. ::v-deep &>.zj-page-fill-scroll {
  188. box-sizing: border-box;
  189. padding-right: 16px;
  190. &>div:nth-child(1) {
  191. margin-top: 20px;
  192. }
  193. }
  194. }
  195. </style>