Browse Source

Merge branch '修改维权订单' into feature/pyh_进销存

pengyh 1 year ago
parent
commit
53a2e76535
33 changed files with 7383 additions and 3359 deletions
  1. 29 23
      src/App.vue
  2. 57 0
      src/api/commercialMaterial.js
  3. 109 0
      src/api/goodsPurchasedStored.js
  4. 109 0
      src/api/merchandisePurchaseReturn.js
  5. 14 14
      src/components/Common/import-button.vue
  6. 39 39
      src/components/template/import_mixin.js
  7. 1 1
      src/layout/components/AppMain.vue
  8. 468 448
      src/layout/components/Navbar.vue
  9. 71 0
      src/mixin/orderListColumn.js
  10. 2 2
      src/utils/request.js
  11. 574 344
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js
  12. 504 444
      src/views/auxiliaryFittings/salesManagement/components/auxiliaryAdjustPriceOrderDetail.vue
  13. 321 284
      src/views/mallManagement/configCenter/slideshowConfig/index.vue
  14. 14 12
      src/views/mallManagement/order/order_list/index.vue
  15. 503 490
      src/views/mallManagement/order/order_refund/index.vue
  16. 693 0
      src/views/salesPurchasing/commercialMaterial/index.vue
  17. 330 0
      src/views/salesPurchasing/goodsPurchasedStored/index.vue
  18. 325 0
      src/views/salesPurchasing/merchandisePurchaseReturn/index.vue
  19. 567 0
      src/views/salesPurchasing/mixins/common_code.js
  20. 258 0
      src/views/salesPurchasing/mixins/common_form.js
  21. 76 0
      src/views/salesPurchasing/mixins/out_storage_codes.js
  22. 250 0
      src/views/salesPurchasing/mixins/out_storage_goods.js
  23. 102 0
      src/views/salesPurchasing/mixins/out_storage_table.js
  24. 76 0
      src/views/salesPurchasing/mixins/storage_codes.js
  25. 628 0
      src/views/salesPurchasing/mixins/storage_goods.js
  26. 108 0
      src/views/salesPurchasing/mixins/storage_table.js
  27. 12 10
      src/views/setting/departmentManage/index.vue
  28. 22 62
      src/views/valueAddedService/extendedWarrantyWork/index.vue
  29. 2 2
      src/views/valueAddedService/orderSettleManag/index.vue
  30. 7 1
      src/views/valueAddedService/orderSettleManag/pages/collect.vue
  31. 22 13
      src/views/valueAddedService/orderSettleManag/pages/offline.vue
  32. 1088 1128
      src/views/workOrder/completedToBeSettled/index.vue
  33. 2 42
      src/views/workOrder/workOrderPool/index.vue

+ 29 - 23
src/App.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="app">
-    <router-view/>
+    <router-view />
   </div>
 </template>
 
