Преглед изворни кода

sync: 同步供应链项目

Signed-off-by: Howie <zhouhao@zfire.com>
Howie пре 1 година
родитељ
комит
85694582d2
23 измењених фајлова са 1398 додато и 648 уклоњено
  1. 9 0
      src/api/common.js
  2. 1 1
      src/utils/common_select.js
  3. 54 30
      src/views/basic_data/numerusClausus.vue
  4. 148 64
      src/views/commercialEngineering/components/base.vue
  5. 37 14
      src/views/commercialEngineering/components/examine.vue
  6. 24 47
      src/views/commercialEngineering/components/model.vue
  7. 1 1
      src/views/commercialEngineering/crossDistrict/crossDistrictkList.vue
  8. 4 0
      src/views/commercialEngineering/crossDistrict/examine.vue
  9. 1 1
      src/views/commercialEngineering/frock/examine.vue
  10. 1 1
      src/views/commercialEngineering/frock/frockList.vue
  11. 4 4
      src/views/commercialEngineering/homeDecoration/examine.vue
  12. 1 1
      src/views/commercialEngineering/homeDecoration/homeDecorationForm.vue
  13. 1 31
      src/views/commercialEngineering/homeDecoration/homeDecorationList.vue
  14. 10 13
      src/views/commercialEngineering/mixin/index.js
  15. 1 1
      src/views/deposit_home/components/deposit-apply-surrender.vue
  16. 9 12
      src/views/deposit_home/components/refund_list-detail.vue
  17. 1 1
      src/views/deposit_home/components/refund_reexamine.vue
  18. 3 3
      src/views/deposit_home/components/refund_replenish.vue
  19. 916 357
      src/views/setting/account.vue
  20. 51 15
      src/views/setting/engineeringSubAccount.vue
  21. 2 2
      src/views/supply/engin/components/home_detail.vue
  22. 3 3
      src/views/supply/engin/components/home_examine.vue
  23. 116 46
      src/views/supply/implement/implement_total_list.vue

+ 9 - 0
src/api/common.js

@@ -122,6 +122,15 @@ export function getSalesmanList(params) {
     params
   })
 }
+// 获取业务员列表
+export function getSalesmanListService(params) {
+  return request({
+    url: '/admin/user/listService',
+    method: 'get',
+    params
+  })
+}
+
 
 // 更新发票
 export function updateReceipt(params) {

+ 1 - 1
src/utils/common_select.js

@@ -237,4 +237,4 @@ export const COMMON_SELECT_DATA = {
   SALES_TYPE,
   CENTER_LIST,
   CODE_CHECK_STATUS
-}
+}

+ 54 - 30
src/views/basic_data/numerusClausus.vue

@@ -18,9 +18,28 @@
       :close-on-click-modal="false"
       @close="handleClose"
     >
-      <el-form ref="formData" :model="formData" :rules="rules" label-width="150px" :inline="false" size="mini" :disabled="isDetail">
+      <el-form
+        ref="formData"
+        :model="formData"
+        :rules="rules"
+        label-width="150px"
+        :inline="false"
+        size="mini"
+        :disabled="isDetail"
+      >
         <el-form-item label="商家信息" prop="customerId">
-          <el-select v-model="formData.customerId" placeholder="请选择" clearable filterable style="width: 100%;" @change="handleChange">
+          <el-select
+            v-model="formData.customerId"
+            placeholder="请选择"
+            clearable
+            filterable
+            remote
+            reserve-keyword
+            :remote-method="remoteMethod"
+            :loading="loading"
+            style="width: 100%"
+            @change="handleChange"
+          >
             <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
         </el-form-item>
