Jelajahi Sumber

Merge branch 'lin_yb' of ssh://gogs.zfire.top:2222/zfire-front/zfire-newmall-admin into develop

linwenxin 1 tahun lalu
induk
melakukan
398e4fc84d

+ 8 - 0
src/api/applicationWithoutFee.js

@@ -23,3 +23,11 @@ export function enginMaterialDetail(params) {
     params
   })
 }
+
+export function enginMaterialExamine(params) {
+  return request({
+    url: `/engin/material/examine`,
+    method: 'post',
+    params
+  })
+}

+ 2 - 1
src/views/engineeringMaintenance/allInclusiveExpense/index.vue

@@ -6,7 +6,7 @@
         <zj-page-container v-if="formBool">
           <zj-page-fill class="neibuview" v-if="formBool">
             <zj-form-container v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
-              <zj-form-module v-if="formBool" title="" :form-data="formData" :form-items="formItems">
+              <zj-form-module v-if="formBool" title="费用信息" :form-data="formData" :form-items="formItems">
               </zj-form-module>
             </zj-form-container>
           </zj-page-fill>
@@ -87,6 +87,7 @@ export default {
     },
 
     handleClose() {
+      this.formData = {}
       this.formBool = false
     },
 

+ 63 - 6
src/views/engineeringMaintenance/applicationWithoutFee/index.vue

@@ -6,8 +6,14 @@
       <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
         <zj-page-container v-if="formBool">
           <zj-page-fill class="neibuview" v-if="formBool">
-            <zj-form-container v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
-              <zj-form-module v-if="formBool" title="" :form-data="formData" :form-items="formItems">
+            <zj-form-container ref="formRef" v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module v-if="formBool" title="费用信息" :form-data="formData" :form-items="formItems">
+              </zj-form-module>
+              <zj-form-module v-if="formBool && formData.payType !== 'WECHAT'" title="审批信息" :form-data="formData"
+                :form-items="spFormItems">
+                <div v-if="openType === 1" style="text-align:right">
+                  <el-button size="mini" type="danger" plain @click="WAITfun">确定</el-button>
+                </div>
               </zj-form-module>
             </zj-form-container>
           </zj-page-fill>
@@ -21,7 +27,8 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
-import { enginMaterialList, enginMaterialListExport, enginMaterialDetail } from "@/api/applicationWithoutFee.js"
+import { enginMaterialList, enginMaterialListExport, enginMaterialDetail, enginMaterialExamine } from "@/api/applicationWithoutFee.js"
+import { required } from '@/components/template/rules_verify.js'
 import feel from "../mixins/feel.js"
 export default {
   components: {
@@ -40,7 +47,11 @@ export default {
       tableEvents: {
         'selection-change': this.selectionChange
       },
-      formData: {}
+      formData: {
+        examineStatus: "",
+        examineRemark: "",
+      },
+      openType: 0
     }
   },
   computed: {
@@ -62,6 +73,20 @@ export default {
         }
       ]
     },
+    spFormItems() {
+      return [{
+        name: 'el-radio',
+        md: 24,
+        options: [{ value: "OK", label: "审批" }, { value: "FAIL", label: "驳回" }],
+        attributes: { disabled: this.openType == 0 },
+        formItemAttributes: { label: '审批状态', prop: 'examineStatus', rules: [...required] },
+      }, {
+        name: 'el-input',
+        md: 24,
+        attributes: { disabled: this.openType == 0, type: "textarea", placeholder: '' },
+        formItemAttributes: { label: '审批备注', prop: 'examineRemark' },
+      }]
+    }
   },
   methods: {
     // 列表请求函数
@@ -96,24 +121,56 @@ export default {
       return this.operationBtn({
         detail: {
           click: ({ row, index, column }) => {
-            console.log(row)
             enginMaterialDetail({
               id: row.orderId
             }).then(res => {
+              this.openType = 0
               this.formData = res.data
               this.$nextTick(() => {
                 this.formBool = true
               })
             })
           }
-        }
+        },
+        examine: {
+          conditions: ({ row, index, column }) => {
+            return res.data.examineStatus == "WAIT"
+          },
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 1
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
       })
     },
 
     handleClose() {
+      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.formData = {}
       this.formBool = false
     },
 
+    WAITfun() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginMaterialExamine({
+            id: this.formData.orderId,
+            examineStatus: this.formData.examineStatus,
+            examineRemark: this.formData.examineRemark
+          }).then(res => {
+            this.$refs.pageRef.refreshList()
+            this.handleClose()
+          })
+        }
+      })
+    }
   }
 }
 </script>

+ 62 - 57
src/views/engineeringMaintenance/mixins/feel.js

@@ -150,68 +150,73 @@ export default {
             return prev + curr;
           }).toFixed(2)}</span>
         }
-      },
-      {
+      }, {
         name: 'el-input',
         md: 24,
         attributes: { disabled: true, type: "textarea", placeholder: '' },
         formItemAttributes: { label: '申请备注', prop: 'remark' },
-      }, {
-        md: 24,
-        name: 'slot-component',
-        formItemAttributes: {
-          label: '交易记录',
-        },
-        render: (h, { props, onInput }) => {
-          var { formData } = props
-          return (
-            <zj-table
-              columns={[{
-                columnAttributes: {
-                  label: 'id',
-                  prop: 'orderId',
-                }
-              }, {
-                columnAttributes: {
-                  label: '交易类型',
-                  prop: 'goodsType',
-                },
-                render: (h, { row }) => {
-                  return <div>
-                    {({ M: "辅材", P: "配件" })[row.goodsType]}
-                  </div>
-                }
-              }, {
-                columnAttributes: {
-                  label: '交易金额',
-                  prop: 'totalAmount',
-                }
-              }, {
-                columnAttributes: {
-                  label: '交易状态',
-                  prop: 'payStatus',
-                },
-                render: (h, { row }) => {
-                  return <div>
-                    {({ CANCEL: "取消", WAIT: "待支付", PAID: "已支付" })[row.payStatus]}
-                  </div>
-                }
-              }, {
-                columnAttributes: {
-                  label: '交易时间',
-                  prop: 'payTime',
-                }
-              }, {
-                columnAttributes: {
-                  label: '创建时间',
-                  prop: 'createTime',
-                }
-              }]}
-              table-data={[formData]}
-            />
-          )
+      }, 
+      ...(()=>{
+        if(this.formData.payType == 'WECHAT'){
+          return [{
+            md: 24,
+            name: 'slot-component',
+            formItemAttributes: {
+              label: '交易记录',
+            },
+            render: (h, { props, onInput }) => {
+              var { formData } = props
+              return (
+                <zj-table
+                  columns={[{
+                    columnAttributes: {
+                      label: 'id',
+                      prop: 'orderId',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易类型',
+                      prop: 'goodsType',
+                    },
+                    render: (h, { row }) => {
+                      return <div>
+                        {({ M: "辅材", P: "配件" })[row.goodsType]}
+                      </div>
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易金额',
+                      prop: 'totalAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易状态',
+                      prop: 'payStatus',
+                    },
+                    render: (h, { row }) => {
+                      return <div>
+                        {({ CANCEL: "取消", WAIT: "待支付", PAID: "已支付" })[row.payStatus]}
+                      </div>
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易时间',
+                      prop: 'payTime',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '创建时间',
+                      prop: 'createTime',
+                    }
+                  }]}
+                  table-data={[formData]}
+                />
+              )
+            }
+          }]
         }
-      }]
+        return []
+      })()]
     }
   }
 }