@@ -17,8 +17,8 @@ export default {
 <style lang="scss">
 .el-tree {
   .is-current {
-    &>div:nth-child(1) {
-      &>.custom-tree-node {
+    & > div:nth-child(1) {
+      & > .custom-tree-node {
         color: #409eff !important;
       }
     }
@@ -41,33 +41,33 @@ export default {
   z-index: 999999 !important;
 }
 
-.diy-dialog{
+.diy-dialog {
   .el-dialog__header {
     padding: 0 !important;
   }
-  .el-dialog__headerbtn{
+  .el-dialog__headerbtn {
     z-index: 9999999;
   }
-  .el-dialog__body{
+  .el-dialog__body {
     padding: 0 !important;
   }
-  .box-card{
+  .box-card {
     margin-bottom: 0 !important;
   }
-  .el-table-column--selection{
-    .cell{
+  .el-table-column--selection {
+    .cell {
       padding: 0 10px !important;
     }
   }
-  .el-form-item__label{
+  .el-form-item__label {
     padding-bottom: 0 !important;
   }
-  .el-table__cell{
+  .el-table__cell {
     padding: 0 !important;
   }
-  .is-center{
-    .text-view{
-      div{
+  .is-center {
+    .text-view {
+      div {
         width: 100%;
         text-align: center !important;
       }
@@ -94,10 +94,10 @@ export default {
     padding: 20px;
     overflow-y: auto;
   }
-  .el-dialog__headerbtn{
+  .el-dialog__headerbtn {
     z-index: 99999 !important;
   }
-  .el-dialog__footer{
+  .el-dialog__footer {
     background: #fff !important;
   }
 }
@@ -121,18 +121,24 @@ export default {
     padding: 0px;
     overflow-y: auto;
   }
-  .el-dialog__headerbtn{
+  .el-dialog__headerbtn {
     z-index: 99999 !important;
   }
-  .el-dialog__footer{
+  .el-dialog__footer {
     background: #fff !important;
   }
 }
-.custom-tree-node{
-  .el-input__inner{
-      border: none !important;
-      padding: 0 !important;
-      width: auto !important;
+.custom-tree-node {
+  .el-input__inner {
+    border: none !important;
+    padding: 0 !important;
+    width: auto !important;
+  }
+}
+.el-card__header {
+  .el-tabs__header {
+    margin-bottom: 0;
+    overflow: hidden;
   }
 }
 </style>

+ 57 - 0
src/api/commercialMaterial.js

@@ -0,0 +1,57 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function goodsMaterialList(data) {
+  return request({
+    url: `/goods/material/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsMaterialListExport(data, name) {
+  return postBlob({
+    url: '/goods/material/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsMaterialAdd(data) {
+  return request({
+    url: '/goods/material/add',
+    method: 'post',
+    data: data
+  })
+}
+
+export function goodsMaterialUpdate(data) {
+  return request({
+    url: '/goods/material/update',
+    method: 'post',
+    data: data
+  })
+}
+
+export function goodsMaterialBatchUpdateStatus(params) {
+  return request({
+    url: '/goods/material/batch/update/status',
+    method: 'post',
+    params
+  })
+}
+
+export function goodsMaterialItemCount(params) {
+  return request({
+    url: '/goods/material/item/count',
+    method: 'post',
+    params
+  })
+}
+
+export function goodsMaterialDetail(params) {
+  return request({
+    url: '/goods/material/detail',
+    method: 'post',
+    params
+  })
+}

+ 109 - 0
src/api/goodsPurchasedStored.js

@@ -0,0 +1,109 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function goodsPurchaseList(data) {
+  return request({
+    url: `/goods/purchase/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseItemList(data) {
+  return request({
+    url: `/goods/purchase/item/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseItemListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/item/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseCodeList(data) {
+  return request({
+    url: `/goods/purchase/code/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseCodeListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/code/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseAdd(data) {
+  return request({
+    url: `/goods/purchase/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseItemAddCode(data) {
+  return request({
+    url: `/goods/purchase/item/add/code`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseDetail(params) {
+  return request({
+    url: `/goods/purchase/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseSubmit(params) {
+  return request({
+    url: `/goods/purchase/submit`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseConfirm(params) {
+  return request({
+    url: `/goods/purchase/confirm`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseItemDelCode(params) {
+  return request({
+    url: `/goods/purchase/item/del/code`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseDel(params) {
+  return request({
+    url: `/goods/purchase/del`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseItemImportCode(data) {
+  return handleImport('/goods/purchase/item/import/code', data.formdata, data.id || '')
+}

+ 109 - 0
src/api/merchandisePurchaseReturn.js

@@ -0,0 +1,109 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function goodsPurchaseRetList(data) {
+  return request({
+    url: `/goods/purchase/ret/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/ret/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseRetItemList(data) {
+  return request({
+    url: `/goods/purchase/ret/item/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetItemListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/ret/item/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseRetCodeList(data) {
+  return request({
+    url: `/goods/purchase/ret/code/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetCodeListExport(data, name) {
+  return postBlob({
+    url: '/goods/purchase/ret/code/list/export',
+    data,
+    name
+  })
+}
+
+export function goodsPurchaseRetAdd(data) {
+  return request({
+    url: `/goods/purchase/ret/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetSubmit(params) {
+  return request({
+    url: `/goods/purchase/ret/submit`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetConfirm(params) {
+  return request({
+    url: `/goods/purchase/ret/confirm`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetDetail(params) {
+  return request({
+    url: `/goods/purchase/ret/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetDel(params) {
+  return request({
+    url: `/goods/purchase/ret/del`,
+    method: 'post',
+    params
+  })
+}
+
+export function goodsPurchaseRetItemImportCode(data) {
+  return handleImport('/goods/purchase/ret/item/import/code', data.formdata, data.id || '')
+}
+
+export function goodsPurchaseRetItemAddCode(data) {
+  return request({
+    url: `/goods/purchase/ret/item/add/code`,
+    method: 'post',
+    data
+  })
+}
+
+export function goodsPurchaseRetItemDelCode(params) {
+  return request({
+    url: `/goods/purchase/ret/item/del/code`,
+    method: 'post',
+    params
+  })
+}

+ 14 - 14
src/components/Common/import-button.vue

@@ -60,20 +60,20 @@ export default {
           }
         }
       }
-
-      let result = await handleImport(this.imUrl, formData)
-      this.importLoading = false
-      this.importFileList = []
-      if (result.code == 200) {
-        this.$alert(result.message, '导入成功', {
-          confirmButtonText: '确定'
-        })
-        this.$emit('importSuccess', result.data)
-      } else {
-        this.$alert(result.message, '导入失败', {
-          confirmButtonText: '确定'
-        })
-      }
+      handleImport(this.imUrl, formData).then(result=>{
+        this.importLoading = false
+        this.importFileList = []
+        if (result.code == 200) {
+          this.$alert(result.message, '导入成功', {
+            confirmButtonText: '确定'
+          })
+          this.$emit('importSuccess', result.data)
+        } else {
+          this.$alert(result.message, '导入失败', {
+            confirmButtonText: '确定'
+          })
+        }
+      })
     }
   }
 }

+ 39 - 39
src/components/template/import_mixin.js

@@ -3,49 +3,49 @@ export default {
     //导入按钮
     importButton(func, name = '导入', params, fun1, fun2) {
       return (
-          <el-upload
-            action={'_'}
-            show-file-list={false}
-            http-request={data => {
-              const loading = this.$loading({
-                lock: true,
-                text: '正在导入',
-                spinner: 'el-icon-loading',
-                background: 'rgba(0, 0, 0, 0.7)'
-              })
-              fun1 && fun1()
-              var formdata = new FormData()
-              formdata.append('file', data.file)
-              if (!!params) {
-                for (const key in params) {
-                  if (Object.hasOwnProperty.call(params, key)) {
-                    formdata.append(key, params[key])
-                  }
+        <el-upload
+          action={'_'}
+          show-file-list={false}
+          http-request={data => {
+            const loading = this.$loading({
+              lock: true,
+              text: '正在导入',
+              spinner: 'el-icon-loading',
+              background: 'rgba(0, 0, 0, 0.7)'
+            })
+            fun1 && fun1()
+            var formdata = new FormData()
+            formdata.append('file', data.file)
+            if (!!params) {
+              for (const key in params) {
+                if (Object.hasOwnProperty.call(params, key)) {
+                  formdata.append(key, params[key])
                 }
               }
-              func({ formdata })
-                .then(res => {
-                  fun2 && fun2()
-                  this.$refs.pageRef.refreshList()
-                  loading.close()
-                  this.$message({
-                    type: 'success',
-                    message: '导入成功!'
-                  })
+            }
+            func({ formdata })
+              .then(res => {
+                fun2 && fun2()
+                this.$refs.pageRef.refreshList()
+                loading.close()
+                this.$message({
+                  type: 'success',
+                  message: '导入成功!'
                 })
-                .catch(err => {
-                  fun2 && fun2()
-                  loading.close()
-                  this.$message({
-                    type: 'error',
-                    message: err.message || '导入失败'
-                  })
+              })
+              .catch(err => {
+                fun2 && fun2()
+                loading.close()
+                this.$message({
+                  type: 'error',
+                  message: err.message || '导入失败'
                 })
-            }}
-          >
-            <span class="teshudeshangchuananniu">{name}</span>
-          </el-upload>
-        )
+              })
+          }}
+        >
+          <span class="teshudeshangchuananniu">{name}</span>
+        </el-upload>
+      )
     }
   }
 }

+ 1 - 1
src/layout/components/AppMain.vue

@@ -39,7 +39,7 @@ export default {
       var { name, params } = this.$route
       var { pageType, pageCode, pagePam } = params
       var item = this.$store.state.tagsView.visitedViews.find(item => {
-        return !!~item?.nameKey.indexOf(`${name}_${pageType}_${pageCode}_${pagePam}`)
+        return item?.nameKey.indexOf(`${name}_${pageType}_${pageCode}_${pagePam}`) === 0
       })
       if (!item) {
         setTimeout(() => {

File diff suppressed because it is too large
+ 468 - 448
src/layout/components/Navbar.vue


+ 71 - 0
src/mixin/orderListColumn.js

@@ -0,0 +1,71 @@
+
+import ywgdjs from "@/assets/ywgdjs.png"
+import yjs from "@/assets/yjs.png"
+
+export default {
+  data() {
+    return {
+
+    }
+  },
+  methods: {
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'orderFlags') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;display:flex;align-items:center;">
+              {(row[column.columnAttributes.prop] || []).map(item => {
+                if (item.tagName == "已完工") {
+                  return (
+                    <img src={ywgdjs} style="width:16px;height:16px;margin:0 3px;" />
+                  )
+                } else if (item.tagName == "已结算") {
+                  return (
+                    <img src={yjs} style="width:16px;height:16px;margin:0 3px;" />
+                  )
+                } else {
+                  return (
+                    <div style="display: inline-block;border:1px solid #409EFF; color:#409EFF;padding:4px;border-radius: 4px;margin:2px 2px 0 0; font-size: 12px!important; line-height: 12px !important;">
+                      {item.tagName}
+                    </div>
+                  )
+                }
+              })}
+            </div>
+          )
+        }
+      }
+      if (item.jname === 'appointmentTime') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
+            </div>
+          )
+        }
+      }
+      if (item.jname === "orderStatus") {
+        defaultData.render = (h, { row, index, column }) => {
+          var colors = {
+            DJD: "#00acff",
+            DSHPG: "#ff27bf",
+            DWDPG: "#236cfe",
+            DYY: "#0d07ff",
+            FWZ: "#00ee5a",
+            YCD: "#ff3030",
+            YJS: "#02b100",
+            YQX: "#ffbd2f",
+            YWG: "#f77233",
+          }
+          return (
+            <div style={`padding:0 6px;cursor: pointer;color:${colors[Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0] || '']};`}>
+              {row[column.columnAttributes.prop]}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+  }
+}

+ 2 - 2
src/utils/request.js

@@ -178,8 +178,8 @@ export function getBlob(data) {
  * @param {*} formData
  * @param {*} id
  */
-export async function handleImport(url, formData, id = '') {
-  return await new Promise((resolve, reject) => {
+export function handleImport(url, formData, id = '') {
+  return new Promise((resolve, reject) => {
     axios
       .post(zhapi(process.env.VUE_APP_BASE_API, url), formData, {
         headers: {

File diff suppressed because it is too large
+ 574 - 344
src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js


+ 504 - 444
src/views/auxiliaryFittings/salesManagement/components/auxiliaryAdjustPriceOrderDetail.vue

@@ -1,451 +1,511 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="12" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'OK'?'审核通过':formData.flag == 'FAIL'?'审核失败':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="12" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.sheetId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="12">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="12">
-							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websit" :disabled="formData.flag == 'OK'" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in websitList"
-								      :key="item.websitId"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="附件">
-								<ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" :disabled="formData.flag == 'OK'" v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>辅材信息</span>
-			</div>
-			<el-button size="small" v-if="formData.flag == 'SAVE' || formType==0" type="primary" @click="add()">添加</el-button>
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="大类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.productCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index || formData.flag == 'OK'" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in mainList"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="小类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
-									if(!scope.row.productCategory){return this.$message.warning('请先选择大类!');}
-								}" :disabled="isEdit != scope.$index || formData.flag == 'OK'" value-key="categoryId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.productCategory.items"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="辅材名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index || formData.flag == 'OK'" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
-					<el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="" align="center" label="原售价">
-						<template slot-scope="scope">
-							{{scope.row.goods.oldPrice || scope.row.goods.price}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="" align="center" label="新售价" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.newPrice" :disabled="isEdit != scope.$index || formData.flag == 'OK'" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formData.flag != 'OK'">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-				<el-button v-if="formType != 2" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formType == 1" size="small" type="primary" @click="confirm()">审核通过</el-button>
-			</div>
-		</div>
-	</div>
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="12" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="
+                    formData.flag == 'SAVE'
+                      ? '已保存'
+                      : formData.flag == 'SUBMIT'
+                      ? '已提交'
+                      : formData.flag == 'OK'
+                      ? '审核通过'
+                      : formData.flag == 'FAIL'
+                      ? '审核失败'
+                      : ''
+                  "
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.sheetId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="网点名称" prop="websitId" :required="true">
+                <el-select
+                  v-model="formData.websit"
+                  :disabled="formData.flag == 'OK'"
+                  value-key="websitId"
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="附件">
+                <ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  :disabled="formData.flag == 'OK'"
+                  v-model="formData.remark"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>辅材信息</span>
+      </div>
+      <el-button size="small" v-if="formData.flag == 'SAVE' || formType == 0" type="primary" @click="add()"
+        >添加</el-button
+      >
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="大类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.productCategory"
+                value-key="categoryId"
+                @change="changeMain"
+                :disabled="isEdit != scope.$index || formData.flag == 'OK'"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in mainList" :key="item.categoryId" :label="item.categoryName" :value="item">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="小类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goodsCategory"
+                @change="changeSmall"
+                @focus="
+                  () => {
+                    if (!scope.row.productCategory) {
+                      return this.$message.warning('请先选择大类!')
+                    }
+                  }
+                "
+                :disabled="isEdit != scope.$index || formData.flag == 'OK'"
+                value-key="categoryId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.productCategory.items"
+                  :key="item.categoryId"
+                  :label="item.categoryName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="辅材名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="isEdit != scope.$index || formData.flag == 'OK'"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
+          <el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
+          <el-table-column prop="" align="center" label="原售价">
+            <template slot-scope="scope">
+              {{ scope.row.goods.oldPrice || scope.row.goods.price }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="" align="center" label="新售价">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.newPrice"
+                :disabled="isEdit != scope.$index || formData.flag == 'OK'"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formData.flag != 'OK'">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="dataList.splice(scope.$index, 1)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+        <el-button v-if="formType != 2" size="small" type="primary" @click="submit()">提交</el-button>
+        <el-button v-if="formType == 1" size="small" type="primary" @click="confirm()">审核通过</el-button>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import ImageUpload from '@/components/file-upload'
-	import { getWorker, getCategory, getGoods } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { getDetail, add, edit, confirm } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
-	export default {
-		components: { ImageUpload },
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				websitList: [],
-				workerList: [],
-				mainList: [],
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					fileUrl: [],
-					sheetId: '',
-					flag: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					remark: ''
-				},
-				productCategory: {},
-				goodsCategory: {},
-				isEdit: 0,
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					source: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					payType: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					idcard: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					phone: [
-						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-				}
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			this.getWebsit()
-		},
-		mounted() {
-			console.log(111,this.mainList)
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({sheetId: this.id}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
-					})
-					this.getCategory(res.data.websitId)
-					this.formData.remark = res.data.remark
-					for(var item of res.data.items){
-						item.productCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
-						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-					}
-					this.dataList = res.data.items
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			changeWebsit(e){
-				this.formData.websitId = e.websitId
-				this.formData.websitName = e.name
-				this.getWorker()
-				this.getCategory(e.websitId)
-			},
-			getCategory(websitId){
-				getCategory({websitId}).then(res => {
-					this.mainList = res.data
-				})
-			},
-			async getGoods(categoryId,goodsName,type){
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-					})
-				}
-			},
-			getWorker(name){
-				const that = this
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'a.nick_name',compare: '=',value: name},{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					if(name){
-						that.formData.idcard = res.data.records[0].idCard
-						that.formData.phone = res.data.records[0].mobile
-					}else{
-						this.workerList = res.data.records
-					}
-				})
-			},
-			changeWorker(e){
-				this.getWorker(e)
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeMain(e){
-				this.dataList[this.isEdit].goodsList = [],
-				this.dataList[this.isEdit].productCategory = e,
-				this.dataList[this.isEdit].parentCategoryId = e.categoryId,
-				this.dataList[this.isEdit].parentCategoryName = e.categoryName,
-				this.dataList[this.isEdit].goodsCategory = {},
-				this.dataList[this.isEdit].goodsCategoryName = '',
-				this.dataList[this.isEdit].goodsCategoryId = '',
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].newPrice = '',
-				this.dataList[this.isEdit].oldPrice = '',
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsType = 'M'
-			},
-			async changeSmall(e){
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].newPrice = '',
-				this.dataList[this.isEdit].oldPrice = '',
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsCategoryId = e.categoryId
-				this.dataList[this.isEdit].goodsCategoryName = e.categoryName
-				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M'}).then(res => {
-					this.dataList[this.isEdit].goodsList = res.data
-				})
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
-				this.dataList[this.isEdit].oldPrice = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-			},
-			add(){
-				if(this.dataList.length != 0){this.isEdit += 1}
-				this.dataList.push({
-					goodsList: [],
-					productCategory: {},
-					parentCategoryId: '',
-					parentCategoryName: '',
-					goodsCategory: {},
-					goodsCategoryName: '',
-					goodsCategoryId: '',
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-					goodsSalesUnit: '',
-					goodsSpecification: '',
-					goodsCode: '',
-					newPrice: '',
-					oldPrice: '',
-					qty: '',
-					goodsType: 'M'
-				})
-			},
-			confirm(){
-				this.$confirm(`请确认是否审核通过, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					confirm({
-						sheetId: this.formData.sheetId,
-						flag: 'OK'
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('审核成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			submit(){
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								items: this.dataList
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								sheetId: this.formData.sheetId,
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								items: this.dataList
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			}
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import ImageUpload from '@/components/file-upload'
+import { getWorker, getCategory, getGoods } from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { getDetail, add, edit, confirm } from '@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder'
+export default {
+  components: { ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      websitList: [],
+      workerList: [],
+      mainList: [],
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        fileUrl: [],
+        sheetId: '',
+        flag: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        remark: ''
+      },
+      productCategory: {},
+      goodsCategory: {},
+      isEdit: 0,
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        source: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        payType: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        idcard: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        phone: [
+          { required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.getWebsit()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ sheetId: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : []
+        })
+        this.getCategory(res.data.websitId)
+        this.formData.remark = res.data.remark
+        for (var item of res.data.items) {
+          item.productCategory = {
+            categoryId: item.parentCategoryId,
+            categoryName: item.parentCategoryName,
+            items: [{ categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }]
+          }
+          item.goodsCategory = { categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }
+          var ress = await that.getGoods(item.goodsCategoryId, item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+        }
+        this.dataList = res.data.items
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    changeWebsit(e) {
+      this.formData.websitId = e.websitId
+      this.formData.websitName = e.name
+      this.getWorker()
+      this.getCategory(e.websitId)
+    },
+    getCategory(websitId) {
+      getCategory({ websitId }).then(res => {
+        this.mainList = res.data
+      })
+    },
+    async getGoods(categoryId, goodsName, type) {
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({ websitId: this.formData.websitId, categoryId: categoryId, type: 'M', goodsName: goodsName }).then(
+            res => {
+              resolve({
+                data: res.data[0]
+              })
+            }
+          )
+        })
+      } else {
+        getGoods({ websitId: this.formData.websitId, categoryId: categoryId, type: 'M' }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+        })
+      }
+    },
+    getWorker(name) {
+      const that = this
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.nick_name', compare: '=', value: name },
+          { param: 'b.websit_id', compare: '=', value: this.formData.websitId }
+        ]
+      }).then(res => {
+        if (name) {
+          that.formData.idcard = res.data.records[0].idCard
+          that.formData.phone = res.data.records[0].mobile
+        } else {
+          this.workerList = res.data.records
+        }
+      })
+    },
+    changeWorker(e) {
+      this.getWorker(e)
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeMain(e) {
+      ;(this.dataList[this.isEdit].goodsList = []),
+        (this.dataList[this.isEdit].productCategory = e),
+        (this.dataList[this.isEdit].parentCategoryId = e.categoryId),
+        (this.dataList[this.isEdit].parentCategoryName = e.categoryName),
+        (this.dataList[this.isEdit].goodsCategory = {}),
+        (this.dataList[this.isEdit].goodsCategoryName = ''),
+        (this.dataList[this.isEdit].goodsCategoryId = ''),
+        (this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].newPrice = ''),
+        (this.dataList[this.isEdit].oldPrice = ''),
+        (this.dataList[this.isEdit].qty = ''),
+        (this.dataList[this.isEdit].goodsType = 'M')
+    },
+    async changeSmall(e) {
+      ;(this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].newPrice = ''),
+        (this.dataList[this.isEdit].oldPrice = ''),
+        (this.dataList[this.isEdit].qty = ''),
+        (this.dataList[this.isEdit].goodsCategoryId = e.categoryId)
+      this.dataList[this.isEdit].goodsCategoryName = e.categoryName
+      getGoods({ websitId: this.formData.websitId, categoryId: e.categoryId, type: 'M' }).then(res => {
+        this.dataList[this.isEdit].goodsList = res.data
+      })
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
+      this.dataList[this.isEdit].oldPrice = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+    },
+    add() {
+      if (this.dataList.length != 0) {
+        this.isEdit += 1
+      }
+      this.dataList.push({
+        goodsList: [],
+        productCategory: {},
+        parentCategoryId: '',
+        parentCategoryName: '',
+        goodsCategory: {},
+        goodsCategoryName: '',
+        goodsCategoryId: '',
+        goods: {},
+        goodsId: '',
+        goodsName: '',
+        goodsSalesUnit: '',
+        goodsSpecification: '',
+        goodsCode: '',
+        newPrice: '',
+        oldPrice: '',
+        qty: '',
+        goodsType: 'M'
+      })
+    },
+    confirm() {
+      this.$confirm(`请确认是否审核通过, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        confirm({
+          sheetId: this.formData.sheetId,
+          flag: 'OK'
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('审核成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    submit() {
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              items: this.dataList
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              sheetId: this.formData.sheetId,
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              items: this.dataList
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 321 - 284
src/views/mallManagement/configCenter/slideshowConfig/index.vue

@@ -1,30 +1,54 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList">
-			</template-page>
-			<div v-if="~['add', 'edit'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				  <zj-form-module title="" label-width="100px" :showPackUp="false"
-				    :form-data="formData" :form-items="formItems">
-				  </zj-form-module>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="100px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { carouselMapListPageV2, carouselMapPageExport, changeBannerStatus, addBanner, editBanner, getBannerDetail, deleteBanner, getGoodsList, batchDeleteBanner } from '@/api/setting'
+import {
+  carouselMapListPageV2,
+  carouselMapPageExport,
+  changeBannerStatus,
+  addBanner,
+  editBanner,
+  getBannerDetail,
+  deleteBanner,
+  getGoodsList,
+  batchDeleteBanner
+} from '@/api/setting'
 import ImageUpload from '@/components/file-upload'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
@@ -45,173 +69,185 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增", "编辑"],
+      formDialogTitles: ['新增', '编辑'],
       formDialog: false,
       formData: {
-        carouselName: "",
+        carouselName: '',
         imgSrc: [],
         state: true,
-        sortNum: "",
-        type: "",
-        goodsId: "",
-        appId: "",
-        linkUrl: "",
+        sortNum: '',
+        type: '',
+        goodsId: '',
+        appId: '',
+        linkUrl: ''
       },
       goodsList: [],
-	  formType: 'add',
-	  formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   computed: {
-	// 事件组合
-	optionsEvensGroup() {
-		return [
-			[
-				[
-					this.optionsEvensAuth("add", {
-						click: () => {
-							this.openForm('add')
-						}
-					})
-				],
-			],
-			[
-				[
-					this.optionsEvensAuth("del", {
-						name: '批量删除',
-						click: () => {
-							this.batchDelete()
-						}
-					})
-				],
-			]
-		]
-	},
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('del', {
+              name: '批量删除',
+              click: () => {
+                this.batchDelete()
+              }
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
     },
     formItems() {
-      return [{
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '轮播图名称',
-          prop: 'carouselName',
-          rules: [...required]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '排序',
-          prop: 'sortNum',
-          rules: []
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '轮播图名称',
+            prop: 'carouselName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '排序',
+            prop: 'sortNum',
+            rules: []
+          }
+        },
+        {
+          md: 8,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '商品链接', value: 1 },
+            { label: '凡科活动链接', value: 2 },
+            { label: '专区活动链接', value: 3 }
+          ],
+          attributes: { filterable: true, placeholder: '请选择' },
+          formItemAttributes: {
+            label: '链接类型',
+            prop: 'type',
+            rules: []
+          }
+        },
+        ...(() => {
+          if (this.formData.type == 1) {
+            this.formData.appid = ''
+            this.formData.linkUrl = ''
+            // this.formData.goodsId = ""
+            return [
+              {
+                md: 6,
+                isShow: true,
+                name: 'el-select',
+                options: this.goodsList,
+                attributes: { filterable: true, placeholder: '请选择' },
+                formItemAttributes: {
+                  label: '选择活动',
+                  prop: 'goodsId',
+                  rules: []
+                }
+              }
+            ]
+          } else if (this.formData.type == 2) {
+            this.formData.goodsId = ''
+            return [
+              {
+                md: 6,
+                isShow: true,
+                name: 'el-input',
+                attributes: { placeholder: '请输入' },
+                formItemAttributes: {
+                  label: '活动APPID',
+                  prop: 'appid',
+                  rules: []
+                }
+              },
+              {
+                md: 6,
+                isShow: true,
+                name: 'el-input',
+                attributes: { placeholder: '请输入' },
+                formItemAttributes: {
+                  label: '活动路径',
+                  prop: 'linkUrl',
+                  rules: []
+                }
+              }
+            ]
+          } else if (this.formData.type == 3) {
+            this.formData.appid = ''
+            this.formData.linkUrl = ''
+            // this.formData.goodsId = ""
+            return [
+              {
+                md: 6,
+                isShow: true,
+                name: 'el-select',
+                options: [
+                  { value: 2, label: '首页弹窗' },
+                  { value: 3, label: '胶囊图' },
+                  { value: 4, label: '活动专区2-左侧专区' },
+                  { value: 5, label: '活动专区2-右侧专区' },
+                  { value: 6, label: '专场专区-01' },
+                  { value: 7, label: '专场专区-02' },
+                  { value: 8, label: '专场专区-03' },
+                  { value: 9, label: '专场专区-04' },
+                  { value: 10, label: '专题精选-01' },
+                  { value: 11, label: '专题精选-02' },
+                  { value: 12, label: '专题精选-03' },
+                  { value: 13, label: '底部广告图' }
+                ],
+                attributes: { filterable: true, placeholder: '请选择' },
+                formItemAttributes: {
+                  label: '选择活动',
+                  prop: 'goodsId',
+                  rules: []
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '封面图片',
+            prop: 'imgSrc',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return <ImageUpload fileList={this.formData.imgSrc} uid="imgSrc_materials_drawing_images" limit={1} />
+          }
         }
-      }, {
-        md: 8,
-        isShow: true,
-        name: 'el-radio',
-        options: [{ label: "商品链接", value: 1 }, { label: "凡科活动链接", value: 2 }, { label: "专区活动链接", value: 3 }],
-        attributes: { filterable: true, placeholder: '请选择' },
-        formItemAttributes: {
-          label: '链接类型',
-          prop: 'type',
-          rules: []
-        }
-      },
-      ...(() => {
-        if (this.formData.type == 1) {
-          this.formData.appid = ""
-          this.formData.linkUrl = ""
-          // this.formData.goodsId = ""
-          return [{
-            md: 6,
-            isShow: true,
-            name: 'el-select',
-            options: this.goodsList,
-            attributes: { filterable: true, placeholder: '请选择' },
-            formItemAttributes: {
-              label: '选择活动',
-              prop: 'goodsId',
-              rules: []
-            }
-          }]
-        } else if (this.formData.type == 2) {
-          this.formData.goodsId = ""
-          return [{
-            md: 6,
-            isShow: true,
-            name: 'el-input',
-            attributes: { placeholder: '请输入' },
-            formItemAttributes: {
-              label: '活动APPID',
-              prop: 'appid',
-              rules: []
-            }
-          }, {
-            md: 6,
-            isShow: true,
-            name: 'el-input',
-            attributes: { placeholder: '请输入' },
-            formItemAttributes: {
-              label: '活动路径',
-              prop: 'linkUrl',
-              rules: []
-            }
-          }]
-        } else if (this.formData.type == 3) {
-          this.formData.appid = ""
-          this.formData.linkUrl = ""
-          // this.formData.goodsId = ""
-          return [{
-            md: 6,
-            isShow: true,
-            name: 'el-select',
-            options: [
-              { value: 2, label: '首页弹窗' },
-              { value: 3, label: '胶囊图' },
-              { value: 4, label: '活动专区2-左侧专区' },
-              { value: 5, label: '活动专区2-右侧专区' },
-              { value: 6, label: '专场专区-01' },
-              { value: 7, label: '专场专区-02' },
-              { value: 8, label: '专场专区-03' },
-              { value: 9, label: '专场专区-04' },
-              { value: 10, label: '专题精选-01' },
-              { value: 11, label: '专题精选-02' },
-              { value: 12, label: '专题精选-03' },
-              { value: 13, label: '底部广告图' },
-            ],
-            attributes: { filterable: true, placeholder: '请选择' },
-            formItemAttributes: {
-              label: '选择活动',
-              prop: 'goodsId',
-              rules: []
-            }
-          }]
-        }
-        return []
-      })()
-	  , {
-	    md: 24,
-	    isShow: true,
-	    name: 'slot-component',
-	    formItemAttributes: {
-	      label: '封面图片',
-	      prop: 'imgSrc',
-	      rules: [...required]
-	    },
-	    render: (h, { props, onInput }) => {
-	      var { value } = props
-	      return (
-	        <ImageUpload fileList={this.formData.imgSrc} uid="imgSrc_materials_drawing_images" limit={1} />
-	      )
-	    }
-	  }
       ]
     }
   },
@@ -230,102 +266,103 @@ export default {
     },
     // 表格操作列
     operation() {
-		return this.operationBtn({
-		  edit: {
-			btnType: 'text',
-		    click: ({ row, index, column }) => {
-				this.openForm('edit',row.id)
-		    }
-		  },
-		  del: {
-			btnType: 'text',
-			prompt: '确定删除吗?',
-		    click: ({ row, index, column }) => {
-		      deleteBanner({ carouselMapId: row.id }).then(() => {
-		        this.$message({ type: 'success', message: '删除成功!' })
-		        this.$refs.pageRef.refreshList()
-		      })
-		    }
-		  },
-		  status: {
-			btnType: 'text',
-			name: ({ row, index, column }) => {
-				return row.state ? '隐藏' : '显示'
-			},
-		  	prompt:  ({ row, index, column }) => {
-				return `确定${row.state ? '隐藏' : '显示'}吗?`
-			},
-		    click: ({ row, index, column }) => {
-		      changeBannerStatus({ carouselMapId: row.id, state: !row.state }).then(() => {
-		        this.$message({ type: 'success', message: `${row.state ? '隐藏' : '显示'}成功!` })
-		        this.$refs.pageRef.refreshList()
-		      })
-		    }
-		  },
-		})
+      return this.operationBtn({
+        edit: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.id)
+          }
+        },
+        del: {
+          btnType: 'text',
+          prompt: '确定删除吗?',
+          click: ({ row, index, column }) => {
+            deleteBanner({ carouselMapId: row.id }).then(() => {
+              this.$message({ type: 'success', message: '删除成功!' })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        },
+        status: {
+          btnType: 'text',
+          name: ({ row, index, column }) => {
+            return row.state ? '隐藏' : '显示'
+          },
+          prompt: ({ row, index, column }) => {
+            return `确定${row.state ? '隐藏' : '显示'}吗?`
+          },
+          click: ({ row, index, column }) => {
+            changeBannerStatus({ carouselMapId: row.id, state: !row.state }).then(() => {
+              this.$message({ type: 'success', message: `${row.state ? '隐藏' : '显示'}成功!` })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        }
+      })
+    },
+    // 取消 新增编辑
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    // 打开 新增编辑 网点表单
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else {
+              this.formDialogType = 1
+              getBannerDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : []
+                })
+                getGoodsList({
+                  pageNum: 1,
+                  pageSize: -1
+                }).then(res => {
+                  this.goodsList = res.data.records.map(item => ({
+                    value: item.goodsId,
+                    label: item.goodsName
+                  }))
+                })
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.formCancel()
+        }
+      })
     },
-	// 取消 新增编辑
-	formCancel() {
-	  this.formVisible = false
-	  this.$refs?.formRef?.resetFields()
-	  this.$data.formData = this.$options.data().formData
-	},
-	// 打开 新增编辑 网点表单
-	openForm(type, id) {
-	  this.$refs.tabPage.addTab({
-	    // 对应显示的模块
-	    activeKey: type,
-	    // 唯一标识
-	    key: type,
-	    // 页签名称
-	    label: ({ edit: "编辑", add: "新增" })[type],
-	    // 打开时事件
-	    triggerEvent: () => {
-	      this.formCancel()
-	      this.$nextTick(()=>{
-	        this.formType = type
-	        this.formVisible = true
-	        if (type == 'add') {
-	          this.formDialogType = 0
-	        } else {
-				this.formDialogType = 1
-	          getBannerDetail({ id }).then(res => {
-	            Object.assign(this.formData, res.data, {
-	              imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
-	            })
-	            getGoodsList({
-	              pageNum: 1,
-	              pageSize: -1
-	            }).then(res => {
-	              this.goodsList = res.data.records.map(item => ({
-	                value: item.goodsId,
-	                label: item.goodsName
-	              }));
-	            })
-	          })
-	        }
-	      })
-	    },
-	    // 关闭时事件
-	    closeEvent: () => {
-			console.log(111)
-	      this.formCancel()
-	    }
-	  })
-	},
     formConfirm(cancel) {
-		this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-			if (valid) {
-				([addBanner, editBanner][this.formDialogType])({
-					...this.formData,
-					imgSrc: this.formData.imgSrc.map(item => item.url).join(","),
-				}).then(res => {
-					this.$message({ type: 'success', message: `${({ edit: "编辑", add: "新增" })[this.formType]}成功!` })
-					cancel('list')
-					this.$refs.pageRef.refreshList()
-				})
-			}
-		})
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ;[addBanner, editBanner]
+            [this.formDialogType]({
+              ...this.formData,
+              imgSrc: this.formData.imgSrc.map(item => item.url).join(',')
+            })
+            .then(res => {
+              this.$message({ type: 'success', message: `${{ edit: '编辑', add: '新增' }[this.formType]}成功!` })
+              cancel('list')
+              this.$refs.pageRef.refreshList()
+            })
+        }
+      })
     },
     batchDelete() {
       if (this.recordSelected && this.recordSelected.length > 0) {
@@ -333,31 +370,31 @@ export default {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then(() => {
-          let ids = []
-          this.recordSelected.forEach(value => {
-            ids.push(value.id)
+        })
+          .then(() => {
+            let ids = []
+            this.recordSelected.forEach(value => {
+              ids.push(value.id)
+            })
+            batchDeleteBanner(ids).then(() => {
+              this.$message({ type: 'success', message: '删除成功!' })
+              this.$refs.pageRef.refreshList()
+            })
           })
-          batchDeleteBanner(ids).then(() => {
-            this.$message({ type: 'success', message: '删除成功!' })
-            this.$refs.pageRef.refreshList()
-          })
-        }).catch(() => { });
+          .catch(() => {})
       } else {
         this.$errorMsg('请选择要删除的轮播图')
       }
-    },
+    }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-	
-</style>
+<style lang="scss" scoped></style>
 <style>
-	.dialog-footer{
-		padding: 0 30px;
-		display: flex;
-		justify-content: flex-end;
-	}
+.dialog-footer {
+  padding: 0 30px;
+  display: flex;
+  justify-content: flex-end;
+}
 </style>

+ 14 - 12
src/views/mallManagement/order/order_list/index.vue

@@ -1174,18 +1174,20 @@ export default {
       const file = this.fileList[0].raw;
       const formData = new FormData();
       formData.append("file", file);
-      let result = await handleImport('order/goods/batch/deliver', formData);
-      this.importFileList = [];
-      if (result.code == 200) {
-        loading.close();
-        this.$successMsg('批量发货成功');
-        this.getList();
-      } else {
-        loading.close();
-        this.$alert(result.message, '批量发货失败', {
-          confirmButtonText: '确定'
-        });
-      }
+
+      handleImport('order/goods/batch/deliver', formData).then(result=>{
+        this.importFileList = [];
+        if (result.code == 200) {
+          loading.close();
+          this.$successMsg('批量发货成功');
+          this.getList();
+        } else {
+          loading.close();
+          this.$alert(result.message, '批量发货失败', {
+            confirmButtonText: '确定'
+          });
+        }
+      })      
     },
 
     // 获取省市区街道

File diff suppressed because it is too large
+ 503 - 490
src/views/mallManagement/order/order_refund/index.vue


+ 693 - 0
src/views/salesPurchasing/commercialMaterial/index.vue

@@ -0,0 +1,693 @@
+<template>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <div
+        :style="{
+          width: '100%',
+          height: activeKey == 'list' ? '100%' : '0px',
+          overflow: 'hidden'
+        }"
+      >
+        <template-page
+          ref="pageRef"
+          :get-list="getList"
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :options-evens-group="optionsEvensGroup"
+          :moreParameters="moreParameters"
+          :column-parsing="columnParsing"
+          :exportList="exportList"
+          :operation="operation()"
+        >
+        </template-page>
+      </div>
+      <div v-if="~['add', 'edit'].indexOf(activeKey)" style="box-sizing: border-box; padding: 16px">
+        <zj-form-container ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
+          <zj-form-module title="" label-width="100px" :form-data="formData" :form-items="formItems">
+            <div
+              slot="internal-bottom"
+              style="text-align: right; margin-bottom: 20px; box-sizing: border-box; padding-right: 10px"
+            >
+              <el-button size="mini" @click="data.removeTab()">取消</el-button>
+              <el-button size="mini" type="primary" @click="queding(data.removeTab)">确定</el-button>
+            </div>
+          </zj-form-module>
+        </zj-form-container>
+      </div>
+    </template>
+  </zj-tab-page>
+</template>
+
+<script>
+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 { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { getBrandList } from '@/api/miniapp'
+import { getClassifyList } from '@/api/goods'
+import {
+  goodsMaterialList,
+  goodsMaterialListExport,
+  goodsMaterialAdd,
+  goodsMaterialUpdate,
+  goodsMaterialBatchUpdateStatus,
+  goodsMaterialItemCount,
+  goodsMaterialDetail
+} from '@/api/commercialMaterial.js'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      formData: {
+        companyWechatId: '',
+        brandId: '',
+        mainId: '',
+        smallId: '',
+        seriesName: '',
+        goodsName: '',
+        specsName: '',
+        state: '',
+        unit: '',
+        isVirtyual: '',
+        remark: '',
+        items: []
+      },
+      isEditIndex: -1,
+      brandList: [],
+      ClassifyList: []
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.$refs.tabPage.addTab({
+                  activeKey: 'add',
+                  key: 'add',
+                  label: '新增',
+                  triggerEvent: () => {
+                    this.openForm()
+                  }
+                })
+              }
+            })
+          ]
+          // [
+          // 	this.optionsEvensAuth("pilqy", {
+          // 		click: () => {
+
+          // 		}
+          // 	})
+          // ],
+          // [
+          // 	this.optionsEvensAuth("piljy", {
+          // 		click: () => {
+
+          // 		}
+          // 	})
+          // ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return [
+        {
+          name: 'slot-component',
+          md: 12,
+          formItemAttributes: {
+            label: '所属商户'
+          },
+          render: (h, { props }) => {
+            return <el-input disabled={true} value={JSON.parse(localStorage.getItem('greemall_user')).companyName} />
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          options: this.brandList,
+          attributes: {
+            disabled: false,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '选择品牌',
+            prop: 'brandId',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.formData.brandName = this.brandList.find(item => item.value === val)?.label || ''
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          options: this.ClassifyList.map(item => ({ label: item.name, value: item.categoryId })),
+          attributes: {
+            disabled: false,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '选择大类',
+            prop: 'mainId',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.formData.mainName =
+                this.ClassifyList.map(item => ({ label: item.name, value: item.categoryId })).find(
+                  item => item.value === val
+                )?.label || ''
+              this.formData.smallId = ''
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          options: (this.ClassifyList.find(item => item.categoryId === this.formData.mainId)?.children || [])?.map(
+            item => ({ label: item.name, value: item.categoryId })
+          ),
+          attributes: {
+            disabled: false,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '选择小类',
+            prop: 'smallId',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.formData.smallName =
+                (this.ClassifyList.find(item => item.categoryId === this.formData.mainId)?.children || [])
+                  ?.map(item => ({ label: item.name, value: item.categoryId }))
+                  .find(item => item.value === val)?.label || ''
+            }
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: false,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '系列名称',
+            prop: 'seriesName'
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: false,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '商品名称',
+            prop: 'goodsName',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: false,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '规格型号',
+            prop: 'specsName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          name: 'el-radio',
+          options: [
+            { label: '有效', value: 'ON' },
+            { label: '无效', value: 'OFF' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'state',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          name: 'el-radio',
+          options: [
+            { label: '整套', value: 'C' },
+            { label: '单个', value: 'I' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '单位',
+            prop: 'unit',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          name: 'el-radio',
+          options: [
+            { label: '是', value: 'YES' },
+            { label: '否', value: 'NO' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '虚拟商品',
+            prop: 'isVirtyual',
+            rules: [...required]
+          }
+        },
+        ...(() => {
+          if (this.formData.isVirtyual === 'NO') {
+            this.isEditIndex = -1
+            return [
+              {
+                name: 'slot-component',
+                md: 24,
+                formItemAttributes: {
+                  label: '子物料',
+                  prop: 'items',
+                  rules: [...required]
+                },
+                render: (h, { props }) => {
+                  return (
+                    <div>
+                      <el-button
+                        size="mini"
+                        type="primary"
+                        onClick={() => {
+                          if (this.isEditIndex > -1) {
+                            this.$refs.formRef.validateField(
+                              this.getVfyKey(this.isEditIndex),
+                              (valid, invalidFields, errLabels) => {
+                                if (valid && this.eidtItems()) {
+                                  this.formData.items.unshift({
+                                    name: '',
+                                    qty: '',
+                                    type: '',
+                                    uniqueCode: '',
+                                    unit: ''
+                                  })
+                                  this.isEditIndex = 0
+                                }
+                              }
+                            )
+                          } else if (this.eidtItems()) {
+                            this.formData.items.unshift({
+                              name: '',
+                              qty: '',
+                              type: '',
+                              uniqueCode: '',
+                              unit: ''
+                            })
+                            this.isEditIndex = 0
+                          }
+                        }}
+                      >
+                        新增
+                      </el-button>
+                      <zj-table columns={this.productColumns} table-data={this.formData.items} />
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })(),
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: false,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    },
+    productColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '物料类型',
+            prop: 'type'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={this.isEditIndex !== index}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请选择"
+                  >
+                    {[
+                      { value: 'INSIDE', label: '内机' },
+                      { value: 'OUT', label: '外机' },
+                      { value: 'PARTS', label: '配件' }
+                    ].map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '名称',
+            prop: 'name'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    disabled={this.isEditIndex !== index}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否一物一码',
+            prop: 'uniqueCode'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    disabled={this.isEditIndex !== index}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请选择"
+                  >
+                    {[
+                      { label: '是', value: 'YES' },
+                      { label: '否', value: 'NO' }
+                    ].map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'qty'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    disabled={this.isEditIndex !== index}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单位',
+            prop: 'unit'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  label-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    disabled={this.isEditIndex !== index}
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入内容"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="padding-left:10px">
+                <el-button
+                  type="text"
+                  onClick={() => {
+                    this.delProduct(row, index)
+                  }}
+                >
+                  删除
+                </el-button>
+                {this.isEditIndex == index && (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      this.$refs.formRef.validateField(
+                        this.getVfyKey(this.isEditIndex),
+                        (valid, invalidFields, errLabels) => {
+                          if (valid && this.eidtItems()) {
+                            this.isEditIndex = -1
+                          }
+                        }
+                      )
+                    }}
+                  >
+                    确定
+                  </el-button>
+                )}
+                {this.isEditIndex == -1 && (
+                  <el-button
+                    type="text"
+                    onClick={() => {
+                      this.isEditIndex = index
+                    }}
+                  >
+                    编辑
+                  </el-button>
+                )}
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: goodsMaterialList,
+    // 列表导出函数
+    exportList: goodsMaterialListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    getVfyKey(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [`items`]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              `items.${index}.name`,
+              `items.${index}.type`,
+              `items.${index}.uniqueCode`,
+              `items.${index}.qty`,
+              `items.${index}.unit`
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    eidtItems() {
+      try {
+        this.formData.items.map((item, index) => {
+          this.formData.items.map((item2, index2) => {
+            if (index !== index2 && `${item.type}_${item.name}` == `${item2.type}_${item2.name}`) {
+              throw new Error('')
+            }
+          })
+        })
+      } catch (error) {
+        this.$message.warning('子物料重复')
+        return false
+      }
+      return true
+    },
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            this.$refs.tabPage.addTab({
+              activeKey: 'edit',
+              key: 'edit',
+              label: '编辑',
+              triggerEvent: () => {
+                this.openForm()
+                goodsMaterialDetail({ id: row.id }).then(res => {
+                  this.formData = res.data
+                  console.log(this.formData)
+                })
+              }
+            })
+          }
+        }
+      })
+    },
+    openForm() {
+      this.formCancel()
+      getBrandList({
+        status: true
+      }).then(res => {
+        this.brandList = res.data.map(item => ({
+          label: item.brandName,
+          value: item.id
+        }))
+      })
+      getClassifyList({
+        type: 2,
+        status: true
+      }).then(res => {
+        this.ClassifyList = res.data
+      })
+    },
+    formCancel() {
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    queding(removeTab) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid && this.eidtItems()) {
+          ;[goodsMaterialAdd, goodsMaterialUpdate][this.formData.id ? 1 : 0](this.formData).then(res => {
+            this.$message({
+              type: 'success',
+              message: '保存成功'
+            })
+            this.$refs.pageRef.refreshList()
+            removeTab()
+          })
+        }
+      })
+    },
+    delProduct(row, index) {
+      if (index > this.isEditIndex) {
+        this.formData?.items?.splice(index, 1)
+      } else if (index == this.isEditIndex) {
+        this.formData?.items?.splice(index, 1)
+        this.isEditIndex = -1
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 330 - 0
src/views/salesPurchasing/goodsPurchasedStored/index.vue

@@ -0,0 +1,330 @@
+<template>
+  <template-page v-if="pageShow" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+    :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :exportList="exportList" :operation="operation()" key="pageType">
+    <div slot="moreSearch">
+      <el-radio-group v-model="pageType" size="mini" @input="changePageType">
+        <el-radio-button label="list">列表</el-radio-button>
+        <el-radio-button label="goodsder">商品明细</el-radio-button>
+        <el-radio-button label="codeder">条码明细</el-radio-button>
+      </el-radio-group>
+      <br /><br />
+    </div>
+    <div class="cartographer_big">
+      <el-dialog :title="formDialogTitles[formDialogType]" width="100%" :modal="false" :visible.sync="formDialog"
+        :before-close="handleClose">
+        <zj-page-container>
+          <zj-page-fill>
+            <div style="box-sizing: border-box; padding: 20px 20px 0 20px">
+              <zj-form-container ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
+                <zj-form-module title="单据信息" label-width="100px" :form-data="formData" :form-items="formItems">
+                </zj-form-module>
+                <zj-form-module title="" label-width="100px" :form-data="formData" :form-items="formItems2">
+                  <el-tabs slot="header" v-model="activeName">
+                    <el-tab-pane label="商品信息" name="goodsInfo"></el-tab-pane>
+                    <el-tab-pane v-if="formDialogType > 0 && joinCode" label="条码信息" name="codeInfo"></el-tab-pane>
+                  </el-tabs>
+                </zj-form-module>
+              </zj-form-container>
+            </div>
+          </zj-page-fill>
+          <div v-if="activeName == 'goodsInfo'" style="text-align: right; box-sizing: border-box; padding: 16px 20px">
+            <el-button v-if="formDialogType == 0" size="mini" type="primary" @click="save">保存</el-button>
+            <el-button v-if="formDialogType == 1" size="mini" type="primary" @click="submit">提交</el-button>
+            <el-button v-if="formDialogType == 3" size="mini" type="primary" @click="examine">审核通过</el-button>
+          </div>
+        </zj-page-container>
+      </el-dialog>
+    </div>
+  </template-page>
+</template>
+
+<script>
+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 {
+  goodsPurchaseList,
+  goodsPurchaseListExport,
+  goodsPurchaseItemList,
+  goodsPurchaseItemListExport,
+  goodsPurchaseCodeList,
+  goodsPurchaseCodeListExport,
+  goodsPurchaseAdd,
+  goodsPurchaseDetail,
+  goodsPurchaseSubmit,
+  goodsPurchaseConfirm,
+  goodsPurchaseDel
+} from '@/api/goodsPurchasedStored.js'
+import form_ty from '../mixins/common_form'
+import storage_table from '../mixins/storage_table'
+import storage_goods from '../mixins/storage_goods'
+import storage_codes from '../mixins/storage_codes'
+import common from '../mixins/common_code'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin, form_ty, storage_table, storage_goods, storage_codes, common],
+  data() {
+    return {
+      pageType: 'list',
+      pageShow: true,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增入库单', '编辑入库单', '入库单详情', '审核入库单'],
+      formDialog: false,
+      appraise_status: '',
+      formData: {
+        companyWechatId: '',
+        companyWechatName: '',
+        examineBy: '',
+        examineTime: '',
+        fileUrl: '',
+        remark: '',
+        status: '',
+        submitBy: '',
+        submitTime: '',
+        totalAmount: 0,
+        totalQty: 0,
+        updateBy: '',
+        updateTime: '',
+        venderId: '',
+        venderName: '',
+        fileUrl: [],
+        items: [],
+        codeInfoList: []
+      },
+      activeName: 'goodsInfo',
+      goods_material_id: '',
+      joinCode: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      if (this.pageType == 'list') {
+        return [
+          [
+            [
+              this.optionsEvensAuth('add', {
+                click: () => {
+                  this.openForm()
+                  this.formDialog = true
+                  this.joinCode = JSON.parse(localStorage.getItem('greemall_user')).joinCode
+                }
+              })
+            ]
+          ]
+        ]
+      } else if (this.pageType == 'goodsder') {
+        return []
+      } else if (this.pageType == 'codeder') {
+        return []
+      }
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    }
+  },
+  watch: {
+    pageType() {
+      this.handleClose()
+      this.pageShow = false
+      this.$nextTick(() => {
+        this.pageShow = true
+      })
+    }
+  },
+  methods: {
+    changePageType() {
+      this.goods_material_id = ''
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      if (this.pageType == 'list') {
+        return goodsPurchaseList(p)
+      } else if (this.pageType == 'goodsder') {
+        return goodsPurchaseItemList(p)
+      } else if (this.pageType == 'codeder') {
+        if (this.goods_material_id) {
+          return goodsPurchaseCodeList({
+            ...p,
+            params: [...p.params, { param: 'b.goods_material_id', compare: '=', value: this.goods_material_id }]
+          })
+        } else {
+          return goodsPurchaseCodeList(p)
+        }
+      }
+    },
+    // 列表导出函数
+    exportList(...p) {
+      if (this.pageType == 'list') {
+        return goodsPurchaseListExport(...p)
+      } else if (this.pageType == 'goodsder') {
+        return goodsPurchaseItemListExport(...p)
+      } else if (this.pageType == 'codeder') {
+        return goodsPurchaseCodeListExport(...p)
+      }
+    },
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 打开创建弹窗
+    openForm() {
+      this.getGysList()
+      this.getBaseList()
+    },
+    // 打开详情弹窗
+    openDetailForm(row, type) {
+      goodsPurchaseDetail({ id: row.id }).then(res => {
+        Object.assign(this.formData, res.data, {
+          fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+          items: res.data.items.map(item => ({ ...item, details: {} }))
+        })
+        this.joinCode = res.data.joinCode
+        this.formDialogType = type
+        this.openForm()
+        this.formDialog = true
+      })
+    },
+    // 关闭弹窗
+    handleClose() {
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+      this.formDialog = false
+      this.formDialogType = 0
+      this.activeName = 'goodsInfo'
+      this.joinCode = false
+    },
+    // 操作按钮
+    operation() {
+      if (this.pageType == 'list') {
+        return this.operationBtn({
+          edit: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'SAVE'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 1)
+            }
+          },
+          del: {
+            prompt: '是否确定删除',
+            conditions: ({ row, index, column }) => {
+              return row.status == 'SAVE'
+            },
+            click: ({ row, index, column }) => {
+              goodsPurchaseDel({
+                id: row.id
+              }).then(res => {
+                this.$message({
+                  type: 'success',
+                  message: '删除成功'
+                })
+                this.$refs.pageRef.refreshList()
+              })
+            }
+          },
+          detail: {
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 2)
+            }
+          },
+          shenhe: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'WAIT'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 3)
+            }
+          }
+        })
+      } else if (this.pageType == 'goodsder') {
+        return this.operationBtn({
+          codeDetail: {
+            click: ({ row, index, column }) => {
+              this.goods_material_id = row.goodsMaterialId
+              this.pageType = 'codeder'
+            }
+          }
+        })
+      } else if (this.pageType == 'codeder') {
+        return undefined
+      }
+    },
+    // 保存
+    save() {
+      this.$refs.formRef.validateField(this.getVfyKey(this.isEditIndex), (valid, invalidFields, errLabels) => {
+        if (valid && this.eidtItems()) {
+          goodsPurchaseAdd({
+            ...this.formData,
+            items: this.formData.items.map((item, index) => ({ ...item, index: index + 1 })),
+            fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+            codeInfoList: undefined
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '保存成功'
+            })
+            this.handleClose()
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    },
+    // 提交
+    submit() {
+      goodsPurchaseSubmit({
+        id: this.formData.id
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '提交成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    },
+    // 审核
+    examine() {
+      goodsPurchaseConfirm({
+        id: this.formData.id,
+        statusEnum: 'OK'
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '审核成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+
+::v-deep .teshudeshangchuananniu {
+  color: #409eff !important;
+}
+</style>

+ 325 - 0
src/views/salesPurchasing/merchandisePurchaseReturn/index.vue

@@ -0,0 +1,325 @@
+<template>
+  <template-page v-if="pageShow" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+    :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :exportList="exportList" :operation="operation()" key="pageType">
+    <div slot="moreSearch">
+      <el-radio-group v-model="pageType" size="mini" @change="changePageType">
+        <el-radio-button label="list">列表</el-radio-button>
+        <el-radio-button label="goodsder">商品明细</el-radio-button>
+        <el-radio-button label="codeder">条码明细</el-radio-button>
+      </el-radio-group>
+      <br /><br />
+    </div>
+    <div class="cartographer_big">
+      <el-dialog :title="formDialogTitles[formDialogType]" width="100%" :modal="false" :visible.sync="formDialog"
+        :before-close="handleClose">
+        <zj-page-container>
+          <zj-page-fill>
+            <div style="box-sizing: border-box; padding: 20px 20px 0 20px">
+              <zj-form-container ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
+                <zj-form-module title="单据信息" label-width="100px" :form-data="formData" :form-items="formItems">
+                </zj-form-module>
+                <zj-form-module title="" label-width="100px" :form-data="formData" :form-items="formItems2">
+                  <el-tabs slot="header" v-model="activeName">
+                    <el-tab-pane label="商品信息" name="goodsInfo"></el-tab-pane>
+                    <el-tab-pane v-if="formDialogType > 0 && joinCode" label="条码信息" name="codeInfo"></el-tab-pane>
+                  </el-tabs>
+                </zj-form-module>
+              </zj-form-container>
+            </div>
+          </zj-page-fill>
+          <div v-if="activeName == 'goodsInfo'" style="text-align: right; box-sizing: border-box; padding: 16px 20px">
+            <el-button v-if="formDialogType == 0" size="mini" type="primary" @click="save">保存</el-button>
+            <el-button v-if="formDialogType == 1" size="mini" type="primary" @click="submit">提交</el-button>
+            <el-button v-if="formDialogType == 3" size="mini" type="primary" @click="examine">审核通过</el-button>
+          </div>
+        </zj-page-container>
+      </el-dialog>
+    </div>
+  </template-page>
+</template>
+
+<script>
+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 {
+  goodsPurchaseRetList,
+  goodsPurchaseRetListExport,
+  goodsPurchaseRetItemList,
+  goodsPurchaseRetItemListExport,
+  goodsPurchaseRetCodeList,
+  goodsPurchaseRetCodeListExport,
+  goodsPurchaseRetAdd,
+  goodsPurchaseRetSubmit,
+  goodsPurchaseRetConfirm,
+  goodsPurchaseRetDetail,
+  goodsPurchaseRetDel
+} from '@/api/merchandisePurchaseReturn.js'
+import form_ty from '../mixins/common_form'
+import out_storage_table from '../mixins/out_storage_table'
+import out_storage_goods from '../mixins/out_storage_goods'
+import out_storage_codes from '../mixins/out_storage_codes'
+import common from '../mixins/common_code'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin, form_ty, out_storage_table, out_storage_goods, out_storage_codes, common],
+  data() {
+    return {
+      pageType: 'list',
+      pageShow: true,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增退货单', '编辑退货单', '退货单详情', '审核退货单'],
+      formDialog: false,
+      appraise_status: '',
+      formData: {
+        companyWechatId: '',
+        companyWechatName: '',
+        examineBy: '',
+        examineTime: '',
+        fileUrl: [],
+        goodsPurchaseId: '',
+        items: [],
+        remark: '',
+        status: '',
+        submitBy: '',
+        submitTime: '',
+        totalAmount: '',
+        totalQty: '',
+        venderId: '',
+        venderName: '',
+        codeInfoList: []
+      },
+      activeName: 'goodsInfo',
+      goods_material_id: '',
+      joinCode: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      if (this.pageType == 'list') {
+        return [
+          [
+            [
+              this.optionsEvensAuth('add', {
+                click: () => {
+                  this.formDialog = true
+                  this.openForm()
+                }
+              })
+            ]
+          ]
+        ]
+      } else if (this.pageType == 'goodsder') {
+        return []
+      } else if (this.pageType == 'codeder') {
+        return []
+      }
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    }
+  },
+  watch: {
+    pageType() {
+      this.handleClose()
+      this.pageShow = false
+      this.$nextTick(() => {
+        this.pageShow = true
+      })
+    }
+  },
+  methods: {
+    changePageType() {
+      this.goods_material_id = ''
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      if (this.pageType == 'list') {
+        return goodsPurchaseRetList(p)
+      } else if (this.pageType == 'goodsder') {
+        return goodsPurchaseRetItemList(p)
+      } else if (this.pageType == 'codeder') {
+        if (this.goods_material_id) {
+          return goodsPurchaseRetCodeList({
+            ...p,
+            params: [...p.params, { param: 'b.goods_material_id', compare: '=', value: this.goods_material_id }]
+          })
+        } else {
+          return goodsPurchaseRetCodeList(p)
+        }
+      }
+    },
+    // 列表导出函数
+    exportList(...p) {
+      if (this.pageType == 'list') {
+        return goodsPurchaseRetListExport(...p)
+      } else if (this.pageType == 'goodsder') {
+        return goodsPurchaseRetItemListExport(...p)
+      } else if (this.pageType == 'codeder') {
+        return goodsPurchaseRetCodeListExport(...p)
+      }
+    },
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 打开创建弹窗
+    openForm() {
+      this.getGysList()
+      this.getCgrkOrder()
+    },
+    // 打开详情弹窗
+    openDetailForm(row, type) {
+      goodsPurchaseRetDetail({ id: row.id }).then(res => {
+        Object.assign(this.formData, res.data, {
+          fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+          items: res.data.items.map(item => ({ ...item, details: {} }))
+        })
+        this.formDialogType = type
+        this.openForm()
+        this.formDialog = true
+      })
+    },
+    handleClose() {
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+      this.formDialog = false
+      this.formDialogType = 0
+      this.activeName = 'goodsInfo'
+      this.joinCode = false
+    },
+    // 操作按钮
+    operation() {
+      if (this.pageType == 'list') {
+        return this.operationBtn({
+          edit: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'SAVE'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 1)
+            }
+          },
+          del: {
+            prompt: '是否确定删除',
+            conditions: ({ row, index, column }) => {
+              return row.status == 'SAVE'
+            },
+            click: ({ row, index, column }) => {
+              goodsPurchaseRetDel({
+                id: row.id
+              }).then(res => {
+                this.$message({
+                  type: 'success',
+                  message: '删除成功'
+                })
+                this.$refs.pageRef.refreshList()
+              })
+            }
+          },
+          detail: {
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 2)
+            }
+          },
+          shenhe: {
+            conditions: ({ row, index, column }) => {
+              return row.status == 'WAIT'
+            },
+            click: ({ row, index, column }) => {
+              this.openDetailForm(row, 3)
+            }
+          }
+        })
+      } else if (this.pageType == 'goodsder') {
+        return this.operationBtn({
+          codeDetail: {
+            click: ({ row, index, column }) => {
+              this.goods_material_id = row.goodsMaterialId
+              this.pageType = 'codeder'
+            }
+          }
+        })
+      } else if (this.pageType == 'codeder') {
+        return undefined
+      }
+    },
+    // 保存
+    save() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          goodsPurchaseRetAdd({
+            ...this.formData,
+            items: this.formData.items.map((item, index) => ({ ...item, index: index + 1 })),
+            fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+            codeInfoList: undefined
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '保存成功'
+            })
+            this.handleClose()
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    },
+    // 提交
+    submit() {
+      goodsPurchaseRetSubmit({
+        id: this.formData.id
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '提交成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    },
+    // 审核
+    examine() {
+      goodsPurchaseRetConfirm({
+        id: this.formData.id,
+        statusEnum: 'OK'
+      }).then(res => {
+        this.$message({
+          type: 'success',
+          message: '审核成功'
+        })
+        this.handleClose()
+        this.$refs.pageRef.refreshList()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+
+::v-deep .teshudeshangchuananniu {
+  color: #409eff !important;
+}
+</style>

+ 567 - 0
src/views/salesPurchasing/mixins/common_code.js

@@ -0,0 +1,567 @@
+import { goodsMaterialDetail } from '@/api/commercialMaterial.js'
+import { required } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1
+    }
+  },
+  computed: {
+    storage_codes() {
+      return [
+        {
+          columnAttributes: {
+            label: '品牌',
+            prop: 'brandId',
+            propName: 'brandName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 0)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(this.formData.items, {
+                          value: 'brandId',
+                          label: 'brandName'
+                        }).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(this.formData.items, { value: 'brandId', label: 'brandName' }).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品大类',
+            prop: 'mainId',
+            propName: 'mainName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 1)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(
+                          this.formData.items.filter(item => item.brandId === row.brandId),
+                          { value: 'mainId', label: 'mainName' }
+                        ).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(item => item.brandId === row.brandId),
+                      { value: 'mainId', label: 'mainName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品小类',
+            prop: 'smallId',
+            propName: 'smallName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 2)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.arrQC(
+                          this.formData.items.filter(
+                            item => item.brandId === row.brandId && item.mainId === row.mainId
+                          ),
+                          { value: 'smallId', label: 'smallName' }
+                        ).find(item => item.value == val).label
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(item => item.brandId === row.brandId && item.mainId === row.mainId),
+                      { value: 'smallId', label: 'smallName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品名称',
+            prop: 'goodsMaterialId',
+            propName: 'goodsMaterialName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 3)
+                      if (val) {
+                        var data = this.arrQC(
+                          this.formData.items.filter(
+                            item =>
+                              item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                          ),
+                          { value: 'goodsMaterialId', label: 'goodsMaterialName' }
+                        ).find(item => item.value == val)
+                        this.getGoodsDetl(data?.data, res => {}, 'goodsMaterialId')
+                        row[column.columnAttributes.propName] = data.label
+                        row['specsName'] = data?.data?.specsName
+                        row['goodsPurchaseItemId'] = data?.data?.id
+                        row['goodsPurchaseRetItemId'] = data?.data?.id
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                        row['specsName'] = ''
+                        row['goodsPurchaseItemId'] = ''
+                        row['goodsPurchaseRetItemId'] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.arrQC(
+                      this.formData.items.filter(
+                        item =>
+                          item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                      ),
+                      { value: 'goodsMaterialId', label: 'goodsMaterialName' }
+                    ).map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specsName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料类型',
+            prop: 'goodsMaterialItemType',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 4)
+                    }}
+                    placeholder="请选择"
+                  >
+                    {[
+                      { value: 'INSIDE', label: '内机' },
+                      { value: 'OUT', label: '外机' },
+                      { value: 'PARTS', label: '配件' }
+                    ].map((item, index_) => (
+                      <el-option key={index_} label={item.label} value={item.value}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">
+                {[
+                  { value: 'INSIDE', label: '内机' },
+                  { value: 'OUT', label: '外机' },
+                  { value: 'PARTS', label: '配件' }
+                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料名称',
+            prop: 'goodsMaterialItemId',
+            propName: 'goodsMaterialItemName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchuCodejichu(row, 5)
+                      if (val) {
+                        var data = (
+                          this.formData.items.find(
+                            item =>
+                              item.brandId === row.brandId &&
+                              item.mainId === row.mainId &&
+                              item.smallId === row.smallId &&
+                              item.goodsMaterialId === row.goodsMaterialId
+                          )?.details?.items || []
+                        )
+                          .filter(item => item.type == row.goodsMaterialItemType)
+                          .find(item => item.id == val)
+                        row[column.columnAttributes.propName] = data.name
+                        row['uniqueCode'] = data.uniqueCode
+                        row['codeQty'] = data.uniqueCode == 'YES' ? 1 : ''
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                        row['uniqueCode'] = ''
+                        row['codeQty'] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {(
+                      this.formData.items.find(
+                        item =>
+                          item.brandId === row.brandId &&
+                          item.mainId === row.mainId &&
+                          item.smallId === row.smallId &&
+                          item.goodsMaterialId === row.goodsMaterialId
+                      )?.details?.items || []
+                    )
+                      .filter(item => item.type == row.goodsMaterialItemType)
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.id}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否一物一码',
+            prop: 'uniqueCode',
+            width: 120
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="padding:0 6px">
+                {[
+                  { value: 'YES', label: '是' },
+                  { value: 'NO', label: '否' }
+                ].find(item => item.value == row[column.columnAttributes.prop])?.label || ''}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '条码',
+            prop: 'code',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'codeQty',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index && row.uniqueCode == 'NO' ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`codeInfoList.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        ...(() => {
+          if (this.formDialogType < 2) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      {this.formDialogType == 0
+                        ? null
+                        : this.formDialogType == 1
+                        ? [
+                            this.isEditIndex == index ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  this.addCode(row)
+                                }}
+                              >
+                                保存
+                              </el-button>
+                            ) : null,
+                            this.isEditIndex == -1 ? (
+                              <el-button
+                                type="text"
+                                onClick={() => {
+                                  this.getGoodsDetl(
+                                    this.formData.items.find(
+                                      item =>
+                                        item.brandId === row.brandId &&
+                                        item.mainId === row.mainId &&
+                                        item.smallId === row.smallId &&
+                                        item.goodsMaterialId === row.goodsMaterialId
+                                    ),
+                                    res => {
+                                      this.isEditIndex = index
+                                    },
+                                    'goodsMaterialId'
+                                  )
+                                }}
+                              >
+                                编辑
+                              </el-button>
+                            ) : null,
+                            <el-button
+                              type="text"
+                              onClick={() => {
+                                this.delCode(row, index)
+                              }}
+                            >
+                              删除
+                            </el-button>
+                          ]
+                        : null}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    }
+  },
+  methods: {
+    // 获取商品详情
+    getGoodsDetl(row, cb, key = 'id') {
+      if (!row?.details?.id) {
+        goodsMaterialDetail({ id: row[key] }).then(res => {
+          Object.assign(row.details, res.data || {})
+          cb(row.details)
+        })
+      } else {
+        cb(row.details)
+      }
+    },
+    arrQC(list, qz = { label: '', value: '' }) {
+      var obj = {}
+      for (var item of list) {
+        obj[item[qz?.value || 'value']] = item
+      }
+      return Object.keys(obj).map(key => {
+        return {
+          data: obj[key],
+          value: key,
+          label: obj[key][qz?.label || 'label']
+        }
+      })
+    },
+    shanchuCodejichu(row, num) {
+      if (num <= 0) {
+        row.mainId = ''
+        row.mainName = ''
+      }
+      if (num <= 1) {
+        row.smallId = ''
+        row.smallName = ''
+      }
+      if (num <= 2) {
+        row.goodsMaterialId = ''
+        row.goodsMaterialName = ''
+        row.goodsPurchaseItemId = ''
+        row.goodsPurchaseRetItemId = ''
+        row.specsName = ''
+      }
+      if (num <= 3) {
+        row.goodsMaterialItemType = ''
+      }
+      if (num <= 4) {
+        row.goodsMaterialItemId = ''
+        row.goodsMaterialItemName = ''
+        row.codeQty = ''
+      }
+      if (num <= 5) {
+        row.uniqueCode = ''
+        row.code = ''
+      }
+    },
+    getCodeVfyKey() {
+      return [
+        `codeInfoList.${this.isEditIndex}.brandId`,
+        `codeInfoList.${this.isEditIndex}.mainId`,
+        `codeInfoList.${this.isEditIndex}.smallId`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialId`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialItemType`,
+        `codeInfoList.${this.isEditIndex}.goodsMaterialItemId`,
+        `codeInfoList.${this.isEditIndex}.code`,
+        `codeInfoList.${this.isEditIndex}.codeQty`
+      ]
+    },
+    eidtCodeItems() {
+      // try {
+      //   this.formData.codeInfoList.map((item, index) => {
+      //     this.formData.codeInfoList.map((item2, index2) => {
+      //       if (
+      //         index !== index2 &&
+      //         `${item.brandId}_${item.mainId}_${item.smallId}_${item.goodsMaterialId}_${item.goodsMaterialItemType}_${item.goodsMaterialItemId}` ==
+      //           `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}_${item2.goodsMaterialItemType}_${item2.goodsMaterialItemId}`
+      //       ) {
+      //         throw new Error('')
+      //       }
+      //     })
+      //   })
+      // } catch (error) {
+      //   this.$message.warning('重复')
+      //   return false
+      // }
+      return true
+    }
+  }
+}

+ 258 - 0
src/views/salesPurchasing/mixins/common_form.js

@@ -0,0 +1,258 @@
+import { required } from '@/components/template/rules_verify.js'
+import { listPageV2 } from '@/api/auxiliaryFittings/supplier'
+import { goodsPurchaseList, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
+import ImageUpload from '@/components/file-upload'
+export default {
+  data() {
+    return {
+      gysList: [],
+      cgrkOrder: []
+    }
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <el-descriptions
+                  border
+                  title=""
+                  column={4}
+                  colon={false}
+                  labelStyle={{ width: '8%' }}
+                  contentStyle={{ width: '17%' }}
+                >
+                  <el-descriptions-item label="单据状态">
+                    {{ SAVE: '保存', WAIT: '待审核', OK: '通过', FAIL: '失败' }[this.formData.status] || ''}
+                  </el-descriptions-item>
+                  <el-descriptions-item label="单据编号">{this.formData.id || ''}</el-descriptions-item>
+                  <el-descriptions-item label="所属商户" contentStyle={{ width: '42%' }}>
+                    {JSON.parse(localStorage.getItem('greemall_user')).companyName}
+                  </el-descriptions-item>
+                </el-descriptions>
+                <el-descriptions
+                  border
+                  title=""
+                  column={2}
+                  colon={false}
+                  labelStyle={{ width: '8%' }}
+                  contentStyle={{ width: '42%' }}
+                  style="margin-top:-1px"
+                >
+                  <el-descriptions-item label="供应商名称">
+                    <div class="redbordererr">
+                      <el-form-item label="" lebel-width="0px" prop={`venderId`} rules={required}>
+                        <el-select
+                          style="width:100%"
+                          value={this.formData.venderId}
+                          onInput={val => {
+                            this.formData.venderId = val
+                          }}
+                          placeholder="请选择"
+                          disabled={!!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)}
+                          onChange={val => {
+                            if (val) {
+                              this.formData['venderName'] = this.gysList.find(item => item.venderId == val).venderName
+                            } else {
+                              this.formData['venderName'] = ''
+                            }
+                            if (!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name)) {
+                              this.formData.goodsPurchaseId = ''
+                              this.cgrkOrder = []
+                              this.formData.items = []
+                              this.getCgrkOrder()
+                            }
+                          }}
+                        >
+                          {this.gysList.map(item => (
+                            <el-option key={item.venderId} label={item.venderName} value={item.venderId}></el-option>
+                          ))}
+                        </el-select>
+                      </el-form-item>
+                    </div>
+                  </el-descriptions-item>
+                  {!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) ? (
+                    <el-descriptions-item label="采购入库单">
+                      <div class="redbordererr">
+                        <el-form-item label="" lebel-width="0px" prop={`goodsPurchaseId`} rules={required}>
+                          <el-select
+                            style="width:100%"
+                            value={this.formData.goodsPurchaseId}
+                            onInput={val => {
+                              this.formData.goodsPurchaseId = val
+                            }}
+                            placeholder="请选择"
+                            disabled={!!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)}
+                            filterable={true}
+                            clearable={true}
+                            onChange={val => {
+                              this.formData.items = []
+                              if (val) {
+                                goodsPurchaseDetail({ id: val, isQuery: true }).then(res => {
+                                  this.joinCode = res.data.joinCode
+                                  this.formData.items = res.data.items.map(item => ({
+                                    brandId: item.brandId,
+                                    brandName: item.brandName,
+                                    mainId: item.mainId,
+                                    mainName: item.mainName,
+                                    smallId: item.smallId,
+                                    smallName: item.smallName,
+                                    goodsMaterialId: item.goodsMaterialId,
+                                    goodsMaterialName: item.goodsMaterialName,
+                                    specsName: item.specsName,
+                                    unit: item.unit,
+                                    insideQty: item.insideQty,
+                                    outQty: item.outQty,
+                                    partsQty: item.partsQty,
+                                    qty: item.qty,
+                                    price: item.price,
+                                    amount: item.amount,
+                                    stockQty: item.stockQty,
+                                    retQty: '',
+                                    retInsideQty: '',
+                                    retOutQty: '',
+                                    retPartsQty: '',
+                                    insideCodeQty: '',
+                                    outCodeQty: '',
+                                    partsCodeQty: '',
+                                    retAmount: '',
+                                    details: {}
+                                  }))
+                                })
+                              }
+                            }}
+                          >
+                            {this.cgrkOrder.map(item => (
+                              <el-option
+                                key={item.id}
+                                label={`${item.id} | 销售金额:${item.totalAmount || '-'} | 入库时间:${item.examineTime || '-'
+                                  }`}
+                                value={item.id}
+                              ></el-option>
+                            ))}
+                          </el-select>
+                        </el-form-item>
+                      </div>
+                    </el-descriptions-item>
+                  ) : (
+                    <el-descriptions-item label=""></el-descriptions-item>
+                  )}
+                </el-descriptions>
+                <el-descriptions
+                  border
+                  title=""
+                  column={4}
+                  colon={false}
+                  labelStyle={{ width: '8%' }}
+                  contentStyle={{ width: '17%' }}
+                  style="margin-top:-1px"
+                >
+                  {!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name)
+                    ? [
+                      <el-descriptions-item label="退货数量">{this.formData.totalQty}</el-descriptions-item>,
+                      <el-descriptions-item label="退款金额">{this.formData.totalAmount}</el-descriptions-item>,
+                      <el-descriptions-item label=""></el-descriptions-item>,
+                      <el-descriptions-item label=""></el-descriptions-item>
+                    ]
+                    : null}
+                  <el-descriptions-item label="制单人">{this.formData.createBy}</el-descriptions-item>
+                  <el-descriptions-item label="制单时间">{this.formData.createTime}</el-descriptions-item>
+                  <el-descriptions-item label="审核人">{this.formData.examineBy}</el-descriptions-item>
+                  <el-descriptions-item label="审核时间">{this.formData.examineTime}</el-descriptions-item>
+                </el-descriptions>
+                <el-descriptions
+                  border
+                  title=""
+                  column={4}
+                  colon={false}
+                  labelStyle={{ width: '8%' }}
+                  contentStyle={{ width: '17%' }}
+                  style="margin-top:-1px"
+                >
+                  <el-descriptions-item label="备注" contentStyle={{ width: '92%' }}>
+                    <el-input
+                      type="textarea"
+                      placeholder="请输入内容"
+                      value={this.formData.remark}
+                      onInput={val => {
+                        this.formData.remark = val
+                      }}
+                      maxlength="200"
+                      show-word-limit
+                      autosize={{ minRows: 2, maxRows: 4 }}
+                      disabled={!!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)}
+                    ></el-input>
+                  </el-descriptions-item>
+                </el-descriptions>
+                <el-descriptions
+                  border
+                  title=""
+                  column={4}
+                  colon={false}
+                  labelStyle={{ width: '8%' }}
+                  contentStyle={{ width: '17%' }}
+                  style="margin-top:-1px"
+                >
+                  <el-descriptions-item label="附件" contentStyle={{ width: '92%' }}>
+                    <ImageUpload
+                      fileList={this.formData.fileUrl}
+                      uid="imgSrc666_materials_drawing_images"
+                      limit={1}
+                      isEdit={!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)}
+                      fileType={['image']}
+                    />
+                  </el-descriptions-item>
+                </el-descriptions>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 获取供应商列表
+    getGysList() {
+      listPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.status', compare: '=', value: 'ON' },
+          { param: 'a.vender_type', compare: 'like', value: '商品' }
+        ]
+      }).then(res => {
+        this.gysList = res.data.records
+      })
+    },
+    getCgrkOrder() {
+      if (this.formData.venderId) {
+        goodsPurchaseList({
+          pageNum: 1,
+          pageSize: -1,
+          params: [
+            { param: 'a.vender_id', compare: '=', value: this.formData.venderId },
+            { "param": "a.status", "compare": "=", "value": "OK" }
+          ]
+        }).then(res => {
+          this.cgrkOrder = res.data.records
+          if (this.formData.goodsPurchaseId) {
+            goodsPurchaseDetail({ id: this.formData.goodsPurchaseId, isQuery: true }).then(res => {
+              this.joinCode = res.data.joinCode
+            })
+          }
+        })
+      }
+    }
+  }
+}

+ 76 - 0
src/views/salesPurchasing/mixins/out_storage_codes.js

@@ -0,0 +1,76 @@
+import {
+  goodsPurchaseRetCodeList,
+  goodsPurchaseRetItemAddCode,
+  goodsPurchaseRetItemDelCode
+} from '@/api/merchandisePurchaseReturn.js'
+export default {
+  data() {
+    return {}
+  },
+  methods: {
+    getGoodsPurchaseRetCodeList() {
+      if (this.formData.id) {
+        goodsPurchaseRetCodeList({
+          pageNum: 1,
+          pageSize: -1,
+          params: [{ param: 'c.goods_purchase_ret_id', compare: '=', value: this.formData.id }]
+        }).then(res => {
+          this.formData.codeInfoList = res.data.records
+          console.log(this.formData.codeInfoList)
+        })
+      }
+    },
+    // 添加条码信息
+    addCodeInfo() {
+      this.formData.codeInfoList.unshift({
+        brandId: '',
+        brandName: '',
+        mainId: '',
+        mainName: '',
+        smallId: '',
+        smallName: '',
+        goodsMaterialId: '',
+        goodsMaterialName: '',
+        specsName: '',
+        goodsMaterialItemType: '',
+        goodsMaterialItemId: '',
+        goodsMaterialItemName: '',
+        uniqueCode: '',
+        code: '',
+        codeQty: '',
+        goodsPurchaseRetItemId: '',
+        goodsPurchaseRetId: this.formData.id
+      })
+      this.isEditIndex = 0
+    },
+    addCode(row) {
+      if (this.isEditIndex > -1) {
+        this.$refs.formRef.validateField(this.getCodeVfyKey(), (valid, invalidFields, errLabels) => {
+          if (valid && this.eidtCodeItems()) {
+            goodsPurchaseRetItemAddCode({
+              codeList: [{ ...row }]
+            }).then(res => {
+              this.isEditIndex = -1
+              this.getGoodsPurchaseRetCodeList()
+            })
+          }
+        })
+      }
+    },
+    delCode(row, index) {
+      if (row.id) {
+        goodsPurchaseRetItemDelCode({
+          codeId: row.id,
+          id: row.goodsPurchaseRetId
+        }).then(res => {
+          this.getGoodsPurchaseRetCodeList()
+        })
+      } else {
+        this.formData?.codeInfoList?.splice(index, 1)
+        if (index == this.isEditIndex) {
+          this.isEditIndex = -1
+        }
+      }
+    }
+  }
+}

+ 250 - 0
src/views/salesPurchasing/mixins/out_storage_goods.js

@@ -0,0 +1,250 @@
+import { required } from '@/components/template/rules_verify.js'
+import { goodsPurchaseRetItemImportCode, goodsPurchaseRetDetail } from '@/api/merchandisePurchaseReturn.js'
+export default {
+  data() {
+    return {}
+  },
+  computed: {
+    storage_goods() {
+      return [
+        {
+          columnAttributes: {
+            label: '品牌',
+            prop: 'brandName',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品大类',
+            prop: 'mainName',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品小类',
+            prop: 'smallName',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品名称',
+            prop: 'goodsMaterialName',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specsName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单位',
+            prop: 'unit'
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding:0 6px">{{ C: '整套', I: '单个' }[row[column.columnAttributes.prop]] || ''}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '退货数量',
+            prop: 'retQty',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.formDialogType == 0 ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      if (Number(val) > Number(row.qty)) {
+                        row[column.columnAttributes.prop] = Number(row.qty)
+                      } else {
+                        row[column.columnAttributes.prop] = val ? Number(val) : ''
+                      }
+                      row.retAmount = (row[column.columnAttributes.prop] * Number(row.price)).toFixed(2)
+                      row.retInsideQty =
+                        parseInt(Number(row.insideQty) / Number(row.qty)) * Number(row[column.columnAttributes.prop])
+                      row.retOutQty =
+                        parseInt(Number(row.outQty) / Number(row.qty)) * Number(row[column.columnAttributes.prop])
+                      row.retPartsQty =
+                        parseInt(Number(row.partsQty) / Number(row.qty)) * Number(row[column.columnAttributes.prop])
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '退货内机数量',
+            prop: 'retInsideQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '退货外机数量',
+            prop: 'retOutQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '退货配件数量',
+            prop: 'retPartsQty',
+            width: 120
+          }
+        },
+
+        {
+          columnAttributes: {
+            label: '导入内机条码数量',
+            prop: 'insideCodeQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导入外机条码数量',
+            prop: 'outCodeQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导入配件条码数量',
+            prop: 'partsCodeQty',
+            width: 120
+          }
+        },
+
+        {
+          columnAttributes: {
+            label: '退款金额',
+            prop: 'retAmount',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购数量',
+            prop: 'qty',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机数量',
+            prop: 'insideQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '外机数量',
+            prop: 'outQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '配件数量',
+            prop: 'partsQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购价格',
+            prop: 'price',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购金额',
+            prop: 'amount',
+            width: 160
+          }
+        },
+        {
+          columnAttributes: {
+            label: '库存数量',
+            prop: 'stockQty'
+          }
+        },
+        ...(() => {
+          if (this.formDialogType < 2 && !~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      <el-button
+                        type="text"
+                        onClick={() => {
+                          this.formData?.items?.splice(index, 1)
+                        }}
+                      >
+                        删除
+                      </el-button>
+                    </div>
+                  )
+                }
+              }
+            ]
+          } else if (this.formDialogType < 2 && !!~['SAVE'].indexOf(this.formData.status) && this.joinCode) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      {this.importButton(goodsPurchaseRetItemImportCode, '导入条码', { id: this.formData.id, purchaseRetItemId: row.id }, () => { }, () => {
+                        if (this.formData.id) {
+                          // 更新表单信息
+                          goodsPurchaseRetDetail({ id: this.formData.id }).then(res => {
+                            Object.assign(this.formData, res.data, {
+                              fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+                              items: res.data.items.map(item => ({ ...item, details: {} }))
+                            })
+                          })
+                        }
+                      })}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    }
+  },
+  methods: {}
+}

+ 102 - 0
src/views/salesPurchasing/mixins/out_storage_table.js

@@ -0,0 +1,102 @@
+import { goodsPurchaseRetDetail } from '@/api/merchandisePurchaseReturn.js'
+import { commonTemplateDownload } from '@/api/common.js'
+export default {
+  data() {
+    return {}
+  },
+  computed: {
+    formItems2() {
+      return [
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                {this.activeName == 'goodsInfo'
+                  ? [
+                    this.formDialogType == 1 && this.joinCode ? (
+                      <div style="margin-bottom:10px">
+                        <el-button type="primary" onClick={this.domlMban}>
+                          下载导入模板
+                        </el-button>
+                      </div>
+                    ) : null,
+                    <zj-table
+                      columns={this.storage_goods}
+                      tableData={this.formData.items}
+                      tableAttributes={{
+                        size: 'mini',
+                        border: true
+                      }}
+                    />
+                  ]
+                  : this.activeName == 'codeInfo' && this.joinCode
+                    ? [
+                      this.formDialogType == 1 ? (
+                        <div style="margin-bottom:10px">
+                          <el-button type="primary" onClick={this.addCodeInfo} disabled={this.isEditIndex != -1}>
+                            添加
+                          </el-button>
+                        </div>
+                      ) : null,
+                      <zj-table
+                        columns={this.storage_codes}
+                        tableData={this.formData.codeInfoList}
+                        tableAttributes={{
+                          size: 'mini',
+                          border: true
+                        }}
+                      />
+                    ]
+                    : null}
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  watch: {
+    activeName(newVal) {
+      this.isEditIndex = -1
+      if (newVal == 'codeInfo') {
+        // 获取单据下的条码
+        this.getGoodsPurchaseRetCodeList()
+      } else {
+        if (this.formData.id) {
+          // 更新表单信息
+          goodsPurchaseRetDetail({ id: this.formData.id }).then(res => {
+            Object.assign(this.formData, res.data, {
+              fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+              items: res.data.items.map(item => ({ ...item, details: {} }))
+            })
+          })
+        }
+        // 清空条码数据列表
+        this.formData.codeInfoList = []
+      }
+    }
+  },
+  methods: {
+    domlMban() {
+      commonTemplateDownload({ name: '商品采购条码模板.xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+    }
+  }
+}

+ 76 - 0
src/views/salesPurchasing/mixins/storage_codes.js

@@ -0,0 +1,76 @@
+import {
+  goodsPurchaseItemAddCode,
+  goodsPurchaseCodeList,
+  goodsPurchaseItemDelCode
+} from '@/api/goodsPurchasedStored.js'
+export default {
+  data() {
+    return {}
+  },
+  methods: {
+    // 获取条码列表
+    getGoodsPurchaseCodeList() {
+      if (this.formData.id) {
+        goodsPurchaseCodeList({
+          pageNum: 1,
+          pageSize: -1,
+          params: [{ param: 'c.goods_purchase_id', compare: '=', value: this.formData.id }]
+        }).then(res => {
+          this.formData.codeInfoList = res.data.records
+        })
+      }
+    },
+    // 添加条码信息
+    addCodeInfo() {
+      this.formData.codeInfoList.unshift({
+        brandId: '',
+        brandName: '',
+        mainId: '',
+        mainName: '',
+        smallId: '',
+        smallName: '',
+        goodsMaterialId: '',
+        goodsMaterialName: '',
+        specsName: '',
+        goodsMaterialItemType: '',
+        goodsMaterialItemId: '',
+        goodsMaterialItemName: '',
+        uniqueCode: '',
+        code: '',
+        codeQty: '',
+        goodsPurchaseItemId: '',
+        goodsPurchaseId: this.formData.id
+      })
+      this.isEditIndex = 0
+    },
+    addCode(row) {
+      if (this.isEditIndex > -1) {
+        this.$refs.formRef.validateField(this.getCodeVfyKey(), (valid, invalidFields, errLabels) => {
+          if (valid && this.eidtCodeItems()) {
+            goodsPurchaseItemAddCode({
+              codeList: [{ ...row }]
+            }).then(res => {
+              this.isEditIndex = -1
+              this.getGoodsPurchaseCodeList()
+            })
+          }
+        })
+      }
+    },
+    delCode(row, index) {
+      if (row.id) {
+        goodsPurchaseItemDelCode({
+          codeId: row.id,
+          id: row.goodsPurchaseId
+        }).then(res => {
+          this.getGoodsPurchaseCodeList()
+        })
+      } else {
+        this.formData?.codeInfoList?.splice(index, 1)
+        if (index == this.isEditIndex) {
+          this.isEditIndex = -1
+        }
+      }
+    }
+  }
+}

+ 628 - 0
src/views/salesPurchasing/mixins/storage_goods.js

@@ -0,0 +1,628 @@
+import { required } from '@/components/template/rules_verify.js'
+import { getBrandList } from '@/api/miniapp'
+import { getClassifyList } from '@/api/goods'
+import { goodsMaterialList } from '@/api/commercialMaterial.js'
+import { goodsPurchaseItemImportCode, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
+
+export default {
+  data() {
+    return {
+      brandList: [],
+      ClassifyList: [],
+      goodsMaterialList: []
+    }
+  },
+  computed: {
+    storage_goods() {
+      return [
+        {
+          columnAttributes: {
+            label: '品牌',
+            prop: 'brandId',
+            propName: 'brandName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchujichu(row, 0)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.brandList.find(item => item.id == val).brandName
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.brandList.map((item, index_) => (
+                      <el-option key={index_} label={item.brandName} value={item.id}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品大类',
+            prop: 'mainId',
+            propName: 'mainName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchujichu(row, 1)
+                      if (val) {
+                        row[column.columnAttributes.propName] = this.ClassifyList.find(
+                          item => item.categoryId == val
+                        ).name
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.ClassifyList.map((item, index_) => (
+                      <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
+                    ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品小类',
+            prop: 'smallId',
+            propName: 'smallName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchujichu(row, 2)
+                      if (val) {
+                        row[column.columnAttributes.propName] = (
+                          this.ClassifyList.find(item => item.categoryId == row.mainId)?.children || []
+                        ).find(item => item.categoryId == val).name
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {(this.ClassifyList.find(item => item.categoryId == row.mainId)?.children || []).map(
+                      (item, index_) => (
+                        <el-option key={index_} label={item.name} value={item.categoryId}></el-option>
+                      )
+                    )}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商品名称',
+            prop: 'goodsMaterialId',
+            propName: 'goodsMaterialName',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-select
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    onChange={val => {
+                      this.shanchujichu(row, 3)
+                      if (val) {
+                        var data = this.goodsMaterialList
+                          .filter(
+                            item =>
+                              item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                          )
+                          .find(item => item.id == val)
+                        row[column.columnAttributes.propName] = data?.goodsName
+                        this.getGoodsDetl(data, res => {
+                          if (this.formDialogType == 0) {
+                            row['specsName'] = res?.specsName
+                            row['unit'] = res?.unit
+                            row['stockQty'] = res?.stockQty
+                            row['insideQty'] =
+                              res.items
+                                .filter(item => item.type === 'INSIDE')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
+                            row['outQty'] =
+                              res.items
+                                .filter(item => item.type === 'OUT')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
+                            row['partsQty'] =
+                              res.items
+                                .filter(item => item.type === 'PARTS')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
+                          }
+                        })
+                      } else {
+                        row[column.columnAttributes.propName] = ''
+                        row['specsName'] = ''
+                        row['unit'] = ''
+                        row['insideQty'] = ''
+                        row['outQty'] = ''
+                        row['partsQty'] = ''
+                        row['stockQty'] = ''
+                      }
+                    }}
+                    placeholder="请选择"
+                  >
+                    {this.goodsMaterialList
+                      .filter(
+                        item =>
+                          item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                      )
+                      .map((item, index_) => (
+                        <el-option key={index_} label={item.goodsName} value={item.id}></el-option>
+                      ))}
+                  </el-select>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.propName]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specsName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单位',
+            prop: 'unit'
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding:0 6px">{{ C: '整套', I: '单个' }[row[column.columnAttributes.prop]] || ''}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购数量',
+            prop: 'qty',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val <= 0 ? 0 : Number(val)
+                      this.getGoodsDetl(
+                        this.goodsMaterialList
+                          .filter(
+                            item =>
+                              item.brandId === row.brandId && item.mainId === row.mainId && item.smallId === row.smallId
+                          )
+                          .find(item => item.id == row.goodsMaterialId),
+                        res => {
+                          if (this.formDialogType == 0) {
+                            row['insideQty'] =
+                              res.items
+                                .filter(item => item.type === 'INSIDE')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
+                              row[column.columnAttributes.prop]
+                            row['outQty'] =
+                              res.items
+                                .filter(item => item.type === 'OUT')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
+                              row[column.columnAttributes.prop]
+                            row['partsQty'] =
+                              res.items
+                                .filter(item => item.type === 'PARTS')
+                                .map(item => item.qty)
+                                .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
+                              row[column.columnAttributes.prop]
+                          }
+                        }
+                      )
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机数量',
+            prop: 'insideQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '外机数量',
+            prop: 'outQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '配件数量',
+            prop: 'partsQty'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导入内机条码数量',
+            prop: 'insideCodeQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导入外机条码数量',
+            prop: 'outCodeQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '导入配件条码数量',
+            prop: 'partsCodeQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购价格',
+            prop: 'price',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? (
+              <div class="redbordererr">
+                <el-form-item
+                  label=""
+                  lebel-width="0px"
+                  prop={`items.${index}.${column.columnAttributes.prop}`}
+                  rules={required}
+                >
+                  <el-input
+                    value={row[column.columnAttributes.prop]}
+                    onInput={val => {
+                      row[column.columnAttributes.prop] = val
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            ) : (
+              <div style="padding:0 6px">{row[column.columnAttributes.prop]}</div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '采购金额',
+            prop: 'amount',
+            width: 160
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding:0 6px">{Number(row['qty']) * Number(row['price'])}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '库存数量',
+            prop: 'stockQty'
+          }
+        },
+        ...(() => {
+
+          if (this.formDialogType < 2 && !~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      {[
+                        this.isEditIndex == index ? (
+                          <el-button
+                            type="text"
+                            onClick={() => {
+                              this.$refs.formRef.validateField(
+                                this.getVfyKey(this.isEditIndex),
+                                (valid, invalidFields, errLabels) => {
+                                  if (valid && this.eidtItems()) {
+                                    this.isEditIndex = -1
+                                  }
+                                }
+                              )
+                            }}
+                          >
+                            保存
+                          </el-button>
+                        ) : null,
+                        this.isEditIndex == -1 ? (
+                          <el-button
+                            type="text"
+                            onClick={() => {
+                              this.isEditIndex = index
+                            }}
+                          >
+                            编辑
+                          </el-button>
+                        ) : null,
+                        <el-button
+                          type="text"
+                          onClick={() => {
+                            this.delGoodsInfo(row, index)
+                          }}
+                        >
+                          删除
+                        </el-button>
+                      ]}
+                    </div>
+                  )
+                }
+              }
+            ]
+          } else if (this.formDialogType < 2 && !!~['SAVE'].indexOf(this.formData.status) && this.joinCode) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                  fixed: 'right',
+                  width: 140
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding:0 6px" class="operation-btns">
+                      {this.importButton(goodsPurchaseItemImportCode, '导入条码', { purchaseItemId: row.id }, () => { }, () => {
+                        if (this.formData.id) {
+                          // 更新表单信息
+                          goodsPurchaseDetail({ id: this.formData.id }).then(res => {
+                            Object.assign(this.formData, res.data, {
+                              fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+                              items: res.data.items.map(item => ({ ...item, details: {} }))
+                            })
+                          })
+                        }
+                      })}
+                    </div>
+                  )
+                }
+              }
+            ]
+          }
+          return []
+        })()
+      ]
+    }
+  },
+  methods: {
+    getBaseList() {
+      getBrandList({
+        status: true
+      }).then(res => {
+        this.brandList = res.data
+      })
+      getClassifyList({
+        type: 2,
+        status: true
+      }).then(res => {
+        this.ClassifyList = res.data
+      })
+      goodsMaterialList({
+        pageNum: 1,
+        pageSize: -1,
+        params: []
+      }).then(res => {
+        this.goodsMaterialList = res.data.records
+          .filter(item => item.isVirtyual !== 'YES' && item.state == 'ON')
+          .map(item => ({ ...item, details: {} }))
+      })
+    },
+    shanchujichu(row, num) {
+      if (num <= 0) {
+      }
+      if (num <= 1) {
+        row.smallId = ''
+        row.smallName = ''
+      }
+      if (num <= 2) {
+        row.goodsMaterialId = ''
+        row.goodsMaterialName = ''
+        row.specsName = ''
+        row.unit = ''
+        row.insideQty = ''
+        row.outQty = ''
+        row.partsQty = ''
+        row.stockQty = ''
+      }
+    },
+    getVfyKey(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [`items`]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              `items.${index}.brandId`,
+              `items.${index}.mainId`,
+              `items.${index}.smallId`,
+              `items.${index}.goodsMaterialId`,
+              `items.${index}.qty`,
+              `items.${index}.price`
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    eidtItems() {
+      try {
+        this.formData.items.map((item, index) => {
+          this.formData.items.map((item2, index2) => {
+            if (
+              index !== index2 &&
+              `${item.brandId}_${item.mainId}_${item.smallId}_${item.goodsMaterialId}` ==
+              `${item2.brandId}_${item2.mainId}_${item2.smallId}_${item2.goodsMaterialId}`
+            ) {
+              throw new Error('')
+            }
+          })
+        })
+      } catch (error) {
+        this.$message.warning('重复')
+        return false
+      }
+      return true
+    },
+    // 添加商品信息
+    addGoodsInfo() {
+      if (this.isEditIndex > -1) {
+        this.$refs.formRef.validateField(this.getVfyKey(this.isEditIndex), (valid, invalidFields, errLabels) => {
+          if (valid && this.eidtItems()) {
+            this.formData.items.unshift({
+              brandId: '',
+              brandName: '',
+              mainId: '',
+              mainName: '',
+              smallId: '',
+              smallName: '',
+              goodsMaterialId: '',
+              goodsMaterialName: '',
+              specsName: '',
+              unit: '',
+              qty: '',
+              insideQty: '',
+              outQty: '',
+              partsQty: '',
+              insideCodeQty: '',
+              outCodeQty: '',
+              partsCodeQty: '',
+              price: '',
+              amount: '',
+              stockQty: ''
+            })
+            this.isEditIndex = 0
+          }
+        })
+      } else if (this.eidtItems()) {
+        this.formData.items.unshift({
+          brandId: '',
+          brandName: '',
+          mainId: '',
+          mainName: '',
+          smallId: '',
+          smallName: '',
+          goodsMaterialId: '',
+          goodsMaterialName: '',
+          specsName: '',
+          unit: '',
+          qty: '',
+          insideQty: '',
+          outQty: '',
+          partsQty: '',
+          insideCodeQty: '',
+          outCodeQty: '',
+          partsCodeQty: '',
+          price: '',
+          amount: '',
+          stockQty: ''
+        })
+        this.isEditIndex = 0
+      }
+    },
+    delGoodsInfo(row, index) {
+      if (index > this.isEditIndex) {
+        this.formData?.items?.splice(index, 1)
+      } else if (index == this.isEditIndex) {
+        this.formData?.items?.splice(index, 1)
+        this.isEditIndex = -1
+      }
+    }
+  }
+}

+ 108 - 0
src/views/salesPurchasing/mixins/storage_table.js

@@ -0,0 +1,108 @@
+import { goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
+import { commonTemplateDownload } from '@/api/common.js'
+export default {
+  data() {
+    return {}
+  },
+  computed: {
+    formItems2() {
+      return [
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '',
+            prop: '',
+            'label-width': '0px'
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                {this.activeName == 'goodsInfo'
+                  ? [
+                    this.formDialogType == 0 ? (
+                      <div style="margin-bottom:10px">
+                        <el-button type="primary" onClick={this.addGoodsInfo}>
+                          添加
+                        </el-button>
+                      </div>
+                    ) : this.formDialogType == 1 && this.joinCode ? (
+                      <div style="margin-bottom:10px">
+                        <el-button type="primary" onClick={this.domlMban}>
+                          下载导入模板
+                        </el-button>
+                      </div>
+                    ) : null,
+                    <zj-table
+                      columns={this.storage_goods}
+                      tableData={this.formData.items}
+                      tableAttributes={{
+                        size: 'mini',
+                        border: true
+                      }}
+                    />
+                  ]
+                  : this.activeName == 'codeInfo' && this.joinCode
+                    ? [
+                      this.formDialogType == 1 ? (
+                        <div style="margin-bottom:10px">
+                          <el-button type="primary" onClick={this.addCodeInfo} disabled={this.isEditIndex != -1}>
+                            添加
+                          </el-button>
+                        </div>
+                      ) : null,
+                      <zj-table
+                        columns={this.storage_codes}
+                        tableData={this.formData.codeInfoList}
+                        tableAttributes={{
+                          size: 'mini',
+                          border: true
+                        }}
+                      />
+                    ]
+                    : null}
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  watch: {
+    activeName(newVal) {
+      this.isEditIndex = -1
+      if (newVal == 'codeInfo') {
+        // 获取单据下的条码
+        this.getGoodsPurchaseCodeList()
+      } else {
+        if (this.formData.id) {
+          // 更新表单信息
+          goodsPurchaseDetail({ id: this.formData.id }).then(res => {
+            Object.assign(this.formData, res.data, {
+              fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+              items: res.data.items.map(item => ({ ...item, details: {} }))
+            })
+          })
+        }
+        // 清空条码数据列表
+        this.formData.codeInfoList = []
+      }
+    }
+  },
+  methods: {
+    domlMban() {
+      commonTemplateDownload({ name: '商品采购条码模板.xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+    }
+  }
+}

+ 12 - 10
src/views/setting/departmentManage/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
     <template slot-scope="{activeKey, data}">
       <div class="app-container">
         <div v-if="activeKey == 'list'" class="mymain-container">
@@ -95,12 +95,12 @@
                 <el-radio :label="false">禁用</el-radio>
               </el-radio-group>
             </el-form-item>
-						<el-form-item label="商品出入库" prop="joinCode">
-						  <el-radio-group v-model="mainForm.joinCode">
-						    <el-radio :label="true">关联条码</el-radio>
-						    <el-radio :label="false">不关联条码</el-radio>
-						  </el-radio-group>
-						</el-form-item>
+            <el-form-item v-if="mainForm.type == 'B'" label="商品出入库" prop="joinCode">
+              <el-radio-group v-model="mainForm.joinCode">
+                <el-radio :label="true">关联条码</el-radio>
+                <el-radio :label="false">不关联条码</el-radio>
+              </el-radio-group>
+            </el-form-item>
           </el-form>
           <div slot="footer" class="dialog-footer">
             <el-button @click="data.removeTab()">取 消</el-button>
@@ -142,7 +142,8 @@ export default {
         address: '',
         status: true,
         isIncre: true,
-		joinCode: true
+        joinCode: true,
+        type: ""
       },
       mainFormRules: {
         name: [{ required: true, message: '请填写网点名称', trigger: 'blur' }],
@@ -279,7 +280,8 @@ export default {
                   address: res.data.address,
                   status: res.data.status,
                   isIncre: res.data.isIncre,
-									joinCode: res.data.joinCode
+                  joinCode: res.data.joinCode,
+                  type: res.data.type,
                 }
               })
             }
@@ -319,7 +321,7 @@ export default {
             address: this.mainForm.address,
             status: this.mainForm.status,
             isIncre: this.mainForm.isIncre,
-						joinCode: this.mainForm.joinCode
+            joinCode: this.mainForm.joinCode
           }
           if (this.mainFormType == 'edit') {
             params.websitId = this.editId

+ 22 - 62
src/views/valueAddedService/extendedWarrantyWork/index.vue

@@ -9,14 +9,13 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { orderBaseList, orderBaseListExport } from "@/api/workOrderPool.js"
-import ywgdjs from "@/assets/ywgdjs.png"
-import yjs from "@/assets/yjs.png"
+import orderListColumn from "@/mixin/orderListColumn"
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: {
     TemplatePage,
   },
-  mixins: [import_mixin,operation_mixin],
+  mixins: [import_mixin, operation_mixin, orderListColumn],
   data() {
     return {
       // 表格属性
@@ -50,7 +49,7 @@ export default {
       var pam = JSON.parse(JSON.stringify(p))
       try {
         pam.params.push(
-          { "param": "a.order_status", "compare": "=", "value": ["YWG","YJS"] }
+          { "param": "a.order_status", "compare": "=", "value": ["YWG", "YJS"] }
         )
         pam.isYb = true
         cb && cb(pam)
@@ -62,68 +61,29 @@ export default {
     // 列表导出函数
     exportList: orderBaseListExport,
 
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      if (item.jname === 'orderFlags') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;display:flex;align-items:center;">
-              {(row[column.columnAttributes.prop] || []).map(item => {
-                if (item.tagName == "已完工") {
-                  return (
-                    <img src={ywgdjs} style="width:22px;height:22px;" />
-                  )
-                } else if (item.tagName == "已结算") {
-                  return (
-                    <img src={yjs} style="width:22px;height:22px;" />
-                  )
-                } else {
-                  return (
-                    <div style="display: inline-block;border:1px solid #409EFF; color:#409EFF;padding:0 2px;border-radius: 4px;margin:2px 2px 0 0;">
-                      {item.tagName}
-                    </div>
-                  )
-                }
-              })}
-            </div>
-          )
-        }
-      }
-      if (item.jname === 'appointmentTime') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;cursor: pointer;">
-              {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
-            </div>
-          )
-        }
-      }
-      return defaultData
-    },
-
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
     },
-		
-	// 表格操作列
-	operation() {
-		return this.operationBtn({
-			detail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.$router.push({
-						name: 'workOrderPool',
-						params: {
-							pageName: row.id,
-							pageType: 'detail',
-							pageCode: row.id,
-						},
-					})
-				}
-			}
-		})
-	},
+
+    // 表格操作列
+    operation() {
+      return this.operationBtn({
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.$router.push({
+              name: 'workOrderPool',
+              params: {
+                pageName: row.id,
+                pageType: 'detail',
+                pageCode: row.id,
+              },
+            })
+          }
+        }
+      })
+    },
   }
 }
 </script>

+ 2 - 2
src/views/valueAddedService/orderSettleManag/index.vue

@@ -21,8 +21,8 @@ export default {
   components: { collect, offline },
   data() {
     return {
-      tabType: 'collect',
-      tabTypeCk: 'collect',
+      tabType: this?.$route?.params?.pageType ? ({ SELF: "offline", ONLINE: "collect" })[this?.$route?.params?.pageType] || 'collect' : 'collect',
+      tabTypeCk: this?.$route?.params?.pageType ? ({ SELF: "offline", ONLINE: "collect" })[this?.$route?.params?.pageType] || 'collect' : 'collect',
     }
   },
   methods: {

+ 7 - 1
src/views/valueAddedService/orderSettleManag/pages/collect.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()"
-    :operationColumnWidth="200" :optionsEvensGroup="optionsEvensGroup">
+    :operationColumnWidth="200" :optionsEvensGroup="optionsEvensGroup" :defaultSearchData="defaultSearchData">
     <div class="cartographer">
       <el-dialog :title="formTypeName[formType]" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="formCancel">
@@ -60,6 +60,7 @@ export default {
         pgIncreItems: []
       },
       formDialog: false,
+      defaultSearchData: [],
     }
   },
   computed: {
@@ -115,6 +116,11 @@ export default {
       ]
     }
   },
+  created() {
+    if (this.pageCode) {
+      this.defaultSearchData = [{ "param": "a.id", "compare": "=", "value": this.pageCode, label: "订单单号" }]
+    }
+  },
   methods: {
     selectable(row, index) {
       return ["PAID"].includes(Object.entries(row.selectMapData.payStatus).find(([key, val]) => val == row.payStatus)?.[0]) &&

+ 22 - 13
src/views/valueAddedService/orderSettleManag/pages/offline.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()"
-    :operationColumnWidth="200" :optionsEvensGroup="optionsEvensGroup">
+    :operationColumnWidth="200" :optionsEvensGroup="optionsEvensGroup" :defaultSearchData="defaultSearchData">
     <div class="cartographer">
       <el-dialog :title="formTypeName[formType]" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="formCancel">
@@ -31,11 +31,14 @@
     <div class="cartographer">
       <el-dialog title="新增" width="100%" :modal="false" :visible.sync="addFormDialog" :before-close="addFormCancel">
         <zj-form-container v-if="addFormDialog" ref="addFormRef" :form-data="addFormData">
-          <zj-form-module  v-if="addFormDialog" title="客户信息" label-width="80px" :form-data="addFormData" :form-items="basicInfo">
+          <zj-form-module v-if="addFormDialog" title="客户信息" label-width="80px" :form-data="addFormData"
+            :form-items="basicInfo">
           </zj-form-module>
-          <zj-form-module  v-if="addFormDialog" title="服务信息" label-width="80px" :form-data="addFormData" :form-items="serviceInfo">
+          <zj-form-module v-if="addFormDialog" title="服务信息" label-width="80px" :form-data="addFormData"
+            :form-items="serviceInfo">
           </zj-form-module>
-          <zj-form-module  v-if="addFormDialog" title="产品信息" label-width="80px" :form-data="addFormData" :form-items="productInfo">
+          <zj-form-module v-if="addFormDialog" title="产品信息" label-width="80px" :form-data="addFormData"
+            :form-items="productInfo">
           </zj-form-module>
         </zj-form-container>
         <div slot="footer" class="dialog-footer">
@@ -98,6 +101,7 @@ export default {
       formDialog: false,
       addFormDialog: false,
       formDshType: false,
+      defaultSearchData: [],
       addFormData: {
         shiyongleixing: "按使用年限",
         "amount": "",
@@ -213,11 +217,16 @@ export default {
       }
     }
   },
+  created() {
+    if (this.pageCode) {
+      this.defaultSearchData = [{ "param": "a.id", "compare": "=", "value": this.pageCode, label: "订单单号" }]
+    }
+  },
   methods: {
     wxPay(id) {
       increOrderSettleGeneratePayCode({ id }).then(res => {
         this.codeUrl = res.data.codeUrl
-        if(this.$refs?.payQRCode?.innerHTML){
+        if (this.$refs?.payQRCode?.innerHTML) {
           this.$refs.payQRCode.innerHTML = '';
         }
         this.$nextTick(() => {
@@ -301,14 +310,14 @@ export default {
             return ["PAID", "REFUND"].includes(row.payStatus)
           },
           click: ({ row, index, column }) => {
-				this.$router.push({
-					name: 'workOrderPool',
-					params: {
-            pageName: row.id,
-						pageType: 'pgIncreItemId',
-						pageCode: row.id,
-					},
-				})
+            this.$router.push({
+              name: 'workOrderPool',
+              params: {
+                pageName: row.id,
+                pageType: 'pgIncreItemId',
+                pageCode: row.id,
+              },
+            })
           }
         },
         examine: {

+ 1088 - 1128
src/views/workOrder/completedToBeSettled/index.vue

@@ -1,8 +1,8 @@
 <template>
-	<template-page ref="pageRef" :getList="getList" :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing"
-		:tableAttributes="tableAttributes" :tableEvents="tableEvents" :moreParameters="moreParameters"
-		:screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true">
-	</template-page>
+  <template-page ref="pageRef" :getList="getList" :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes" :tableEvents="tableEvents" :moreParameters="moreParameters"
+    :screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true">
+  </template-page>
 </template>
 
 <script>
@@ -13,1150 +13,1110 @@ import { listPageV2 as listPageV3 } from "@/api/workOrder/settlementStandardInst
 import { listPageV2 as listPageV2Repair } from "@/api/workOrder/settlementStandardRepair";
 import { orderBaseList2, orderBaseStatusCount2, orderBaseSettleNormDetail2, settleNormInstallQuery, orderBaseSettleNormConfirm, settleNormOtherQuery, orderBaseSettleNormReset } from "@/api/workOrderPool.js"
 import { listPageV2 } from "@/api/workOrder/orderType";
-import ywgdjs from "@/assets/ywgdjs.png"
-import yjs from "@/assets/yjs.png"
+import orderListColumn from "@/mixin/orderListColumn"
 import { required } from '@/components/template/rules_verify.js'
 export default {
-	components: {
-		TemplatePage,
-	},
-	mixins: [import_mixin, operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				columnExpand: this.columnExpand
-			},
-			// 表格事件
-			tableEvents: {
-				'expand-change': this.expandChange
-			},
-			orderTypeList: [],
-			orderStatusList: [],
-		}
-	},
-	computed: {
-		moreParameters() {
-			return [
-				{
-					name: '工单类型',
-					key: 'orderSmallType',
-					value: '',
-					conditions: [{
-						label: "全部",
-						value: ""
-					}, ...this.orderTypeList]
-				},
-				{
-					name: '工单状态',
-					key: 'orderStatus',
-					value: this.$route.query.orderStatus || "",
-					conditions: [{
-						label: "全部",
-						value: ""
-					}, ...this.orderStatusList]
-				}
-			]
-		},
-		// 用户信息
-		userInfo() {
-			return JSON.parse(localStorage.getItem('greemall_user'))
-		},
-		// 事件组合
-		optionsEvensGroup() {
-			return []
-		}
-	},
-	created() {
-		// 获取工单类型
-		listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
-			this.orderTypeList = res.data.records.map(item => ({
-				value: item.id,
-				label: item.orderSmallTypeText
-			}))
-		})
-	},
-	methods: {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, orderListColumn],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        columnExpand: this.columnExpand
+      },
+      // 表格事件
+      tableEvents: {
+        'expand-change': this.expandChange
+      },
+      orderTypeList: [],
+      orderStatusList: [],
+    }
+  },
+  computed: {
+    moreParameters() {
+      return [
+        {
+          name: '工单类型',
+          key: 'orderSmallType',
+          value: '',
+          conditions: [{
+            label: "全部",
+            value: ""
+          }, ...this.orderTypeList]
+        },
+        {
+          name: '工单状态',
+          key: 'orderStatus',
+          value: this.$route.query.orderStatus || "",
+          conditions: [{
+            label: "全部",
+            value: ""
+          }, ...this.orderStatusList]
+        }
+      ]
+    },
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    // 事件组合
+    optionsEvensGroup() {
+      return []
+    }
+  },
+  created() {
+    // 获取工单类型
+    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+      this.orderTypeList = res.data.records.map(item => ({
+        value: item.id,
+        label: item.orderSmallTypeText
+      }))
+    })
+  },
+  methods: {
 
-		screeningAnalysis(jname, val) {
-			if (jname == 'orderFlags') {
-				return (val || []).map(item => item.tagName).join(',')
-			} else {
-				return val
-			}
-		},
+    screeningAnalysis(jname, val) {
+      if (jname == 'orderFlags') {
+        return (val || []).map(item => item.tagName).join(',')
+      } else {
+        return val
+      }
+    },
 
-		filterMethod(value, row, column) {
-			if (column['property'] == 'orderFlags') {
-				return (row[column['property']] || []).map(item => item.tagName).join(',') === value
-			}
-			return row[column['property']] === value
-		},
+    filterMethod(value, row, column) {
+      if (column['property'] == 'orderFlags') {
+        return (row[column['property']] || []).map(item => item.tagName).join(',') === value
+      }
+      return row[column['property']] === value
+    },
 
-		// 获取统计
-		getOrderBaseStatusCount(...p) {
-			orderBaseStatusCount2(...p).then(res => {
-				this.orderStatusList = [{
-					label: "已完工待结算",
-					value: "YWG"
-				}, {
-					label: "已结算",
-					value: "YJS"
-				}].map(item => {
-					var data = res.data.find(val => val.orderStatus == item.value)
-					if (data) {
-						item.label = `${item.label}(${data.total})`
-					}
-					return item
-				})
-			})
-		},
+    // 获取统计
+    getOrderBaseStatusCount(...p) {
+      orderBaseStatusCount2(...p).then(res => {
+        this.orderStatusList = [{
+          label: "已完工待结算",
+          value: "YWG"
+        }, {
+          label: "已结算",
+          value: "YJS"
+        }].map(item => {
+          var data = res.data.find(val => val.orderStatus == item.value)
+          if (data) {
+            item.label = `${item.label}(${data.total})`
+          }
+          return item
+        })
+      })
+    },
 
-		// 列表请求函数
-		getList(p, cb) {
-			var pam = JSON.parse(JSON.stringify(p))
-			try {
-				if (pam.orderStatus) {
-					pam.params.push({ "param": "a.order_status", "compare": "=", "value": pam.orderStatus })
-				}
-				if (pam.orderSmallType) {
-					pam.params.push({ "param": "a.order_small_type", "compare": "=", "value": pam.orderSmallType })
-				}
-				cb && cb(pam)
-				return orderBaseList2(pam)
-			} catch (err) {
-			} finally {
-				this.$nextTick(() => {
-					this.getOrderBaseStatusCount({ orderSmallType: pam.orderSmallType || "" })
-				})
-			}
-		},
+    // 列表请求函数
+    getList(p, cb) {
+      var pam = JSON.parse(JSON.stringify(p))
+      try {
+        if (pam.orderStatus) {
+          pam.params.push({ "param": "a.order_status", "compare": "=", "value": pam.orderStatus })
+        }
+        if (pam.orderSmallType) {
+          pam.params.push({ "param": "a.order_small_type", "compare": "=", "value": pam.orderSmallType })
+        }
+        cb && cb(pam)
+        return orderBaseList2(pam)
+      } catch (err) {
+      } finally {
+        this.$nextTick(() => {
+          this.getOrderBaseStatusCount({ orderSmallType: pam.orderSmallType || "" })
+        })
+      }
+    },
 
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'orderFlags') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;display:flex;align-items:center;">
-							{(row[column.columnAttributes.prop] || []).map(item => {
-								if (item.tagName == "已完工") {
-									return (
-										<img src={ywgdjs} style="width:22px;height:22px;" />
-									)
-								} else if (item.tagName == "已结算") {
-									return (
-										<img src={yjs} style="width:22px;height:22px;" />
-									)
-								} else {
-									return (
-										<div style="display: inline-block;border:1px solid #409EFF; color:#409EFF;padding:0 2px;border-radius: 4px;margin:2px 2px 0 0;">
-											{item.tagName}
-										</div>
-									)
-								}
-							})}
-						</div>
-					)
-				}
-			}
-			if (item.jname === 'appointmentTime') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
+    expandChange(row) {
+      if (!row.expandData) {
+        orderBaseSettleNormDetail2({
+          id: row.id,
+          orderProductId: row.pgOrderProductId
+        }).then(res => {
+          this.zhuzhuang(res.data).then(res => {
+            row.expandData = res
+          })
+        })
+      }
+    },
 
-		expandChange(row) {
-			if (!row.expandData) {
-				orderBaseSettleNormDetail2({
-					id: row.id,
-					orderProductId: row.pgOrderProductId
-				}).then(res => {
-					this.zhuzhuang(res.data).then(res => {
-						row.expandData = res
-					})
-				})
-			}
-		},
+    columnExpand(h, { row, column, index }) {
+      var expandDataForm = row.expandData
+      var rowZhu = row
+      return expandDataForm ? (<div style="box-sizing: border-box;padding: 10px 10px 0px 50px;">
+        <zj-form-container form-data={expandDataForm}
+          formAttributes={{ 'label-position': 'top' }}
+          styleSwitch={false}>
+          <zj-form-module title="费用结算" showHade={false} form-data={expandDataForm}
+            form-items={[{
+              md: 24,
+              name: 'slot-component',
+              formItemAttributes: {
+                label: '费用结算',
+                prop: 'normList',
+              },
+              render: (h, { props, onInput }) => {
+                var { formData } = props
+                var columns = [{
+                  columnAttributes: {
+                    label: '工单类型',
+                    prop: 'typeName'
+                  },
+                },
+                {
+                  columnAttributes: {
+                    label: '结算工单来源',
+                    prop: 'channelId',
+                    width: '110'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-select
+                          disabled={expandDataForm.normListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.parentCategoryId = ""
+                            row.parentCategoryName = ""
+                            row.categoryId = ""
+                            row.categoryName = ""
+                            row.label = ""
+                            row.normAmount = ""
+                            row.repairAmount = ""
+                            row.settleNormId = ""
+                            if (val) {
+                              var data = this.classifyListChuLi(expandDataForm.classifyList, "orderChannelId", "orderChannelText").find(item => item.value == val)
+                              row.channelText = data.label
+                            } else {
+                              row.channelText = ""
+                            }
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.classifyList, "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '结算产品大类',
+                    prop: 'parentCategoryId',
+                    width: '110'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-select
+                          disabled={expandDataForm.normListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.categoryId = ""
+                            row.categoryName = ""
+                            row.label = ""
+                            row.normAmount = ""
+                            row.repairAmount = ""
+                            row.settleNormId = ""
+                            if (val) {
+                              var data = this.classifyListChuLi(expandDataForm.classifyList, "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).find(item => item.value == val)
+                              row.parentCategoryName = data.label
+                            } else {
+                              row.parentCategoryName = ""
+                            }
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.classifyList, "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '结算产品小类',
+                    prop: 'categoryId',
+                    width: '110'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-select
+                          disabled={expandDataForm.normListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.label = ""
+                            row.normAmount = ""
+                            row.repairAmount = ""
+                            row.settleNormId = ""
+                            if (val) {
+                              var data = this.classifyListChuLi(expandDataForm.classifyList, "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).find(item => item.value == val)
+                              row.categoryName = data.label
+                            } else {
+                              row.categoryName = ""
+                            }
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.classifyList, "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                ...(() => {
+                  if (expandDataForm.orderType == 'INSTALL') {
+                    return [
+                      {
+                        columnAttributes: {
+                          label: '结算功率',
+                          prop: 'label'
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-select
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                onChange={(val) => {
+                                  if (val) {
+                                    var data = this.getflList(expandDataForm.gonglv, row).find(item => item.label == val)
+                                    row.normAmount = data.normAmount
+                                    row.settleNormId = data.id
+                                  } else {
+                                    row.normAmount = ""
+                                    row.settleNormId = ""
+                                  }
+                                }}
+                                placeholder="请选择">
+                                {this.getflList(expandDataForm.gonglv, row).map((item, index_) => <el-option key={index_} label={item.label} value={item.label}></el-option>)}
+                              </el-select>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '结算标准(元/套)',
+                          prop: 'normAmount',
+                          width: "160px"
+                        },
+                      },
+                      {
+                        columnAttributes: {
+                          label: '结算数量',
+                          prop: 'settleNum',
+                          width: "160px"
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-input
+                                type="number"
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                placeholder="请输入内容"
+                              >
+                              </el-input>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '结算金额(元)',
+                          prop: 'settleAmount',
+                          width: "160px"
+                        },
+                        render: (h, { row, column, index }) => {
+                          row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            {row.settleAmount}
+                          </div> : null
+                        }
+                      },
+                    ]
+                  }
+                  return []
+                })(),
+                ...(() => {
+                  if (expandDataForm.orderType == 'REPAIR') {
+                    return [
+                      {
+                        columnAttributes: {
+                          label: '质保类型',
+                          prop: 'label'
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-select
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                onChange={(val) => {
+                                  if (val) {
+                                    var data = this.getflList(expandDataForm.gonglr, row).find(item => item.label == val)
+                                    row.repairAmount = data.repairAmount
+                                    row.normAmount = data.normAmount
+                                    row.settleNormId = data.id
+                                  } else {
+                                    row.repairAmount = ""
+                                    row.normAmount = ""
+                                    row.settleNormId = ""
+                                  }
+                                }}
+                                placeholder="请选择">
+                                {this.getflList(expandDataForm.gonglr, row).map((item, index_) => <el-option key={index_} label={({ INSIDE: '保内', OUT: '保外' })[item.label]} value={item.label}></el-option>)}
+                              </el-select>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '上门费(元/单)',
+                          prop: 'repairAmount',
+                          width: '110'
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-input
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                type="number"
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                placeholder="请输入内容"
+                              >
+                              </el-input>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '维修费结算比例%',
+                          prop: 'normAmount',
+                          width: '110'
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            {row[column.columnAttributes.prop]}%
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '维修费用结算',
+                          prop: 'repairNormAmount',
+                          width: '110'
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-input
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                type="number"
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                placeholder="请输入内容"
+                              >
+                              </el-input>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '结算数量',
+                          prop: 'settleNum',
+                          width: "160px"
+                        },
+                        render: (h, { row, column, index }) => {
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                              <el-input
+                                type="number"
+                                disabled={expandDataForm.normListBj || !row.bianji}
+                                value={row[column.columnAttributes.prop]}
+                                onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                                placeholder="请输入内容"
+                              >
+                              </el-input>
+                            </el-form-item>
+                          </div> : null
+                        }
+                      },
+                      {
+                        columnAttributes: {
+                          label: '结算金额(元)',
+                          prop: 'settleAmount',
+                          width: "160px"
+                        },
+                        render: (h, { row, column, index }) => {
+                          row.settleAmount = (((Number(row.repairAmount || 0) + (Number(row.normAmount || 0) / 100) * Number(row.repairNormAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
+                          return this.panfuan(row) ? <div class="redbordererr">
+                            {row.settleAmount}
+                          </div> : null
+                        }
+                      },
+                    ]
+                  }
+                  return []
+                })(),
+                {
+                  columnAttributes: {
+                    label: '备注',
+                    prop: 'remark',
+                    width: "200px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-input
+                          disabled={expandDataForm.normListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          placeholder="请输入内容"
+                        >
+                        </el-input>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '工程师名称',
+                    prop: 'workerName',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '联系电话',
+                    prop: 'workerMobile',
+                    width: '140px'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '结算费用',
+                    prop: 'settleAmount',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`normList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-input
+                          type="number"
+                          disabled={!expandDataForm.normList[row.pfuqinid].bianji || expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
+                          value={expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                          onInput={(val) => {
+                            expandDataForm.normList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        >
+                        </el-input>
+                      </el-form-item>
+                    </div>
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '确认人',
+                    prop: 'confirmBy',
+                    width: "100px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '确认时间',
+                    prop: 'confirmTime',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '汇总状态',
+                    prop: 'poolStatus',
+                    width: "100px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
+                    </div>
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '操作',
+                    prop: '',
+                    fixed: 'right',
+                    width: "120px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.normList[row.pfuqinid]?.workerList?.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr redbordererranniuright" style="padding:0 6px;">
+                      {expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          var yjsje = [0, 0, 0, expandDataForm?.normList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
+                            return prev + curr;
+                          })
+                          var nou = expandDataForm?.normList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "NO")
+                          var qian = ((((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
+                          var rongyu = ((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
+                          nou.map((item, index) => {
+                            if (index === 0) {
+                              item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
+                            } else {
+                              item.settleAmount = qian
+                            }
+                          })
+                        }
+                      }>平分费用</el-button> : null}
+                      {expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          this.itemOrderBaseSettleNormReset(rowZhu, "normList", () => {
+                            expandDataForm.normList[row.pfuqinid].bianji = false
+                          })
+                        }
+                      }>确定</el-button> : null}
+                      {!expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          expandDataForm.normList[row.pfuqinid].bianji = true
+                        }
+                      }>修改</el-button> : null}
+                      {!expandDataForm.showOtherNormList ? <el-button type="text" onClick={
+                        () => {
+                          expandDataForm.showOtherNormList = true
+                        }
+                      }>添加其他费用</el-button> : null}
+                    </div>) : null
+                  }
+                }]
+                return (
+                  <zj-table
+                    columns={columns}
+                    table-data={formData.normList}
+                    tableAttributes={{
+                      'span-method': ({ row, column, rowIndex, columnIndex }) => {
+                        if (columnIndex === columns.length - 1) {
+                          if (row.zijideid == 0) {
+                            return {
+                              rowspan: formData.normList[row.pfuqinid].workerList?.length,
+                              colspan: 1
+                            };
+                          } else {
+                            return {
+                              rowspan: 0,
+                              colspan: 0
+                            };
+                          }
+                        }
+                      }
+                    }}
+                  />
+                )
+              }
+            },
+            {
+              md: 24,
+              isShow: expandDataForm.showOtherNormList,
+              name: 'slot-component',
+              formItemAttributes: {
+                label: '其他费用结算',
+                prop: 'otherNormList',
+              },
+              render: (h, { props, onInput }) => {
+                var { formData } = props
+                var columns = [{
+                  columnAttributes: {
+                    label: '结算工单来源',
+                    prop: 'channelId',
+                    width: '110'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-select
+                          disabled={expandDataForm.otherNormListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.type = ""
+                            row.label = ""
+                            row.normAmount = ""
+                            row.settleNormId = ""
+                            row.settleNum = ""
+                            if (val) {
+                              var data = this.classifyListChuLi(expandDataForm.otherList, "orderChannelId", "orderChannelText").find(item => item.value == val)
+                              row.channelText = data.label
+                            } else {
+                              row.channelText = ""
+                            }
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.otherList, "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '费用类型',
+                    prop: 'type'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-select
+                          disabled={expandDataForm.otherNormListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.label = ""
+                            row.normAmount = ""
+                            row.settleNormId = ""
+                            row.settleNum = ""
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.otherList, "type", "typeName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '规格',
+                    prop: 'label'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-select
+                          disabled={expandDataForm.otherNormListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          onChange={(val) => {
+                            row.settleNum = ""
+                            if (val) {
+                              var data = this.classifyListChuLi(expandDataForm.otherList, "label", "label", (item) => { return item.orderChannelId == row.channelId && item.type == row.type }, "normAmount", "id").find(item => item.label == val)
+                              row.normAmount = data.normAmount
+                              row.settleNormId = data.id
+                            } else {
+                              row.normAmount = ""
+                              row.settleNormId = ""
+                            }
+                          }}
+                          placeholder="请选择">
+                          {this.classifyListChuLi(expandDataForm.otherList, "label", "label", (item) => item.orderChannelId == row.channelId && item.type == row.type).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                        </el-select>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '单价(元/套)',
+                    prop: 'normAmount',
+                    width: "160px"
+                  },
+                },
+                {
+                  columnAttributes: {
+                    label: '数量',
+                    prop: 'settleNum',
+                    width: "160px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-input
+                          type="number"
+                          disabled={expandDataForm.otherNormListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          placeholder="请输入内容"
+                        >
+                        </el-input>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '结算金额(元)',
+                    prop: 'settleAmount',
+                    width: "160px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      {row.settleAmount}
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '备注',
+                    prop: 'remark',
+                    width: "200px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return this.panfuan(row) ? <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-input
+                          disabled={expandDataForm.otherNormListBj || !row.bianji}
+                          value={row[column.columnAttributes.prop]}
+                          onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                          placeholder="请输入内容"
+                        >
+                        </el-input>
+                      </el-form-item>
+                    </div> : null
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '工程师名称',
+                    prop: 'workerName',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '联系电话',
+                    prop: 'workerMobile',
+                    width: '140px'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '结算费用',
+                    prop: 'settleAmount',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr">
+                      <el-form-item label="" label-width="0px" prop={`otherNormList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
+                        <el-input
+                          type="number"
+                          disabled={!expandDataForm.otherNormList[row.pfuqinid].bianji || expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
+                          value={expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                          onInput={(val) => {
+                            expandDataForm.otherNormList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
+                          }}
+                          placeholder="请输入内容"
+                        >
+                        </el-input>
+                      </el-form-item>
+                    </div>
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '确认人',
+                    prop: 'confirmBy',
+                    width: "100px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '确认时间',
+                    prop: 'confirmTime',
+                    width: "140px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
+                    </div>
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '汇总状态',
+                    prop: 'poolStatus',
+                    width: "100px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
+                      {({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
+                    </div>
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '操作',
+                    prop: '',
+                    fixed: 'right',
+                    width: "120px"
+                  },
+                  render: (h, { row, column, index }) => {
+                    return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr redbordererranniuright" style="padding:0 6px;display:flex;align-items:center;">
+                      {expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          var yjsje = [0, 0, 0, expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
+                            return prev + curr;
+                          })
+                          var nou = expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "NO")
+                          var qian = ((((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
+                          var rongyu = ((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
+                          nou.map((item, index) => {
+                            if (index === 0) {
+                              item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
+                            } else {
+                              item.settleAmount = qian
+                            }
+                          })
+                        }
+                      }>平分费用</el-button> : null}
+                      {expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          this.itemOrderBaseSettleNormReset(rowZhu, "otherNormList", () => {
+                            expandDataForm.otherNormList[row.pfuqinid].bianji = false
+                          })
+                        }
+                      }>确定</el-button> : null}
+                      {!expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
+                        () => {
+                          expandDataForm.otherNormList[row.pfuqinid].bianji = true
+                        }
+                      }>修改</el-button> : null}
+                    </div>) : null
+                  }
+                }]
+                return (
+                  <zj-table
+                    columns={columns}
+                    table-data={formData.otherNormList}
+                    tableAttributes={{
+                      'span-method': ({ row, column, rowIndex, columnIndex }) => {
+                        if (columnIndex === columns.length - 1) {
+                          if (row.zijideid == 0) {
+                            return {
+                              rowspan: formData.otherNormList[row.pfuqinid].workerList?.length,
+                              colspan: 1
+                            };
+                          } else {
+                            return {
+                              rowspan: 0,
+                              colspan: 0
+                            };
+                          }
+                        }
+                      }
+                    }}
+                  />
+                )
+              }
+            }]} />
+        </zj-form-container>
+      </div>) : null
+    },
 
-		columnExpand(h, { row, column, index }) {
-			var expandDataForm = row.expandData
-			var rowZhu = row
-			return expandDataForm ? (<div style="box-sizing: border-box;padding: 10px 10px 0px 50px;">
-				<zj-form-container form-data={expandDataForm}
-					formAttributes={{ 'label-position': 'top' }}
-					styleSwitch={false}>
-					<zj-form-module title="费用结算" showHade={false} form-data={expandDataForm}
-						form-items={[{
-							md: 24,
-							name: 'slot-component',
-							formItemAttributes: {
-								label: '费用结算',
-								prop: 'normList',
-							},
-							render: (h, { props, onInput }) => {
-								var { formData } = props
-								var columns = [{
-									columnAttributes: {
-										label: '工单类型',
-										prop: 'typeName'
-									},
-								},
-								{
-									columnAttributes: {
-										label: '结算工单来源',
-										prop: 'channelId',
-										width: '110'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-												<el-select
-													disabled={expandDataForm.normListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.parentCategoryId = ""
-														row.parentCategoryName = ""
-														row.categoryId = ""
-														row.categoryName = ""
-														row.label = ""
-														row.normAmount = ""
-														row.repairAmount = ""
-														row.settleNormId = ""
-														if (val) {
-															var data = this.classifyListChuLi(expandDataForm.classifyList, "orderChannelId", "orderChannelText").find(item => item.value == val)
-															row.channelText = data.label
-														} else {
-															row.channelText = ""
-														}
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.classifyList, "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '结算产品大类',
-										prop: 'parentCategoryId',
-										width: '110'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-												<el-select
-													disabled={expandDataForm.normListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.categoryId = ""
-														row.categoryName = ""
-														row.label = ""
-														row.normAmount = ""
-														row.repairAmount = ""
-														row.settleNormId = ""
-														if (val) {
-															var data = this.classifyListChuLi(expandDataForm.classifyList, "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).find(item => item.value == val)
-															row.parentCategoryName = data.label
-														} else {
-															row.parentCategoryName = ""
-														}
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.classifyList, "parentCategoryId", "parentCategoryName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '结算产品小类',
-										prop: 'categoryId',
-										width: '110'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-												<el-select
-													disabled={expandDataForm.normListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.label = ""
-														row.normAmount = ""
-														row.repairAmount = ""
-														row.settleNormId = ""
-														if (val) {
-															var data = this.classifyListChuLi(expandDataForm.classifyList, "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).find(item => item.value == val)
-															row.categoryName = data.label
-														} else {
-															row.categoryName = ""
-														}
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.classifyList, "categoryId", "categoryName", (item) => item.orderChannelId == row.channelId && item.parentCategoryId == row.parentCategoryId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								...(() => {
-									if (expandDataForm.orderType == 'INSTALL') {
-										return [
-											{
-												columnAttributes: {
-													label: '结算功率',
-													prop: 'label'
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-select
-																disabled={expandDataForm.normListBj || !row.bianji}
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																onChange={(val) => {
-																	if (val) {
-																		var data = this.getflList(expandDataForm.gonglv, row).find(item => item.label == val)
-																		row.normAmount = data.normAmount
-																		row.settleNormId = data.id
-																	} else {
-																		row.normAmount = ""
-																		row.settleNormId = ""
-																	}
-																}}
-																placeholder="请选择">
-																{this.getflList(expandDataForm.gonglv, row).map((item, index_) => <el-option key={index_} label={item.label} value={item.label}></el-option>)}
-															</el-select>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '结算标准(元/套)',
-													prop: 'normAmount',
-													width: "160px"
-												},
-											},
-											{
-												columnAttributes: {
-													label: '结算数量',
-													prop: 'settleNum',
-													width: "160px"
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-input
-																type="number"
-																disabled={expandDataForm.normListBj || !row.bianji}
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																placeholder="请输入内容"
-															>
-															</el-input>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '结算金额(元)',
-													prop: 'settleAmount',
-													width: "160px"
-												},
-												render: (h, { row, column, index }) => {
-													row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
-													return this.panfuan(row) ? <div class="redbordererr">
-														{row.settleAmount}
-													</div> : null
-												}
-											},
-										]
-									}
-									return []
-								})(),
-								...(() => {
-									if (expandDataForm.orderType == 'REPAIR') {
-										return [
-											{
-												columnAttributes: {
-													label: '质保类型',
-													prop: 'label'
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-select
-																disabled={expandDataForm.normListBj || !row.bianji}
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																onChange={(val) => {
-																	if (val) {
-																		var data = this.getflList(expandDataForm.gonglr, row).find(item => item.label == val)
-																		row.repairAmount = data.repairAmount
-																		row.normAmount = data.normAmount
-																		row.settleNormId = data.id
-																	} else {
-																		row.repairAmount = ""
-																		row.normAmount = ""
-																		row.settleNormId = ""
-																	}
-																}}
-																placeholder="请选择">
-																{this.getflList(expandDataForm.gonglr, row).map((item, index_) => <el-option key={index_} label={({ INSIDE: '保内', OUT: '保外' })[item.label]} value={item.label}></el-option>)}
-															</el-select>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '上门费(元/单)',
-													prop: 'repairAmount',
-													width: '110'
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-input
-																disabled={expandDataForm.normListBj || !row.bianji}
-																type="number"
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																placeholder="请输入内容"
-															>
-															</el-input>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '维修费结算比例%',
-													prop: 'normAmount',
-													width: '110'
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														{row[column.columnAttributes.prop]}%
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '维修费用结算',
-													prop: 'repairNormAmount',
-													width: '110'
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-input
-																disabled={expandDataForm.normListBj || !row.bianji}
-																type="number"
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																placeholder="请输入内容"
-															>
-															</el-input>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '结算数量',
-													prop: 'settleNum',
-													width: "160px"
-												},
-												render: (h, { row, column, index }) => {
-													return this.panfuan(row) ? <div class="redbordererr">
-														<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-															<el-input
-																type="number"
-																disabled={expandDataForm.normListBj || !row.bianji}
-																value={row[column.columnAttributes.prop]}
-																onInput={(val) => { row[column.columnAttributes.prop] = val }}
-																placeholder="请输入内容"
-															>
-															</el-input>
-														</el-form-item>
-													</div> : null
-												}
-											},
-											{
-												columnAttributes: {
-													label: '结算金额(元)',
-													prop: 'settleAmount',
-													width: "160px"
-												},
-												render: (h, { row, column, index }) => {
-													row.settleAmount = (((Number(row.repairAmount || 0) + (Number(row.normAmount || 0) / 100) * Number(row.repairNormAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
-													return this.panfuan(row) ? <div class="redbordererr">
-														{row.settleAmount}
-													</div> : null
-												}
-											},
-										]
-									}
-									return []
-								})(),
-								{
-									columnAttributes: {
-										label: '备注',
-										prop: 'remark',
-										width: "200px"
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px">
-												<el-input
-													disabled={expandDataForm.normListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													placeholder="请输入内容"
-												>
-												</el-input>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '工程师名称',
-										prop: 'workerName',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '联系电话',
-										prop: 'workerMobile',
-										width: '140px'
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '结算费用',
-										prop: 'settleAmount',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`normList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
-												<el-input
-													type="number"
-													disabled={!expandDataForm.normList[row.pfuqinid].bianji || expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
-													value={expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-													onInput={(val) => {
-														expandDataForm.normList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
-													}}
-													placeholder="请输入内容"
-												>
-												</el-input>
-											</el-form-item>
-										</div>
-									}
-								}, {
-									columnAttributes: {
-										label: '确认人',
-										prop: 'confirmBy',
-										width: "100px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '确认时间',
-										prop: 'confirmTime',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '汇总状态',
-										prop: 'poolStatus',
-										width: "100px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.normList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
-										</div>
-									}
-								}, {
-									columnAttributes: {
-										label: '操作',
-										prop: '',
-										fixed: 'right',
-										width: "120px"
-									},
-									render: (h, { row, column, index }) => {
-										return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.normList[row.pfuqinid]?.workerList?.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr redbordererranniuright" style="padding:0 6px;">
-											{expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													var yjsje = [0, 0, 0, expandDataForm?.normList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
-														return prev + curr;
-													})
-													var nou = expandDataForm?.normList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "NO")
-													var qian = ((((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
-													var rongyu = ((Number(expandDataForm?.normList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
-													nou.map((item, index) => {
-														if (index === 0) {
-															item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
-														} else {
-															item.settleAmount = qian
-														}
-													})
-												}
-											}>平分费用</el-button> : null}
-											{expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													this.itemOrderBaseSettleNormReset(rowZhu, "normList", () => {
-														expandDataForm.normList[row.pfuqinid].bianji = false
-													})
-												}
-											}>确定</el-button> : null}
-											{!expandDataForm.normList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													expandDataForm.normList[row.pfuqinid].bianji = true
-												}
-											}>修改</el-button> : null}
-											{!expandDataForm.showOtherNormList ? <el-button type="text" onClick={
-												() => {
-													expandDataForm.showOtherNormList = true
-												}
-											}>添加其他费用</el-button> : null}
-										</div>) : null
-									}
-								}]
-								return (
-									<zj-table
-										columns={columns}
-										table-data={formData.normList}
-										tableAttributes={{
-											'span-method': ({ row, column, rowIndex, columnIndex }) => {
-												if (columnIndex === columns.length - 1) {
-													if (row.zijideid == 0) {
-														return {
-															rowspan: formData.normList[row.pfuqinid].workerList?.length,
-															colspan: 1
-														};
-													} else {
-														return {
-															rowspan: 0,
-															colspan: 0
-														};
-													}
-												}
-											}
-										}}
-									/>
-								)
-							}
-						},
-						{
-							md: 24,
-							isShow: expandDataForm.showOtherNormList,
-							name: 'slot-component',
-							formItemAttributes: {
-								label: '其他费用结算',
-								prop: 'otherNormList',
-							},
-							render: (h, { props, onInput }) => {
-								var { formData } = props
-								var columns = [{
-									columnAttributes: {
-										label: '结算工单来源',
-										prop: 'channelId',
-										width: '110'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`normList.${index}.${column.columnAttributes.prop}`} rules={required}>
-												<el-select
-													disabled={expandDataForm.otherNormListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.type = ""
-														row.label = ""
-														row.normAmount = ""
-														row.settleNormId = ""
-														row.settleNum = ""
-														if (val) {
-															var data = this.classifyListChuLi(expandDataForm.otherList, "orderChannelId", "orderChannelText").find(item => item.value == val)
-															row.channelText = data.label
-														} else {
-															row.channelText = ""
-														}
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.otherList, "orderChannelId", "orderChannelText").map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '费用类型',
-										prop: 'type'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px">
-												<el-select
-													disabled={expandDataForm.otherNormListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.label = ""
-														row.normAmount = ""
-														row.settleNormId = ""
-														row.settleNum = ""
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.otherList, "type", "typeName", (item) => item.orderChannelId == row.channelId).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '规格',
-										prop: 'label'
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px">
-												<el-select
-													disabled={expandDataForm.otherNormListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													onChange={(val) => {
-														row.settleNum = ""
-														if (val) {
-															var data = this.classifyListChuLi(expandDataForm.otherList, "label", "label", (item) => { return item.orderChannelId == row.channelId && item.type == row.type }, "normAmount", "id").find(item => item.label == val)
-															row.normAmount = data.normAmount
-															row.settleNormId = data.id
-														} else {
-															row.normAmount = ""
-															row.settleNormId = ""
-														}
-													}}
-													placeholder="请选择">
-													{this.classifyListChuLi(expandDataForm.otherList, "label", "label", (item) => item.orderChannelId == row.channelId && item.type == row.type).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
-												</el-select>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '单价(元/套)',
-										prop: 'normAmount',
-										width: "160px"
-									},
-								},
-								{
-									columnAttributes: {
-										label: '数量',
-										prop: 'settleNum',
-										width: "160px"
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px">
-												<el-input
-													type="number"
-													disabled={expandDataForm.otherNormListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													placeholder="请输入内容"
-												>
-												</el-input>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '结算金额(元)',
-										prop: 'settleAmount',
-										width: "160px"
-									},
-									render: (h, { row, column, index }) => {
-										row.settleAmount = (((Number(row.normAmount || 0) * Number(row.settleNum || 0)) * 100) / 100).toFixed(2)
-										return this.panfuan(row) ? <div class="redbordererr">
-											{row.settleAmount}
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '备注',
-										prop: 'remark',
-										width: "200px"
-									},
-									render: (h, { row, column, index }) => {
-										return this.panfuan(row) ? <div class="redbordererr">
-											<el-form-item label="" label-width="0px">
-												<el-input
-													disabled={expandDataForm.otherNormListBj || !row.bianji}
-													value={row[column.columnAttributes.prop]}
-													onInput={(val) => { row[column.columnAttributes.prop] = val }}
-													placeholder="请输入内容"
-												>
-												</el-input>
-											</el-form-item>
-										</div> : null
-									}
-								},
-								{
-									columnAttributes: {
-										label: '工程师名称',
-										prop: 'workerName',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '联系电话',
-										prop: 'workerMobile',
-										width: '140px'
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '结算费用',
-										prop: 'settleAmount',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr">
-											<el-form-item label="" label-width="0px" prop={`otherNormList.${row.pfuqinid}.workerList.${row.zijideid}.${column.columnAttributes.prop}`} rules={required}>
-												<el-input
-													type="number"
-													disabled={!expandDataForm.otherNormList[row.pfuqinid].bianji || expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.["poolStatus"] == "YES"}
-													value={expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-													onInput={(val) => {
-														expandDataForm.otherNormList[row.pfuqinid].workerList[row.zijideid][column.columnAttributes.prop] = val
-													}}
-													placeholder="请输入内容"
-												>
-												</el-input>
-											</el-form-item>
-										</div>
-									}
-								}, {
-									columnAttributes: {
-										label: '确认人',
-										prop: 'confirmBy',
-										width: "100px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '确认时间',
-										prop: 'confirmTime',
-										width: "140px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]}
-										</div>
-									}
-								},
-								{
-									columnAttributes: {
-										label: '汇总状态',
-										prop: 'poolStatus',
-										width: "100px"
-									},
-									render: (h, { row, column, index }) => {
-										return <div class="redbordererr" style="padding:0 6px;display:flex;align-items:center;">
-											{({ "NO": "未汇总", "YES": "已汇总" })[expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.[row.zijideid]?.[column.columnAttributes.prop]]}
-										</div>
-									}
-								}, {
-									columnAttributes: {
-										label: '操作',
-										prop: '',
-										fixed: 'right',
-										width: "120px"
-									},
-									render: (h, { row, column, index }) => {
-										return expandDataForm.settleStatus == 'YWG' || (expandDataForm.settleStatus == 'YJS' && expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.find(item => item.poolStatus == "NO")) ? (<div class="redbordererr redbordererranniuright" style="padding:0 6px;display:flex;align-items:center;">
-											{expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													var yjsje = [0, 0, 0, expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "YES").map(item => item.settleAmount)].reduce(function (prev, curr, idx, arr) {
-														return prev + curr;
-													})
-													var nou = expandDataForm?.otherNormList[row.pfuqinid]?.workerList?.filter(item => item.poolStatus == "NO")
-													var qian = ((((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
-													var rongyu = ((Number(expandDataForm?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
-													nou.map((item, index) => {
-														if (index === 0) {
-															item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
-														} else {
-															item.settleAmount = qian
-														}
-													})
-												}
-											}>平分费用</el-button> : null}
-											{expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													this.itemOrderBaseSettleNormReset(rowZhu, "otherNormList", () => {
-														expandDataForm.otherNormList[row.pfuqinid].bianji = false
-													})
-												}
-											}>确定</el-button> : null}
-											{!expandDataForm.otherNormList[row.pfuqinid].bianji ? <el-button type="text" onClick={
-												() => {
-													expandDataForm.otherNormList[row.pfuqinid].bianji = true
-												}
-											}>修改</el-button> : null}
-										</div>) : null
-									}
-								}]
-								return (
-									<zj-table
-										columns={columns}
-										table-data={formData.otherNormList}
-										tableAttributes={{
-											'span-method': ({ row, column, rowIndex, columnIndex }) => {
-												if (columnIndex === columns.length - 1) {
-													if (row.zijideid == 0) {
-														return {
-															rowspan: formData.otherNormList[row.pfuqinid].workerList?.length,
-															colspan: 1
-														};
-													} else {
-														return {
-															rowspan: 0,
-															colspan: 0
-														};
-													}
-												}
-											}
-										}}
-									/>
-								)
-							}
-						}]} />
-				</zj-form-container>
-			</div>) : null
-		},
+    itemOrderBaseSettleNormReset(data, type, cb) {
+      try {
+        data.expandData.normList.filter(item => !!item.id).map(item => {
+          if ([0, 0, 0, ...item.workerList?.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }) !== Number(item.settleAmount)) {
+            throw new Error(`费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`);
+          }
+        })
+        data.expandData.otherNormList.filter(item => !!item.id).map(item => {
+          if ([0, 0, 0, ...item.workerList?.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }) !== Number(item.settleAmount)) {
+            throw new Error(`其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`);
+          }
+        })
+      } catch (err) {
+        this.$message.warning(err.message)
+        return
+      }
 
-		itemOrderBaseSettleNormReset(data, type, cb) {
-			try {
-				data.expandData.normList.filter(item => !!item.id).map(item => {
-					if ([0, 0, 0, ...item.workerList?.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
-						return prev + curr;
-					}) !== Number(item.settleAmount)) {
-						throw new Error(`费用信息-${item.channelText}-${item.parentCategoryName}-${item.categoryName}-${item.label}:合计结算总金额与总金额不等`);
-					}
-				})
-				data.expandData.otherNormList.filter(item => !!item.id).map(item => {
-					if ([0, 0, 0, ...item.workerList?.map(val => Number(val.settleAmount))].reduce(function (prev, curr, idx, arr) {
-						return prev + curr;
-					}) !== Number(item.settleAmount)) {
-						throw new Error(`其他费用信息-${item.channelText}-${item.type}-${item.label}:合计结算总金额与总金额不等`);
-					}
-				})
-			} catch (err) {
-				this.$message.warning(err.message)
-				return
-			}
+      var { classifyList, gonglr, gonglv, otherList, normListBj, otherNormListBj, showOtherNormList, ...pam } = data.expandData;
+      var pams = {
+        ...pam,
+        ...(() => {
+          if (type == "normList") {
+            return {
+              normList: pam.normList.filter(item => !!item.id),
+            }
+          }
+          return {
+            normList: [],
+          }
+        })(),
+        ...(() => {
+          if (type == "otherNormList") {
+            return {
+              otherNormList: pam.otherNormList.filter(item => !!item.id),
+            }
+          }
+          return {
+            otherNormList: [],
+          }
+        })(),
+      };
+      ([orderBaseSettleNormConfirm, orderBaseSettleNormReset])[pams[type]?.map(item => item.workerList?.find(resdata => !!resdata.settleOrderId))?.find(item => item) ? 1 : 0](pams).then(res => {
+        orderBaseSettleNormDetail2({
+          id: data.id,
+          orderProductId: data.pgOrderProductId
+        }).then(res => {
+          this.zhuzhuang(res.data).then(res => {
+            data.expandData = res
+          })
+        })
+        cb && cb()
+        this.$message({
+          type: 'success',
+          message: '结算成功'
+        })
+      })
+    },
 
-			var { classifyList, gonglr, gonglv, otherList, normListBj, otherNormListBj, showOtherNormList, ...pam } = data.expandData;
-			var pams = {
-				...pam,
-				...(() => {
-					if (type == "normList") {
-						return {
-							normList: pam.normList.filter(item => !!item.id),
-						}
-					}
-					return {
-						normList: [],
-					}
-				})(),
-				...(() => {
-					if (type == "otherNormList") {
-						return {
-							otherNormList: pam.otherNormList.filter(item => !!item.id),
-						}
-					}
-					return {
-						otherNormList: [],
-					}
-				})(),
-			};
-			([orderBaseSettleNormConfirm, orderBaseSettleNormReset])[pams[type]?.map(item => item.workerList?.find(resdata => !!resdata.settleOrderId))?.find(item => item) ? 1 : 0](pams).then(res => {
-				orderBaseSettleNormDetail2({
-					id: data.id,
-					orderProductId: data.pgOrderProductId
-				}).then(res => {
-					this.zhuzhuang(res.data).then(res => {
-						data.expandData = res
-					})
-				})
-				cb && cb()
-				this.$message({
-					type: 'success',
-					message: '结算成功'
-				})
-			})
-		},
+    zhuzhuang(data) {
+      return new Promise((r, j) => {
+        var orderChannelId
+        var normList = []
+        var pfuqinid = 0
+        data.normListBj = false
+        data.otherNormListBj = false
+        data.showOtherNormList = false
+        data.normList.map((item, index) => {
+          if (!orderChannelId) { orderChannelId = item.orderChannelId }
+          item.settleNum = item.settleNum || ""
+          normList.push({ ...item, pfuqinid: pfuqinid, zijideid: 0, bianji: !item.workerList?.find(resdata => !!resdata.settleOrderId) })
+          item.workerList?.map((resdata, ind_) => {
+            if (resdata.settleOrderId) { data.normListBj = true }
+            if (ind_ !== 0) { normList.push({ pfuqinid: pfuqinid, zijideid: ind_ }) }
+            if (ind_ == item.workerList?.length - 1) { pfuqinid += (ind_ + 1) }
+          })
+        })
+        var otherNormList = []
+        var qtpfuqinid = 0
+        data.otherNormList.map((item, index) => {
+          item.settleNum = item.settleNum || ""
+          otherNormList.push({ ...item, pfuqinid: qtpfuqinid, zijideid: 0, bianji: !item.workerList?.find(resdata => !!resdata.settleOrderId) })
+          if (!data.showOtherNormList) {
+            data.showOtherNormList = !!item.workerList?.find(resdata => !!resdata.settleOrderId)
+          }
+          item.workerList?.map((resdata, ind_) => {
+            if (resdata.settleOrderId) { data.otherNormListBj = true }
+            if (ind_ !== 0) { otherNormList.push({ pfuqinid: qtpfuqinid, zijideid: ind_ }) }
+            if (ind_ == item.workerList?.length - 1) { qtpfuqinid += (ind_ + 1) }
+          })
+        })
+        Promise.all([
+          listPageV3({ "pageNum": 1, "pageSize": -1 }),
+          listPageV2Repair({ "pageNum": 1, "pageSize": -1 }),
+          settleNormInstallQuery({
+            settleNormType: data.orderType,
+            type: data.orderSmallType
+          }),
+          settleNormOtherQuery()
+        ]).then(([res1, res2, res3, res4]) => {
+          r({
+            ...data,
+            normList,
+            otherNormList,
+            gonglv: res1.data.records,
+            gonglr: res2.data.records,
+            classifyList: res3.data,
+            otherList: res4.data,
+          })
 
-		zhuzhuang(data) {
-			return new Promise((r, j) => {
-				var orderChannelId
-				var normList = []
-				var pfuqinid = 0
-				data.normListBj = false
-				data.otherNormListBj = false
-				data.showOtherNormList = false
-				data.normList.map((item, index) => {
-					if (!orderChannelId) { orderChannelId = item.orderChannelId }
-					item.settleNum = item.settleNum || ""
-					normList.push({ ...item, pfuqinid: pfuqinid, zijideid: 0, bianji: !item.workerList?.find(resdata => !!resdata.settleOrderId) })
-					item.workerList?.map((resdata, ind_) => {
-						if (resdata.settleOrderId) { data.normListBj = true }
-						if (ind_ !== 0) { normList.push({ pfuqinid: pfuqinid, zijideid: ind_ }) }
-						if (ind_ == item.workerList?.length - 1) { pfuqinid += (ind_ + 1) }
-					})
-				})
-				var otherNormList = []
-				var qtpfuqinid = 0
-				data.otherNormList.map((item, index) => {
-					item.settleNum = item.settleNum || ""
-					otherNormList.push({ ...item, pfuqinid: qtpfuqinid, zijideid: 0, bianji: !item.workerList?.find(resdata => !!resdata.settleOrderId) })
-					if (!data.showOtherNormList) {
-						data.showOtherNormList = !!item.workerList?.find(resdata => !!resdata.settleOrderId)
-					}
-					item.workerList?.map((resdata, ind_) => {
-						if (resdata.settleOrderId) { data.otherNormListBj = true }
-						if (ind_ !== 0) { otherNormList.push({ pfuqinid: qtpfuqinid, zijideid: ind_ }) }
-						if (ind_ == item.workerList?.length - 1) { qtpfuqinid += (ind_ + 1) }
-					})
-				})
-				Promise.all([
-					listPageV3({ "pageNum": 1, "pageSize": -1 }),
-					listPageV2Repair({ "pageNum": 1, "pageSize": -1 }),
-					settleNormInstallQuery({
-						settleNormType: data.orderType,
-						type: data.orderSmallType
-					}),
-					settleNormOtherQuery()
-				]).then(([res1, res2, res3, res4]) => {
-					r({
-						...data,
-						normList,
-						otherNormList,
-						gonglv: res1.data.records,
-						gonglr: res2.data.records,
-						classifyList: res3.data,
-						otherList: res4.data,
-					})
+        }).catch(j)
+      })
+    },
 
-				}).catch(j)
-			})
-		},
+    panfuan(item) {
+      if (!!item.id) {
+        return true
+      } else {
+        return false
+      }
+    },
 
-		panfuan(item) {
-			if (!!item.id) {
-				return true
-			} else {
-				return false
-			}
-		},
+    classifyListChuLi(list, value, label, func, ...keys) {
+      var obj = {};
+      list.map(item => {
+        if (func && !func(item)) {
+          return
+        }
+        obj[item[value]] = {
+          label: item[label]
+        }
+        for (var key of keys) {
+          obj[item[value]][key] = item[key]
+        }
+      })
+      return Object.keys(obj).map(value => {
+        return {
+          value: value,
+          ...obj[value]
+        }
+      })
+    },
 
-		classifyListChuLi(list, value, label, func, ...keys) {
-			var obj = {};
-			list.map(item => {
-				if (func && !func(item)) {
-					return
-				}
-				obj[item[value]] = {
-					label: item[label]
-				}
-				for (var key of keys) {
-					obj[item[value]][key] = item[key]
-				}
-			})
-			return Object.keys(obj).map(value => {
-				return {
-					value: value,
-					...obj[value]
-				}
-			})
-		},
+    getflList(list = [], row = {},) {
+      return list.filter(item => (
+        item.type == row.type &&
+        item.parentCategoryId == row.parentCategoryId &&
+        item.categoryId == row.categoryId
+      ))
+    },
 
-		getflList(list = [], row = {},) {
-			return list.filter(item => (
-				item.type == row.type &&
-				item.parentCategoryId == row.parentCategoryId &&
-				item.categoryId == row.categoryId
-			))
-		},
-
-	}
+  }
 }
 </script>
 
 <style lang="scss">
 .redbordererranniuright {
-	.el-button {
-		margin-left: 0px;
-		margin-right: 10px;
-	}
+  .el-button {
+    margin-left: 0px;
+    margin-right: 10px;
+  }
 }
 </style>

+ 2 - 42
src/views/workOrder/workOrderPool/index.vue

@@ -45,8 +45,7 @@ import Detail from './detail'
 import Reassignment from "./components/reassignment/index.vue"
 import Reschedule from "./components/reschedule/index.vue"
 import { commonTemplateDownload } from '@/api/common.js'
-import ywgdjs from "@/assets/ywgdjs.png"
-import yjs from "@/assets/yjs.png"
+import orderListColumn from "@/mixin/orderListColumn"
 export default {
   components: {
     TemplatePage,
@@ -55,7 +54,7 @@ export default {
     Reassignment,
     Reschedule
   },
-  mixins: [import_mixin, operation_mixin],
+  mixins: [import_mixin, operation_mixin, orderListColumn],
   data() {
     return {
       id: this.$route.query.id || '',
@@ -316,45 +315,6 @@ export default {
     // 列表导出函数
     exportList: orderBaseListExport,
 
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      if (item.jname === 'orderFlags') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;display:flex;align-items:center;">
-              {(row[column.columnAttributes.prop] || []).map(item => {
-                if (item.tagName == "已完工") {
-                  return (
-                    <img src={ywgdjs} style="width:22px;height:22px;" />
-                  )
-                } else if (item.tagName == "已结算") {
-                  return (
-                    <img src={yjs} style="width:22px;height:22px;" />
-                  )
-                } else {
-                  return (
-                    <div style="display: inline-block;border:1px solid #409EFF; color:#409EFF;padding:0 2px;border-radius: 4px;margin:2px 2px 0 0;">
-                      {item.tagName}
-                    </div>
-                  )
-                }
-              })}
-            </div>
-          )
-        }
-      }
-      if (item.jname === 'appointmentTime') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;cursor: pointer;">
-              {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
-            </div>
-          )
-        }
-      }
-      return defaultData
-    },
-
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data

Some files were not shown because too many files changed in this diff