Browse Source

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

linwenxin 1 year ago
parent
commit
bfceb19b20

+ 16 - 0
src/api/workOrderPool.js

@@ -30,6 +30,22 @@ export function orderBaseSettleNormDetail(params) {
   })
 }
 
+export function enginMaterialCancel(params) {
+  return request({
+    url: `/engin/material/cancel`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginMaterialDetailWorker(params) {
+  return request({
+    url: `/engin/material/detailWorker`,
+    method: 'post',
+    params
+  })
+}
+
 export function changeOrderGetOrderList(params) {
   return request({
     url: `/changeOrder/getOrderList`,

+ 1 - 1
src/views/workOrder/workOrderPool/detail.vue

@@ -17,7 +17,7 @@
       </div>
       <OperationDetail v-if="activeName == 'operationDetails'" :id="id" ref="operationDetails" />
       <CompletionDetails v-if="activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
-      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" />
+      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
       <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
       <SettleAccounts v-if="activeName == 'SettleAccounts' && SettleAccountsShow" :id="id" ref="SettleAccounts" />
     </div>

+ 94 - 37
src/views/workOrder/workOrderPool/detailModule/Payment/index.vue

@@ -4,7 +4,11 @@
       <template v-if="payData.length">
         <zj-form-container :formAttributes="{ 'label-position': 'top' }">
           <template v-for="(item, index) in payData.length">
-            <zj-form-module :title="'支付费用' + (index + 1)" :form-data="payData[index]" :form-items="formItems" />
+            <zj-form-module :title="'支付费用' + (index + 1)" :form-data="payData[index]" :form-items="formItems">
+              <div v-if="item.examineStatus === 'FAIL'" style="text-align:right">
+                <el-button size="mini" type="danger" plain @click="enginMaterialCancelFun(item)">取消申请</el-button>
+              </div>
+            </zj-form-module>
           </template>
         </zj-form-container>
       </template>
@@ -16,13 +20,18 @@
 <script>
 import { listPageV2 } from "@/api/workOrder/appraise";
 import { tableDataParsing } from "@/utils/common.js"
-import { changeOrderGetOrderList } from "@/api/workOrderPool.js";
+import { changeOrderGetOrderList, enginMaterialDetailWorker, enginMaterialCancel } from "@/api/workOrderPool.js";
+
 export default {
   props: {
     id: {
       type: [String, Number],
       default: null,
-    }
+    },
+    workOrderType: {
+      type: Number,
+      default: 0, // 0普通工单, 1维保工单
+    },
   },
   data() {
     return {
@@ -32,13 +41,7 @@ export default {
   watch: {
     id: {
       handler(newVal, oldVal) {
-        if (this.id) {
-          changeOrderGetOrderList({
-            id: this.id
-          }).then(res => {
-            this.payData = res.data
-          })
-        }
+        this.getxiangqing()
       },
       deep: true,
       immediate: true,
@@ -62,9 +65,6 @@ export default {
               <el-descriptions-item label="工单号">
                 {formData.workerOrderId}
               </el-descriptions-item>
-              {/* <el-descriptions-item label="流水号">
-                {formData.wechatOrder}
-              </el-descriptions-item> */}
               <el-descriptions-item label="工程师名称">
                 {formData.workerName}
               </el-descriptions-item>
@@ -86,12 +86,28 @@ export default {
               <el-descriptions-item label="支付总金额">
                 {formData.totalAmount}
               </el-descriptions-item>
-              <el-descriptions-item label="总手续费">
-                {formData.commissionAmount}
-              </el-descriptions-item>
+              {this?.workOrderType == 0 ? (
+                <el-descriptions-item label="总手续费">
+                  {formData.commissionAmount}
+                </el-descriptions-item>
+              ) : null}
               <el-descriptions-item label="支付时间">
                 {formData.payTime}
               </el-descriptions-item>
+              <el-descriptions-item label="">
+              </el-descriptions-item>
+              {this?.workOrderType == 1 ? [
+                (<el-descriptions-item label=""></el-descriptions-item>),
+                (<el-descriptions-item label="审批状态">
+                  {({ WAIT: "待审", OK: "审批", FAIL: "驳回", PAID: "现场支付", NO: "取消", NO_PAID: "未支付" })[formData.examineStatus]}
+                </el-descriptions-item>),
+                (<el-descriptions-item label="审批人">
+                  {formData.examineName}
+                </el-descriptions-item>),
+                (<el-descriptions-item label="审批时间">
+                  {formData.examineTime}
+                </el-descriptions-item>),
+              ] : null}
             </el-descriptions>
           )
         }
@@ -125,28 +141,35 @@ export default {
                   label: '费用金额',
                   prop: 'totalAmount',
                 }
-              }, {
-                columnAttributes: {
-                  label: '师傅分账金额',
-                  prop: 'workerAmount',
+              },
+              ...(() => {
+                if (this?.workOrderType == 0) {
+                  return [{
+                    columnAttributes: {
+                      label: '师傅分账金额',
+                      prop: 'workerAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '师傅手续费',
+                      prop: 'workerProceAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '网点分账金额',
+                      prop: 'websitAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '网点手续费',
+                      prop: 'websitProceAmount',
+                    }
+                  }]
                 }
-              }, {
-                columnAttributes: {
-                  label: '师傅手续费',
-                  prop: 'workerProceAmount',
-                }
-              }, {
-                columnAttributes: {
-                  label: '网点分账金额',
-                  prop: 'websitAmount',
-                }
-              }, {
-                columnAttributes: {
-                  label: '网点手续费',
-                  prop: 'websitProceAmount',
-                }
-              }]}
-              table-data={formData.workerOrderItems}
+                return []
+              })(),
+              ]}
+              table-data={[formData.workerOrderItems, formData.rpMaterialOrderItems][this?.workOrderType]}
             />
           )
         }
@@ -213,6 +236,40 @@ export default {
       }]
     }
   },
+  methods: {
+    getxiangqing() {
+      if (this.id) {
+        if (this?.workOrderType == 0) {
+          changeOrderGetOrderList({
+            id: this.id
+          }).then(res => {
+            this.payData = res.data
+          })
+        } else if (this?.workOrderType == 1) {
+          enginMaterialDetailWorker({
+            workerOrderId: this.id
+          }).then(res => {
+            this.payData = res.data
+          })
+        }
+
+      }
+    },
+    enginMaterialCancelFun(item) {
+      this.$confirm('是否确认取消申请?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        enginMaterialCancel({
+          id: item.orderId
+        }).then(res => {
+          this.getxiangqing()
+        })
+      }).catch(() => {
+      });
+    }
+  }
 }
 </script>
 

