浏览代码

no message

linwenxin 1 年之前
父节点
当前提交
ddae6187ff

+ 32 - 0
src/api/projectCollectionManagement.js

@@ -35,3 +35,35 @@ export function enginPayGatherListExport(data, name) {
     name
   })
 }
+
+export function enginPaySave(data) {
+  return request({
+    url: `/engin/pay/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginPayConfirm(params) {
+  return request({
+    url: `/engin/pay/confirm`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginPayPay(params) {
+  return request({
+    url: `/engin/pay/pay`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginPayDetail(params) {
+  return request({
+    url: `/engin/pay/detail`,
+    method: 'post',
+    params
+  })
+}

+ 109 - 0
src/components/template/editTable.js

@@ -0,0 +1,109 @@
+function setShowElement(name, row) {
+  if (typeof name == 'function') {
+    return name(row || {})
+  } else {
+    return !!name
+  }
+}
+
+export default {
+  data() {
+    return {
+      isEditTableIndex: -1
+    }
+  },
+  methods: {
+    convertTableJson(tableData, list, attributes = {
+      isAdd: true,
+      isDel: true,
+      isUpdate: true,
+      isConfirm: true,
+      isEdit: true,
+      isTemElm: true,
+      confirmText: "",
+      editText: "",
+      delText: "",
+    }, funs = {
+      add: function () { },
+      confirm: function () { },
+      delete: function () { },
+      update: function () { },
+      verify: function () { },
+    }) {
+      var newList = list.map(item => {
+        if (item.editRender && item.viewRender) {
+          item.render = (h, { row, column, index }) => {
+            if (attributes?.isTemElm !== undefined ? setShowElement(attributes?.isTemElm, { row, column, index }) : index == this.isEditTableIndex) {
+              return item.editRender(h, { row, column, index })
+            } else {
+              return item.viewRender(h, { row, column, index })
+            }
+          }
+        }
+        return item
+      });
+      if (setShowElement(attributes?.isEdit)) {
+        newList.push({
+          columnAttributes: {
+            label: '操作',
+            width: 100
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding-left:10px">
+              {(attributes?.isConfirm !== undefined ? setShowElement(attributes?.isConfirm, { row, column, index }) : this.isEditTableIndex == index) && <el-button type="text" onClick={async () => {
+                if (funs.verify && !await funs.verify({ row, column, index }, this.isEditTableIndex)) {
+                  return;
+                }
+                if (funs.confirm) {
+                  funs.confirm({ row, column, index })
+                } else {
+                  this.isEditTableIndex = -1
+                }
+              }}>{attributes?.confirmText || '确定'}</el-button>}
+              {(attributes?.isUpdate !== undefined ? setShowElement(attributes?.isUpdate, { row, column, index }) : this.isEditTableIndex == -1) && <el-button type="text" onClick={async () => {
+                if (funs.verify && !await funs.verify({ row, column, index }, this.isEditTableIndex)) {
+                  return;
+                }
+                if (funs.update) {
+                  funs.update({ row, column, index })
+                } else {
+                  this.isEditTableIndex = index
+                }
+              }}>{attributes?.editText || '编辑'}</el-button>}
+              {setShowElement(attributes?.isDel, { row, column, index }) && <el-button type="text" onClick={async () => {
+                if (this.isEditTableIndex > -1) {
+                  if (this.isEditTableIndex === index) {
+                    this.isEditTableIndex = -1
+                  } else if (this.isEditTableIndex > index) {
+                    this.isEditTableIndex -= 1
+                  }
+                }
+                if (funs.delete) {
+                  funs.delete({ row, column, index })
+                } else {
+                  tableData.splice(index, 1)
+                }
+              }}>{attributes?.delText || '删除'}</el-button>}
+            </div>
+          }
+        })
+      };
+      return <div>
+        {setShowElement(attributes?.isAdd) ? <div>
+          <el-button size="mini" type="primary" onClick={async () => {
+            if (funs.verify && !await funs.verify({}, this.isEditTableIndex)) {
+              return;
+            }
+            if (funs.add) {
+              funs.add()
+            }
+          }}>新增</el-button>
+        </div> : null}
+        <zj-table
+          columns={newList}
+          table-data={tableData}
+        />
+      </div>
+    }
+  }
+}

+ 6 - 2
src/views/engineeringAuxiliaryParts/projectCollectionManagement/index.vue

@@ -22,7 +22,7 @@ export default {
   data() {
     return {
       tabType: 'collect',
-      tabTypeCk: 'collect'
+      tabTypeCk: 'collect',
     }
   },
   methods: {
@@ -30,7 +30,7 @@ export default {
       this.$nextTick(() => {
         this.tabTypeCk = this.tabType
       })
-    }
+    },
   }
 }
 </script>
@@ -39,4 +39,8 @@ export default {
 .tab {
   padding: 20px 20px 0 20px;
 }
+
+::v-deep .zj-page-fill {
+  position: static
+}
 </style>

+ 41 - 27
src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/collect.vue

@@ -1,25 +1,25 @@
 <template>
-  <template-page
-    ref="pageRef"
-    :getList="getList"
-    :operation="operation()"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-    :optionsEvensGroup="optionsEvensGroup"
-  >
-    <div slot="moreSearch">
-      <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
-        <el-radio-button label="">全部</el-radio-button>
-        <el-radio-button label="WAIT">待审核</el-radio-button>
-        <el-radio-button label="WAIT_PAY">待收款</el-radio-button>
-        <el-radio-button label="PART_PAY">部分收款</el-radio-button>
-        <el-radio-button label="PAY">收款完成</el-radio-button>
-      </el-radio-group>
-      <br /><br />
+  <div style="width: 100%;height:100%">
+    <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+      :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
+      :optionsEvensGroup="optionsEvensGroup">
+      <div slot="moreSearch">
+        <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="WAIT">待审核</el-radio-button>
+          <el-radio-button label="WAIT_PAY">待收款</el-radio-button>
+          <el-radio-button label="PART_PAY">部分收款</el-radio-button>
+          <el-radio-button label="PAY">收款完成</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="cartographer_big">
+      <el-dialog title="创建" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
+        <formModule v-if="createFormBool" :id="id" :handleClose="handleClose" />
+      </el-dialog>
     </div>
-  </template-page>
+  </div>
 </template>
 
 <script>
@@ -28,10 +28,11 @@ import import_mixin from '@/components/template/import_mixin.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import { enginPayList, enginPayListExport, enginPayImport } from '@/api/projectCollectionManagement'
 import { commonTemplateDownload } from '@/api/common.js'
-import { EventBus } from '@/utils/eventBus'
+import formModule from "../workOrderInfo/index.vue"
 export default {
   components: {
-    TemplatePage
+    TemplatePage,
+    formModule
   },
   mixins: [import_mixin, operation_mixin],
   data() {
@@ -48,7 +49,9 @@ export default {
       },
       formData: {},
       detailParams: [],
-      examineStatus: ''
+      examineStatus: '',
+      createFormBool: false,
+      id: null
     }
   },
   computed: {
@@ -58,13 +61,16 @@ export default {
         [
           [
             this.optionsEvensAuth('add', {
-              click: () => {}
+              click: () => {
+                this.id = null
+                this.createFormBool = true
+              }
             })
           ],
           [
             this.optionsEvensAuth(['imp', 'template'], {
               name: '导入',
-              click: () => {}
+              click: () => { }
             }),
             this.optionsEvensAuth('imp', ({ moduleName }) => {
               return {
@@ -102,7 +108,7 @@ export default {
           pam.params.push({ param: 'a.status', compare: '=', value: this.examineStatus })
         }
         return enginPayList(pam)
-      } catch (error) {}
+      } catch (error) { }
     },
 
     // 列表导出函数
@@ -127,9 +133,17 @@ export default {
       return this.operationBtn({
         details: {
           btnType: 'text',
-          click: ({ row, index, column }) => {}
+          click: ({ row, index, column }) => {
+            this.id = row.id
+            this.createFormBool = true
+          }
         }
       })
+    },
+
+    handleClose() {
+      this.$refs.pageRef.refreshList()
+      this.createFormBool = false
     }
   }
 }

+ 4 - 10
src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/offline.vue

@@ -1,12 +1,6 @@
 <template>
-  <template-page
-    ref="pageRef"
-    :getList="getList"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-  >
+  <template-page ref="pageRef" :getList="getList" :exportList="exportList" :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes" :tableEvents="tableEvents">
   </template-page>
 </template>
 
@@ -64,11 +58,11 @@ export default {
   box-sizing: border-box;
   padding-left: 16px;
 
-  ::v-deep & > .zj-page-fill-scroll {
+  ::v-deep &>.zj-page-fill-scroll {
     box-sizing: border-box;
     padding-right: 16px;
 
-    & > div:nth-child(1) {
+    &>div:nth-child(1) {
       margin-top: 20px;
     }
   }

+ 272 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/index.vue

@@ -0,0 +1,272 @@
+<template>
+  <zj-page-container v-if="formData">
+    <zj-page-fill class="neibuview">
+      <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules"
+        :form-attributes="{ size: 'mini' }">
+        <!-- 工程信息 -->
+        <zj-form-module title="工程信息" :form-data="formData" :form-items="serviceInfo" label-width="120px" />
+        <!-- 基本信息 -->
+        <zj-form-module title="基本信息" :form-data="formData" :form-items="basicInfo" label-width="120px" />
+        <!-- 产品信息 -->
+        <zj-form-module title="产品信息" :form-data="formData" :form-items="product" label-width="120px" />
+        <!-- 收款信息 -->
+        <zj-form-module
+          v-if="!!id && (formData.status == 'WAIT_PAY' || formData.status == 'PART_PAY' || formData.status == 'PAY')"
+          title="收款信息" :form-data="formData" :form-items="product" label-width="120px" />
+      </zj-form-container>
+    </zj-page-fill>
+    <!-- 操作按钮 -->
+    <div>
+      <div style="box-sizing: border-box; padding: 10px">
+        <el-button size="mini">关闭</el-button>
+        <el-button v-if="!id" size="mini" type="primary" @click="submit">提交</el-button>
+        <el-button v-if="!!id && formData.status == 'WAIT'" size="mini" type="primary" @click="examine">审核</el-button>
+        <el-button v-if="!!id && (formData.status == 'WAIT_PAY' || formData.status == 'PART_PAY')" size="mini"
+          type="primary" @click="confirm">确定提交</el-button>
+      </div>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import basicInfo from './mixins/basicInfo.js'
+import productColumns from './mixins/productColumns.js'
+import serviceInfo from './mixins/serviceInfo.js'
+import editTable from "@/components/template/editTable.js"
+import { enginPayDetail, enginPaySave, enginPayConfirm, enginPayPay } from "@/api/projectCollectionManagement.js"
+import ImageUpload from '@/components/file-upload'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    },
+    handleClose: Function
+  },
+  components: { ImageUpload },
+  mixins: [
+    basicInfo,
+    productColumns,
+    serviceInfo,
+    editTable
+  ],
+  data() {
+    return {
+      formData: {
+        "address": "",
+        "area": "",
+        "areaId": "",
+        "city": "",
+        "cityId": "",
+        "companyWechatId": "",
+        "companyWechatName": "",
+        "confirmBy": "",
+        "confirmTime": "",
+        "customerMobile": "",
+        "customerMobile2": "",
+        "customerName": "",
+        "goodsType": "",
+        "items": [],
+        "lastUpdateBy": "",
+        "lastUpdateTime": "",
+        "linkName": "",
+        "orderSmallType": "",
+        "orderSmallTypeText": "",
+        "projectName": "",
+        "projectNo": "",
+        "province": "",
+        "provinceId": "",
+        "records": [],
+        "remark": "",
+        "salesNo": "",
+        "salesWebsit": "",
+        "status": "",
+        "street": "",
+        "streetId": "",
+        "totalPayAmount": 0,
+        "totalSalesAmount": 0,
+        "websitId": "",
+        "websitName": "",
+        // 收款信息
+        "amount": "",
+        "fileUrl": [],
+        "payRemark": ""
+      },
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.getorderDetail((data) => {
+          this.getinitlbslist()
+          this.gettGoodsAloneList()
+        })
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    // 表单校验规则
+    formRules() {
+      return {}
+    },
+    payInfo() {
+      return [
+        ...(() => {
+          if (!!this.id && (this.formData.status == 'WAIT_PAY' || this.formData.status == 'PART_PAY')) {
+            return [{
+              name: 'el-input',
+              md: 6,
+              attributes: { placeholder: '请输入' },
+              formItemAttributes: {
+                label: '收款金额',
+                prop: 'amount',
+                rules: [...required]
+              }
+            },
+            {
+              md: 24,
+              isShow: true,
+              name: 'slot-component',
+              formItemAttributes: {
+                label: '收款凭证',
+                prop: 'fileUrl',
+                rules: []
+              },
+              render: (h, { props, onInput }) => {
+                var { value } = props
+                return (
+                  <ImageUpload fileList={this.formData.fileUrl} limit={1} />
+                )
+              }
+            },
+            {
+              name: 'el-input',
+              md: 24,
+              attributes: {
+                type: 'textarea',
+                rows: 3,
+                placeholder: '请输入'
+              },
+              formItemAttributes: {
+                label: '备注',
+                prop: 'payRemark',
+                rules: []
+              }
+            }]
+          }
+          return []
+        })()
+      ]
+    }
+  },
+  methods: {
+    // 获取工单详情
+    getorderDetail(cb) {
+      if (this.id) {
+        // 编辑详情
+        enginPayDetail({
+          id: this.id
+        }).then((res) => {
+          Object.assign(this.formData, res.data)
+          cb && cb()
+        })
+      }
+    },
+    appointVerify(arr, cb) {
+      this.$refs.formRef.validateField(arr, (valid, invalidFields, errLabels) => {
+        cb && cb(valid, invalidFields, errLabels)
+      })
+    },
+    submit() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPaySave(this.formData).then(res => {
+            this.$message({
+              type: 'success',
+              message: '提交成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+    examine() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPayConfirm({ id: this.formData.id }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '审核成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+    confirm() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPayPay({
+            "amount": this.formData.amount,
+            "fileUrl": this.formData.fileUrl.map(item => item.url).join(","),
+            "payRemark": this.formData.payRemark,
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '收款成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+
+.pgxxTable {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+}
+
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+
+.redbordererr {
+  ::v-deep .el-form-item {
+    margin: 0 !important;
+    overflow: hidden;
+  }
+}
+</style>

+ 281 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/basicInfo.js

@@ -0,0 +1,281 @@
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+    }
+  },
+  computed: {
+    // 基本信息数据模型
+    basicInfo() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '客户名称',
+            prop: 'customerName',
+            rules: [...required]
+          },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '联系人',
+            prop: 'linkName',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入', maxlength: 11 },
+          formItemAttributes: {
+            label: '客户电话',
+            prop: 'customerMobile',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入', maxlength: 11 },
+          formItemAttributes: {
+            label: '客户电话2',
+            prop: 'customerMobile2',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          formItemAttributes: {
+            label: '客户地址', //省
+            prop: 'provinceId',
+            rules: [...required],
+            errLabel: '省'
+          },
+          options: this.provinceList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取省名称
+              this.formData.province = this.provinceList.find(item => item.id === val)?.name || ''
+              // 清除市区街道以及详细地址数据
+              this.delDataK(1)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.cityList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //市
+            prop: 'cityId',
+            rules: [...required],
+            errLabel: '市'
+          },
+          options: this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取市名称
+              this.formData.city = this.cityList.find(item => item.id === val).name
+              // 清除区街道以及详细地址数据
+              this.delDataK(2)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.areaList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //区
+            prop: 'areaId',
+            rules: [...required],
+            errLabel: '区'
+          },
+          options: this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取区名称
+              this.formData.area = this.areaList.find(item => item.id === val).name
+              // 清除街道以及详细地址数据
+              this.delDataK(3)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //街道
+            prop: 'streetId',
+            rules: [...required],
+            errLabel: '街道'
+          },
+          options: this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取街道名称
+              this.formData.street = this.streetList.find(item => item.id === val).name
+              // 清除详细地址数据
+              this.delDataK(4)
+            }
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 3,
+          formItemAttributes: {
+            'label-width': '0px',
+            prop: '',
+          },
+          render: (h, { props }) => {
+            return (
+              <geographicalPosi
+                disabled={!!this.id}
+                formData={this.formData}
+                onSelectPosi={data => {
+                  // 获取经纬度
+                  this.formData.lng = data.center[0]
+                  this.formData.lat = data.center[1]
+                  // 获取定位的省市区街道
+                  var { province, city, district, township } = data.data.addressComponent
+                  // 获取选中省名称id
+                  var { id, name } = this.provinceList.find(item => item.name === province)
+                  this.formData.provinceId = id
+                  this.formData.province = name
+                  // 请求市选项
+                  lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+                    // 赋值市选项
+                    this.cityList = res.data
+                    // 获取选中市名称id
+                    var { id, name } = res.data.find(item => item.name === city)
+                    this.formData.cityId = id
+                    this.formData.city = name
+                    // 请求区选项
+                    lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                      // 赋值区选项
+                      this.areaList = res.data
+                      // 获取选中区名称id
+                      var { id, name } = res.data.find(item => item.name === district)
+                      this.formData.areaId = id
+                      this.formData.area = name
+                      // 请求街道选项
+                      lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                        // 赋值街道选项
+                        this.streetList = res.data
+                        // 获取选中街道名称id
+                        var { id, name } = res.data.find(item => item.name === township)
+                        this.formData.streetId = id
+                        this.formData.street = name
+                        if (!this.formData.address) {
+                          this.formData.address = data.name
+                        }
+                      })
+                    })
+                  })
+                }}
+              />
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          formItemAttributes: { label: '详细地址', prop: 'address', rules: [...required] },
+          attributes: { disabled: !!this.id, placeholder: '详细地址' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: !!this.id,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    this.getinitlbslist()
+  },
+  methods: {
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+                if (this.formData.areaId) {
+                  lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                    this.streetList = res.data
+                  })
+                }
+              })
+            }
+          })
+        }
+      })
+    },
+    delDataK(num) {
+      if (num <= 1) {
+        // 删除市
+        this.formData.cityId = ''
+        this.formData.city = ''
+        // 删除市选项
+        this.cityList = []
+      }
+      if (num <= 2) {
+        // 删除区
+        this.formData.areaId = ''
+        this.formData.area = ''
+        // 删除区选项
+        this.areaList = []
+      }
+      if (num <= 3) {
+        // 删除街道
+        this.formData.streetId = ''
+        this.formData.street = ''
+        // 删除街道选项
+        this.streetList = []
+      }
+      // 删除gps地址
+      this.formData.gpsAddress = ''
+    }
+  }
+}

+ 191 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/productColumns.js

@@ -0,0 +1,191 @@
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1,
+      serviceProvider: null,
+      specificationList: [],
+      hezuoshangjiaList: [],
+    }
+  },
+  watch: {
+
+  },
+  computed: {
+    product() {
+      return [{
+        name: 'slot-component',
+        md: 24,
+        formItemAttributes: {
+          'label-width': '0px',
+          label: '',
+          prop: 'items',
+          rules: [...required]
+        },
+        render: (h, { props }) => {
+          return this.convertTableJson(this.formData?.items || [], [
+            {
+              columnAttributes: {
+                label: '商品',
+                prop: 'goodsId',
+                propName: 'goodsName',
+              },
+              editRender: (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
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      onChange={(val) => {
+                        row[column.columnAttributes.propName] = ""
+                        row.categoryName = ""
+                        row.unit = ""
+                        row.goodsSpecification = ""
+                        row.marketPrice = ""
+                        row.qty = ""
+                        row.amount = ""
+                        if (val) {
+                          var data = this.goodsList.find(item => item.goodsId == val)
+                          if (data) {
+                            row[column.columnAttributes.propName] = data.goodsName
+                            row.categoryName = data.categoryName
+                            row.unit = data.goodsStockUnit
+                            row.goodsSpecification = data.goodsSpecification
+                            row.marketPrice = data.marketPrice
+                            row.qty = ""
+                          }
+                        }
+                      }}
+                      placeholder="请选择">
+                      {this.goodsList.filter(item => !(this.formData?.items || []).find(data => data.goodsId == item.goodsId)).map((item, index_) => <el-option key={index_} label={item.goodsName} value={item.goodsId}></el-option>)}
+                    </el-select>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.propName]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '分类',
+                prop: 'categoryName'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '单位',
+                prop: 'unit'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '商品代码',
+                prop: 'goodsId'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '规格型号',
+                prop: 'goodsSpecification'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '销售价格',
+                prop: 'marketPrice',
+              },
+              editRender: (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
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      placeholder="请输入内容"
+                      type="number"
+                    >
+                    </el-input>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '数量',
+                prop: 'qty',
+              },
+              editRender: (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
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      placeholder="请输入内容"
+                      type="number"
+                    >
+                    </el-input>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '金额(元)',
+                prop: 'amount',
+              },
+              render: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{
+                  (Number(row.marketPrice) * Number(row.qty)).toFixed(2)
+                }</div>
+              },
+            },
+          ], {
+            isEdit: !this.id,
+            isAdd: !this.id,
+            isDel: !this.id,
+          }, {
+            // 点击添加触发
+            add: () => {
+              this.formData.items.unshift({
+                "goodsId": "",
+                "goodsName": "",
+                "categoryName": "",
+                "unit": "",
+                "goodsSpecification": "",
+                "marketPrice": "",
+                "qty": "",
+                "amount": ""
+              })
+              this.isEditTableIndex = 0
+            },
+            verify: ({ row, column, index }, isEditTableIndex) => {
+              return new Promise(r => {
+                if (isEditTableIndex > -1) {
+                  this.appointVerify([
+                    `items.${isEditTableIndex}.goodsId`,
+                    `items.${isEditTableIndex}.marketPrice`,
+                    `items.${isEditTableIndex}.qty`,
+                  ], (v) => {
+                    if (v) {
+                      r(true)
+                    } else {
+                      r(false)
+                    }
+                  })
+                } else {
+                  r(true)
+                }
+              })
+            },
+          })
+        }
+      }]
+    },
+  },
+}

+ 171 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/serviceInfo.js

@@ -0,0 +1,171 @@
+import { listPageV2 } from "@/api/workOrder/orderType";
+import { getWebsit } from "@/api/customerManagement.js"
+import {
+  websitGoodsAlonePList,
+  websitGoodsAloneMList
+} from '@/api/auxiliaryMaterialBasicInfo.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      orderSmallTypeData: [],
+      goodsList: []
+    }
+  },
+  computed: {
+    serviceInfo() {
+      return [
+        {
+          md: 6,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyWechatName',
+            rules: []
+          }
+        },
+        {
+          name: 'el-select',
+          options: this.websitList,
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitId',
+            rules: [...required],
+          },
+          events: {
+            change: (val) => {
+              this.formData.websitName = this.websitList.find(item => item.value === val)?.label
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          options: this.orderSmallTypeData,
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单类型',
+            prop: 'orderSmallType',
+            rules: [...required]
+          },
+          events: {
+            change: (val) => {
+              this.formData.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value === val)?.label
+            }
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '工程编号',
+            prop: 'projectNo',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '工程名称',
+            prop: 'projectName',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '销售单号',
+            prop: 'salesNo',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '销售网点',
+            prop: 'salesWebsit',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-radio',
+          md: 6,
+          options: [{ value: "M", label: "辅材" }, { value: "P", label: "配件" }],
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+          },
+          formItemAttributes: {
+            label: '费用类型',
+            prop: 'goodsType',
+            rules: [...required]
+          },
+          events: {
+            change: (val) => {
+              this.formData.items = []
+              this.gettGoodsAloneList()
+            }
+          }
+        },
+      ]
+    }
+  },
+  created() {
+    // 获取网点
+    getWebsit({ type: "C", status: true, isAll: this.id ? true : false }).then(res => {
+      this.websitList = res.data.map(item => ({
+        label: item.name,
+        value: item.websitId,
+        data: item
+      }))
+    })
+    // 获取工单类型
+    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+      this.orderSmallTypeData = res.data.records.map(item => ({
+        value: item.id,
+        label: item.orderSmallTypeText
+      }))
+    })
+  },
+  methods: {
+    gettGoodsAloneList() {
+      this.goodsList = []
+      if (this.formData.goodsType) {
+        ({
+          M: websitGoodsAloneMList,
+          P: websitGoodsAlonePList
+        })[this.formData.goodsType]({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }] }).then(res => {
+          this.goodsList = res.data.records
+        })
+      }
+    }
+  },
+}