@@ -78,6 +97,7 @@ export default {
   mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      loading: false,
       visible: false,
       // 事件组合
       optionsEvensGroup: [
@@ -97,7 +117,7 @@ export default {
           [
             {
               name: '批量删除',
-              click: async() => {
+              click: async () => {
                 if (this.recordSelected.length === 0) {
                   this.$message.error('请选择需要删除的数据')
                   return
@@ -139,24 +159,12 @@ export default {
       },
       customerList: [],
       rules: {
-        customerId: [
-          { required: true, message: '请选择', trigger: 'change' }
-        ],
-        customerNumber: [
-          { required: true, message: '请填写', trigger: 'change' }
-        ],
-        homeLoginLimit: [
-          { required: true, message: '请填写', trigger: 'change' }
-        ],
-        spanLoginLimit: [
-          { required: true, message: '请填写', trigger: 'change' }
-        ],
-        workLoginLimit: [
-          { required: true, message: '请填写', trigger: 'change' }
-        ],
-        state: [
-          { required: true, message: '请选择', trigger: 'change' }
-        ]
+        customerId: [{ required: true, message: '请选择', trigger: 'change' }],
+        customerNumber: [{ required: true, message: '请填写', trigger: 'change' }],
+        homeLoginLimit: [{ required: true, message: '请填写', trigger: 'change' }],
+        spanLoginLimit: [{ required: true, message: '请填写', trigger: 'change' }],
+        workLoginLimit: [{ required: true, message: '请填写', trigger: 'change' }],
+        state: [{ required: true, message: '请选择', trigger: 'change' }]
       },
       isDetail: false
     }
@@ -180,10 +188,10 @@ export default {
     operation() {
       return (_h, { row, index, column }) => {
         return (
-          <div class='operation-btns'>
+          <div class="operation-btns">
             <el-button
-              size='mini'
-              type='text'
+              size="mini"
+              type="text"
               onClick={() => {
                 this.getDealerListV2()
                 this.getMerchantLoginQuotaLimitDetail(row.id)
@@ -193,8 +201,8 @@ export default {
               编辑
             </el-button>
             <el-button
-              size='mini'
-              type='text'
+              size="mini"
+              type="text"
               onClick={() => {
                 this.getDealerListV2()
                 this.getMerchantLoginQuotaLimitDetail(row.id)
@@ -206,7 +214,7 @@ export default {
             </el-button>
             {
               <el-popconfirm
-                title='确定删除吗?'
+                title="确定删除吗?"
                 onOnConfirm={() => {
                   delMerchantLoginQuotaLimit([row.id]).then(res => {
                     this.$refs.pageRef.refreshList()
@@ -214,7 +222,7 @@ export default {
                   })
                 }}
               >
-                <el-button slot='reference' type='text' size='mini'>
+                <el-button slot="reference" type="text" size="mini">
                   删除
                 </el-button>
               </el-popconfirm>
@@ -238,12 +246,28 @@ export default {
         }
       })
     },
-    getDealerListV2() {
+    remoteMethod(e) {
+      this.loading = true
+      this.getDealerListV2(e)
+    },
+    getDealerListV2(e) {
+      let params = []
+      if (e) {
+        params = [
+          {
+            param: 'a.name',
+            compare: 'like',
+            value: e
+          }
+        ]
+      }
       getDealerListV2({
         pageNum: 1,
-        pageSize: 100
+        pageSize: 200,
+        params
       }).then(res => {
         this.customerList = res.data.records
+        this.loading = false
       })
     },
     handleChange(e) {

+ 148 - 64
src/views/commercialEngineering/components/base.vue

@@ -11,7 +11,7 @@
         <el-col v-if="['cross'].includes(pageType)" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目性质*:</div>
           <div class="value">
-            <el-radio-group v-model="formData.orderType" size="mini" style="width: 100%" @change="initTradeData">
+            <el-radio-group v-model="formData.orderType"   style="width: 100%" @change="initTradeData">
               <el-radio
                 v-for="item in [
                   { label: '工装', value: 'WORK' },
@@ -28,7 +28,8 @@
         <el-col :xs="24" :sm="['add'].includes(module) ? 12 : 24" :lg="['add'].includes(module) ? 12 : 24" class="item">
           <div class="label">销售公司名称:</div>
           <div class="value">
-            <el-input v-model="formData.salesCompanyName" disabled placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.salesCompanyName" disabled placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.salesCompanyName" />
           </div>
         </el-col>
         <template v-if="!['add'].includes(module)">
@@ -38,21 +39,24 @@
               <el-input
                 :value="formData.orderType === 'WORK' ? '工装' : '家装'"
                 placeholder="请填写"
-                size="mini"
+
                 clearable
               />
+              <CopyButton v-if="module !== 'add'" :copyText="formData.orderType" />
             </div>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="8" class="item">
             <div class="label">项目编号:</div>
             <div class="value">
-              <el-input v-model="formData.projectNo" placeholder="请填写" size="mini" clearable />
+              <el-input v-model="formData.projectNo" placeholder="请填写"   clearable />
+              <CopyButton v-if="module !== 'add'" :copyText="formData.projectNo" />
             </div>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="8" class="item">
             <div class="label">登录时间:</div>
             <div class="value">
-              <el-input v-model="formData.createTime" placeholder="请填写" size="mini" clearable />
+              <el-input v-model="formData.createTime" placeholder="请填写"   clearable />
+              <CopyButton v-if="module !== 'add'" :copyText="formData.createTime" />
             </div>
           </el-col>
         </template>
@@ -73,6 +77,8 @@
                 :value="item.value"
               />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="getCopyText(commonData.dict['TRADE_PROJECT_AREA'], formData.projectArea)" />
+
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
@@ -86,13 +92,14 @@
                 :value="item.value"
               />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="getCopyText(commonData.salesmanList, formData.serviceId)" />
           </div>
         </el-col>
         <el-col
-          v-if="['frock', 'cross'].includes(pageType) && formData.orderType === 'WORK'"
+          v-if="pageType === 'frock' || (pageType === 'cross' && formData.orderType === 'WORK')"
           :xs="24"
-          :sm="module === 'detail' ? 24 : 12"
-          :lg="module === 'detail' ? 24 : 12"
+          :sm="!['add', 'edit'].includes(module)  ? 24 : 12"
+          :lg="!['add', 'edit'].includes(module)  ? 24 : 12"
           class="item"
         >
           <div class="label">甲方名称*:</div>
@@ -105,9 +112,16 @@
                 :value="item.value"
               />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="getCopyText(commonData.PartyAList, formData.partyAId)" />
           </div>
         </el-col>
-        <el-col   v-if="['home'].includes(pageType)" :xs="24" :sm="12" :lg="12" class="item">
+        <el-col
+          v-if="['add', 'edit'].includes(module)  && (pageType === 'home' || formData.orderType === 'HOME')"
+          :xs="24"
+          :sm="12"
+          :lg="12"
+          class="item"
+        >
           <div class="label" />
           <div class="value" />
         </el-col>
@@ -119,7 +133,6 @@
               v-model="formData.customerName"
               disabled
               placeholder="请填写"
-              size="mini"
               clearable
             />
             <el-input
@@ -127,7 +140,6 @@
               v-model="formData.customerName"
               disabled
               placeholder="请填写"
-              size="mini"
               clearable
             />
             <el-select
@@ -145,36 +157,44 @@
                 :value="item.value"
               />
             </el-select>
+            <CopyButton v-if="module !== 'add' && isTradeExaminer" :copyText="getCopyText(commonData.customerList, formData.customerId)" />
+            <CopyButton v-if="module !== 'add' && !isTradeExaminer" :copyText="formData.customerName" />
+
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" class="item">
           <div class="label">经销商联系人*:</div>
           <div class="value">
-            <el-input v-model="formData.customerLinkName" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.customerLinkName" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.customerLinkName" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" class="item">
           <div class="label">经销商联系电话*:</div>
           <div class="value">
-            <el-input v-model="formData.customerLinkMobile" maxlength="11" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.customerLinkMobile" maxlength="11" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.customerLinkMobile" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" class="item">
           <div class="label">经销商办公地址*:</div>
           <div class="value">
-            <el-input v-model="formData.customerAddress" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.customerAddress" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.customerAddress" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" class="item">
           <div class="label">跟进经销商*:</div>
           <div class="value">
-            <el-input v-model="formData.followCustomer" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.followCustomer" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.followCustomer" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" class="item">
           <div class="label">跟进经销商电话*:</div>
           <div class="value">
-            <el-input v-model="formData.followCustomerMobile" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.followCustomerMobile" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.followCustomerMobile" />
           </div>
         </el-col>
         <el-col
@@ -186,7 +206,8 @@
         >
           <div class="label">工程项目名称*:</div>
           <div class="value">
-            <el-input v-model="formData.projectName" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.projectName" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.projectName" />
           </div>
         </el-col>
         <el-col
@@ -197,7 +218,8 @@
         >
           <div class="label">工程联系人*:</div>
           <div class="value">
-            <el-input v-model="formData.enginLinkName" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.enginLinkName" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.enginLinkName" />
           </div>
         </el-col>
         <el-col
@@ -208,7 +230,8 @@
         >
           <div class="label">电话*:</div>
           <div class="value">
-            <el-input v-model="formData.enginLinkMobile" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.enginLinkMobile" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.enginLinkMobile" />
           </div>
         </el-col>
         <el-col
@@ -220,70 +243,70 @@
         >
           <div class="label" style="height: auto">工程项目名称*:</div>
           <div class="value my-center" style="height: 100%">
-            <el-radio-group v-model="formData.homeProjectNameRadio" size="mini">
+            <el-radio-group v-model="formData.homeProjectNameRadio"  >
               <el-radio label="AREA">
                 <el-input
                   v-model="formData.homeProjectNameArea"
                   class="my-width"
                   placeholder="请填写"
-                  size="mini"
                   clearable
                 />小区
                 <el-input
                   v-model="formData.homeProjectNameSeat"
                   class="my-width"
                   placeholder="请填写"
-                  size="mini"
-                  clearable
-                />座
-                <el-input
                   v-model="formData.homeProjectNameNumber"
-                  class="my-width"
                   placeholder="请填写"
-                  size="mini"
-                  clearable
-                />号
+                  :copyText="
+                    formData.homeProjectNameArea +
+                    '小区' +
+                    formData.homeProjectNameSeat +
+                    '座' +
+                    formData.homeProjectNameNumber +
+                    '号'
+                  "
+                />
               </el-radio>
               <el-radio label="SELF">
                 <el-input
                   v-model="formData.homeProjectNameArea2"
-                  class="my-width"
                   placeholder="请填写"
-                  size="mini"
+
                   clearable
                 />(业主名称)自建房
+                <CopyButton v-if="module !== 'add'" :copyText="formData.homeProjectNameArea2 + '(业主名称)自建房'" />
               </el-radio>
               <el-radio label="VILLA">
                 <el-input
                   v-model="formData.homeProjectNameArea3"
                   class="my-width"
                   placeholder="请填写"
-                  size="mini"
                   clearable
                 />小区
                 <el-input
                   v-model="formData.homeProjectNameNumber3"
                   class="my-width"
                   placeholder="请填写"
-                  size="mini"
-                  clearable
-                />号别墅
+                  :copyText="formData.homeProjectNameArea3 + '小区' + formData.homeProjectNameNumber3 + '号'"
+                />
               </el-radio>
             </el-radio-group>
           </div>
         </el-col>
-        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">工程(建筑)地址*:</div>
           <div class="value">
             <el-select v-model="formData.provinceId" placeholder="请选择省" class="my-width" @change="changeProvince">
               <el-option v-for="item in provinceList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
             </el-select>
+
             <el-select v-model="formData.cityId" placeholder="请选择市" class="my-width" @change="changeCity">
               <el-option v-for="item in cityList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
             </el-select>
+
             <el-select v-model="formData.areaId" placeholder="请选择区" class="my-width" @change="changeArea">
               <el-option v-for="item in areaList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
             </el-select>
+
             <el-select v-model="formData.streetId" placeholder="请选择街道" class="my-width" @change="changeStreet">
               <el-option v-for="item in streetList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
             </el-select>
@@ -292,14 +315,16 @@
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">详细地址*:</div>
           <div class="value">
-            <!-- <el-input v-model="formData.positionAddress" placeholder="定位地址" size="mini" clearable disabled /> -->
+            <!-- <el-input v-model="formData.positionAddress" placeholder="定位地址"   clearable disabled /> -->
             <geographicalPosi
               style="margin: 0 20px 0 0"
               v-if="module !== 'detail' && !['cross'].includes(pageType)"
               :form-data="formData"
               @selectPosi="handleSelectPosi"
             />
-            <el-input v-model="formData.address" placeholder="请填写详细地址" size="mini" clearable />
+            <el-input v-model="formData.address" placeholder="请填写详细地址"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.address" />
+
             <i
               v-if="formData.positionAddress && !['cross'].includes(pageType)"
               class="el-icon-s-promotion"
@@ -334,7 +359,7 @@
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目类别*:</div>
           <div class="value">
-            <el-radio-group v-model="formData.projectCategory" size="mini">
+            <el-radio-group v-model="formData.projectCategory"  >
               <el-radio v-for="item in commonData.dict['TRADE_LOGIN_CATEGORY']" :key="item.value" :label="item.value">
                 {{ item.label }}
               </el-radio>
@@ -344,7 +369,7 @@
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">图纸上传:</div>
           <div class="value" style="justify-content: flex-end; position: relative">
-            <FileUpload v-if="module !== 'detail'" :file-list="formData.fileList" size="mini" :limit="1" class="file" />
+            <FileUpload v-if="module !== 'detail'" :file-list="formData.fileList"   :limit="1" class="file" />
             <el-link
               v-if="module == 'detail' && formData.fileList && formData.fileList.length"
               style="position: absolute; left: 5px"
@@ -353,13 +378,13 @@
               @click="openPdf(formData.fileList[0])"
               >{{ formData.fileList[0].name }}下载</el-link
             >
-            <!-- <el-input v-model="formData.drawUpload"  size="mini" clearable /> -->
+            <!-- <el-input v-model="formData.drawUpload"    clearable /> -->
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">类型</div>
           <div class="value">
-            <el-radio-group v-model="formData.type" size="mini">
+            <el-radio-group v-model="formData.type"  >
               <el-radio v-for="item in commonData.dict['TRADE_LOGIN_TYPE']" :key="item.value" :label="item.value">
                 {{ item.label }}
               </el-radio>
@@ -369,13 +394,15 @@
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">建筑面积㎡*:</div>
           <div class="value">
-            <el-input v-model="formData.extent" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.extent" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.extent" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">空调使用面积㎡*:</div>
           <div class="value">
-            <el-input v-model="formData.useExtent" placeholder="请填写" size="mini" clearable />
+            <el-input v-model="formData.useExtent" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.useExtent" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
@@ -391,6 +418,7 @@
             >
               <el-option v-for="item in tradeParentList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="formData.tradeParentName" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
@@ -406,12 +434,14 @@
             >
               <el-option v-for="item in tradeList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="formData.tradeName" />
           </div>
         </el-col>
         <el-col v-if="['frock', 'home'].includes(pageType)" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目性质*:</div>
           <div class="value">
             {{ pageType === 'frock' ? '工程' : '家装' }}
+            <CopyButton v-if="module !== 'add'" :copyText="pageType === 'frock' ? '工程' : '家装'" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
@@ -425,12 +455,13 @@
                 :value="item.value"
               />
             </el-select>
+            <CopyButton v-if="module !== 'add'" :copyText="getCopyText(commonData.dict['LOGIN_MACHINE_TYPE'], formData.machineType)" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">成功机率*:</div>
           <div class="value">
-            <el-radio-group v-model="formData.successRate" size="mini">
+            <el-radio-group v-model="formData.successRate"  >
               <el-radio v-for="item in commonData.dict['SUCCESS_RATE']" :key="item.value" :label="item.value">
                 {{ item.label }}
               </el-radio>
@@ -448,18 +479,19 @@
               style="width: 100%"
               placeholder="选择日期"
             />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.preSignDate" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">预计设备金额*:</div>
           <div class="value">
-            <el-input v-model="formData.preDeviceAmount" placeholder="请填写" size="mini" clearable />万
+            <el-input type="number" v-model.number="formData.preDeviceAmount" placeholder="请填写"   clearable />万
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">工程跟进状态*:</div>
           <div class="value">
-            <el-radio-group v-model="formData.status" size="mini">
+            <el-radio-group v-model="formData.status"  >
               <el-radio v-for="item in commonData.dict['FOLLOW_STATUS']" :key="item.value" :label="item.value">
                 {{ item.label }}
               </el-radio>
@@ -469,7 +501,8 @@
         <el-col v-if="['detail', 'examine'].includes(module)" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">订单状态:</div>
           <div class="value">
-            <el-input :value="orderTypeEume[formData.orderStatus]" placeholder="请填写" size="mini" clearable />
+            <el-input :value="orderTypeEume[formData.orderStatus]" placeholder="请填写"   clearable />
+            <CopyButton v-if="module !== 'add'" :copyText="orderTypeEume[formData.orderStatus]" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
@@ -482,6 +515,7 @@
               :rows="4"
               placeholder="请输入备注"
             />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.remark" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
@@ -496,6 +530,7 @@
               :rows="3"
               placeholder="请输入内容"
             />
+            <CopyButton v-if="module !== 'add'" :copyText="formData.otherInfo" />
           </div>
         </el-col>
       </el-row>
@@ -569,11 +604,27 @@ export default {
       region: {
         G: ['广州市', '清远市', '韶关市'],
         F: ['佛山市', '肇庆市', '云浮市']
+      },
+      // 特殊处理市区
+      specialCity: {
+        '1608754035946549250': '东莞市',
+        '1608754032574328834': '中山市',
+        '1608756901402767362': '儋州市',
+        '1608756898412228610': '三沙市',
+        '1608757977963163649': '嘉峪关市'
       }
     }
   },
   computed: {
-    ...mapGetters(['isTradeExaminer', 'isCustomer', 'customerNumber', 'customerId', 'customerName'])
+    ...mapGetters(['isTradeExaminer', 'isCustomer', 'customerNumber', 'customerId', 'customerName']),
+    getCopyText(){
+      return(arr = [], id = '')=>{
+          if (id && arr.length) {
+            return String(arr.find(k=>k.value===id)?.label || id)
+          }
+          return String(id)
+      }
+    }
   },
   watch: {
     async 'formData.id'(newValue, oldValue) {
@@ -621,7 +672,10 @@ export default {
         await this.getCallbackPosition(null, this.formData.provinceId, 'province', 'lbsId')
         await this.getCallbackPosition(this.formData.provinceId, this.formData.cityId, 'city', 'lbsId')
         await this.getCallbackPosition(this.formData.cityId, this.formData.areaId, 'area', 'lbsId')
-        await this.getCallbackPosition(this.formData.areaId, this.formData.streetId, 'street', 'lbsId')
+        const temp = this.areaList.find(k => this.formData.cityId == k.value)
+        if (!temp && !temp?.parentLbsId && !Object.keys(this.specialCity).includes(temp?.parentLbsId)) {
+          await this.getCallbackPosition(this.formData.areaId, this.formData.streetId, 'street', 'lbsId')
+        }
       }
     }
   },
@@ -644,21 +698,20 @@ export default {
     }
     if (this.pageType === 'home' || this.formData.orderType === 'HOME') {
       this.initTradeData('HOME')
-    }else{
+    } else {
       this.getTradeConfigList()
     }
   },
   methods: {
-    initTradeData(e){
-      if ( e === 'HOME') {
+    initTradeData(e) {
+      if (e === 'HOME') {
         this.getTradeConfigList()
         this.formData.tradeParentId = '1689529426267607042'
-      this.formData.tradeId = '1689529478943870978'
-      }else{
+        this.formData.tradeId = '1689529478943870978'
+      } else {
         this.formData.tradeParentId = ''
-      this.formData.tradeId = ''
+        this.formData.tradeId = ''
       }
-
     },
     // 获取省市区街道
     getAutonaviRegion(level = 0, id = null) {
@@ -673,7 +726,7 @@ export default {
             this.provinceList = res.data
           }
         } else if (level === 1) {
-          if (this.formData.province === '广东省') {
+          if (this.formData.province === '广东省' && ['frock', 'home'].includes(this.pageType)) {
             this.cityList = res.data.filter(k => {
               if (this.formData.projectArea) {
                 return this.region[this.formData.projectArea].includes(k.name)
@@ -691,7 +744,11 @@ export default {
       })
     },
     handleProjectArea(e) {
-      if (this.formData.provinceId && this.formData.province === '广东省') {
+      if (
+        ['frock', 'home'].includes(this.pageType) &&
+        this.formData.provinceId &&
+        this.formData.province === '广东省'
+      ) {
         this.getAutonaviRegion(1, this.formData.provinceId)
       }
     },
@@ -758,6 +815,22 @@ export default {
       this.areaValue = value
       this.formData.streetId = ''
       this.streetList = []
+      // 特殊处理市
+      const temps = this.areaList.filter(k => {
+        return k.lbsId === value
+      })
+      if (
+        value &&
+        this.areaList.length &&
+        temps.length &&
+        temps[0]?.parentLbsId &&
+        Object.keys(this.specialCity).includes(temps[0]?.parentLbsId)
+      ) {
+        this.streetList = temps
+        this.formData.streetId = value
+        this.handleArea(value, 'street')
+        return
+      }
       this.getAutonaviRegion(3, value)
       this.handleArea(value, 'area')
     },
@@ -821,10 +894,10 @@ export default {
           return
         }
         this.tradeParentList = res.data
-          const item = this.tradeParentList.find(k => k.id === this.formData.tradeParentId)
-          if (item && item.childList) {
-            this.tradeList = item.childList
-          }
+        const item = this.tradeParentList.find(k => k.id === this.formData.tradeParentId)
+        if (item && item.childList) {
+          this.tradeList = item.childList
+        }
       })
     },
     handleService(e) {
@@ -875,7 +948,10 @@ export default {
       await this.getCallbackPosition(null, province, 'province')
       await this.getCallbackPosition(this.formData.provinceId, city, 'city')
       await this.getCallbackPosition(this.formData.cityId, area, 'area')
-      await this.getCallbackPosition(this.formData.areaId, street, 'street')
+      const temp = this.areaList.find(k => this.formData.cityId == k.value)
+      if (!temp && !temp?.parentLbsId && !Object.keys(this.specialCity).includes(temp?.parentLbsId)) {
+        await this.getCallbackPosition(this.formData.areaId, street, 'street')
+      }
     },
 
     /**
@@ -888,6 +964,13 @@ export default {
       const { data } = await getAutonaviRegion({ parentLbsId: id })
       this[name + 'List'] = data
       const temp = data.find(k => k[way] == value)
+      // 特殊处理市
+      if (name === 'area' && Object.keys(this.specialCity).includes(temp.parentLbsId)) {
+        this.streetList = [temp]
+        this.formData.streetId = temp.lbsId
+        this.handleArea(temp.lbsId, 'street')
+        return
+      }
       this.formData[name] = temp && temp.name
       this.formData[name + 'Id'] = temp && temp.lbsId
     },
@@ -927,6 +1010,7 @@ export default {
 }
 .diy-table-1 .item .value {
   border-right: 1px solid #ccc;
+  justify-content: space-between;
 }
 ::v-deep .el-select {
   width: 100% !important;

+ 37 - 14
src/views/commercialEngineering/components/examine.vue

@@ -26,6 +26,7 @@
                 size="mini"
                 clearable
               >
+              <CopyButton :copyText="formData.successLoginProject" />
                 <el-button slot="append" @click="handleFocus">引入</el-button>
               </el-input>
             </el-col>
@@ -33,51 +34,62 @@
               <el-col :span="7" class="flex-box">
               <div class="flex-box-title">经销商编号</div>
               <el-input
-                v-model="formData.customerNumber2"
+                v-model="formData.successCustomerNumber"
                 class="my-input"
                 placeholder="请填写"
                 size="mini"
                 clearable
               />
+              <CopyButton :copyText="formData.successCustomerNumber" />
+
             </el-col>
             <el-col :span="7" class="flex-box">
               <div class="flex-box-title">经销商名称</div>
-              <el-input v-model="formData.customerName2" class="my-input" placeholder="请填写" size="mini" clearable />
+              <el-input v-model="formData.successCustomerName" class="my-input" placeholder="请填写" size="mini" clearable />
+              <CopyButton :copyText="formData.successCustomerName" />
+
             </el-col>
             </template>
             <el-col :span="7" class="flex-box">
               <div class="flex-box-title">业务员编号</div>
-              <el-input v-model="formData.serviceNumber2" class="my-input" placeholder="请填写" size="mini" clearable />
+              <el-input v-model="formData.successServiceNumber" class="my-input" placeholder="请填写" size="mini" clearable />
+              <CopyButton :copyText="formData.successServiceNumber" />
+
             </el-col>
             <el-col :span="7" class="flex-box">
               <div class="flex-box-title">业务员名称</div>
-              <el-input v-model="formData.serviceName2" class="my-input" placeholder="请填写" size="mini" clearable />
+              <el-input v-model="formData.successServiceName" class="my-input" placeholder="请填写" size="mini" clearable />
+              <CopyButton :copyText="formData.successServiceName" />
+
             </el-col>
           </div>
         </el-col>
         <el-col :xs="12" :sm="12" :lg="12" class="item">
           <div class="label">审核备注{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
           <div class="value">
-            <el-select v-if="!['frock', 'cross'].includes(pageType)" v-model="formData.examineNote" placeholder="请选择" size="mini" clearable style="width: 100%">
+            <!-- <el-select v-if="!['frock', 'cross'].includes(pageType)" v-model="formData.examineNote" placeholder="请选择" size="mini" clearable style="width: 100%">
               <el-option
                 v-for="item in commonData.dict['TRADE_EXAMINE_NOTE']"
                 :key="item.value"
                 :label="item.label"
                 :value="item.value"
               />
-            </el-select>
+            </el-select> -->
             <el-input
               v-model="formData.note"
               placeholder="请填写"
               size="mini"
               clearable
             />
+            <CopyButton :copyText="formData.note" />
+
           </div>
         </el-col>
         <el-col :xs="12" :sm="12" :lg="12" class="item">
           <div class="label">共同跟进项目编号</div>
           <div class="value">
             <el-input v-model="formData.commonFollowProject" placeholder="请填写" size="mini" clearable />
+            <CopyButton :copyText="formData.commonFollowProject" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
@@ -200,10 +212,10 @@ export default {
     handleSuccess(val) {
       const res = val[0]
       this.formData.successLoginProject = res.projectNo
-      this.formData.customerNumber2 = res.customerNumber
-      this.formData.customerName2 = res.customerName
-      this.formData.serviceName2 = res.serviceName
-      this.formData.serviceNumber2 = res.serviceNumber
+      this.formData.successCustomerNumber = res.customerNumber
+      this.formData.successCustomerName = res.customerName
+      this.formData.successServiceName = res.serviceName
+      this.formData.successServiceNumber = res.serviceNumber
     },
     handleCancel() {
       this.showDialog = false
@@ -263,10 +275,21 @@ export default {
       }
       objFn[this.pageType](params).then(res => {
         if (res.data.records && res.data.records.length) {
-          this.formData.customerNumber2 = res.data.records[0].customerNumber
-          this.formData.customerName2 = res.data.records[0].customerName
-          this.formData.serviceName2 = res.data.records[0].serviceName
-          this.formData.serviceNumber2 = res.data.records[0].serviceNumber
+          if(!this.formData.successCustomerNumber){
+            this.formData.successCustomerNumber =  res.data.records[0].customerNumber
+          }
+          if (!this.formData.successCustomerName) {
+            this.formData.successCustomerName =  res.data.records[0].customerName
+
+          }
+          if (!this.formData.successServiceName) {
+            this.formData.successServiceName =  res.data.records[0].serviceName
+
+          }
+          if (!this.formData.successServiceNumber) {
+            this.formData.successServiceNumber =  res.data.records[0].serviceNumber
+
+          }
         }
       })
     }

+ 24 - 47
src/views/commercialEngineering/components/model.vue

@@ -170,56 +170,28 @@ export default {
             label: '物料名称*',
             prop: 'materialName'
           },
-          // render: (h, { row, column, index }) => {
-          //   return (
-          //     <el-select
-          //       value={row.materialName}
-          //       clearable
-          //       style="width: 100%;padding: 5px;"
-          //       onInput={e => (row.materialName = e)}
-          //       onChange={e => this.setCheckeData(e, row)}
-          //       filterable
-          //       size="mini"
-          //       remote
-          //       reserve-keyword
-          //       placeholder="请输入物料名称"
-          //       remote-method={e => this.remoteMethod(e, 'name')}
-          //       loading={this.loading}
-          //     >
-          //       {this.k3List.map(k => {
-          //         return <el-option key={k.id} label={k.name} value={k.id}></el-option>
-          //       })}
-          //     </el-select>
-          //   )
-          // }
+          render: (h, { row, column, index }) => {
+            return (
+              <div style="display:flex;justify-content: space-between;align-items: center;">
+              <div> {row.materialName}</div>
+              <CopyButton copyText={row.materialName} />
+            </div>
+            )
+          }
         },
         {
           columnAttributes: {
             label: '规格型号*',
             prop: 'specification'
           },
-          // render: (h, { row, column, index }) => {
-          //   return (
-          //     <el-select
-          //       value={row.specification}
-          //       clearable
-          //       style="width: 100%;padding: 5px;"
-          //       onInput={e => (row.specification = e)}
-          //       onChange={e => this.setCheckeData(e, row)}
-          //       filterable
-          //       size="mini"
-          //       remote
-          //       reserve-keyword
-          //       placeholder="请输入规格型号"
-          //       remote-method={e => this.remoteMethod(e, 'specification')}
-          //       loading={this.loading}
-          //     >
-          //       {this.k3List.map(k => {
-          //         return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
-          //       })}
-          //     </el-select>
-          //   )
-          // }
+          render: (h, { row, column, index }) => {
+            return (
+             <div style="display:flex;justify-content: space-between;align-items: center;">
+              <div> {row.specification}</div>
+              <CopyButton copyText={row.specification} />
+             </div>
+            )
+          }
         },
         {
           columnAttributes: {
@@ -228,14 +200,19 @@ export default {
           },
           render: (h, { row, column, index }) => {
             return (
-              <el-input
-                style="padding: 5px;"
+             <div>
+               <el-input
+                style="padding: 5px;width:90%"
                 value={row.itemRemark}
                 onInput={e => (row.itemRemark = e)}
                 placeholder="请输入备注"
                 size="mini"
                 clearable
-              ></el-input>
+              >
+              </el-input>
+              <CopyButton copyText={row.itemRemark} />
+
+             </div>
             )
           }
         },

+ 1 - 1
src/views/commercialEngineering/crossDistrict/crossDistrictkList.vue

@@ -217,7 +217,7 @@ export default {
                 申请修改
               </el-button>
             ) : null}
-            {this.isTradeExaminer && (row.orderStatus === 'WAIT' || row.orderStatus === 'OK' || row.orderStatus === 'FAIL') ? (
+            {this.isTradeExaminer && row.orderStatus !== 'SAVE' ? (
               <el-button
                 size='mini'
                 type='text'

+ 4 - 0
src/views/commercialEngineering/crossDistrict/examine.vue

@@ -65,7 +65,11 @@ export default {
         return
       }
 
+<<<<<<< HEAD
       if (params.loginStatus === 'REJECT' && !params.examineNote && !params.note) {
+=======
+      if (params.loginStatus === 'REJECT' && !params.note) {
+>>>>>>> sync_supply_front_master
         this.$errorMsg('请填写审核备注')
         return
       }

+ 1 - 1
src/views/commercialEngineering/frock/examine.vue

@@ -63,7 +63,7 @@ export default {
         return
       }
 
-      if (params.loginStatus === 'REJECT' && !params.examineNote) {
+      if (params.loginStatus === 'REJECT' && !params.note) {
         this.$errorMsg('请填写审核备注')
         return
       }

+ 1 - 1
src/views/commercialEngineering/frock/frockList.vue

@@ -216,7 +216,7 @@ export default {
                 申请修改
               </el-button>
             ) : null}
-            {this.isTradeExaminer && (row.orderStatus === 'WAIT' || row.orderStatus === 'OK' || row.orderStatus === 'FAIL') ? (
+            {this.isTradeExaminer && row.orderStatus !== 'SAVE'  ? (
               <el-button
                 size='mini'
                 type='text'

+ 4 - 4
src/views/commercialEngineering/homeDecoration/examine.vue

@@ -6,8 +6,8 @@
     </el-radio-group>
     <div v-show="current === 'detail'">
       <el-form disabled>
-        <Base :form-data="formData" page-type="frock" :module="module" :common-data="commonData" />
-        <Model :form-data="formData" page-type="frock" :module="module" :common-data="commonData" />
+        <Base :form-data="formData" page-type="home" :module="module" :common-data="commonData" />
+        <Model :form-data="formData" page-type="home" :module="module" :common-data="commonData" />
       </el-form>
       <Examine :form-data="formData" page-type="home" :module="module" :common-data="commonData" />
       <div style="margin: 20px 0">
@@ -64,7 +64,7 @@ export default {
         return
       }
 
-      if (params.loginStatus === 'REJECT' && !params.examineNote) {
+      if (params.loginStatus === 'REJECT' &&  !params.note) {
         this.$errorMsg('请填写审核备注')
         return
       }
@@ -82,7 +82,7 @@ export default {
             params.homeProjectNameNumber +
             '号',
           SELF: params.homeProjectNameArea2 + '(业主名称)自建房',
-          VILLA: params.homeProjectNameArea3 + '小区' + params.homeProjectNameNumber3 + '号'
+          VILLA: params.homeProjectNameArea3 + '小区' + params.homeProjectNameNumber3 + '号别墅'
         }[params.homeProjectNameRadio]
       }
       if (params.homeProjectNameRadio === 'SELF') {

+ 1 - 1
src/views/commercialEngineering/homeDecoration/homeDecorationForm.vue

@@ -35,7 +35,7 @@ export default {
         params.projectName = {
           'AREA': params.homeProjectNameArea + '小区' + params.homeProjectNameSeat + '座' + params.homeProjectNameNumber + '号',
           'SELF': params.homeProjectNameArea2 + '(业主名称)自建房',
-          'VILLA': params.homeProjectNameArea3 + '小区' + params.homeProjectNameNumber3 + '号'
+          'VILLA': params.homeProjectNameArea3 + '小区' + params.homeProjectNameNumber3 + '号别墅'
         }[params.homeProjectNameRadio]
       }
       if (params.homeProjectNameRadio === 'SELF') {

+ 1 - 31
src/views/commercialEngineering/homeDecoration/homeDecorationList.vue

@@ -135,36 +135,6 @@ export default {
                     }
                   }
                 ]
-              ],
-              [
-                [
-                  {
-                    name: '删除',
-                    click: () => {
-                      if (this.recordSelected.length === 0) {
-                        this.$message.error('请选择需要删除的数据')
-                        return
-                      }
-                      if(!this.isTradeExaminer){
-                        for (let index = 0; index < this.recordSelected.length; index++) {
-                        if (this.recordSelected[index].orderStatus !== '保存') {
-                          this.$message.error('请选择保存的数据')
-                          return
-                        }
-                      }
-                      }
-                      // for (let index = 0; index < this.recordSelected.length; index++) {
-                      //   if (this.recordSelected[index].orderStatus !== '已审核') {
-                      //     this.$message.error('请选择审核通过的数据')
-                      //     return
-                      //   }
-                      // }
-                      this.operateType = 'delete'
-                      this.operateTitle = '删除'
-                      this.operateVisible = true
-                    }
-                  }
-                ]
               ]
             ]
             : []
@@ -253,7 +223,7 @@ export default {
                 申请修改
               </el-button>
             ) : null}
-            {this.isTradeExaminer && (row.orderStatus === 'WAIT' || row.orderStatus === 'OK' || row.orderStatus === 'FAIL') ? (
+            {this.isTradeExaminer && row.orderStatus !== 'SAVE' ? (
               <el-button
                 size='mini'
                 type='text'

+ 10 - 13
src/views/commercialEngineering/mixin/index.js

@@ -1,5 +1,5 @@
 import { getCommercialEngineeringDetail, getPositionProject } from '@/api/frock'
-import { getDictList, getSalesmanList } from '@/api/common'
+import { getDictList, getSalesmanListService } from '@/api/common'
 import { getDealerListV2 } from '@/api/basic_data/dealer'
 import { getFirstPartyCustomerManagementList } from '@/api/basic_data/partya'
 import { mapGetters } from 'vuex'
@@ -104,7 +104,11 @@ export default {
         serviceName2: '',
         customerNumber2: '',
         customerName2: '',
-        joinAddress: ''
+        joinAddress: '',
+        successServiceNumber: '',
+        successServiceName: '',
+        successCustomerNumber: '',
+        successCustomerName: '',
       },
       commonData: {
         dict: {
@@ -132,7 +136,7 @@ export default {
     }
     this.getDictList()
     this.getDealerListV2()
-    this.getSalesmanList()
+    this.getSalesmanListService()
     this.getFirstPartyCustomerManagementList()
     if (this.detailId) {
       this.getCommercialEngineeringDetail()
@@ -150,8 +154,8 @@ export default {
         })
       })
     },
-    getSalesmanList() {
-      getSalesmanList({
+    getSalesmanListService() {
+      getSalesmanListService({
         pageNum: 1,
         pageSize: -1,
         isCustomer: 0,
@@ -179,14 +183,7 @@ export default {
     getDealerListV2() {
       getDealerListV2({
         pageNum: 1,
-        pageSize: -1,
-        params: [
-          {
-            param: 'a.jiaxian_type',
-            compare: '=',
-            value: 'KING'
-          }
-        ]
+        pageSize: -1
       }).then(res => {
         this.commonData.customerList = res.data.records.map(k => {
           return {

+ 1 - 1
src/views/deposit_home/components/deposit-apply-surrender.vue

@@ -333,7 +333,7 @@
               {{ scope.row.depositAmount | numToFixed }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="上交资料" prop="dataQty" min-width="160" show-overflow-tooltip>
+          <el-table-column align="center" label="上交资料数量" prop="dataQty" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input
                 v-model.number="scope.row.dataQty"

+ 9 - 12
src/views/deposit_home/components/refund_list-detail.vue

@@ -447,14 +447,13 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <div
+                <!-- <div
                   v-if="title=='详情' && detailList.examineStatus !== 'OK'"
                   :class="setColour(scope.row,'specification', 'realSpecification', 'depositSpecification')"
                 >
                   {{ scope.row.depositSpecification }}
-                </div>
+                </div> -->
                 <el-input
-                  v-else
                   v-model="scope.row.depositSpecification"
                   :class="setColour(scope.row,'specification', 'realSpecification', 'depositSpecification')"
                   size="mini"
@@ -471,14 +470,13 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <div
+                <!-- <div
                   v-if="title=='详情'&& detailList.examineStatus !== 'OK'"
                   :class="setColour(scope.row,'materialNumber', 'realMaterialNumber', 'depositMaterialNumber')"
                 >
                   {{ scope.row.depositMaterialNumber }}
-                </div>
+                </div> -->
                 <el-input
-                  v-else
                   v-model="scope.row.depositMaterialNumber"
                   :class="setColour(scope.row,'materialNumber', 'realMaterialNumber', 'depositMaterialNumber')"
                   size="mini"
@@ -495,14 +493,13 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <div
+                <!-- <div
                   v-if="title=='详情'&& detailList.examineStatus !== 'OK'"
                   :class="setColour(scope.row,'materialOldNumber', 'realMaterialOldNumber', 'depositMaterialOldNumber')"
                 >
                   {{ scope.row.depositMaterialOldNumber }}
-                </div>
+                </div> -->
                 <el-input
-                  v-else
                   v-model="scope.row.depositMaterialOldNumber"
                   :class="setColour(scope.row,'materialOldNumber', 'realMaterialOldNumber', 'depositMaterialOldNumber')"
                   size="mini"
@@ -576,7 +573,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column align="right" label="上交资料" prop="dataQty" min-width="160" show-overflow-tooltip>
+            <el-table-column align="right" label="上交资料数量" prop="dataQty" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input
                   v-if="title !== '详情'"
@@ -1360,7 +1357,7 @@ export default {
           }
 
           if (!this.detailList.items.every(e => e.dataQty)) {
-            this.$confirm(`上交资料为0,是否继续提交`, '提示', {
+            this.$confirm(`上交资料数量为0,是否继续提交`, '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'
@@ -1466,7 +1463,7 @@ export default {
           }
 
           if (!this.detailList.items.every(e => e.dataQty)) {
-            this.$confirm(`上交资料为0,是否继续提交`, '提示', {
+            this.$confirm(`上交资料数量为0,是否继续提交`, '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'

+ 1 - 1
src/views/deposit_home/components/refund_reexamine.vue

@@ -562,7 +562,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column align="right" label="上交资料" prop="dataQty" min-width="160" show-overflow-tooltip>
+            <el-table-column align="right" label="上交资料数量" prop="dataQty" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input
                   v-if="title !== '详情'"

+ 3 - 3
src/views/deposit_home/components/refund_replenish.vue

@@ -562,7 +562,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column align="right" label="上交资料" prop="dataQty" min-width="160" show-overflow-tooltip>
+            <el-table-column align="right" label="上交资料数量" prop="dataQty" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input
                   v-if="title !== '详情'"
@@ -1255,7 +1255,7 @@ export default {
           }
 
           if (!this.detailList.items.every(e => e.dataQty)) {
-            this.$confirm(`上交资料为0,是否继续提交`, '提示', {
+            this.$confirm(`上交资料数量为0,是否继续提交`, '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'
@@ -1361,7 +1361,7 @@ export default {
           }
 
           if (!this.detailList.items.every(e => e.dataQty)) {
-            this.$confirm(`上交资料为0,是否继续提交`, '提示', {
+            this.$confirm(`上交资料数量为0,是否继续提交`, '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'

+ 916 - 357
src/views/setting/account.vue

@@ -1,40 +1,96 @@
 <template>
   <div class="app-container">
-    <div class="setting_title">用户管理</div>
-    <el-divider />
-
+    <div class="tree-container">
+      <div style="padding: 10px; display: flex">
+        <el-button
+          icon="el-icon-refresh-right"
+          size="small"
+          style="padding: 9px 10px; margin-right: 6px"
+          @click="refreshDepartment()"
+        />
+        <el-input v-model="filterText" placeholder="输入关键字进行过滤" size="small" clearable />
+      </div>
+      <el-tree
+        ref="listTree"
+        :data="departmentList"
+        :props="defaultProps"
+        default-expand-all
+        highlight-current
+        :expand-on-click-node="false"
+        :filter-node-method="filterNode"
+        node-key="id"
+        @node-click="handleNodeClick"
+      >
+        <div slot-scope="{ node, data }" class="custom-tree-node">
+          <i
+            :class="data.children && data.children.length > 0 ? 'el-icon-folder-opened' : 'el-icon-document-remove'"
+          /><span>{{ node.label }}</span>
+        </div>
+      </el-tree>
+    </div>
     <div class="mymain-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="150px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="8">
-                <el-form-item label="账号/用户名名称:" prop="userName">
-                  <el-input v-model="screenForm.userName" placeholder="请输入账号/用户名名称" />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-      <div class="btn-group clearfix">
+      <div class="screen-container">
+        <!-- <div class="top clearfix">
+          <div class="title fl">条件筛选</div>
+        </div> -->
+        <Collapse :screen-form="screenForm">
+          <template #right_btn>
+            <el-button size="mini" @click="resetScreenForm">清空</el-button>
+            <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
+          </template>
+          <template #search>
+            <el-form ref="screenForm" :model="screenForm" label-width="150px" size="mini" label-position="left">
+              <el-row :gutter="20">
+                <el-col :xs="24" :sm="12" :lg="8">
+                  <el-form-item label="账号/用户名名称:" prop="name">
+                    <el-input v-model="screenForm.name" placeholder="请输入账号/用户名名称" />
+                  </el-form-item>
+                </el-col>
+                <el-col :xs="24" :sm="12" :lg="8">
+                  <el-form-item label="角色:" prop="roleId">
+                    <el-select v-model="screenForm.roleId" class="selectStyle" placeholder="请选择" filterable>
+                      <el-option v-for="(v, i) in roleList" :key="i" :label="v.name" :value="v.adminRoleId" />
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </template>
+        </Collapse>
+      </div>
+      <div class="btn-group clearfix" style="margin-top: 20px">
         <div class="fl">
-          <el-button
-            v-if="checkBtnRole('add')"
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            @click="addOrEdit('add')"
-            >新增账号</el-button
+          <el-button size="mini" type="primary" @click="openAccountForm('add')">添加账号</el-button>
+        </div>
+        <div class="fr">
+          <el-button v-if="checkBtnRole('download')" size="mini" @click="handleDownload">下载导入模板</el-button>
+          <ExportButton class="import-btn" :ex-url="'admin/user/user/listExport'" :ex-params="exParams" />
+          <ImportButton
+            class="import-btn"
+            im-text="批量变更仓库和产品分类"
+            :im-url="'admin/user/batch/update'"
+            @importSuccess="getList"
+          />
+
+          <el-upload
+            v-if="checkBtnRole('import')"
+            class="import-btn"
+            action=""
+            :http-request="handleImport"
+            :file-list="importFileList"
+            :show-file-list="false"
           >
+            <!-- v-if="checkBtnRole('import')" -->
+            <el-button size="mini" type="primary" :loading="importLoading">{{
+              importLoading ? '导入中...' : '导入'
+            }}</el-button>
+          </el-upload>
+          <!--/admin/user/batch/update
+          <el-button size="small" type="primary" @click="handleExport">导出</el-button>
+
+          <el-button size="small" type="primary" :loading="importLoading" @click="clickImport">{{ importLoading ? '导入中...' : '导入' }}</el-button>
+-->
         </div>
-        <!--        <div class="fr">-->
-        <!--          <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />-->
-        <!--        </div>-->
       </div>
 
       <div class="table">
@@ -47,29 +103,98 @@
           highlight-current-row
           stripe
         >
-          <el-table-column align="left" label="序号" type="index" width="50" />
-          <el-table-column align="left" label="账号" prop="userName" />
-          <el-table-column align="left" label="账号名称" prop="nickName" />
-          <el-table-column align="left" label="创建时间" prop="createTime" />
-          <el-table-column align="left" label="最后登录时间" prop="lastLoginTime" />
-          <el-table-column align="left" label="主帐号" prop="isMaster">
+          <!-- <el-table-column align="center" type="selection" width="55" fixed></el-table-column> -->
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="账号"
+            prop="userName"
+            min-width="120"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="用户名"
+            prop="nickName"
+            min-width="160"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="角色"
+            prop="roleName"
+            min-width="100"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="修改人"
+            prop="updateBy"
+            min-width="160"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="修改时间"
+            prop="updateTime"
+            min-width="160"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="创建时间"
+            prop="createTime"
+            min-width="160"
+          />
+          <el-table-column
+            show-overflow-tooltip
+            align="center"
+            label="最后登录时间"
+            prop="lastLoginTime"
+            min-width="160"
+          />
+          <el-table-column show-overflow-tooltip align="center" label="状态" class-name="status-col">
             <template slot-scope="scope">
-              <el-tag v-if="scope.row.isMaster" type="success">是</el-tag>
-              <el-tag v-else type="danger">否</el-tag>
+              <el-tag size="mini" :type="scope.row.status ? 'success' : 'danger'">{{
+                scope.row.status ? '正常' : '冻结'
+              }}</el-tag>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="操作" width="180">
+          <el-table-column align="center" label="操作" min-width="160">
             <template slot-scope="scope">
-              <el-button type="text" @click="addOrEdit('edit', scope.row)">编辑</el-button>
-              <el-button type="text" @click="addOrEdit('password', scope.row)">重置密码</el-button>
-              <el-popconfirm title="确定删除吗?" @onConfirm="handleDel(scope.row)">
-                <el-button slot="reference" type="text" size="mini"> 删除 </el-button>
-              </el-popconfirm>
-              <!-- <el-button
-                v-if="checkBtnRole('detail')"
+              <template v-if="checkBtnRole('status')">
+                <el-popconfirm
+                  v-if="scope.row.status"
+                  style="margin-right: 10px"
+                  title="确定冻结吗?"
+                  @onConfirm="changeStatus(scope.row.adminUserId, 0)"
+                >
+                  <el-button slot="reference" type="text">冻结</el-button>
+                </el-popconfirm>
+                <el-popconfirm
+                  v-else
+                  style="margin-right: 10px"
+                  title="确定恢复吗?"
+                  @onConfirm="changeStatus(scope.row.adminUserId, 1)"
+                >
+                  <el-button slot="reference" type="text">恢复</el-button>
+                </el-popconfirm>
+              </template>
+
+              <el-button
+                v-if="checkBtnRole('edit')"
                 type="text"
-                @click="setMenuRole(scope.row.adminUserId, 'role')"
-              >设置权限</el-button> -->
+                @click="openAccountForm('edit', scope.row.adminUserId)"
+              >编辑</el-button>
+              <el-button
+                v-if="checkBtnRole('reset')"
+                type="text"
+                @click="handleReset(scope.row.adminUserId)"
+              >重置密码</el-button>
+
+              <!-- <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="deleteAccount(scope.row.id)" v-if="checkBtnRole('del')">
+                <el-button slot="reference" type="text">删除</el-button>
+              </el-popconfirm> -->
             </template>
           </el-table-column>
         </el-table>
@@ -90,180 +215,375 @@
       </div>
     </div>
 
-    <!-- 设置权限 -->
+    <!-- 添加编辑账号 -->
     <el-dialog
-      title="设置权限"
-      :visible.sync="roleFormVisible"
+      :title="AccountFormType == 'add' ? '添加账号' : '编辑账号'"
+      :visible.sync="AccountFormVisible"
       :show-close="false"
       width="40%"
       :close-on-click-modal="false"
-      custom-class="tree-dialog"
-      top="50px"
     >
-      <el-tree
-        ref="tree"
-        :data="menuRoleList"
-        show-checkbox
-        :check-strictly="true"
-        :default-expand-all="true"
-        :expand-on-click-node="false"
-        node-key="moduleId"
-        highlight-current
-        :props="defaultProps"
+      <el-form
+        ref="AccountForm"
+        :model="AccountForm"
+        :rules="AccountFormRules"
+        label-position="left"
+        label-width="100px"
       >
-        <span slot-scope="{ node, data }" class="custom-tree-node">
-          <span>{{ node.label }}</span>
-          <span v-if="data.type < 3">
-            <el-button type="text" size="mini" @click="() => quickSelection(data)">一键全选</el-button>
-            <el-button type="text" size="mini" style="color: #f56c6c" @click="() => quickCancel(data)"
-              >一键取消</el-button
-            >
+        <el-form-item label="账号" prop="account">
+          <el-input v-model="AccountForm.account" autocomplete="off" placeholder="请输入账号" />
+        </el-form-item>
+        <el-form-item label="用户名" prop="nickName">
+          <el-input v-model="AccountForm.nickName" autocomplete="off" placeholder="请输入用户名" />
+        </el-form-item>
+
+        <el-form-item label="角色组" prop="role">
+          <el-select v-model="AccountForm.role" placeholder="请选择角色组" style="width: 100%" filterable>
+            <el-option
+              v-for="(item, index) in roleList"
+              :key="index"
+              :label="item.name"
+              :value="item.adminRoleId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-show="roleObj.type === 0" label="部门" prop="department">
+          <el-tree
+            ref="tree"
+            :data="departmentList"
+            show-checkbox
+            :check-strictly="true"
+            node-key="adminWebsitId"
+            highlight-current
+            :props="props"
+          />
+        </el-form-item>
+        <el-form-item v-show="roleObj.type === 0 && roleObj.name === '经销商'" label="经销商" prop="dealer">
+          <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%" filterable>
+            <el-option v-for="(item, index) in dealerList" :key="index" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-show="roleObj.type === 1 || roleObj.type === 2" label="商户" prop="merchant">
+          <el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%" filterable>
+            <el-option
+              v-for="(item, index) in merchantList"
+              :key="index"
+              :label="item.adminCompanyName"
+              :value="item.adminCompanyId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-show="roleObj.type === 0 && roleObj.name === '经销商'" label="集团公司" prop="isGroup">
+          <el-radio-group v-model="AccountForm.isGroup">
+            <el-radio :label="true">是</el-radio>
+            <el-radio :label="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          v-show="roleObj.type === 0 && roleObj.name === '经销商' && !AccountForm.isGroup"
+          label="所属集团"
+          prop="company"
+        >
+          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%" filterable>
+            <el-option v-for="(item, index) in groupList" :key="index" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-show="roleObj.type === 0 && roleObj.name === '经销商'" label="是否折让" prop="isDiscount">
+          <el-radio-group v-model="AccountForm.isDiscount">
+            <el-radio :label="true">是</el-radio>
+            <el-radio :label="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item v-if="AccountFormType == 'add'" label="密码" prop="newPassword">
+          <el-input
+            ref="password1"
+            v-model="AccountForm.newPassword"
+            autocomplete="off"
+            placeholder="请输入密码"
+            :type="passwordType1"
+          />
+          <span class="show-pwd" @click="showPwd(1)">
+            <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
           </span>
-        </span>
-      </el-tree>
+        </el-form-item>
+        <el-form-item v-if="AccountFormType == 'add'" label="确认密码" prop="confirmPassword">
+          <el-input
+            ref="password2"
+            v-model="AccountForm.confirmPassword"
+            autocomplete="off"
+            placeholder="请再次输入密码"
+            :type="passwordType2"
+          />
+          <span class="show-pwd" @click="showPwd(2)">
+            <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
+          </span>
+        </el-form-item>
+        <el-form-item label="可用仓库" prop="correspondIds">
+          <el-select
+            v-model="AccountForm.correspondIds"
+            multiple
+            placeholder="请选择可用仓库"
+            style="width: 100%"
+            filterable
+          >
+            <el-option v-for="(item, index) in stockList" :key="index" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="物料分类" prop="k3CategoryIds">
+          <el-select
+            v-model="AccountForm.k3CategoryIds"
+            multiple
+            placeholder="请选择物料分类"
+            style="width: 100%"
+            filterable
+          >
+            <el-option
+              v-for="(item, index) in categoryList"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="roleObj.name === '经销商'" label="商用经销商" prop="isShangyong">
+          <el-radio-group v-model="AccountForm.isShangyong" size="mini">
+            <el-radio v-for="item in [{label:'是',value:true},{label:'否', value:false}]" :key="item.value" :label="item.value">
+              {{item.label}}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="roleFormVisible = false">{{ editId != 1 ? '取 消' : '关 闭' }}</el-button>
-        <el-button v-if="editId != 1" type="primary" @click="submitRoleForm('role')">确 定</el-button>
+        <el-button @click="cancelAccountForm">取 消</el-button>
+        <el-button type="primary" @click="submitAccountForm">确 定</el-button>
       </div>
     </el-dialog>
+
+    <!-- 重置密码 -->
     <el-dialog
-      :visible.sync="dialogVisible"
+      title="重置密码"
+      :visible.sync="resetFormVisible"
+      :show-close="false"
+      width="40%"
       :close-on-click-modal="false"
-      width="45%"
-      :title="'add' === addFormType ? '新增' : '修改'"
-      @close="cancelAddForm"
     >
-      <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="140px" class="demo-ruleForm">
-        <el-form-item label="账号" prop="account">
-          <el-input v-model="ruleForm.account" type="text" autocomplete="off" disabled placeholder="系统自动生成" />
+      <el-form ref="resetForm" :model="resetForm" :rules="resetFormRules" label-position="left" label-width="100px">
+        <el-form-item label="输入新密码" prop="newPassword">
+          <el-input
+            ref="password1"
+            v-model="resetForm.newPassword"
+            autocomplete="off"
+            placeholder="请输入新密码"
+            :type="passwordType1"
+          />
+          <span class="show-pwd" @click="showPwd(1)">
+            <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
+          </span>
         </el-form-item>
-        <template v-if="addFormType !== 'password'">
-          <el-form-item label="工装登录名额限制" prop="workLoginLimit">
-            <el-input
-              type="number"
-              v-model.number="ruleForm.workLoginLimit"
-              autocomplete="off"
-              placeholder="请输入工装登录名额限制"
-            />
-          </el-form-item>
-          <el-form-item label="家装登录名额限制" prop="homeLoginLimit">
-            <el-input
-              type="number"
-              v-model.number="ruleForm.homeLoginLimit"
-              autocomplete="off"
-              placeholder="请输入家装登录名额限制"
-            />
-          </el-form-item>
-          <el-form-item label="跨区登录名额限制" prop="spanLoginLimit">
-            <el-input
-              type="number"
-              v-model.number="ruleForm.spanLoginLimit"
-              autocomplete="off"
-              placeholder="请输入跨区登录名额限制"
-            />
-          </el-form-item>
-          <el-form-item label="上级经销商" prop="parentId">
-            <el-select
-              v-model="ruleForm.parentId"
-              placeholder="请选择上级经销商"
-              :disabled="addFormType === 'edit'"
-              filterable
-              style="width: 100%"
-            >
-              <el-option v-for="item in subCustomerList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="子经销商名称" prop="nickName">
-            <el-input v-model="ruleForm.nickName" autocomplete="off" placeholder="请输入子经销商名称" />
-          </el-form-item>
-        </template>
-        <el-form-item v-if="addFormType !== 'edit'" label="密码" prop="password">
-          <el-input v-model="ruleForm.password" type="password" autocomplete="off" placeholder="请输入密码" />
+        <el-form-item label="确认密码" prop="confirmPassword">
+          <el-input
+            ref="password2"
+            v-model="resetForm.confirmPassword"
+            autocomplete="off"
+            placeholder="请再次输入新密码"
+            :type="passwordType2"
+          />
+          <span class="show-pwd" @click="showPwd(2)">
+            <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
+          </span>
         </el-form-item>
       </el-form>
-
-      <span slot="footer" class="dialog-footer">
-        <!--        <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>-->
-        <el-button @click="cancelAddForm">取 消</el-button>
-        <el-button type="primary" @click="submitAddForm">确 定</el-button>
-      </span>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelResetForm">取 消</el-button>
+        <el-button type="primary" @click="submitResetForm">确 定</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import { getDealerListV2 } from '@/api/basic_data/dealer'
 import {
-  addEngineeringUser,
-  deleteRole,
-  editRole,
-  getEngineeringUserList,
-  getMenuList,
-  getRoleChecked,
-  setMenuRole,
-  editSubAccount,
-  editEngineeringUser,
-  getDetailGongCheng,
-  delUserGongCheng
+  getStockListStock,
+  getDepartmentList,
+  getAccountList,
+  addAccount,
+  editAccount,
+  deleteAccount,
+  getAccountDetail,
+  getRoleList,
+  getMerchantList,
+  changeAccountStatus,
+  resetPassword
 } from '@/api/setting'
+import { getDealerList, getCategoryList } from '@/api/common'
+import { findElem, downloadFiles, handleImportTwo } from '@/utils/util'
 
 export default {
   data() {
+    var validatePass = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请输入新密码'))
+      } else if (value && value.length < 6) {
+        callback(new Error('密码长度至少6位'))
+      } else {
+        if (this.resetForm.confirmPassword !== '') {
+          this.$refs.resetForm.validateField('confirmPassword')
+        }
+        callback()
+      }
+    }
+    var validatePass2 = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请再次输入密码'))
+      } else if (value !== this.resetForm.newPassword) {
+        callback(new Error('两次输入密码不一致'))
+      } else {
+        callback()
+      }
+    }
+    var validatePass3 = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请输入新密码'))
+      } else if (value && value.length < 6) {
+        callback(new Error('密码长度至少6位'))
+      } else {
+        if (this.AccountForm.confirmPassword !== '') {
+          this.$refs.AccountForm.validateField('confirmPassword')
+        }
+        callback()
+      }
+    }
+    var validatePass4 = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请再次输入密码'))
+      } else if (value !== this.AccountForm.newPassword) {
+        callback(new Error('两次输入密码不一致'))
+      } else {
+        callback()
+      }
+    }
+    var validateName = (rule, value, callback) => {
+      if (!/^[A-Za-z0-9]+$/.test(value)) {
+        callback(new Error('帐号只能用英文字母和数字组成'))
+      } else {
+        callback()
+      }
+    }
     return {
-      imageURL: this.$imageUrl,
+      stockList: [], // 仓库列表
+      baseURL: process.env.VUE_APP_BASE_API,
       dataList: null, // 列表数据
+      moduleList: null, // 模块列表
       listLoading: true, // 列表加载loading
+      screenForm: {
+        // 筛选表单数据
+        name: '', // 名称
+        roleId: ''
+      },
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
-
-      editId: null,
-      addFormType: 'add',
-      addFormVisible: false,
-      addForm: {
-        name: '' // 角色名
+      selectDepartment: null, // 选中的部门
+      isCollapse: true,
+      AccountFormType: 'add',
+      AccountFormVisible: false,
+      AccountForm: {
+        account: '', // 账号
+        nickName: '', // 用户名
+        merchant: '', // 商户
+        dealer: '', // 经销商
+        role: '', // 角色组
+        correspondIds: [], // 仓库
+        isGroup: false,
+        company: '',
+        isDiscount: true,
+        newPassword: '', // 新密码
+        confirmPassword: '', // 确认密码
+        k3CategoryIds: [],
+        isShangyong: false, // 是否商用经销商
       },
-      addFormRules: {
-        name: [{ required: true, message: '请输入角色名', trigger: 'blur' }]
+      AccountFormRules: {
+        account: [{ required: true, validator: validateName, trigger: 'blur' }],
+        nickName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
+        role: [{ required: true, message: '请选择角色组', trigger: 'change' }],
+        correspondIds: [{ required: true, message: '请选择可用仓库', trigger: 'change' }],
+        isShangyong: [{ required: true, message: '请选择商用经销商', trigger: 'change' }],
+        newPassword: [{ required: true, validator: validatePass3, trigger: 'blur' }],
+        confirmPassword: [{ required: true, validator: validatePass4, trigger: 'blur' }]
       },
-
-      roleFormVisible: false,
-
-      menuRoleList: [],
+      editAccountId: null,
+      categoryList: [],
+      filterText: '',
+      departmentList: [],
       defaultProps: {
         children: 'children',
-        label: 'moduleName'
+        label: 'name'
       },
-      dialogVisible: false,
-      ruleForm: {
-        account: '',
-        password: '',
-        parentId: '',
-        nickName: '',
-        spanLoginLimit: 5,
-        homeLoginLimit: 5,
-        workLoginLimit: 5
+      props: {
+        multiple: true,
+        value: 'adminWebsitId',
+        label: 'name',
+        children: 'children'
+      },
+
+      tableSelection: [],
+
+      importLoading: false, // 导入加载loading
+      importFileList: [], // 导入列表
+
+      resetId: null,
+      resetFormVisible: false,
+      resetForm: {
+        newPassword: '', // 新密码
+        confirmPassword: '' // 确认密码
       },
-      rules: {
-        password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
-        parentId: [{ required: true, message: '请选择上级经销商', trigger: 'change' }],
-        nickName: [{ required: true, message: '请输入子经销商名称', trigger: 'blur' }]
+      resetFormRules: {
+        newPassword: [{ required: true, validator: validatePass, trigger: 'blur' }],
+        confirmPassword: [{ required: true, validator: validatePass2, trigger: 'blur' }]
       },
-      subCustomerList: [],
-      screenForm: {
-        // 筛选表单数据
-        userName: '' // 名称
-      }
+
+      roleList: [], // 角色列表
+      roleObj: {}, // 选中的角色
+      merchantList: [],
+      dealerList: [],
+      groupList: [],
+
+      passwordType1: 'password',
+      passwordType2: 'password'
     }
   },
   computed: {
-    ...mapGetters(['userid', 'name', 'parentId'])
+    exParams() {
+      return {
+        userName: this.screenForm.name,
+        roleId: this.screenForm.roleId,
+        isMaster: true
+      }
+    }
   },
-  created() {
+  watch: {
+    filterText(val) {
+      this.$refs.listTree.filter(val)
+    },
+    'AccountForm.role'() {
+      if (this.AccountForm.role) {
+        const index = findElem(this.roleList, 'adminRoleId', this.AccountForm.role)
+        this.roleObj = this.roleList[index]
+      }
+    }
+  },
+  async created() {
+    this.getTree()
     this.getList()
+    this.getStockList()
+    await this.getRoleList()
   },
   methods: {
+    // 获取仓库仓位对应关系列表
+    async getStockList() {
+      const res = await getStockListStock({ pageSize: -1, pageNum: 1 })
+      this.stockList = res.data.records
+    },
     // 查询按钮权限
     checkBtnRole(value) {
       // let btnRole = this.$route.meta.roles;
@@ -272,25 +592,112 @@ export default {
       // return index >= 0 ? true : false;
       return true
     },
-    // 获取子经销商
-    getDealerListV2() {
-      getDealerListV2({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.subCustomerList = res.data.records
+
+    // 获取角色列表
+    async getRoleList() {
+      const result = await new Promise((resolve, reject) => {
+        getRoleList({ pageNum: 1, pageSize: -1 })
+          .then(res => {
+            this.roleList = res.data.records
+            resolve(res.data)
+          })
+          .catch(res => {
+            resolve([])
+          })
+      })
+      return result
+    },
+    // 获取金蝶品类
+    async getCategoryList() {
+      const result = await new Promise((resolve, reject) => {
+        getCategoryList({ pageNum: 1, pageSize: -1 })
+          .then(res => {
+            this.categoryList = res.data.records
+            resolve(res.data)
+          })
+          .catch(res => {
+            resolve([])
+          })
       })
+      return result
     },
+    // 获取商户列表
+    async getMerchantList() {
+      const result = await new Promise((resolve, reject) => {
+        getMerchantList({
+          pageNum: 1,
+          pageSize: -1
+        })
+          .then(res => {
+            this.merchantList = res.data.records
+            resolve(res.data.records)
+          })
+          .catch(res => {
+            resolve([])
+          })
+      })
+      return result
+    },
+
+    // 获取经销商列表
+    async getDealerList(id) {
+      const result = await new Promise((resolve, reject) => {
+        getDealerList({
+          pageNum: 1,
+          pageSize: -1,
+          bindUser: false,
+          adminUserId: id || ''
+        })
+          .then(res => {
+            this.dealerList = res.data.records
+            resolve(res.data.records)
+          })
+          .catch(res => {
+            resolve([])
+          })
+      })
+      return result
+    },
+
+    // 获取集团列表
+    async getGroupList(id) {
+      const result = await new Promise((resolve, reject) => {
+        getDealerList({
+          pageNum: 1,
+          pageSize: -1
+        })
+          .then(res => {
+            this.groupList = res.data.records
+            resolve(res.data.records)
+          })
+          .catch(res => {
+            resolve([])
+          })
+      })
+      return result
+    },
+
+    // 获取部门列表
+    getTree() {
+      getDepartmentList().then(res => {
+        this.departmentList = res.data
+      })
+    },
+
+    // 获取账号列表
     getList() {
       this.listLoading = true
+
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        parentId: this.parentId,
-        userName: this.screenForm.userName,
-        isMaster: false
+        adminWebsitId: this.selectDepartment ? this.selectDepartment.adminWebsitId : '',
+        userName: this.screenForm.name,
+        roleId: this.screenForm.roleId,
+        isMaster: true
       }
-      getEngineeringUserList(params).then(res => {
+
+      getAccountList(params).then(res => {
         this.dataList = res.data.records
         this.listTotal = res.data.total
         this.listLoading = false
@@ -310,229 +717,381 @@ export default {
       this.getList()
     },
 
-    // 操作 - 删除
-    handleDelete(id) {
-      deleteRole({ adminRoleId: id }).then(res => {
-        this.getList()
-        this.$successMsg()
-      })
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
     },
-    handleDel(row) {
-      delUserGongCheng({ userName: row.userName }).then(res => {
-        this.$successMsg('删除成功')
-        this.getList()
-      })
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
     },
-    // 新增编辑
-    addOrEdit(type, row) {
-      this.addFormType = type
-      if (row) {
-        getDetailGongCheng({ adminUserId: row.adminUserId }).then(res => {
-          if (type === 'edit') {
-            this.ruleForm = {
-              account: res.data.userName,
-              password: '',
-              nickName: res.data.nickName,
-              adminUserId: res.data.adminUserId,
-              parentId: res.data.parentId,
-              spanLoginLimit: res.data.spanLoginLimit,
-              homeLoginLimit: res.data.homeLoginLimit,
-              workLoginLimit: res.data.workLoginLimit
-            }
-          }
-          if (type === 'password') {
-            this.ruleForm = {
-              account: res.data.userName,
-              password: '',
-              adminUserId: res.data.adminUserId
-            }
-          }
-        })
-      }
-      this.dialogVisible = true
 
-      this.getDealerListV2()
+    // 筛选部门
+    filterNode(value, data) {
+      if (!value) return true
+      return data.name.indexOf(value) !== -1
     },
 
-    // 取消 新增编辑
-    cancelAddForm() {
-      this.$refs.ruleForm.resetFields()
+    // 选择部门
+    handleNodeClick(data) {
+      console.log(data)
+      if (this.selectDepartment && data.adminWebsitId === this.selectDepartment.adminWebsitId) {
+        this.$refs.listTree.setCurrentKey(null)
+        this.selectDepartment = null
+      } else {
+        this.selectDepartment = data
+      }
+      this.getList()
+    },
 
-      this.$nextTick(() => {
-        this.dialogVisible = false
-      })
+    // 刷新部门
+    refreshDepartment() {
+      this.$refs.listTree.setCurrentKey(null)
+      this.selectDepartment = null
+      this.getTree()
+      this.getList()
     },
 
-    // 提交 新增编辑
-    submitAddForm() {
-      this.$refs.ruleForm.validate(valid => {
-        const params = {
-          userName: this.ruleForm.account,
-          password: this.ruleForm.password,
-          parentId: this.ruleForm.parentId,
-          nickName: this.ruleForm.nickName,
-          spanLoginLimit: this.ruleForm.spanLoginLimit,
-          homeLoginLimit: this.ruleForm.homeLoginLimit,
-          workLoginLimit: this.ruleForm.workLoginLimit
-          // adminModuleIds:this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') :
+    // 打开 新增编辑 账号表单
+    async openAccountForm(type, id) {
+      this.AccountFormType = type
+      this.AccountFormVisible = true
+      await this.getMerchantList()
+      await this.getDealerList(id)
+      await this.getGroupList(id)
+      await this.getRoleList()
+      await this.getCategoryList()
+
+      if (type == 'add') {
+        if (this.selectDepartment) {
+          this.$refs.tree.setCheckedKeys([this.selectDepartment.adminWebsitId])
         }
+      }
+
+      if (type == 'edit') {
+        this.editAccountId = id
+        getAccountDetail({ adminUserId: id }).then(res => {
+          console.log(res, 78787)
+          this.AccountForm.account = res.data.userName
+          this.AccountForm.role = res.data.roleId
+          this.AccountForm.nickName = res.data.nickName
+          this.AccountForm.merchant = res.data.companyWechatId
+          this.AccountForm.dealer = res.data.customerId
+          this.AccountForm.isGroup = res.data.isGroupCompany
+          this.AccountForm.company = res.data.groupCompanyId
+          this.AccountForm.isDiscount = res.data.isZr
+          this.AccountForm.correspondIds = res.data.stockCorrespondList
+          this.AccountForm.k3CategoryIds = res.data.k3CategoryList
+          this.AccountForm.isShangyong = res.data.isShangyong
+          this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || [])
+        })
+      }
+    },
+
+    // 取消 新增编辑 账号表单
+    cancelAccountForm() {
+      this.AccountFormVisible = false
+      this.$refs.AccountForm.resetFields()
+      this.passwordType1 = 'password'
+      this.passwordType2 = 'password'
+    },
+
+    // 提交 账号表单
+    submitAccountForm() {
+      console.log(this.AccountForm.correspondIds)
+      this.$refs.AccountForm.validate(valid => {
         if (valid) {
-          if (this.addFormType === 'password') {
-            params.adminUserId = this.ruleForm.adminUserId
-            editSubAccount(params).then(res => {
-              this.cancelAddForm()
-              this.getList()
-              this.$successMsg('重置成功')
+          const categoryIds = []
+          this.categoryList.map(k => {
+            this.AccountForm.k3CategoryIds.map(i => {
+              if (i == k.id) {
+                categoryIds.push({
+                  k3CategoryId: k.id,
+                  k3CategoryName: k.name,
+                  k3CategoryNumber: k.number
+                })
+              }
             })
+          })
+
+          const params = {
+            userName: this.AccountForm.account,
+            nickName: this.AccountForm.nickName,
+            roleId: this.AccountForm.role,
+            password: this.AccountForm.newPassword,
+            correspondIds: this.AccountForm.correspondIds,
+            isShangyong: this.AccountForm.isShangyong,
+            categoryIds
+          }
+
+          if (this.roleObj.type === 0) {
+            params.adminWebsitIds = this.$refs.tree.getCheckedKeys()
+            params.roleName = this.roleObj.name
+            if (this.roleObj.name === '经销商') {
+              params.customerId = this.AccountForm.dealer
+              params.isGroupCompany = this.AccountForm.isGroup
+              params.parentCustomerId = this.AccountForm.company
+              params.isZr = this.AccountForm.isDiscount
+            }
+          } else {
+            params.adminCompanyId = this.AccountForm.merchant
           }
-          if (this.addFormType === 'edit') {
-            params.adminUserId = this.ruleForm.adminUserId
-            editEngineeringUser(params).then(res => {
-              this.cancelAddForm()
+          if (this.AccountFormType == 'edit') {
+            params.adminUserId = this.editAccountId
+            editAccount(params).then(res => {
+              this.cancelAccountForm()
               this.getList()
               this.$successMsg('编辑成功')
             })
-          }
-          if (this.addFormType === 'add') {
-            addEngineeringUser(params).then(res => {
-              this.cancelAddForm()
+          } else {
+            addAccount(params).then(res => {
+              this.cancelAccountForm()
               this.getList()
-              this.$successMsg('新增成功')
+              this.$successMsg('添加成功')
             })
           }
         }
       })
     },
 
-    // 设置权限 - 获取列表
-    setMenuRole(id, type) {
-      this.roleFormVisible = true
-      this.editId = id
-      getMenuList({ adminUserId: this.userid }).then(res => {
-        this.menuRoleList = res.data
+    // 表格选择列
+    handleTableSelection(val) {
+      this.tableSelection = val
+    },
+
+    // 批量删除账号
+    batchDeleteAccount() {
+      if (this.tableSelection.length < 1) {
+        return this.$errorMsg('至少选择一名账号')
+      }
+      this.$confirm(`确定删除选中的账号吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
-      getRoleChecked({ adminUserId: id }).then(res => {
-        this.$refs.tree.setCheckedKeys(res.data)
+        .then(() => {
+          const AccountIds = []
+          this.tableSelection.forEach(item => {
+            AccountIds.push(item.id)
+          })
+          deleteAccount({ id: AccountIds.join(',') }).then(res => {
+            this.$successMsg()
+            this.getTree()
+            this.getList()
+          })
+        })
+        .catch(() => {})
+    },
+
+    // 删除账号
+    deleteAccount(id) {
+      deleteAccount({ id: id }).then(res => {
+        this.$successMsg()
+        this.getTree()
+        this.getList()
       })
     },
 
-    // 设置权限 - 提交数据
-    submitRoleForm(type) {
-      const params = {
-        adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
-        adminRoleId: this.editId
-      }
-      setMenuRole(params).then(res => {
+    // 操作 - 更改状态(type: 禁用0,启用1)
+    changeStatus(id, type) {
+      type = !!type
+      changeAccountStatus({ adminUserId: id, status: type }).then(res => {
         this.getList()
         this.$successMsg()
       })
-
-      this.roleFormVisible = false
     },
 
-    // 一键全选
-    quickSelection(data) {
-      const nowChecked = this.$refs.tree.getCheckedKeys()
-      const thisId = data.moduleId
-      let childId = []
-      if (data.children.length) {
-        childId = this.familyTree(data.children)
+    // 显示隐藏密码
+    showPwd(num) {
+      if (num == 1) {
+        if (this.passwordType1 === 'password') {
+          this.passwordType1 = ''
+        } else {
+          this.passwordType1 = 'password'
+        }
+        this.$nextTick(() => {
+          this.$refs.password1.focus()
+        })
+      }
+      if (num == 2) {
+        if (this.passwordType2 === 'password') {
+          this.passwordType2 = ''
+        } else {
+          this.passwordType2 = 'password'
+        }
+        this.$nextTick(() => {
+          this.$refs.password2.focus()
+        })
       }
-
-      const setChecked = nowChecked.concat([thisId]).concat(childId)
-
-      this.$refs.tree.setCheckedKeys(setChecked)
     },
 
-    // 一键取消
-    quickCancel(data) {
-      const nowChecked = this.$refs.tree.getCheckedKeys()
-      const thisId = data.moduleId
-      let childId = []
-      if (data.children.length) {
-        childId = this.familyTree(data.children)
-      }
+    // 重置密码
+    handleReset(id) {
+      this.resetId = id
+      this.resetFormVisible = true
+    },
 
-      const setChecked = nowChecked
-      if (setChecked.indexOf(thisId) >= 0) {
-        setChecked.splice(setChecked.indexOf(thisId), 1)
-      }
+    // 取消重置密码
+    cancelResetForm() {
+      this.resetFormVisible = false
+      this.passwordType1 = 'password'
+      this.passwordType2 = 'password'
+      this.$refs.resetForm.resetFields()
+    },
 
-      if (childId.length) {
-        for (var i = 0; i < childId.length; i++) {
-          if (setChecked.indexOf(childId[i]) >= 0) {
-            setChecked.splice(setChecked.indexOf(childId[i]), 1)
+    // 提交重置密码
+    submitResetForm() {
+      this.$refs.resetForm.validate(valid => {
+        if (valid) {
+          const params = {
+            password: this.resetForm.newPassword,
+            adminUserId: this.resetId
           }
+          resetPassword(params).then(res => {
+            this.cancelResetForm()
+            this.getList()
+            this.$successMsg()
+          })
         }
-      }
-
-      this.$refs.tree.setCheckedKeys(setChecked)
+      })
     },
 
-    // 递归子id
-    familyTree(arr) {
-      var temp = []
-      var forFn = function (list) {
-        for (var i = 0; i < list.length; i++) {
-          var item = list[i]
-          if (item.children) {
-            temp.push(item.moduleId)
-            forFn(item.children)
-          }
-        }
+    // 导出
+    handleExport() {
+      const screenData = {
+        adminWebsitId: this.selectDepartment ? this.selectDepartment.websitId : '',
+        keyword: this.screenForm.name
       }
-      forFn(arr)
-      return temp
+      downloadFiles('wechat/enterprise/export', screenData)
     },
 
-    changeStatus(id, status) {
-      editRole({
-        adminRoleId: id,
-        visitSysStatus: status
-      }).then(res => {
-        this.getList()
-        this.$successMsg('编辑成功')
-      })
-    },
-     // 提交筛选表单
-     submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+    // 下载导入模版
+    handleDownload() {
+      downloadFiles('admin/user/download')
     },
 
-    // 重置筛选表单
-    resetScreenForm() {
-      this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    clickImport() {
+      if (!this.selectDepartment) {
+        return this.$errorMsg('请选择部门')
+      } else {
+        document.querySelector('.import-btn input').click()
+      }
     },
+
+    // 导入
+    async handleImport(param) {
+      console.log(param)
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+
+      const result = await handleImportTwo('/admin/user/importUser', formData)
+      this.importLoading = false
+      this.importFileList = []
+      // console.log(result,999);
+
+      if (result) {
+        this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        const blob = new Blob([result], {
+          type: 'application/vnd.ms-excel,charset=utf-8'
+        })
+        const urll = window.URL.createObjectURL(blob)
+        const link = document.createElement('a')
+        link.download = '导入失败数据.xlsx'
+        link.href = urll
+        link.click()
+        this.getList()
+      } else {
+        this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-::v-deep .tree-dialog {
-  .el-dialog__body {
-    padding: 20px;
+<style scoped lang="scss">
+.import-btn {
+  display: inline-block;
+  margin-left: 10px;
+}
+.app-container {
+  display: flex;
+  .tree-container {
+    width: 18%;
+    height: calc(100vh - 110px);
+    flex-shrink: 0;
+    background: #f5f5f5;
+    margin-right: 2%;
+    display: flex;
+    flex-direction: column;
+    overflow-y: hidden;
     .el-tree {
-      max-height: calc(100vh - 140px - 54px - 70px);
-      overflow-y: scroll;
-      padding: 0 30px;
-      > .el-tree-node {
-        padding: 15px 0;
-        border: 1px dashed #ddd;
-        margin-bottom: 15px;
-        border-radius: 10px;
+      height: 100%;
+      background: none;
+      width: 100%;
+      overflow: scroll;
+      // ::v-deep .el-tree-node:focus > .el-tree-node__content {
+      //   color: #ffffff;
+      //   background-color: #409EFF;
+      // }
+      ::v-deep > .el-tree-node {
+        display: inline-block;
+        min-width: 100%;
+      }
+      ::v-deep .el-tree-node > .el-tree-node__content {
+        padding-right: 10px;
+        align-self: baseline;
+      }
+      ::v-deep .el-tree-node.is-current > .el-tree-node__content {
+        background-color: #409eff;
+        .custom-tree-node {
+          i {
+            color: #fff;
+          }
+          span {
+            color: #fff;
+          }
+        }
+      }
+      ::v-deep .el-tree-node > .el-tree-node__children {
+        overflow: unset;
+      }
+      .custom-tree-node {
+        i {
+          font-size: 14px;
+          color: #999;
+        }
+        span {
+          font-size: 14px;
+          margin-left: 6px;
+          color: #666;
+        }
       }
     }
   }
+  .mymain-container {
+    width: 80%;
+    margin-top: 0;
+  }
 }
-::v-deep .custom-tree-node {
-  flex: 1;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  font-size: 14px;
-  padding-right: 8px;
+::v-deep .el-divider--vertical {
+  margin: 0 15px;
+}
+.show-pwd {
+  position: absolute;
+  right: 15px;
+  top: 0;
+  font-size: 16px;
+  cursor: pointer;
+  user-select: none;
 }
 </style>

+ 51 - 15
src/views/setting/engineeringSubAccount.vue

@@ -1,9 +1,26 @@
 <template>
   <div class="app-container">
-    <div class="setting_title">工程子账号</div>
+    <div class="setting_title">用户管理</div>
     <el-divider />
 
     <div class="mymain-container">
+      <Collapse :screen-form="screenForm">
+        <template #right_btn>
+          <el-button size="mini" @click="resetScreenForm">清空</el-button>
+          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
+        </template>
+        <template #search>
+          <el-form ref="screenForm" :model="screenForm" label-width="150px" size="mini" label-position="left">
+            <el-row :gutter="20">
+              <el-col :xs="24" :sm="12" :lg="8">
+                <el-form-item label="账号/用户名名称:" prop="userName">
+                  <el-input v-model="screenForm.userName" placeholder="请输入账号/用户名名称" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </template>
+      </Collapse>
       <div class="btn-group clearfix">
         <div class="fl">
           <el-button
@@ -45,13 +62,8 @@
             <template slot-scope="scope">
               <el-button type="text" @click="addOrEdit('edit', scope.row)">编辑</el-button>
               <el-button type="text" @click="addOrEdit('password', scope.row)">重置密码</el-button>
-              <el-popconfirm
-                title="确定删除吗?"
-                @onConfirm="handleDel(scope.row)"
-              >
-                <el-button slot="reference" type="text" size="mini">
-                  删除
-                </el-button>
+              <el-popconfirm title="确定删除吗?" @onConfirm="handleDel(scope.row)">
+                <el-button slot="reference" type="text" size="mini"> 删除 </el-button>
               </el-popconfirm>
               <!-- <el-button
                 v-if="checkBtnRole('detail')"
@@ -151,7 +163,13 @@
             />
           </el-form-item>
           <el-form-item label="上级经销商" prop="parentId">
-            <el-select v-model="ruleForm.parentId" placeholder="请选择上级经销商" :disabled="addFormType === 'edit'" filterable style="width: 100%">
+            <el-select
+              v-model="ruleForm.parentId"
+              placeholder="请选择上级经销商"
+              :disabled="addFormType === 'edit'"
+              filterable
+              style="width: 100%"
+            >
               <el-option v-for="item in subCustomerList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
@@ -232,7 +250,11 @@ export default {
         parentId: [{ required: true, message: '请选择上级经销商', trigger: 'change' }],
         nickName: [{ required: true, message: '请输入子经销商名称', trigger: 'blur' }]
       },
-      subCustomerList: []
+      subCustomerList: [],
+      screenForm: {
+        // 筛选表单数据
+        userName: '' // 名称
+      }
     }
   },
   computed: {
@@ -265,6 +287,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         parentId: this.parentId,
+        userName: this.screenForm.userName,
         isMaster: false
       }
       getEngineeringUserList(params).then(res => {
@@ -294,10 +317,11 @@ export default {
         this.$successMsg()
       })
     },
-    handleDel(row){
-             delUserGongCheng({userName: row.userName}).then(res=>{
-                  this.$successMsg('删除成功')
-                  this.getList()})
+    handleDel(row) {
+      delUserGongCheng({ userName: row.userName }).then(res => {
+        this.$successMsg('删除成功')
+        this.getList()
+      })
     },
     // 新增编辑
     addOrEdit(type, row) {
@@ -469,7 +493,19 @@ export default {
         this.getList()
         this.$successMsg('编辑成功')
       })
-    }
+    },
+     // 提交筛选表单
+     submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
+    },
   }
 }
 </script>

+ 2 - 2
src/views/supply/engin/components/home_detail.vue

@@ -750,8 +750,8 @@ export default {
         if (res.data.items) {
           res.data.items.forEach(item => {
             item.number = (item.qty * 100 - item.retiredQty * 100) / 100
-            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
-            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
+            item.sums1 = ['number', 'directTransferQty','salesQty', 'retiredQty','qty', 'enginNum', 'oldQty', 'hasSendQty']
+            item.sums2 = ['totalAmount', 'payAmount', 'payRebateAmount', 'discAmount', 'salesAmount']
           })
         }
         this.detailData = res.data

+ 3 - 3
src/views/supply/engin/components/home_examine.vue

@@ -574,15 +574,15 @@ export default {
       getOrderDetail({ id: this.listItem.parentId }).then(res => {
         if (res.data.items) {
           res.data.items.forEach(item => {
-            item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty', 'hasSendQty']
+            item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'salesQty', 'retiredQty','refundableQty', 'tdQty', 'hasSendQty']
             item.sums2 = [
               'totalAmount',
               'payAmount',
-              'price',
               'discAmount',
               'payRebateAmount',
               'compute_sfAmount',
-              'compute_flAmount'
+              'compute_flAmount',
+              'salesAmount'
             ]
           })
         }

+ 116 - 46
src/views/supply/implement/implement_total_list.vue

@@ -194,8 +194,7 @@
             type="primary"
             size="small"
             @click="handleEliminate"
-            >剔除账单</el-button
-          >
+          >剔除账单</el-button>
 
           <div class="fr">
             <ExportButton :ex-url="'retail/exec/listTotalExport'" :ex-params="exParams" />
@@ -214,7 +213,10 @@
             :summary-method="$getSummaries"
             @selection-change="handleSelectionChange"
           >
-            <el-table-column type="selection" width="55" />
+            <el-table-column
+              type="selection"
+              width="55"
+            />
             <el-table-column align="left" label="标识" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-tag
@@ -223,15 +225,20 @@
                   size="mini"
                   style="cursor: pointer"
                   @click="openDisplaceDetail(scope.row)"
-                  >置换
+                >置换
                 </el-tag>
                 <el-tag v-if="scope.row.directTransferStatusName !== '非直调'" type="success" size="mini">直调</el-tag>
               </template>
             </el-table-column>
             <el-table-column align="left" label="是否置换过" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-tag type="warning" size="mini" style="cursor: pointer" @click="openDisplaceDetail(scope.row)">
-                  {{ scope.row.isDisplaceOrder ? '是' : '否' }}
+                <el-tag
+                  type="warning"
+                  size="mini"
+                  style="cursor: pointer"
+                  @click="openDisplaceDetail(scope.row)"
+                >
+                  {{ scope.row.isDisplaceOrder?'是':'否' }}
                 </el-tag>
               </template>
             </el-table-column>
@@ -244,12 +251,21 @@
             />
             <el-table-column align="left" label="是否剔除" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-tag type="warning" size="mini">
-                  {{ scope.row.isCost === 'NO' ? '否' : '是' }}
+                <el-tag
+                  type="warning"
+                  size="mini"
+                >
+                  {{ scope.row.isCost==='NO'?'否':'是' }}
                 </el-tag>
               </template>
             </el-table-column>
-            <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="200" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="使用单位"
+              prop="refUseUnit"
+              min-width="200"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="left"
               label="货满有效期"
@@ -264,8 +280,20 @@
               min-width="200"
               show-overflow-tooltip
             />
-            <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip />
-            <el-table-column align="left" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="制单日期"
+              prop="createTime"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="left"
+              label="订单日期"
+              prop="theTime"
+              min-width="160"
+              show-overflow-tooltip
+            />
             <el-table-column align="left" label="销售订单" prop="id" min-width="140" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.id" />
@@ -290,7 +318,13 @@
                 <span>{{ scope.row.customerName }}</span>
               </template>
             </el-table-column>
-            <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="销售类型"
+              prop="saleTypeName"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="left"
               label="存货类别"
@@ -298,7 +332,13 @@
               min-width="100"
               show-overflow-tooltip
             />
-            <el-table-column align="left" label="金蝶部门" prop="k3OrgName" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="金蝶部门"
+              prop="k3OrgName"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.materialCode" />
@@ -336,7 +376,13 @@
               min-width="100"
               show-overflow-tooltip
             />
-            <el-table-column align="left" label="钱包" prop="walletName" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="钱包"
+              prop="walletName"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="right"
               label="返利钱包"
@@ -351,8 +397,20 @@
               min-width="120"
               show-overflow-tooltip
             />
-            <el-table-column align="right" label="总数量" prop="qty" min-width="100" show-overflow-tooltip />
-            <el-table-column align="right" label="退订数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="right"
+              label="总数量"
+              prop="qty"
+              min-width="100"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="right"
+              label="退订数量"
+              prop="retiredQty"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="right"
               label="退货数量"
@@ -386,7 +444,13 @@
                 {{ row.qty - (row.refundableQty || 0) }}
               </template>
             </el-table-column>
-            <el-table-column align="right" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="right"
+              label="出库数量"
+              prop="hasSendQty"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="right"
               label="直调数量"
@@ -423,7 +487,13 @@
               </template>
             </el-table-column>
 
-            <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="表头业务员"
+              prop="serviceName"
+              min-width="100"
+              show-overflow-tooltip
+            />
             <el-table-column
               align="left"
               label="表体业务员"
@@ -439,8 +509,20 @@
               show-overflow-tooltip
             />
             <!-- <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column> -->
-            <el-table-column align="left" label="表头备注" prop="remark" min-width="160" show-overflow-tooltip />
-            <el-table-column align="left" label="表体备注" prop="itemRemark" min-width="160" show-overflow-tooltip />
+            <el-table-column
+              align="left"
+              label="表头备注"
+              prop="remark"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="left"
+              label="表体备注"
+              prop="itemRemark"
+              min-width="160"
+              show-overflow-tooltip
+            />
             <el-table-column align="left" label="销售政策名称" prop="policyTitle" min-width="250" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.policyTitle" />
@@ -477,7 +559,11 @@
         </div>
       </div>
     </div>
-    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      width="30%"
+     >
       <el-date-picker
         v-model="time"
         type="datetime"
@@ -485,19 +571,12 @@
         default-time="00:00:00"
         :picker-options="setDisabled"
         style="width: 100%"
-        placeholder="选择日期"
-      >
+        placeholder="选择日期">
       </el-date-picker>
       <span slot="footer" class="dialog-footer">
-        <el-button
-          @click="
-            dialogVisible = false
-            time = ''
-          "
-          >取 消</el-button
-        >
-        <el-button type="primary" @click="onSbumit">确 定</el-button>
-      </span>
+    <el-button @click="dialogVisible = false;time =''">取 消</el-button>
+    <el-button type="primary" @click="onSbumit">确 定</el-button>
+  </span>
     </el-dialog>
     <DisplaceDetail v-if="isShowDisplaceDetail" :list-item="queryItem" @backListFormDetail="backList" />
   </div>
@@ -599,10 +678,9 @@ export default {
       choiceDate: '',
       setDisabled: {
         disabledDate: time => {
-          return time.getTime() < new Date().setDate(new Date().getDate() - 1)
-        }
-      }
-    }
+          return time.getTime() < new Date().setDate(new Date().getDate()-1)
+        },
+      }}
   },
 
   computed: {
@@ -706,15 +784,7 @@ export default {
       getTotalList(params).then(res => {
         res.data.records.forEach(item => {
           item.fahuo = item.qty - (item.refundableQty || 0)
-          item.sums1 = [
-            'refundableQty',
-            'qty',
-            'retiredQty',
-            'hasSendQty',
-            'directTransferQty',
-            'refundProductQty',
-            'fahuo'
-          ]
+          item.sums1 = ['refundableQty', 'qty', 'retiredQty', 'hasSendQty', 'directTransferQty', 'refundProductQty','fahuo']
           item.sums2 = ['payAmount', 'payRebateAmount', 'hasSendAmount', 'retiredAmount', 'refundProductAmount']
         })
         this.dataList = res.data.records
@@ -788,7 +858,7 @@ export default {
     },
     onSbumit() {
       const ids = this.recordSelected.map(k => k.orderItemId)
-      setUpdateOrderCost({ orderId: ids.toString(), time: this.time }).then(res => {
+      setUpdateOrderCost({ orderId: ids.toString(),time: this.time }).then(res => {
         this.dialogVisible = false
         this.$successMsg('剔除成功')
         this.getList()