+ 24 - 22
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js

@@ -46,7 +46,7 @@ export default {
               },
               events: {
                 change: (val) => {
-                  this.getorderDetail(()=>{
+                  this.getorderDetail(() => {
                     if (val) {
                       this.orderInfo.rpProjectRepairId = val
                       this.orderInfo.rpProjectRepairName = this.wb_project.find(item => item.value == val).label
@@ -292,27 +292,29 @@ export default {
     }
   },
   methods: {
-    getWeiBaoDetail(){
-      if(this.orderInfo.rpProjectRepairId){
+    getWeiBaoDetail() {
+      if (this.orderInfo.rpProjectRepairId) {
         getDetail({
-          id:this.orderInfo.rpProjectRepairId
-        }).then(res=>{
+          id: this.orderInfo.rpProjectRepairId
+        }).then(res => {
 
-          this.orderInfo.userName = res.data.manger
-          this.orderInfo.linkName = res.data.manger
-          this.orderInfo.userMobile = res.data.mobile
-          this.orderInfo.provinceId = res.data.provinceId
-          this.orderInfo.province = res.data.province
-          this.orderInfo.cityId = res.data.cityId
-          this.orderInfo.city = res.data.city
-          this.orderInfo.areaId = res.data.areaId
-          this.orderInfo.area = res.data.area
-          this.orderInfo.streetId = res.data.streetId
-          this.orderInfo.street = res.data.street
-          this.orderInfo.gpsAddress = res.data.gpsAddress||res.data.address
-          this.orderInfo.lat = res.data.lat
-          this.orderInfo.lng = res.data.lng
-          this.orderInfo.address = res.data.address
+          if (!this.id) {
+            this.orderInfo.userName = res.data.manger
+            this.orderInfo.linkName = res.data.manger
+            this.orderInfo.userMobile = res.data.mobile
+            this.orderInfo.provinceId = res.data.provinceId
+            this.orderInfo.province = res.data.province
+            this.orderInfo.cityId = res.data.cityId
+            this.orderInfo.city = res.data.city
+            this.orderInfo.areaId = res.data.areaId
+            this.orderInfo.area = res.data.area
+            this.orderInfo.streetId = res.data.streetId
+            this.orderInfo.street = res.data.street
+            this.orderInfo.gpsAddress = res.data.gpsAddress || res.data.address
+            this.orderInfo.lat = res.data.lat
+            this.orderInfo.lng = res.data.lng
+            this.orderInfo.address = res.data.address
+          }
 
           // 工单小类下拉
           this.orderSmallTypeData = res.data.typeList.map(item => ({
@@ -321,13 +323,13 @@ export default {
           }))
 
           // 网点下拉数据
-          this.websitList = (res.data.websitList||[]).map(item => ({
+          this.websitList = (res.data.websitList || []).map(item => ({
             label: item.websitName,
             value: item.websitId
           }))
 
           // 产品信息可选项
-          this.productList_wb = (res.data.productList||[])
+          this.productList_wb = (res.data.productList || [])
 
           this.getinitlbslist()
         })

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js

@@ -213,7 +213,7 @@ export default {
   },
   created() {
     // 普通工单选择网点数据
-    if(this.workOrderType == 0){
+    if (this.workOrderType == 0) {
       getWebsit({ type: "C", status: true, isAll: this.isAllWebsit || this.id ? true : false }).then(res => {
         this.websitList = res.data.map(item => ({
           label: item.name,

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/productColumns.js

@@ -246,7 +246,7 @@ export default {
                         "mainId": "",
                         "mainName": "",
                         "num": "",
-                        "insideCode":"",
+                        "insideCode": "",
                         "orderBaseId": this.id || '',
                         "productId": "",
                         "productName": "",

+ 18 - 18
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -54,7 +54,7 @@ export default {
           if (this.workOrderType == 0) {
             // 普通工单
             return [{
-              isShow: this.formOptions.orderChannelId.isShow && !this.id,
+              isShow: this.formOptions.orderChannelId.isShow,
               name: 'el-select',
               md: 6,
               options: this.orderChannels,
@@ -83,7 +83,7 @@ export default {
             this.orderInfo.orderChannelId = "工程维保"
             // 维保工单
             return [{
-              isShow: this.formOptions.orderChannelId.isShow && !this.id,
+              isShow: this.formOptions.orderChannelId.isShow,
               name: 'el-input',
               md: 6,
               attributes: {
@@ -137,21 +137,21 @@ export default {
   },
   created() {
     // 普通工单选择网点数据
-    if(this.workOrderType == 0){
-    // 获取工单类型
-    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
-      this.orderSmallTypeData = res.data.records.map(item => ({
-        value: item.id,
-        label: item.orderSmallTypeText
-      }))
-    })
-    // 获取工单渠道
-    getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
-      this.orderChannels = res.data.records.map(item => ({
-        value: item.dictCode,
-        label: item.dictValue
-      }))
-    })
-  }
+    if (this.workOrderType == 0) {
+      // 获取工单类型
+      listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+        this.orderSmallTypeData = res.data.records.map(item => ({
+          value: item.id,
+          label: item.orderSmallTypeText
+        }))
+      })
+      // 获取工单渠道
+      getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
+        this.orderChannels = res.data.records.map(item => ({
+          value: item.dictCode,
+          label: item.dictValue
+        }))
+      })
+    }
   },
 }

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/wb_productColumns.js

@@ -255,7 +255,7 @@ export default {
                         "mainId": "",
                         "mainName": "",
                         "num": "",
-                        "insideCode":"",
+                        "insideCode": "",
                         "orderBaseId": this.id || '',
                         "productId": "",
                         "productName": "",

+ 6 - 8
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -68,17 +68,15 @@ export default {
     id: {
       handler(newVal, oldVal) {
         this.getorderDetail((data) => {
-          if(this.workOrderType==0){
+          if (this.workOrderType == 0) {
             this.$nextTick(() => {
               // 获取地址信息
               this.getinitlbslist()
               // 获取可选师傅
               this.getWorkers()
             })
-          }else if(this.workOrderType==1){
+          } else if (this.workOrderType == 1) {
             this.$nextTick(() => {
-              // 获取地址信息
-              this.getinitlbslist()
               // 获取维保单详情
               this.getWeiBaoDetail()
             })
@@ -156,7 +154,7 @@ export default {
         },
         // 客户名称
         userName: {
-          isEdit: this.workOrderType == 0 &&  !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
@@ -180,13 +178,13 @@ export default {
         },
         // gps地址
         gpsAddress: {
-          isEdit:  this.workOrderType == 0 && !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 详细地址
         address: {
-          isEdit: this.workOrderType == 0 &&  !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: []
         },
@@ -198,7 +196,7 @@ export default {
           isRules: [...required]
         },
         orderChannelId: {
-          isEdit: this.id ? false : this.workOrderType == 0 && true,
+          isEdit: this.id || this.workOrderType == 1 ? false : true,
           isShow: true,
           isRules: [...required]
         },