aXin-0810 1 рік тому
батько
коміт
168e7fab55
78 змінених файлів з 26282 додано та 20601 видалено
  1. 11 11
      src/components/Common/image-upload.vue
  2. 32 17
      src/components/Mall/Member/member-browse.vue
  3. 31 16
      src/components/Mall/Member/member-favorite.vue
  4. 107 59
      src/components/Shortcut/index.vue
  5. 34 19
      src/components/file-upload/index.vue
  6. 0 369
      src/components/file-upload/index_oss.vue
  7. 5 2
      src/components/geographicalPosi/index.vue
  8. 4 5
      src/components/image-upload/index.vue
  9. 27 19
      src/main.js
  10. 808 675
      src/views/auxiliaryFittings/attachmentProfile/index.vue
  11. 409 393
      src/views/auxiliaryFittings/projectAttachmentManage/detail.vue
  12. 409 393
      src/views/auxiliaryFittings/projectAuxiliaryManage/detail.vue
  13. 68 48
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js
  14. 194 164
      src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue
  15. 189 160
      src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue
  16. 403 362
      src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue
  17. 404 360
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue
  18. 182 153
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue
  19. 1077 920
      src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue
  20. 1137 947
      src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue
  21. 1198 925
      src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue
  22. 1304 1005
      src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue
  23. 1138 962
      src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue
  24. 350 299
      src/views/auxiliaryFittings/supplier/index.vue
  25. 187 151
      src/views/engineerFeeSettlement/monthlyPayrollSummary/index.vue
  26. 134 120
      src/views/engineeringMaintenance/basicData/index.vue
  27. 66 31
      src/views/login/index.vue
  28. 546 395
      src/views/mallManagement/activity/coupon_index/index.vue
  29. 526 444
      src/views/mallManagement/activity/groupbuy_add/index.vue
  30. 59 44
      src/views/mallManagement/activity/seckill_index/index_2.vue
  31. 5 5
      src/views/mallManagement/activity/special_set/index.vue
  32. 646 544
      src/views/mallManagement/activityOrder/detail.vue
  33. 4 4
      src/views/mallManagement/configCenter/brand/index.vue
  34. 274 227
      src/views/mallManagement/configCenter/chargingStandard/index.vue
  35. 164 110
      src/views/mallManagement/configCenter/mallConfig/index.vue
  36. 400 320
      src/views/mallManagement/configCenter/serviceProduct/index.vue
  37. 213 196
      src/views/mallManagement/configCenter/slideshowConfig/index.vue
  38. 478 393
      src/views/mallManagement/goods/classify_index/index.vue
  39. 561 390
      src/views/mallManagement/goods/goodsWarehouse/detail.vue
  40. 822 615
      src/views/mallManagement/goods/goodsWarehouse/index.vue
  41. 357 264
      src/views/mallManagement/goods/goods_add/index.vue
  42. 452 298
      src/views/mallManagement/goods/goods_index/index.vue
  43. 205 136
      src/views/mallManagement/goods/newclassify_set/index.vue
  44. 218 184
      src/views/mallManagement/goods/watermark_add/index.vue
  45. 156 111
      src/views/mallManagement/invoice/index.vue
  46. 343 258
      src/views/mallManagement/old_machine/index.vue
  47. 330 209
      src/views/mallManagement/order/offline_order_list/index.vue
  48. 554 285
      src/views/mallManagement/order/order_detail/index.vue
  49. 860 380
      src/views/mallManagement/order/order_list/index.vue
  50. 450 202
      src/views/mallManagement/order/order_refund/index.vue
  51. 659 448
      src/views/mallManagement/order/order_refund_detail/index.vue
  52. 372 244
      src/views/mallManagement/order/sales_return_order_list/index.vue
  53. 31 28
      src/views/mallManagement/order/workOrder_detail/index.vue
  54. 227 185
      src/views/mallManagement/secondHandMall/classifiedManagement/index.vue
  55. 2 2
      src/views/mallManagement/setActivity/formModule.vue
  56. 10 5
      src/views/mallManagement/setActivity/index.vue
  57. 1246 1073
      src/views/mallManagement/tenancyManagement/tenancyOrder/detail.vue
  58. 421 397
      src/views/mallManagement/tenancyManagement/tenancyOrder/index.vue
  59. 406 350
      src/views/mallManagement/tenancyManagement/tenancyProduct/index.vue
  60. 119 72
      src/views/secondHandMall/activistOrder/details.vue
  61. 110 74
      src/views/secondHandMall/activistOrder/index.vue
  62. 344 260
      src/views/secondHandMall/commodityManagement/form.vue
  63. 42 19
      src/views/secondHandMall/commodityManagement/index.vue
  64. 182 103
      src/views/secondHandMall/orderManagement/details.vue
  65. 283 173
      src/views/secondHandMall/orderManagement/index.vue
  66. 75 50
      src/views/secondHandMall/orderManagement/materialFlow.vue
  67. 7 3
      src/views/setting/loginSetting/index.vue
  68. 266 148
      src/views/setting/organizationManagement/settledManagement/index.vue
  69. 432 245
      src/views/setting/organizationManagement/tenantDetails/index.vue
  70. 198 172
      src/views/setting/personal/index.vue
  71. 294 264
      src/views/setting/personal/renew.vue
  72. 481 412
      src/views/userManagement/distributorManagement/index.vue
  73. 356 256
      src/views/userManagement/masterManagement/index.vue
  74. 137 116
      src/views/workOrder/appraise/index.vue
  75. 216 165
      src/views/workOrder/basicConfiguration/orderType/index.vue
  76. 305 302
      src/views/workOrder/orderHome/index.vue
  77. 480 405
      src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue
  78. 50 31
      src/views/workOrder/workOrderPool/detailModule/Evaluation/index.vue

+ 11 - 11
src/components/Common/image-upload.vue

@@ -37,7 +37,7 @@
             <i v-if="checkFileType(item.url) != 'image'" class="el-icon-zoom-in" @click="previewFile(item.url)" />
             <i v-if="checkFileType(item.url) != 'image'" class="el-icon-bottom" @click="downloadFile(item)" />
             <i v-if="isEdit && !isOperate && !disabled" class="el-icon-upload2" @click="uploadImage(item.url)" />
-            <i v-if="isEdit && !isOperate && !disabled"  class="el-icon-delete" @click="deleteImage(item.url)" />
+            <i v-if="isEdit && !isOperate && !disabled" class="el-icon-delete" @click="deleteImage(item.url)" />
           </div>
         </div>
       </div>
@@ -81,7 +81,7 @@ export default {
     // 接受上传的文件类型
     fileType: {
       type: Array,
-      default: () => ['image', 'word', 'excel', 'ppt', 'pdf', 'file','video']
+      default: () => ['image', 'word', 'excel', 'ppt', 'pdf', 'file', 'video']
     },
     // 是否支持多选文件
     multiple: {
@@ -109,9 +109,9 @@ export default {
     },
     // 限制添加
     disabled: {
-    type: Boolean,
-    default: false
-  }
+      type: Boolean,
+      default: false
+    }
   },
   data() {
     return {
@@ -171,12 +171,12 @@ export default {
         this.$emit('getFiles', this.files)
       }
     },
-    fileList:{
-      handler(nl){
+    fileList: {
+      handler(nl) {
         this.files = nl
       },
       // immediate:true,
-      deep:true
+      deep: true
     }
   },
   created() {
@@ -233,13 +233,13 @@ export default {
       return result
     },
     //预览视频
-    async previewFile(url){
+    async previewFile(url) {
       let res = await getFileUrl({ key: url })
       window.open(this.$xdocUrl + encodeURIComponent(res.data))
     },
-    downloadFile(item){
+    downloadFile(item) {
       const a = document.createElement('a')
-      a.download =  item.name
+      a.download = item.name
       a.href = this.$imageUrl + item.url
       document.body.appendChild(a)
       a.click()

+ 32 - 17
src/components/Mall/Member/member-browse.vue

@@ -1,12 +1,26 @@
 <template>
   <div>
     <div class="table">
-      <el-table ref="orderTable" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+      <el-table
+        ref="orderTable"
+        v-loading="listLoading"
+        :data="dataList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
         <el-table-column align="center" label="商品信息" prop="goodsName" min-width="200">
           <template slot-scope="scope">
             <div class="goods-info">
-              <el-image style="width: 40px; height: 40px;" :src="scope.row.goodsImg" :preview-src-list="[scope.row.goodsImg]" fit="cover"></el-image>
-              <div class="name">{{scope.row.goodsName}}</div>
+              <el-image
+                style="width: 40px; height: 40px"
+                :src="$showImgUrl(scope.row.goodsImg)"
+                :preview-src-list="[$showImgUrl(scope.row.goodsImg)]"
+                fit="cover"
+              ></el-image>
+              <div class="name">{{ scope.row.goodsName }}</div>
             </div>
           </template>
         </el-table-column>
@@ -28,7 +42,8 @@
           :page-sizes="[10, 20, 30, 50]"
           :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal">
+          :total="listTotal"
+        >
         </el-pagination>
       </div>
     </div>
@@ -36,7 +51,7 @@
 </template>
 
 <script>
-import {getMemberBrowseList} from "@/api/member";
+import { getMemberBrowseList } from '@/api/member'
 
 export default {
   name: 'MemberBrowse',
@@ -52,7 +67,7 @@ export default {
     }
   },
   created() {
-    this.getBrowseList();
+    this.getBrowseList()
   },
   methods: {
     getBrowseList() {
@@ -78,21 +93,21 @@ export default {
     handleCurrentChange(val) {
       this.currentPage = val
       this.getBrowseList()
-    },
+    }
   }
 }
 </script>
 
 <style scoped lang="scss">
-  .goods-info {
-    display: flex;
-    align-items: center;
-    .el-image {
-      flex-shrink: 0;
-    }
-    .name {
-      margin-left: 8px;
-      text-align: left;
-    }
+.goods-info {
+  display: flex;
+  align-items: center;
+  .el-image {
+    flex-shrink: 0;
+  }
+  .name {
+    margin-left: 8px;
+    text-align: left;
   }
+}
 </style>

+ 31 - 16
src/components/Mall/Member/member-favorite.vue

@@ -1,12 +1,26 @@
 <template>
   <div class="address-list">
     <div class="table">
-      <el-table ref="orderTable" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+      <el-table
+        ref="orderTable"
+        v-loading="listLoading"
+        :data="dataList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
         <el-table-column align="center" label="商品信息" prop="goodsName" min-width="200">
           <template slot-scope="scope">
             <div class="goods-info">
-              <el-image style="width: 40px; height: 40px;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover"></el-image>
-              <div class="name">{{scope.row.goodsName}}</div>
+              <el-image
+                style="width: 40px; height: 40px"
+                :src="$showImgUrl(scope.row.imgUrl)"
+                :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                fit="cover"
+              ></el-image>
+              <div class="name">{{ scope.row.goodsName }}</div>
             </div>
           </template>
         </el-table-column>
@@ -28,7 +42,8 @@
           :page-sizes="[10, 20, 30, 50]"
           :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal">
+          :total="listTotal"
+        >
         </el-pagination>
       </div>
     </div>
@@ -36,7 +51,7 @@
 </template>
 
 <script>
-import {getMemberFavoriteList} from "@/api/member";
+import { getMemberFavoriteList } from '@/api/member'
 
 export default {
   name: 'MemberFavorite',
@@ -78,21 +93,21 @@ export default {
     handleCurrentChange(val) {
       this.currentPage = val
       this.getList()
-    },
+    }
   }
 }
 </script>
 
 <style scoped lang="scss">
-  .goods-info {
-    display: flex;
-    align-items: center;
-    .el-image {
-      flex-shrink: 0;
-    }
-    .name {
-      margin-left: 8px;
-      text-align: left;
-    }
+.goods-info {
+  display: flex;
+  align-items: center;
+  .el-image {
+    flex-shrink: 0;
+  }
+  .name {
+    margin-left: 8px;
+    text-align: left;
   }
+}
 </style>

+ 107 - 59
src/components/Shortcut/index.vue

@@ -11,38 +11,62 @@
       <el-dropdown-menu slot="dropdown" class="user-dropdown">
         <el-dropdown-item v-for="(item, index) in QRcodeList" :key="index">
           <div class="QRcode">
-            <el-image class="QRcode-img" :src="item.codeUrl" :preview-src-list="[item.codeUrl]" fit="fill"></el-image>
+            <el-image
+              class="QRcode-img"
+              :src="$showImgUrl(item.codeUrl)"
+              :preview-src-list="[$showImgUrl(item.codeUrl)]"
+              fit="fill"
+            ></el-image>
             <div>
               <div>{{ item.name }}</div>
               <div class="liveTitle">{{ item.saleName }}</div>
               <div>
-                <el-image v-if="item.iosIcon" class="shouji-icon" :src="item.iosIcon" fit="fill"></el-image>
-                <el-image v-if="item.androidIcon" class="shouji-icon" :src="item.androidIcon" fit="fill"></el-image>
+                <el-image
+                  v-if="$showImgUrl(item.iosIcon)"
+                  class="shouji-icon"
+                  :src="item.iosIcon"
+                  fit="fill"
+                ></el-image>
+                <el-image
+                  v-if="$showImgUrl(item.androidIcon)"
+                  class="shouji-icon"
+                  :src="item.androidIcon"
+                  fit="fill"
+                ></el-image>
               </div>
             </div>
           </div>
         </el-dropdown-item>
       </el-dropdown-menu>
     </el-dropdown>
-    <el-drawer size="450px" :with-header="false" :show-close="false" :visible.sync="drawer" direction="rtl"
-      :modal="false">
+    <el-drawer
+      size="450px"
+      :with-header="false"
+      :show-close="false"
+      :visible.sync="drawer"
+      direction="rtl"
+      :modal="false"
+    >
       <div class="drawer">
         <div :offset="0" class="drawer_left">
           <div class="drawer_top">
             <div class="flex center">
-              <div class="radio">
-                状态筛选标签
-              </div>
+              <div class="radio">状态筛选标签</div>
               <div class="icon_close">
                 <i class="el-icon-close" @click="guanbi" />
               </div>
             </div>
             <div>
-              <el-button :type="pam.read_flag == '' ? 'primary' : null" size="mini" @click="hadleRead(0)">全部</el-button>
-              <el-button :type="pam.read_flag == 'NO' ? 'primary' : null" size="mini" @click="hadleRead(1)">未读</el-button>
+              <el-button :type="pam.read_flag == '' ? 'primary' : null" size="mini" @click="hadleRead(0)"
+                >全部</el-button
+              >
+              <el-button :type="pam.read_flag == 'NO' ? 'primary' : null" size="mini" @click="hadleRead(1)"
+                >未读</el-button
+              >
               <el-badge :value="allUnreadNum" class="item" />
-              <el-button :type="pam.read_flag == 'YES' ? 'primary' : null" size="mini"
-                @click="hadleRead(2)">已读</el-button>
+              <el-button :type="pam.read_flag == 'YES' ? 'primary' : null" size="mini" @click="hadleRead(2)"
+                >已读</el-button
+              >
             </div>
             <el-tabs v-model="pam.type" @tab-click="handleClick">
               <el-tab-pane label="通知" name="N"></el-tab-pane>
@@ -50,14 +74,23 @@
               <el-tab-pane label="公告" name="B"></el-tab-pane>
             </el-tabs>
           </div>
-          <div v-loading="loading" class="notice" style="position: relative;">
-            <div style="position: absolute;top: 0;bottom: 0;left: 0;right: 0;">
-              <v-scroll-view :x="false" :y="true" slidingBgClassName="slidingBgClassName3"
-                slidingBlockClassName="slidingBlockClassName3">
-                <div style="box-sizing: border-box;padding: 10px;">
-                  <div v-if="dataList.length" class="item-data" v-for="(item, index) in dataList" :key="index"
-                    @click="opendomview(item)">
-                    <div class="item-tag">{{ ["活动", "公告", "通知"][["A", "B", "N"].indexOf(item.type)] }}</div>
+          <div v-loading="loading" class="notice" style="position: relative">
+            <div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0">
+              <v-scroll-view
+                :x="false"
+                :y="true"
+                slidingBgClassName="slidingBgClassName3"
+                slidingBlockClassName="slidingBlockClassName3"
+              >
+                <div style="box-sizing: border-box; padding: 10px">
+                  <div
+                    v-if="dataList.length"
+                    class="item-data"
+                    v-for="(item, index) in dataList"
+                    :key="index"
+                    @click="opendomview(item)"
+                  >
+                    <div class="item-tag">{{ ['活动', '公告', '通知'][['A', 'B', 'N'].indexOf(item.type)] }}</div>
                     <div class="item-centor">
                       <div class="item-centor">{{ item.content }}</div>
                       <div class="item-time">{{ item.issueTime }}</div>
@@ -68,13 +101,25 @@
               </v-scroll-view>
             </div>
           </div>
-          <el-pagination layout="total, prev, pager, next" :total="total" small :page-size="pam.pageSize"
-            :current-page="pam.pageNum" @current-change="currentChange" />
+          <el-pagination
+            layout="total, prev, pager, next"
+            :total="total"
+            small
+            :page-size="pam.pageSize"
+            :current-page="pam.pageNum"
+            @current-change="currentChange"
+          />
         </div>
       </div>
     </el-drawer>
-    <el-drawer :title="showRow.title" :visible.sync="dialogVisible" direction="rtl" :before-close="dialogVisibleGuanbi"
-      size="450px" :modal="false">
+    <el-drawer
+      :title="showRow.title"
+      :visible.sync="dialogVisible"
+      direction="rtl"
+      :before-close="dialogVisibleGuanbi"
+      size="450px"
+      :modal="false"
+    >
       <el-card class="box-card">
         <div v-html="showRow.content"></div>
       </el-card>
@@ -87,7 +132,7 @@ import { mapMutations, mapActions, mapGetters } from 'vuex'
 import vScrollView from 'v-scroll-view'
 // import { notifyMyList, notifyMyRead } from '@/api/notificationCenter/eventAnnouncement'
 import { EventBus } from '@/utils/eventBus'
-import { commonCompanywechatGet } from "@/api/common";
+import { commonCompanywechatGet } from '@/api/common'
 export default {
   components: { vScrollView },
   data() {
@@ -97,10 +142,10 @@ export default {
       loading: false,
       total: 0,
       pam: {
-        type: "N",
-        read_flag: "",
+        type: 'N',
+        read_flag: '',
         pageNum: 1,
-        pageSize: 20,
+        pageSize: 20
       },
       dialogVisible: false,
       showRow: {},
@@ -112,7 +157,7 @@ export default {
     // 用户信息
     userInfo() {
       return JSON.parse(localStorage.getItem('greemall_user'))
-    },
+    }
   },
   mounted() {
     EventBus.$on('opendomview', this.opendomview)
@@ -121,9 +166,9 @@ export default {
     if (this.timeId) {
       clearTimeout(this.timeId)
     }
-    (function dingshiqingqiu() {
+    ;(function dingshiqingqiu() {
       this_.updateUnreadNotice()
-      this_.timeId = setTimeout(dingshiqingqiu, 2000);
+      this_.timeId = setTimeout(dingshiqingqiu, 2000)
     })()
     commonCompanywechatGet({ id: this.userInfo.companyWechatId }).then(res => {
       console.log(res)
@@ -131,28 +176,34 @@ export default {
       if (res?.data?.qrcode1) {
         this.QRcodeList.push({
           codeUrl: res.data.qrcode1,
-          name: "小程序",
-          saleName: "",
-          iosIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png",
-          androidIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png"
+          name: '小程序',
+          saleName: '',
+          iosIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
+          androidIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
         })
       }
       if (res?.data?.qrcode2) {
         this.QRcodeList.push({
           codeUrl: res.data.qrcode2,
-          name: "公众号",
-          saleName: "",
-          iosIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png",
-          androidIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png"
+          name: '公众号',
+          saleName: '',
+          iosIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
+          androidIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
         })
       }
       if (res?.data?.payQrcode) {
         this.QRcodeList.push({
           codeUrl: res.data.payQrcode,
-          name: "收款码",
-          saleName: "",
-          iosIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png",
-          androidIcon: "https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png"
+          name: '收款码',
+          saleName: '',
+          iosIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/17115930219681afd35b0-8c93-400a-94f8-e49277c88616.png',
+          androidIcon:
+            'https://zf-mall.oss-cn-shenzhen.aliyuncs.com/2024-03/1711593045466d069e7f6-5c77-40a0-a7b3-6e2b3a6ce0eb.png'
         })
       }
     })
@@ -228,18 +279,18 @@ export default {
     guanbi() {
       this.drawer = false
       this.pam = {
-        read_flag: "",
+        read_flag: '',
         pageNum: 1,
-        pageSize: 20,
+        pageSize: 20
       }
     },
     // 状态筛选标签
     hadleRead(index) {
       this.dataList = []
-      this.pam.read_flag = ["", "NO", "YES"][index]
+      this.pam.read_flag = ['', 'NO', 'YES'][index]
       this.pam.pageNum = 1
       this.getMessageList()
-    },
+    }
   }
 }
 </script>
@@ -308,7 +359,7 @@ export default {
     height: 100%;
     line-height: 50px;
 
-    &>div {
+    & > div {
       float: left;
     }
 
@@ -355,7 +406,7 @@ export default {
       }
 
       .right-menu-item {
-        .notice-icon>i {
+        .notice-icon > i {
           font-size: 18px;
         }
 
@@ -501,7 +552,7 @@ export default {
     box-sizing: border-box;
     padding: 6px;
     background: #e8fffb;
-    color: #44D4D0;
+    color: #44d4d0;
     margin-right: 6px;
     line-height: normal;
   }
@@ -519,7 +570,7 @@ export default {
       font-size: 12px;
       color: #aaa;
       margin-top: 5px;
-      text-indent: .8em;
+      text-indent: 0.8em;
     }
   }
 
@@ -528,9 +579,6 @@ export default {
   }
 }
 
-
-
-
 ul {
   list-style: none;
   padding: 0;
@@ -547,7 +595,7 @@ ul {
   height: 100%;
   line-height: 50px;
 
-  &>div {
+  & > div {
     float: left;
   }
 
@@ -594,7 +642,7 @@ ul {
     }
 
     .right-menu-item {
-      .notice-icon>i {
+      .notice-icon > i {
         font-size: 18px;
       }
 
@@ -791,7 +839,7 @@ ul {
 ::v-deep .el-dropdown-menu__item.is-disabled {
   color: #000;
   padding: 20px;
-  border-bottom: 1px solid #EBEEF5;
+  border-bottom: 1px solid #ebeef5;
 }
 
 .yidong {
@@ -800,7 +848,7 @@ ul {
   }
 }
 
-::v-deep ul>li:last-child {
+::v-deep ul > li:last-child {
   border-bottom: none !important;
 }
 
@@ -815,7 +863,7 @@ ul {
   width: 120px;
   height: 120px;
   margin-right: 5px;
-  border: 1px solid #EBEEF5;
+  border: 1px solid #ebeef5;
 }
 
 .shouji-icon {

+ 34 - 19
src/components/file-upload/index.vue

@@ -1,14 +1,28 @@
 <template>
   <div>
-    <el-upload name="file" :class="['uploader', uid_]" :action="baseURL + 'common/upload'" :multiple="false"
-      :accept="accept" :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload"
-      :headers="myHeaders" />
+    <el-upload
+      name="file"
+      :class="['uploader', uid_]"
+      :action="baseURL + 'common/upload'"
+      :multiple="false"
+      :accept="accept"
+      :show-file-list="false"
+      :on-success="uploadSuccess"
+      :before-upload="beforeUpload"
+      :headers="myHeaders"
+    />
     <div class="images" v-if="modType === 'view' || modType === 'text'">
       <div v-for="(item, index) in files" :key="index" class="item">
         <div v-if="item.url" class="img">
-          <el-image v-if="checkFileType(item.url) == 'image'" ref="img" :src="item.url" :preview-src-list="previewImages"
-            style="width: 120px;height: 120px" fit="cover" />
-          <el-image v-else ref="img" :src="item.url" style="width: 120px;height: 120px" fit="cover">
+          <el-image
+            v-if="checkFileType(item.url) == 'image'"
+            ref="img"
+            :src="$showImgUrl(item.url)"
+            :preview-src-list="previewImages"
+            style="width: 120px; height: 120px"
+            fit="cover"
+          />
+          <el-image v-else ref="img" :src="$showImgUrl(item.url)" style="width: 120px; height: 120px" fit="cover">
             <div slot="error" class="image-slot">
               <img v-if="checkFileType(item.url) == 'word'" class="file" src="@/assets/common/word.png" />
               <img v-if="checkFileType(item.url) == 'excel'" class="file" src="@/assets/common/excel.png" />
@@ -24,19 +38,20 @@
             <i v-if="isEdit" class="el-icon-delete" @click="deleteImage(item.url)" />
           </div>
         </div>
-        <div style="display: flex;justify-content: space-around;">
+        <div style="display: flex; justify-content: space-around">
           <span v-if="showName">{{ item.name }}</span>
-          <el-link v-if="viewOnline && (checkFileType(item.url) != 'file')" @click="getBase64(item.url)"
-            type="primary">查看</el-link>
+          <el-link v-if="viewOnline && checkFileType(item.url) != 'file'" @click="getBase64(item.url)" type="primary"
+            >查看</el-link
+          >
           <el-link v-if="download" @click="openNew(item.url)" type="primary">下载</el-link>
         </div>
       </div>
       <template v-if="isEdit">
         <div v-if="limit">
           <div v-if="limit !== files.length" class="add" @click="uploadImage()">
-			<div v-if="modType === 'text'">
-			  <div class="upload_text">上传</div>
-			</div>
+            <div v-if="modType === 'text'">
+              <div class="upload_text">上传</div>
+            </div>
             <i v-else class="el-icon-plus" />
           </div>
         </div>
@@ -120,7 +135,7 @@ export default {
   },
   data() {
     return {
-      uid_: this.uid || "id_" + new Date().getTime(),
+      uid_: this.uid || 'id_' + new Date().getTime(),
       myHeaders: { 'x-token': getToken() },
       baseURL: process.env.VUE_APP_BASE_API,
       imageURL: this.$imageUrl,
@@ -141,7 +156,7 @@ export default {
           return false
         }
       },
-      set: function (newValue) { }
+      set: function (newValue) {}
     },
     accept() {
       const imageList = ['.jpg', '.jpeg', '.png']
@@ -285,7 +300,7 @@ export default {
           name: file.name,
           url: res.data.url,
           size: file.size,
-          type: file.name.split(".")[file.name.split(".").length - 1]
+          type: file.name.split('.')[file.name.split('.').length - 1]
         })
         // this.waitUploadList = []
       } else {
@@ -295,7 +310,7 @@ export default {
           name: file.name,
           url: res.data.url,
           size: file.size,
-          type: file.name.split(".")[file.name.split(".").length - 1]
+          type: file.name.split('.')[file.name.split('.').length - 1]
         })
         // this.waitUploadList.splice(index, 1)
       }
@@ -398,8 +413,8 @@ export default {
 .uploader {
   height: 0;
 }
-.upload_text{
-	color: #409eff;
-	cursor: pointer;
+.upload_text {
+  color: #409eff;
+  cursor: pointer;
 }
 </style>

+ 0 - 369
src/components/file-upload/index_oss.vue

@@ -1,369 +0,0 @@
-<template>
-  <div>
-    <el-upload name="file" :class="['uploader', uid]" :action="oss_url" :data="dataObj" :multiple="multiple"
-      :accept="accept" :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload" />
-    <div class="images" v-if="modType === 'view'">
-      <div v-for="(item, index) in files" :key="index" class="item">
-        <div v-if="item.url" class="img">
-          <el-image v-if="checkFileType(item.url) == 'image'" ref="img" :src="imageURL + item.url"
-            :preview-src-list="previewImages" style="width: 120px; height: 120px" fit="cover" />
-          <el-image v-else ref="img" :src="imageURL + item.url" style="width: 120px; height: 120px" fit="cover">
-            <div slot="error" class="image-slot">
-              <img v-if="checkFileType(item.url) == 'word'" class="file" src="@/assets/common/word.png" />
-              <img v-if="checkFileType(item.url) == 'excel'" class="file" src="@/assets/common/excel.png" />
-              <img v-if="checkFileType(item.url) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
-              <img v-if="checkFileType(item.url) == 'pdf'" class="file" src="@/assets/common/pdf.png" />
-              <img v-if="checkFileType(item.url) == 'file'" class="file" src="@/assets/common/zip.jpeg" />
-              <img v-if="checkFileType(item.url) == 'video'" class="file" src="@/assets/common/video.jpeg" />
-            </div>
-          </el-image>
-          <div v-if="isEdit || checkFileType(item.url) == 'image'" class="mask">
-            <i v-if="checkFileType(item.url) == 'image'" class="el-icon-zoom-in" @click="previewImage(item.url)" />
-            <i v-if="isEdit && isUpdate" class="el-icon-upload2" @click="uploadImage(item.url)" />
-            <i v-if="isEdit" class="el-icon-delete" @click="deleteImage(item.url)" />
-          </div>
-        </div>
-      </div>
-      <template v-if="isEdit">
-        <div v-if="limit">
-          <div v-if="limit !== files.length" class="add" @click="uploadImage()">
-            <i class="el-icon-plus" />
-          </div>
-        </div>
-        <div v-else>
-          <div v-if="multiple || (!multiple && files.length < 1)" class="add" @click="uploadImage()">
-            <i class="el-icon-plus" />
-          </div>
-        </div>
-      </template>
-    </div>
-    <div v-if="modType === 'btn'">
-      <el-button size="mini" type="primary" @click="uploadImage()">上传</el-button>
-    </div>
-  </div>
-</template>
-<script>
-import { getOssConfig } from '@/api/common'
-import { findElem } from '@/utils/util'
-
-export default {
-  name: 'FileUpload',
-  props: {
-    modType: {
-      type: String,
-      default: 'view'
-    },
-    uid: {
-      type: String,
-      default: 'uidImgfile'
-    },
-    // 最大上传数量
-    limit: {
-      type: Number,
-      default: 1
-    },
-    // 接受上传的文件列表
-    fileList: {
-      type: Array,
-      default: () => []
-    },
-    // 接受上传的文件类型
-    fileType: {
-      type: Array,
-      default: () => ['image', 'word', 'excel', 'ppt', 'pdf', 'file', 'video']
-    },
-    // 是否支持多选文件
-    multiple: {
-      type: Boolean,
-      default: false
-    },
-    startRestricting: {
-      type: Boolean,
-      default: false
-    },
-    restrictFilename: {
-      type: Array,
-      default: () => {
-        return []
-      }
-    },
-    isEdit: {
-      type: Boolean,
-      default: true
-    },
-    isUpdate: {
-      type: Boolean,
-      default: true
-    },
-  },
-  data() {
-    return {
-      imageURL: this.$imageUrl,
-      oss_url: '',
-      dataObj: {},
-      uploadImageUrl: '',
-      waitUploadList: [],
-      fileName: '',
-      files: this.fileList
-    }
-  },
-  computed: {
-    isShowFileList: {
-      get: function () {
-        if (this.files.length > 0 && this.files[0].url) {
-          return true
-        } else {
-          return false
-        }
-      },
-      set: function (newValue) { }
-    },
-    accept() {
-      const imageList = ['.jpg', '.jpeg', '.png']
-      const videoList = ['.mp4']
-      const wordList = ['.doc', '.docx', '.dot', '.wps', '.wpt']
-      const excelList = ['.xls', '.xlsx', '.xlt', '.et', '.ett']
-      const pptList = ['.ppt', '.pptx', '.dps', '.dpt', '.pot', '.pps']
-      const pdfList = ['.pdf']
-      const fileList = ['.zip', '.rar', '.gz', '.apk']
-      let whiteList = []
-      this.fileType.includes('image') && (whiteList = whiteList.concat(imageList))
-      this.fileType.includes('video') && (whiteList = whiteList.concat(videoList))
-      this.fileType.includes('word') && (whiteList = whiteList.concat(wordList))
-      this.fileType.includes('excel') && (whiteList = whiteList.concat(excelList))
-      this.fileType.includes('ppt') && (whiteList = whiteList.concat(pptList))
-      this.fileType.includes('pdf') && (whiteList = whiteList.concat(pdfList))
-      this.fileType.includes('file') && (whiteList = whiteList.concat(fileList))
-      return whiteList.join(',')
-    },
-    previewImages() {
-      const fileList = []
-      if (this.files && this.files.length > 0) {
-        this.files.forEach(item => {
-          if (this.checkFileType(item.url) == 'image') {
-            fileList.push(this.imageURL + item.url)
-          }
-        })
-      }
-      return fileList
-    }
-  },
-  watch: {
-    files() {
-      if (this.isEdit) {
-        this.$emit('getFiles', this.files)
-      }
-    },
-    fileList() {
-      this.files = this.fileList
-    }
-  },
-  created() {
-    getOssConfig().then(res => {
-      this.oss_url = res.data.host
-    })
-  },
-  methods: {
-    getUUID() {
-      return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
-        return (c === 'x' ? (Math.random() * 16) | 0 : 'r&0x3' | '0x8').toString(16)
-      })
-    },
-    createName(name) {
-      const date = Date.now()
-      const uuid = this.getUUID()
-      const fileSuffix = name.substring(name.lastIndexOf('.') + 1)
-      return `${date}${uuid}.${fileSuffix}`
-    },
-    // 检查文件类型
-    checkFileType(url) {
-      if (!url) return ''
-      const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
-      if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
-        return 'image'
-      } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
-        return 'word'
-      } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
-        return 'excel'
-      } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
-        return 'ppt'
-      } else if (['pdf'].includes(fileSuffix)) {
-        return 'pdf'
-      } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
-        return 'file'
-      } else if (['mp4'].includes(fileSuffix)) {
-        return 'video'
-      }
-    },
-    // 获取oss配置
-    async getOssConfig(fileName) {
-      const result = await new Promise((resolve, reject) => {
-        getOssConfig()
-          .then(res => {
-            const fileKey = this.createName(fileName)
-            res.data.name = fileName
-            res.data.key = res.data.dir + fileKey
-            resolve(res.data)
-          })
-          .catch(res => {
-            resolve({})
-          })
-      })
-      return result
-    },
-    // 预览图片
-    previewImage(url) {
-      const index = findElem(this.files, 'url', url)
-      this.$refs.img[index].showViewer = true
-    },
-    // 删除图片
-    deleteImage(url) {
-      const index = findElem(this.files, 'url', url)
-      this.files.splice(index, 1)
-    },
-    // 点击上传
-    uploadImage(url) {
-      this.uploadImageUrl = url
-      document.querySelector(`.${this.uid}` + ' input').click()
-    },
-    // 上传文件之前
-    async beforeUpload(file) {
-      const loading = this.$loading({
-        lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
-      })
-      this.getFileName(file.name)
-      this.$emit('handleIsFileName', this.fileName)
-      this.dataObj = await this.getOssConfig(this.fileName)
-      this.waitUploadList.push(this.dataObj)
-    },
-    // 文件上传成功
-    uploadSuccess(res, file) {
-      const loading = this.$loading({
-        lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
-      })
-      if (this.uploadImageUrl) {
-        const index = findElem(this.files, 'url', this.uploadImageUrl)
-        this.$set(this.files, index, {
-          name: this.dataObj.name,
-          url: this.dataObj.key,
-          size: file.size,
-          type: file.name.split(".")[file.name.split(".").length - 1]
-        })
-        this.waitUploadList = []
-      } else {
-        this.getFileName(file.name)
-        const index = findElem(this.waitUploadList, 'name', this.fileName)
-        this.files.push({
-          name: this.waitUploadList[index].name,
-          url: this.waitUploadList[index].key,
-          size: file.size,
-          type: file.name.split(".")[file.name.split(".").length - 1]
-        })
-        this.waitUploadList.splice(index, 1)
-      }
-      this.showFileList = true
-      loading.close()
-    },
-    getFileName(name) {
-      const fileName = name.substring(0, name.lastIndexOf('.'))
-      let suffix = name.match(/.[^.]+$/)[0]
-      // 押金申请上传限制
-      this.fileName = name
-      if (this.startRestricting) {
-        // 检查是否存在相应文字,否filterKeywords.length = 0
-        const filterKeywords = this.restrictFilename.filter(k => fileName.includes(k))
-        // filterKeywords = 0 || 'zip', 'rar', 'gz', 'apk' 归为 其他文件
-        if (!filterKeywords.length || suffix.includes('zip', 'rar', 'gz', 'apk')) {
-          this.fileName = `其他文件-${fileName}${suffix}`
-        }
-        // 限制照片/相片名称统一为照片 , restrictFilename[restrictFilename.length-1|restrictFilename.length-1]为照片、相片
-        if (fileName.includes('相片') || fileName.includes('照片')) {
-          this.fileName = `照片-${fileName}${suffix}`
-        }
-      }
-    }
-  }
-}
-</script>
-
-<style scoped lang="scss">
-.images {
-  display: flex;
-  flex-wrap: wrap;
-
-  .item {
-    margin-right: 20px;
-    margin-bottom: 20px;
-
-    .img {
-      width: 120px;
-      height: 120px;
-      border-radius: 5px;
-      overflow: hidden;
-      position: relative;
-      border: 1px dashed #eaeaea;
-      display: flex;
-
-      .el-image {
-        display: block;
-      }
-
-      .file {
-        width: 120px;
-        height: 120px;
-        display: block;
-        padding: 30px;
-      }
-
-      .mask {
-        position: absolute;
-        left: 0;
-        top: 0;
-        width: 120px;
-        height: 120px;
-        background: rgba($color: #000000, $alpha: 0.3);
-        display: none;
-        align-items: center;
-        justify-content: center;
-
-        i {
-          font-size: 20px;
-          color: #ffffff;
-          cursor: pointer;
-          margin: 0 8px;
-        }
-      }
-
-      &:hover .mask {
-        display: flex;
-      }
-    }
-  }
-
-  .add {
-    width: 120px;
-    height: 120px;
-    border: 1px dashed #eaeaea;
-    border-radius: 5px;
-    cursor: pointer;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-
-    i {
-      font-size: 30px;
-      color: #999;
-    }
-  }
-}
-
-.uploader {
-  height: 0;
-}
-</style>

+ 5 - 2
src/components/geographicalPosi/index.vue

@@ -66,7 +66,8 @@
                 </div>
                 <div>
                   <template v-for="(p, i) in item.photos || []">
-                    <img :key="i" v-if="i === 0" :src="seturl(p.url)" />
+                    <!-- <img :key="i" v-if="i === 0" :src="seturl(p.url)" /> -->
+                    <img :key="i" v-if="i === 0" :src="$showImgUrl(p.url)" />
                   </template>
                 </div>
               </div>
@@ -122,7 +123,9 @@ export default {
     async open() {
       this.dialogVisible = true
       if (this.formData.lng && this.formData.lat && (this.formData.gpsAddress || this.formData.address)) {
-        this.changeSearchMapFn(`${this.formData.lng}//${this.formData.lat}//${(this.formData.gpsAddress || this.formData.address)}`)
+        this.changeSearchMapFn(
+          `${this.formData.lng}//${this.formData.lat}//${this.formData.gpsAddress || this.formData.address}`
+        )
       } else {
         var str = ''
         if (!~(this.formData.gpsAddress || this.formData.address || '').indexOf(this.formData.province)) {

+ 4 - 5
src/components/image-upload/index.vue

@@ -51,7 +51,7 @@
   </div>
 </template>
 <script>
-import { getOssConfig,getFileUrl } from '@/api/common'
+import { getOssConfig, getFileUrl } from '@/api/common'
 import { findElem } from '@/utils/util'
 
 export default {
@@ -210,15 +210,14 @@ export default {
       return result
     },
 
-
     //
-    async previewFile(url){
+    async previewFile(url) {
       let res = await getFileUrl({ key: url })
       window.open(this.$xdocUrl + encodeURIComponent(res.data))
     },
-    downloadFile(item){
+    downloadFile(item) {
       const a = document.createElement('a')
-      a.download =  item.name
+      a.download = item.name
       a.href = this.$imageUrl + item.url
       document.body.appendChild(a)
       a.click()

+ 27 - 19
src/main.js

@@ -15,8 +15,7 @@ import 'quill/dist/quill.snow.css'
 import 'quill/dist/quill.bubble.css'
 Vue.use(VueQuillEditor /* { default global options } */)
 
-
-import dataV from '@jiaminghi/data-view';
+import dataV from '@jiaminghi/data-view'
 Vue.use(dataV)
 
 import VQuillEditor from '@/components/v-quill-editor'
@@ -129,13 +128,23 @@ import CopyButton from '@/components/Common/copy-button.vue'
 Vue.component('CopyButton', CopyButton)
 import Collapse from '@/components/Common/collapse'
 Vue.component('Collapse', Collapse)
-Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_OSS;
 Vue.prototype.$xdocUrl = 'https://pgxtadm.greeapps.com/preview/onlinePreview?url='
 
+Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_API + 'img/get?key='
+Vue.prototype.$showImgUrl = function (url) {
+  try {
+    const { pathname } = new URL(url)
+    if (pathname.startsWith('/')) {
+      return `${process.env.VUE_APP_BASE_API}img/get?key=${pathname.substring(1)}`
+    }
+    return `${process.env.VUE_APP_BASE_API}img/get?key=${pathname}`
+  } catch (error) {
+    return url
+  }
+}
 
-Vue.prototype.$findElem = findElem;
-Vue.prototype.$deleteEmptyObj = deleteEmptyObj;
-
+Vue.prototype.$findElem = findElem
+Vue.prototype.$deleteEmptyObj = deleteEmptyObj
 
 /**
  * If you don't want to use mock-server
@@ -155,33 +164,32 @@ if (process.env.NODE_ENV === 'production') {
 // 如果想要中文版 element-ui,按如下方式声明
 Vue.use(ElementUI)
 
-import { Message } from 'element-ui';
+import { Message } from 'element-ui'
 //定义一个新的Message方法,多传入一个offset参数
 const $message = options => {
   return Message({
     ...options,
     offset: 80
-  });
-};
- 
+  })
+}
+
 //重写方法,将offset写入options
-['success', 'warning', 'info', 'error'].forEach(type => {
+;['success', 'warning', 'info', 'error'].forEach(type => {
   $message[type] = options => {
     if (typeof options === 'string') {
       options = {
         message: options,
         offset: 80
-      };
+      }
     }
-    options.type = type;
-    return Message(options);
-  };
-});
+    options.type = type
+    return Message(options)
+  }
+})
 //将$message挂载到this上
-Vue.prototype.$message = $message;
+Vue.prototype.$message = $message
 //不加这行代码运行this.$message.closeAll时会报错
-Vue.prototype.$message.closeAll = Message.closeAll;
-
+Vue.prototype.$message.closeAll = Message.closeAll
 
 // register global utility filters
 Object.keys(filters).forEach(key => {

+ 808 - 675
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -1,23 +1,41 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing" :operationColumnWidth="50"
-			  :operation="operation()" :exportList="exportList">
-			</template-page>
-			<div v-if="~['add', 'edit'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-					<zj-form-module title="" label-width="170px" :showPackUp="false"
-						:form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
-					</zj-form-module>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operationColumnWidth="50"
+        :operation="operation()"
+        :exportList="exportList"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="170px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+            :disabled="formDialogType == 2"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -26,671 +44,786 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, updateStatus, listImport1, listImport2, getTypeList, getCategoryList } from "@/api/auxiliaryFittings/attachmentProfile";
+import {
+  listPageV2,
+  pageExport,
+  getDetail,
+  add,
+  edit,
+  updateStatus,
+  listImport1,
+  listImport2,
+  getTypeList,
+  getCategoryList
+} from '@/api/auxiliaryFittings/attachmentProfile'
 import { commonTemplateDownload } from '@/api/common.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-	components: { TemplatePage, ImageUpload },
-	mixins: [import_mixin, operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			formData: {
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				goodsType: 'P',
-				goodsStockUnit: '',
-				goodsCode: '',
-				goodsName: '',
-				normType: 'M',
-				status: 'ON',
-				categoryList: [],
-				brandList: [],
-				marketPrice: '',
-				normAmount: '',
-				selfWebsitAmount: '',
-				selfWorkerAmount: '',
-				outWebsitAmount: '',
-				outWorkerAmount: '',
-				remark: ''
-			},
-			partsUnitList: [],
-			brandList: [],
-			categoryList: [],
-			formType: 'add',
-			formVisible: false,
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: () => {
-								this.openForm('add')
-							}
-						}),
-					],
-				],
-				[
-					[
-						this.optionsEvensAuth("shelfInBulk", {
-							click: () => {
-								this.updateStatus('ON')
-							}
-						}),
-					],
-				],
-				[
-					[
-						this.optionsEvensAuth("batchRemoval", {
-							click: () => {
-								this.updateStatus('OFF')
-							}
-						}),
-					],
-				],
-				[
-					[
-						this.optionsEvensAuth("template", {
-							click: this.handleDownload1
-						}),
-					],
-					[
-						this.optionsEvensAuth("imp", ({ moduleName }) => {
-							return {
-								name: moduleName,
-								render: () => {
-									return this.importButton(listImport1, moduleName)
-								}
-							}
-						}),
-					],
-				],
-				[
-					[
-						this.optionsEvensAuth("importTemplate", {
-							click: this.handleDownload2
-						}),
-					],
-					[
-						this.optionsEvensAuth("Import", ({ moduleName }) => {
-							return {
-								name: moduleName,
-								render: () => {
-									return this.importButton(listImport2, moduleName)
-								}
-							}
-						}),
-					],
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      formData: {
+        companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        goodsType: 'P',
+        goodsStockUnit: '',
+        goodsCode: '',
+        goodsName: '',
+        normType: 'M',
+        status: 'ON',
+        categoryList: [],
+        brandList: [],
+        marketPrice: '',
+        normAmount: '',
+        selfWebsitAmount: '',
+        selfWorkerAmount: '',
+        outWebsitAmount: '',
+        outWorkerAmount: '',
+        remark: ''
+      },
+      partsUnitList: [],
+      brandList: [],
+      categoryList: [],
+      formType: 'add',
+      formVisible: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('shelfInBulk', {
+              click: () => {
+                this.updateStatus('ON')
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('batchRemoval', {
+              click: () => {
+                this.updateStatus('OFF')
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('template', {
+              click: this.handleDownload1
+            })
+          ],
+          [
+            this.optionsEvensAuth('imp', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(listImport1, moduleName)
+                }
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('importTemplate', {
+              click: this.handleDownload2
+            })
+          ],
+          [
+            this.optionsEvensAuth('Import', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(listImport2, moduleName)
+                }
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
 
-		//加法 
-		accAdd() {
-			return function (arg1, arg2) {
-				var r1, r2, m;
-				try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
-				try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
-				m = Math.pow(10, Math.max(r1, r2))
-				return (arg1 * m + arg2 * m) / m
-			}
-		},
-		//减法 
-		Subtr() {
-			return function (arg1, arg2) {
-				var r1, r2, m, n;
-				try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
-				try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
-				m = Math.pow(10, Math.max(r1, r2));
-				n = (r1 >= r2) ? r1 : r2;
-				return ((arg1 * m - arg2 * m) / m).toFixed(2);
-			}
-		},
-		formItems() {
-			return [{
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', disabled: true },
-				formItemAttributes: {
-					label: '所属商户',
-					prop: 'companyName',
-					rules: [...required]
-				},
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'slot-component',
-				attributes: {},
-				formItemAttributes: {
-					label: '状态',
-					prop: 'status',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-radio-group v-model={this.formData.status}>
-							<el-radio disabled={this.formDialogType == 2} label="ON">上架</el-radio>
-							<el-radio disabled={this.formDialogType == 2} label="OFF">下架</el-radio>
-						</el-radio-group>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入配件名称', },
-				formItemAttributes: {
-					label: '配件名称',
-					prop: 'goodsName',
-					rules: [...required]
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-select-add',
-				labelKey: 'dictValue',
-				valueKey: 'dictValue',
-				options: this.partsUnitList,
-				attributes: { placeholder: '请选择单位', filterable: true, clearable: true },
-				formItemAttributes: {
-					label: '单位',
-					prop: 'goodsStockUnit',
-					rules: [...required]
-				},
-				events: {
-					change: (e) => {
-						this.$refs.formRef.validateField(['goodsStockUnit'], (valid, invalidFields, errLabels) => { })
-					}
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入配件编码' },
-				formItemAttributes: {
-					label: '配件编码',
-					prop: 'goodsCode',
-					rules: [...required]
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'slot-component',
-				attributes: {},
-				formItemAttributes: {
-					label: '收费类型',
-					prop: 'normType',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-radio-group v-model={this.formData.normType}>
-							<el-radio disabled={this.formDialogType == 2} label="M">配件物料</el-radio>
-							<el-radio disabled={this.formDialogType == 2} label="S">服务收费</el-radio>
-						</el-radio-group>
-					)
-				}
-			}, {
-				md: 24,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'el-checkbox-add',
-				labelKey: 'dictValue',
-				valueKey: 'dictCode',
-				attributes: {},
-				options: this.brandList,
-				formItemAttributes: {
-					label: '适用品牌',
-					prop: 'brandList',
-					rules: [...required]
-				},
-				events: {
-					change: (e) => {
-						this.$refs.formRef.validateField(['brandList'], (valid, invalidFields, errLabels) => { })
-					}
-				}
-			}, {
-				md: 24,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'el-checkbox-add',
-				labelKey: 'name',
-				valueKey: 'categoryId',
-				attributes: {},
-				options: this.categoryList,
-				formItemAttributes: {
-					label: '适用产品大类',
-					prop: 'categoryList',
-					rules: [...required]
-				},
-				events: {
-					change: (e) => {
-						this.$refs.formRef.validateField(['categoryList'], (valid, invalidFields, errLabels) => { })
-					}
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '销售价格',
-					prop: 'marketPrice',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.marketPrice} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-							<div style="color: #EA8000">注:维护网点销售给师傅的价格</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '收费标准',
-					prop: 'normAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.normAmount} onChange={(e) => {
-									this.formData.normAmount = Number(e).toFixed(2)
-									if (this.formData.selfWorkerAmount > e) {
-										this.formData.normAmount = ''
-										return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
-									} else if (this.formData.outWorkerAmount > e) {
-										this.formData.outWorkerAmount = ''
-										return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
-									}
-									this.formData.selfWebsitAmount = this.Subtr(e, this.formData.selfWorkerAmount)
-									this.formData.outWebsitAmount = this.Subtr(e, this.formData.outWorkerAmount)
-									this.$refs.formRef.validateField(['selfWebsitAmount'], (valid, invalidFields, errLabels) => { })
-									this.$refs.formRef.validateField(['outWebsitAmount'], (valid, invalidFields, errLabels) => { })
-								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-							<div style="color: #EA8000">注:分账金额需扣除手续费0.6%</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '自有库存师傅分账金额',
-					prop: 'selfWorkerAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					const that = this
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.selfWorkerAmount} onChange={(e) => {
-									this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-									if (e && (Number(e) > Number(that.formData.normAmount))) {
-										that.formData.selfWorkerAmount = ''
-										return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
-									}
-									that.formData.selfWebsitAmount = this.Subtr(that.formData.normAmount, e)
-								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? false : true,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '师傅分账比例',
-					prop: 'selfWorkerAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					const that = this
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.selfWorkerAmount} onChange={(e) => {
-									this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-									if (e && (Number(e) < 0)) {
-										return this.$message.warning('师傅分账比例不能为0!');
-									}
-									if (e && (this.accAdd(Number(e), Number(that.formData.selfWebsitAmount)) > 100)) {
-										this.formData.selfWorkerAmount = 0
-										return this.$message.warning('商户与师傅分账比例和最大只能100%!');
-									} else {
-										that.formData.selfWebsitAmount = this.Subtr(100, e)
-									}
-								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '外购配件师傅分账金额',
-					prop: 'outWorkerAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					const that = this
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.outWorkerAmount} onChange={(e) => {
-									this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
-									if (Number(e) > Number(that.formData.normAmount)) {
-										this.formData.outWorkerAmount = ''
-										return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
-									}
-									this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount, e)
-								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '自有库存商户分账金额',
-					prop: 'selfWebsitAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.selfWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? false : true,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '商户分账比例',
-					prop: 'selfWebsitAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					const that = this
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.selfWebsitAmount} onChange={(e) => {
-									this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
-									if (e && (Number(e) < 0)) {
-										return this.$message.warning('商户分账比例不能为0!');
-									}
-									if (e && (this.accAdd(Number(e), Number(that.formData.selfWorkerAmount)) > 100)) {
-										this.formData.selfWebsitAmount = 0
-										return this.$message.warning('商户与师傅分账比例和最大只能100%!');
-									} else {
-										that.formData.selfWorkerAmount = this.Subtr(100, e)
-									}
-								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.formData.normType == 'M' ? true : false,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入', type: 'number' },
-				formItemAttributes: {
-					label: '外购配件商户分账金额',
-					prop: 'outWebsitAmount',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<div style="position: relative;">
-							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-								<el-input v-model={this.formData.outWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-							</div>
-						</div>
-					)
-				}
-			}, {
-				md: 24,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
-				formItemAttributes: {
-					label: '备注',
-					prop: 'remark',
-					rules: []
-				}
-			}]
-		}
-	},
-	methods: {
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				if (this.examineStatus) {
-					pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
-				}
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		getTypeList(value, type) {
-			getTypeList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.dict_type", "compare": "=", "value": `${value}` }, { "param": "a.status", "compare": "=", "value": "ON" }] }).then(res => {
-				this[type] = res.data.records
-			})
-		},
-		getCategoryList() {
-			getCategoryList({ "type": 2 }).then(res => {
-				this.categoryList = res.data
-			})
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			if (item.jname === 'selfWorkerAmount') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div>{row.normType == 'M' ? row.selfWorkerAmount : (row.selfWorkerAmount + '%')}</div>
-					)
-				}
-			}
-			if (item.jname === 'selfWebsitAmount') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div>{row.normType == 'M' ? row.selfWebsitAmount : (row.selfWebsitAmount + '%')}</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+    //加法
+    accAdd() {
+      return function (arg1, arg2) {
+        var r1, r2, m
+        try {
+          r1 = arg1.toString().split('.')[1].length
+        } catch (e) {
+          r1 = 0
+        }
+        try {
+          r2 = arg2.toString().split('.')[1].length
+        } catch (e) {
+          r2 = 0
+        }
+        m = Math.pow(10, Math.max(r1, r2))
+        return (arg1 * m + arg2 * m) / m
+      }
+    },
+    //减法
+    Subtr() {
+      return function (arg1, arg2) {
+        var r1, r2, m, n
+        try {
+          r1 = arg1.toString().split('.')[1].length
+        } catch (e) {
+          r1 = 0
+        }
+        try {
+          r2 = arg2.toString().split('.')[1].length
+        } catch (e) {
+          r2 = 0
+        }
+        m = Math.pow(10, Math.max(r1, r2))
+        n = r1 >= r2 ? r1 : r2
+        return ((arg1 * m - arg2 * m) / m).toFixed(2)
+      }
+    },
+    formItems() {
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.status}>
+                <el-radio disabled={this.formDialogType == 2} label="ON">
+                  上架
+                </el-radio>
+                <el-radio disabled={this.formDialogType == 2} label="OFF">
+                  下架
+                </el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入配件名称' },
+          formItemAttributes: {
+            label: '配件名称',
+            prop: 'goodsName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select-add',
+          labelKey: 'dictValue',
+          valueKey: 'dictValue',
+          options: this.partsUnitList,
+          attributes: { placeholder: '请选择单位', filterable: true, clearable: true },
+          formItemAttributes: {
+            label: '单位',
+            prop: 'goodsStockUnit',
+            rules: [...required]
+          },
+          events: {
+            change: e => {
+              this.$refs.formRef.validateField(['goodsStockUnit'], (valid, invalidFields, errLabels) => {})
+            }
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入配件编码' },
+          formItemAttributes: {
+            label: '配件编码',
+            prop: 'goodsCode',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '收费类型',
+            prop: 'normType',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.normType}>
+                <el-radio disabled={this.formDialogType == 2} label="M">
+                  配件物料
+                </el-radio>
+                <el-radio disabled={this.formDialogType == 2} label="S">
+                  服务收费
+                </el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 24,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'el-checkbox-add',
+          labelKey: 'dictValue',
+          valueKey: 'dictCode',
+          attributes: {},
+          options: this.brandList,
+          formItemAttributes: {
+            label: '适用品牌',
+            prop: 'brandList',
+            rules: [...required]
+          },
+          events: {
+            change: e => {
+              this.$refs.formRef.validateField(['brandList'], (valid, invalidFields, errLabels) => {})
+            }
+          }
+        },
+        {
+          md: 24,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'el-checkbox-add',
+          labelKey: 'name',
+          valueKey: 'categoryId',
+          attributes: {},
+          options: this.categoryList,
+          formItemAttributes: {
+            label: '适用产品大类',
+            prop: 'categoryList',
+            rules: [...required]
+          },
+          events: {
+            change: e => {
+              this.$refs.formRef.validateField(['categoryList'], (valid, invalidFields, errLabels) => {})
+            }
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '销售价格',
+            prop: 'marketPrice',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input v-model={this.formData.marketPrice} type="number" placeholder="请输入"></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+                <div style="color: #EA8000">注:维护网点销售给师傅的价格</div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '收费标准',
+            prop: 'normAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.normAmount}
+                    onChange={e => {
+                      this.formData.normAmount = Number(e).toFixed(2)
+                      if (this.formData.selfWorkerAmount > e) {
+                        this.formData.normAmount = ''
+                        return this.$message.warning('自有库存师傅分账金额必须小于收费标准!')
+                      } else if (this.formData.outWorkerAmount > e) {
+                        this.formData.outWorkerAmount = ''
+                        return this.$message.warning('外购配件师傅分账金额必须小于收费标准!')
+                      }
+                      this.formData.selfWebsitAmount = this.Subtr(e, this.formData.selfWorkerAmount)
+                      this.formData.outWebsitAmount = this.Subtr(e, this.formData.outWorkerAmount)
+                      this.$refs.formRef.validateField(['selfWebsitAmount'], (valid, invalidFields, errLabels) => {})
+                      this.$refs.formRef.validateField(['outWebsitAmount'], (valid, invalidFields, errLabels) => {})
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+                <div style="color: #EA8000">注:分账金额需扣除手续费0.6%</div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '自有库存师傅分账金额',
+            prop: 'selfWorkerAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            const that = this
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.selfWorkerAmount}
+                    onChange={e => {
+                      this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+                      if (e && Number(e) > Number(that.formData.normAmount)) {
+                        that.formData.selfWorkerAmount = ''
+                        return this.$message.warning('自有库存师傅分账金额必须小于收费标准!')
+                      }
+                      that.formData.selfWebsitAmount = this.Subtr(that.formData.normAmount, e)
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? false : true,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '师傅分账比例',
+            prop: 'selfWorkerAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            const that = this
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.selfWorkerAmount}
+                    onChange={e => {
+                      this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+                      if (e && Number(e) < 0) {
+                        return this.$message.warning('师傅分账比例不能为0!')
+                      }
+                      if (e && this.accAdd(Number(e), Number(that.formData.selfWebsitAmount)) > 100) {
+                        this.formData.selfWorkerAmount = 0
+                        return this.$message.warning('商户与师傅分账比例和最大只能100%!')
+                      } else {
+                        that.formData.selfWebsitAmount = this.Subtr(100, e)
+                      }
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">%</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '外购配件师傅分账金额',
+            prop: 'outWorkerAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            const that = this
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.outWorkerAmount}
+                    onChange={e => {
+                      this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
+                      if (Number(e) > Number(that.formData.normAmount)) {
+                        this.formData.outWorkerAmount = ''
+                        return this.$message.warning('外购配件师傅分账金额必须小于收费标准!')
+                      }
+                      this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount, e)
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '自有库存商户分账金额',
+            prop: 'selfWebsitAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.selfWebsitAmount}
+                    disabled
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? false : true,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '商户分账比例',
+            prop: 'selfWebsitAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            const that = this
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.selfWebsitAmount}
+                    onChange={e => {
+                      this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
+                      if (e && Number(e) < 0) {
+                        return this.$message.warning('商户分账比例不能为0!')
+                      }
+                      if (e && this.accAdd(Number(e), Number(that.formData.selfWorkerAmount)) > 100) {
+                        this.formData.selfWebsitAmount = 0
+                        return this.$message.warning('商户与师傅分账比例和最大只能100%!')
+                      } else {
+                        that.formData.selfWorkerAmount = this.Subtr(100, e)
+                      }
+                    }}
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">%</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.formData.normType == 'M' ? true : false,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '外购配件商户分账金额',
+            prop: 'outWebsitAmount',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div style="position: relative;">
+                <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+                  <el-input
+                    v-model={this.formData.outWebsitAmount}
+                    disabled
+                    type="number"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span style="margin-left: 10px;">元</span>
+                </div>
+              </div>
+            )
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入备注内容', type: 'textarea', rows: 5 },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.examineStatus) {
+          pam.params.push({ param: 'b.examine_status', compare: '=', value: this.examineStatus })
+        }
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    getTypeList(value, type) {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.dict_type', compare: '=', value: `${value}` },
+          { param: 'a.status', compare: '=', value: 'ON' }
+        ]
+      }).then(res => {
+        this[type] = res.data.records
+      })
+    },
+    getCategoryList() {
+      getCategoryList({ type: 2 }).then(res => {
+        this.categoryList = res.data
+      })
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      if (item.jname === 'selfWorkerAmount') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <div>{row.normType == 'M' ? row.selfWorkerAmount : row.selfWorkerAmount + '%'}</div>
+        }
+      }
+      if (item.jname === 'selfWebsitAmount') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <div>{row.normType == 'M' ? row.selfWebsitAmount : row.selfWebsitAmount + '%'}</div>
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				edit: {
-					click: ({ row, index, column }) => {
-						this.openForm('edit',row.goodsId)
-					}
-				},
-			})
-		},
-		// 打开 新增编辑 网点表单
-		openForm(type, id) {
-			this.$refs.tabPage.addTab({
-				// 对应显示的模块
-				activeKey: type,
-				// 唯一标识
-				key: type,
-				// 页签名称
-				label: ({ edit: "编辑", add: "新增" })[type],
-				// 打开时事件
-				triggerEvent: () => {
-					this.formCancel()
-					this.$nextTick(()=>{
-						this.formType = type
-						this.formVisible = true
-						this.getTypeList('PARTS_UNIT', 'partsUnitList')
-						this.getTypeList('BRAND', 'brandList')
-						this.getCategoryList()
-						if (type == 'add') {
-							this.formDialogType = 0
-						} else if(type == 'edit'){
-							this.formDialogType = 1
-							getDetail({ id }).then(res => {
-								Object.assign(this.formData, res.data, {
-									brandList: res.data.brandList ? res.data.brandList : [],
-									categoryList: res.data.categoryList ? res.data.categoryList : [],
-							
-								})
-							})
-						}
-					})
-				},
-				// 关闭时事件
-				closeEvent: () => {
-				
-				}
-			})
-		},
-		formCancel() {
-			this.formVisible = false
-			this.$refs?.formRef?.resetFields()
-			this.$data.formData = this.$options.data().formData
-		},
-		updateStatus(stateEnum) {
-			if (this.recordSelected.length == 0) {
-				return this.$message.warning('请至少勾选一条数据!');
-			}
-			console.log(this.recordSelected)
-			this.$confirm(`请确认是否${stateEnum == 'OFF' ? '下架' : '上架'}该配件, 是否继续?`, '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				updateStatus({
-					stateEnum,
-					ids: this.recordSelected.map(item => { return item.goodsId }).join(',')
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: `${stateEnum == 'ON' ? '上架' : '下架'}成功!` })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-		},
-		formConfirm(cancel) {
-			this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-				if (valid) {
-					([add, edit][this.formDialogType])(this.formData).then(res => {
-						this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-						cancel('list')
-						this.$refs.pageRef.refreshList()
-					})
-				}
-			})
-		},
-		// 下载导入模版
-		handleDownload1() {
-			commonTemplateDownload({ name: '配件模板(配件物料).xlsx' }, `${this.$route.meta.title}`).then(res => {
-				this.$message({
-					message: '下载成功',
-					type: 'success'
-				})
-			}).catch(err => {
-				this.$message.error('下载失败')
-			})
-			// downloadFiles('charging/standard/download');
-		},
-		handleDownload2() {
-			commonTemplateDownload({ name: '配件模板(服务收费).xlsx' }, `${this.$route.meta.title}`).then(res => {
-				this.$message({
-					message: '下载成功',
-					type: 'success'
-				})
-			}).catch(err => {
-				this.$message.error('下载失败')
-			})
-			// downloadFiles('charging/standard/download');
-		},
-	}
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.goodsId)
+          }
+        }
+      })
+    },
+    // 打开 新增编辑 网点表单
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.getTypeList('PARTS_UNIT', 'partsUnitList')
+            this.getTypeList('BRAND', 'brandList')
+            this.getCategoryList()
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              getDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  brandList: res.data.brandList ? res.data.brandList : [],
+                  categoryList: res.data.categoryList ? res.data.categoryList : []
+                })
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    updateStatus(stateEnum) {
+      if (this.recordSelected.length == 0) {
+        return this.$message.warning('请至少勾选一条数据!')
+      }
+      console.log(this.recordSelected)
+      this.$confirm(`请确认是否${stateEnum == 'OFF' ? '下架' : '上架'}该配件, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        updateStatus({
+          stateEnum,
+          ids: this.recordSelected
+            .map(item => {
+              return item.goodsId
+            })
+            .join(',')
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message({ type: 'success', message: `${stateEnum == 'ON' ? '上架' : '下架'}成功!` })
+            this.$refs.pageRef.refreshList()
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
+      })
+    },
+    formConfirm(cancel) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ;[add, edit][this.formDialogType](this.formData).then(res => {
+            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+            cancel('list')
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    },
+    // 下载导入模版
+    handleDownload1() {
+      commonTemplateDownload({ name: '配件模板(配件物料).xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+      // downloadFiles('charging/standard/download');
+    },
+    handleDownload2() {
+      commonTemplateDownload({ name: '配件模板(服务收费).xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+      // downloadFiles('charging/standard/download');
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 409 - 393
src/views/auxiliaryFittings/projectAttachmentManage/detail.vue

@@ -1,402 +1,418 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>项目信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="12">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="12">
-							<el-form-item label="工程名称" :required="true">
-								<el-input type="text" v-model="formData.projectName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="工程编号" :required="true">
-								<el-input type="text" disabled v-model="formData.projectNo" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="负责人" :required="true">
-								<el-input type="text" disabled v-model="formData.manger" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="联系电话" :required="true">
-								<el-input type="text" disabled v-model="formData.mobile" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="项目时间" :required="true">
-								<el-date-picker
-									style="width:50%"
-								    v-model="formData.startTime"
-								    type="date"
-									:disabled="true"
-									value-format="yyyy-MM-dd"
-								    placeholder="开始日期">
-								</el-date-picker>
-								<el-date-picker
-									style="width:50%"
-								    v-model="formData.endTime"
-								    type="date"
-									:disabled="true"
-									value-format="yyyy-MM-dd"
-								    placeholder="结束日期">
-								</el-date-picker>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="项目地址" :required="true">
-								<el-row>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
-									</el-col>
-									<el-col :span="8">
-										<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
-									</el-col>
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="" prop="address">
-								<el-row :gutter="20">
-									<el-col :span="24">
-										<el-input type="text" v-model="formData.address" disabled placeholder="详细地址"></el-input>
-									</el-col>
-									<!-- <el-col :span="2">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>项目信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="12">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="工程名称" :required="true">
+                <el-input type="text" v-model="formData.projectName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="工程编号" :required="true">
+                <el-input type="text" disabled v-model="formData.projectNo" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="负责人" :required="true">
+                <el-input type="text" disabled v-model="formData.manger" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="联系电话" :required="true">
+                <el-input type="text" disabled v-model="formData.mobile" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="项目时间" :required="true">
+                <el-date-picker
+                  style="width: 50%"
+                  v-model="formData.startTime"
+                  type="date"
+                  :disabled="true"
+                  value-format="yyyy-MM-dd"
+                  placeholder="开始日期"
+                >
+                </el-date-picker>
+                <el-date-picker
+                  style="width: 50%"
+                  v-model="formData.endTime"
+                  type="date"
+                  :disabled="true"
+                  value-format="yyyy-MM-dd"
+                  placeholder="结束日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="项目地址" :required="true">
+                <el-row>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                    <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+                  </el-col>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="" prop="address">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-input type="text" v-model="formData.address" disabled placeholder="详细地址"></el-input>
+                  </el-col>
+                  <!-- <el-col :span="2">
 										<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 									</el-col> -->
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="项目说明">
-								<el-input type="textarea" :rows="4" disabled v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="销售订单数" :required="true">
-								<el-input type="text" disabled v-model="detail.salesNum" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="销售金额" :required="true">
-								<el-input type="text" disabled v-model="detail.salesPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="返还单数量" :required="true">
-								<el-input type="text" disabled v-model="detail.retNum" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="退货金额" :required="true">
-								<el-input type="text" disabled v-model="detail.retPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="应收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.price" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="已收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.givePrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="待收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.waitPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>收款信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="24">
-							<el-form-item label="收款金额" prop="price">
-								<el-input type="text" v-model="formData1.price" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="收款凭证" prop="fileUrl">
-								<ImageUpload :fileList="formData1.fileUrl" :limit="1" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>收款记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column prop="status" label="收款结果" align="center">
-						<template slot-scope="scope">
-							{{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="price" label="收款金额" align="center"></el-table-column>
-					<el-table-column prop="" align="center" label="收款凭证" >
-						<template slot-scope="scope" v-if="scope.row.urlPrc">
-							<el-image style="width: 80px;" :src="scope.row.urlPrc" fit="scale-down" :preview-src-list="[scope.row.urlPrc]"></el-image>
-						</template>
-					</el-table-column>
-					<el-table-column prop="remark" label="备注" align="center"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button size="small" type="primary"  @click="confirm()">确定</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-	</div>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="项目说明">
+                <el-input type="textarea" :rows="4" disabled v-model="formData.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="销售订单数" :required="true">
+                <el-input type="text" disabled v-model="detail.salesNum" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="销售金额" :required="true">
+                <el-input type="text" disabled v-model="detail.salesPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="返还单数量" :required="true">
+                <el-input type="text" disabled v-model="detail.retNum" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="退货金额" :required="true">
+                <el-input type="text" disabled v-model="detail.retPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="应收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.price" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="已收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.givePrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="待收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.waitPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>收款信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form
+          ref="formData1"
+          :rules="rules1"
+          :model="formData1"
+          label-width="110px"
+          size="small"
+          label-position="left"
+        >
+          <el-row :gutter="20" justify="start">
+            <el-col :span="24">
+              <el-form-item label="收款金额" prop="price">
+                <el-input type="text" v-model="formData1.price" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="收款凭证" prop="fileUrl">
+                <ImageUpload :fileList="formData1.fileUrl" :limit="1" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>收款记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="收款结果" align="center">
+            <template slot-scope="scope">
+              {{
+                scope.row.status == 'NO'
+                  ? '未付款'
+                  : scope.row.status == 'WAIT'
+                  ? '部分付款'
+                  : scope.row.status == 'OK'
+                  ? '已完成'
+                  : ''
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
+          <el-table-column prop="" align="center" label="收款凭证">
+            <template slot-scope="scope" v-if="scope.row.urlPrc">
+              <el-image
+                style="width: 80px"
+                :src="$showImgUrl(scope.row.urlPrc)"
+                fit="scale-down"
+                :preview-src-list="[$showImgUrl(scope.row.urlPrc)]"
+              ></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="收款人"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="收款时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button size="small" type="primary" @click="confirm()">确定</el-button>
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	import ImageUpload from '@/components/file-upload'
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import { getDetail, givePrice, getPriceDetail } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
-	export default {
-		components: {geographicalPosi,ImageUpload},
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				collectionList: [],
-				detail: {},
-				formData: {
-					projectName: ''
-				},
-				formData1: {
-					price: '',
-					remark: '',
-					fileUrl: []
-				},
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					workerName: [
-						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
-					],
-				},
-				rules1: {
-					price: [
-						{ required: true, message: '请输入收款金额', trigger: 'blur' },
-						{ pattern:/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
-					],
-					fileUrl: [
-						{ required: true, message: '请上传收款凭证', trigger: 'change' }
-					],
-				},
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			this.getinitlbslist()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({id: this.id}).then( async res => {
-					this.detail = res.data
-					Object.assign(this.formData, res.data.orderEnginBase)
-					this.getPriceDetail(res.data.orderEnginBaseId)
-				})
-			},
-			getPriceDetail(orderEnginBaseId){
-				getPriceDetail({orderEnginBaseId,goodsType: 'P'}).then(res => {
-					this.collectionList = res.data
-				})
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-			confirm(){
-				this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						this.$confirm(`请确定是否确认提交收款信息, 是否继续?`, '提示', {
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							givePrice({
-								goodsType: this.detail.goodsType,
-								orderEnginBaseId: this.detail.orderEnginBaseId,
-								orderId: this.detail.orderEnginBaseId,
-								price: this.formData1.price,
-								remark: this.formData1.remark,
-								urlPrc: this.formData1.fileUrl[0].url
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						});
-					}
-				})
-			}
-		}
-	};
+import ImageUpload from '@/components/file-upload'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import { getDetail, givePrice, getPriceDetail } from '@/api/auxiliaryFittings/projectAuxiliaryManage'
+export default {
+  components: { geographicalPosi, ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      collectionList: [],
+      detail: {},
+      formData: {
+        projectName: ''
+      },
+      formData1: {
+        price: '',
+        remark: '',
+        fileUrl: []
+      },
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        workerName: [{ required: true, message: '请输入客户姓名', trigger: 'blur' }]
+      },
+      rules1: {
+        price: [
+          { required: true, message: '请输入收款金额', trigger: 'blur' },
+          { pattern: /^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
+        ],
+        fileUrl: [{ required: true, message: '请上传收款凭证', trigger: 'change' }]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.getinitlbslist()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ id: this.id }).then(async res => {
+        this.detail = res.data
+        Object.assign(this.formData, res.data.orderEnginBase)
+        this.getPriceDetail(res.data.orderEnginBaseId)
+      })
+    },
+    getPriceDetail(orderEnginBaseId) {
+      getPriceDetail({ orderEnginBaseId, goodsType: 'P' }).then(res => {
+        this.collectionList = res.data
+      })
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    },
+    confirm() {
+      this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          this.$confirm(`请确定是否确认提交收款信息, 是否继续?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            givePrice({
+              goodsType: this.detail.goodsType,
+              orderEnginBaseId: this.detail.orderEnginBaseId,
+              orderId: this.detail.orderEnginBaseId,
+              price: this.formData1.price,
+              remark: this.formData1.remark,
+              urlPrc: this.formData1.fileUrl[0].url
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          })
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 409 - 393
src/views/auxiliaryFittings/projectAuxiliaryManage/detail.vue

@@ -1,402 +1,418 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>项目信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="12">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="12">
-							<el-form-item label="工程名称" :required="true">
-								<el-input type="text" v-model="formData.projectName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="工程编号" :required="true">
-								<el-input type="text" disabled v-model="formData.projectNo" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="负责人" :required="true">
-								<el-input type="text" disabled v-model="formData.manger" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="联系电话" :required="true">
-								<el-input type="text" disabled v-model="formData.mobile" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="项目时间" :required="true">
-								<el-date-picker
-									style="width:50%"
-								    v-model="formData.startTime"
-								    type="date"
-									:disabled="true"
-									value-format="yyyy-MM-dd"
-								    placeholder="开始日期">
-								</el-date-picker>
-								<el-date-picker
-									style="width:50%"
-								    v-model="formData.endTime"
-								    type="date"
-									:disabled="true"
-									value-format="yyyy-MM-dd"
-								    placeholder="结束日期">
-								</el-date-picker>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="项目地址" :required="true">
-								<el-row>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
-									</el-col>
-									<el-col :span="8">
-										<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
-									</el-col>
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="" prop="address">
-								<el-row :gutter="20">
-									<el-col :span="24">
-										<el-input type="text" v-model="formData.address" disabled placeholder="详细地址"></el-input>
-									</el-col>
-									<!-- <el-col :span="2">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>项目信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="12">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="工程名称" :required="true">
+                <el-input type="text" v-model="formData.projectName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="工程编号" :required="true">
+                <el-input type="text" disabled v-model="formData.projectNo" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="负责人" :required="true">
+                <el-input type="text" disabled v-model="formData.manger" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="联系电话" :required="true">
+                <el-input type="text" disabled v-model="formData.mobile" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="项目时间" :required="true">
+                <el-date-picker
+                  style="width: 50%"
+                  v-model="formData.startTime"
+                  type="date"
+                  :disabled="true"
+                  value-format="yyyy-MM-dd"
+                  placeholder="开始日期"
+                >
+                </el-date-picker>
+                <el-date-picker
+                  style="width: 50%"
+                  v-model="formData.endTime"
+                  type="date"
+                  :disabled="true"
+                  value-format="yyyy-MM-dd"
+                  placeholder="结束日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="项目地址" :required="true">
+                <el-row>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                    <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+                  </el-col>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="" prop="address">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-input type="text" v-model="formData.address" disabled placeholder="详细地址"></el-input>
+                  </el-col>
+                  <!-- <el-col :span="2">
 										<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 									</el-col> -->
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="项目说明">
-								<el-input type="textarea" :rows="4" disabled v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="销售订单数" :required="true">
-								<el-input type="text" disabled v-model="detail.salesNum" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="销售金额" :required="true">
-								<el-input type="text" disabled v-model="detail.salesPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="退货单数量" :required="true">
-								<el-input type="text" disabled v-model="detail.retNum" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="退货金额" :required="true">
-								<el-input type="text" disabled v-model="detail.retPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="应收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.price" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="已收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.givePrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="待收金额" :required="true">
-								<el-input type="text" disabled v-model="detail.waitPrice" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>收款信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="24">
-							<el-form-item label="收款金额" prop="price">
-								<el-input type="text" v-model="formData1.price" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="收款凭证" prop="fileUrl">
-								<ImageUpload :fileList="formData1.fileUrl" :limit="1" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>收款记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column prop="status" label="收款结果" align="center">
-						<template slot-scope="scope">
-							{{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="price" label="收款金额" align="center"></el-table-column>
-					<el-table-column prop="" align="center" label="收款凭证" >
-						<template slot-scope="scope" v-if="scope.row.urlPrc">
-							<el-image style="width: 80px;" :src="scope.row.urlPrc" fit="scale-down" :preview-src-list="[scope.row.urlPrc]"></el-image>
-						</template>
-					</el-table-column>
-					<el-table-column prop="remark" label="备注" align="center"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button size="small" type="primary"  @click="confirm()">确定</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-	</div>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="项目说明">
+                <el-input type="textarea" :rows="4" disabled v-model="formData.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="销售订单数" :required="true">
+                <el-input type="text" disabled v-model="detail.salesNum" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="销售金额" :required="true">
+                <el-input type="text" disabled v-model="detail.salesPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="退货单数量" :required="true">
+                <el-input type="text" disabled v-model="detail.retNum" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="退货金额" :required="true">
+                <el-input type="text" disabled v-model="detail.retPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="应收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.price" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="已收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.givePrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="待收金额" :required="true">
+                <el-input type="text" disabled v-model="detail.waitPrice" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>收款信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form
+          ref="formData1"
+          :rules="rules1"
+          :model="formData1"
+          label-width="110px"
+          size="small"
+          label-position="left"
+        >
+          <el-row :gutter="20" justify="start">
+            <el-col :span="24">
+              <el-form-item label="收款金额" prop="price">
+                <el-input type="text" v-model="formData1.price" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="收款凭证" prop="fileUrl">
+                <ImageUpload :fileList="formData1.fileUrl" :limit="1" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>收款记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="收款结果" align="center">
+            <template slot-scope="scope">
+              {{
+                scope.row.status == 'NO'
+                  ? '未付款'
+                  : scope.row.status == 'WAIT'
+                  ? '部分付款'
+                  : scope.row.status == 'OK'
+                  ? '已完成'
+                  : ''
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
+          <el-table-column prop="" align="center" label="收款凭证">
+            <template slot-scope="scope" v-if="scope.row.urlPrc">
+              <el-image
+                style="width: 80px"
+                :src="$showImgUrl(scope.row.urlPrc)"
+                fit="scale-down"
+                :preview-src-list="[$showImgUrl(scope.row.urlPrc)]"
+              ></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="收款人"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="收款时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button size="small" type="primary" @click="confirm()">确定</el-button>
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	import ImageUpload from '@/components/file-upload'
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import { getDetail, givePrice, getPriceDetail } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
-	export default {
-		components: {geographicalPosi,ImageUpload},
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				collectionList: [],
-				detail: {},
-				formData: {
-					projectName: ''
-				},
-				formData1: {
-					price: '',
-					remark: '',
-					fileUrl: []
-				},
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					workerName: [
-						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
-					],
-				},
-				rules1: {
-					price: [
-						{ required: true, message: '请输入收款金额', trigger: 'blur' },
-						{ pattern:/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
-					],
-					fileUrl: [
-						{ required: true, message: '请上传收款凭证', trigger: 'change' }
-					],
-				},
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			this.getinitlbslist()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({id: this.id}).then( async res => {
-					this.detail = res.data
-					Object.assign(this.formData, res.data.orderEnginBase)
-					this.getPriceDetail(res.data.orderEnginBaseId)
-				})
-			},
-			getPriceDetail(orderEnginBaseId){
-				getPriceDetail({orderEnginBaseId,goodsType: 'M'}).then(res => {
-					this.collectionList = res.data
-				})
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-			confirm(){
-				this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						this.$confirm(`请确定是否确认提交收款信息, 是否继续?`, '提示', {
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							givePrice({
-								goodsType: this.detail.goodsType,
-								orderEnginBaseId: this.detail.orderEnginBaseId,
-								orderId: this.detail.orderEnginBaseId,
-								price: this.formData1.price,
-								remark: this.formData1.remark,
-								urlPrc: this.formData1.fileUrl[0].url
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						});
-					}
-				})
-			}
-		}
-	};
+import ImageUpload from '@/components/file-upload'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import { getDetail, givePrice, getPriceDetail } from '@/api/auxiliaryFittings/projectAuxiliaryManage'
+export default {
+  components: { geographicalPosi, ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      collectionList: [],
+      detail: {},
+      formData: {
+        projectName: ''
+      },
+      formData1: {
+        price: '',
+        remark: '',
+        fileUrl: []
+      },
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        workerName: [{ required: true, message: '请输入客户姓名', trigger: 'blur' }]
+      },
+      rules1: {
+        price: [
+          { required: true, message: '请输入收款金额', trigger: 'blur' },
+          { pattern: /^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
+        ],
+        fileUrl: [{ required: true, message: '请上传收款凭证', trigger: 'change' }]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.getinitlbslist()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ id: this.id }).then(async res => {
+        this.detail = res.data
+        Object.assign(this.formData, res.data.orderEnginBase)
+        this.getPriceDetail(res.data.orderEnginBaseId)
+      })
+    },
+    getPriceDetail(orderEnginBaseId) {
+      getPriceDetail({ orderEnginBaseId, goodsType: 'M' }).then(res => {
+        this.collectionList = res.data
+      })
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    },
+    confirm() {
+      this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          this.$confirm(`请确定是否确认提交收款信息, 是否继续?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            givePrice({
+              goodsType: this.detail.goodsType,
+              orderEnginBaseId: this.detail.orderEnginBaseId,
+              orderId: this.detail.orderEnginBaseId,
+              price: this.formData1.price,
+              remark: this.formData1.remark,
+              urlPrc: this.formData1.fileUrl[0].url
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          })
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 68 - 48
src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js

@@ -12,7 +12,7 @@ import {
 } from '@/api/purchasingManagement.js'
 import { commonTemplateDownload } from '@/api/common.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { storageListPageV2 } from "@/api/storage";
+import { storageListPageV2 } from '@/api/storage'
 export default {
   data() {
     return {
@@ -117,7 +117,7 @@ export default {
         {
           name: '状态',
           key: 'flag',
-          value: this?.$route?.params?.pageCode||'',
+          value: this?.$route?.params?.pageCode || '',
           conditions: [
             {
               label: `全部`,
@@ -782,8 +782,8 @@ export default {
                           disabled={this.formDialogType >= 2}
                           onChange={val => {
                             this.formData.items = []
-                            this.formData.storageId = ""
-                            this.formData.storageName = ""
+                            this.formData.storageId = ''
+                            this.formData.storageName = ''
                             this.cangkuList = []
                             this.getStorageListPageV2(val)
                             if (val) {
@@ -832,12 +832,25 @@ export default {
                       </el-form-item>
                     </div>
                   </el-descriptions-item>
-                  <el-descriptions-item label={!!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.$route?.name)?'出库仓库':"入库仓库"}>
+                  <el-descriptions-item
+                    label={
+                      !!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.$route?.name)
+                        ? '出库仓库'
+                        : '入库仓库'
+                    }
+                  >
                     <div class="redbordererr">
                       <el-form-item label="" lebel-width="0px" prop={`storageId`} rules={required}>
                         <el-select
                           style="width:100%"
-                          disabled={this.formDialogType === 2 || !(!this.formData.id || (this.formDialogType === 1) || (this.formDialogType === 3 && this.formData.isImport==true && !!this.formData.id))}
+                          disabled={
+                            this.formDialogType === 2 ||
+                            !(
+                              !this.formData.id ||
+                              this.formDialogType === 1 ||
+                              (this.formDialogType === 3 && this.formData.isImport == true && !!this.formData.id)
+                            )
+                          }
                           value={this.formData.storageId}
                           onInput={val => {
                             this.formData.storageId = val
@@ -870,7 +883,7 @@ export default {
                                 this.peijianList = []
                               }
                             }
-                            if(!this.formData.isImport){
+                            if (!this.formData.isImport) {
                               this.getorderlist()
                             }
                             this.$nextTick(this.jiaoyan)
@@ -883,9 +896,7 @@ export default {
                       </el-form-item>
                     </div>
                   </el-descriptions-item>
-                  <el-descriptions-item label="">
-                    
-                  </el-descriptions-item>
+                  <el-descriptions-item label=""></el-descriptions-item>
                 </el-descriptions>
                 {!!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.$route?.name) ? (
                   <el-descriptions
@@ -970,29 +981,29 @@ export default {
                       {!~[0, 1].indexOf(this.formDialogType)
                         ? this.formData.retTotalQty
                         : this.setNumber(
-                          [
-                            0,
-                            0,
-                            0,
-                            ...this.formData.items.map(row => {
-                              return Number(row.retQty)
-                            })
-                          ].reduce((a, b) => a + b)
-                        )}
+                            [
+                              0,
+                              0,
+                              0,
+                              ...this.formData.items.map(row => {
+                                return Number(row.retQty)
+                              })
+                            ].reduce((a, b) => a + b)
+                          )}
                     </el-descriptions-item>
                     <el-descriptions-item label="退款金额">
                       {!~[0, 1].indexOf(this.formDialogType)
                         ? this.formData.retTotalAmount
                         : this.setNumber(
-                          [
-                            0,
-                            0,
-                            0,
-                            ...this.formData.items.map(row => {
-                              return Number(row.cost) * Number(row.retQty)
-                            })
-                          ].reduce((a, b) => a + b)
-                        )}
+                            [
+                              0,
+                              0,
+                              0,
+                              ...this.formData.items.map(row => {
+                                return Number(row.cost) * Number(row.retQty)
+                              })
+                            ].reduce((a, b) => a + b)
+                          )}
                     </el-descriptions-item>
                   </el-descriptions>
                 ) : null}
@@ -1132,10 +1143,15 @@ export default {
             <div style="padding:0 6px;cursor: pointer;">
               {row.imageUrl
                 ? row.imageUrl
-                  .split(',')
-                  .map(url => (
-                    <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />
-                  ))
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
                 : null}
             </div>
           )
@@ -1148,22 +1164,26 @@ export default {
       this.recordSelected = data
     },
     // 获取
-    getStorageListPageV2(websitId){
-      if(websitId){
+    getStorageListPageV2(websitId) {
+      if (websitId) {
         storageListPageV2({
-          "pageNum":1, 
-          "pageSize":-1, 
-          "params":[
-            {"param":"a.websit_id","compare":"=","value": websitId},
-            {"param":"a.type","compare":"like","value": (()=>{
-              if(~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.$route?.name)){
-                return "辅材"
-              }else if (~['partsStorage', 'partsReturn'].indexOf(this.$route?.name)) {
-                return "配件"
-              }
-              return ""
-            })()},
-            {"param":"a.status","compare":"=","value":"true"},
+          pageNum: 1,
+          pageSize: -1,
+          params: [
+            { param: 'a.websit_id', compare: '=', value: websitId },
+            {
+              param: 'a.type',
+              compare: 'like',
+              value: (() => {
+                if (~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials'].indexOf(this.$route?.name)) {
+                  return '辅材'
+                } else if (~['partsStorage', 'partsReturn'].indexOf(this.$route?.name)) {
+                  return '配件'
+                }
+                return ''
+              })()
+            },
+            { param: 'a.status', compare: '=', value: 'true' }
           ]
         }).then(res => {
           this.cangkuList = res.data.records
@@ -1361,7 +1381,7 @@ export default {
       this.formDialog = false
     },
     jiaoyan() {
-      this.$refs.formRef.validate((valid, invalidFields, errLabels) => { }, false)
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {}, false)
     },
     setNumber(val) {
       return Number(val.toFixed(2))

+ 194 - 164
src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue

@@ -1,24 +1,38 @@
 <template>
-	<div class="page">
-		<template-page v-if="!formDialog && isShowTab" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
-			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
-			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
-			<div slot="moreSearch">
-				<el-radio-group v-model="flag" size="mini" @change="changeType">
-					<el-radio-button label="">全部</el-radio-button>
-					<el-radio-button label="SAVE">保存</el-radio-button>
-					<el-radio-button label="SUBMIT">提交</el-radio-button>
-					<el-radio-button label="WAIT">待审核</el-radio-button>
-					<el-radio-button label="OK">审核通过</el-radio-button>
-				</el-radio-group>
-				<br><br>
-			</div>
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<attachmentNewReturnDetail :id="id" @back="backList" :formType="formDialogType"
-				:title="'配件新件返还' + formDialogTitles[formDialogType]"></attachmentNewReturnDetail>
-		</div>
-	</div>
+  <div class="page">
+    <template-page
+      v-if="!formDialog && isShowTab"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="110"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+      :exportList="exportList"
+    >
+      <div slot="moreSearch">
+        <el-radio-group v-model="flag" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="SAVE">保存</el-radio-button>
+          <el-radio-button label="SUBMIT">提交</el-radio-button>
+          <el-radio-button label="WAIT">待审核</el-radio-button>
+          <el-radio-button label="OK">审核通过</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <attachmentNewReturnDetail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'配件新件返还' + formDialogTitles[formDialogType]"
+      ></attachmentNewReturnDetail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -28,163 +42,179 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from '@/api/auxiliaryFittings/attachmentNewReturn'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-	components: { TemplatePage, ImageUpload, attachmentNewReturnDetail },
-	mixins: [import_mixin,operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			id: '',
-			flag: this?.$route?.params?.pageCode || '',
-			isShowTab: true,
-			orderEnginBaseId: ''
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: this.addData
-						}),
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() { }
-	},
-	created(){
-    if (this.pageCode && !~['SAVE','SUBMIT','OK'].indexOf(this.pageCode)) {
+  components: { TemplatePage, ImageUpload, attachmentNewReturnDetail },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      id: '',
+      flag: this?.$route?.params?.pageCode || '',
+      isShowTab: true,
+      orderEnginBaseId: ''
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {}
+  },
+  created() {
+    if (this.pageCode && !~['SAVE', 'SUBMIT', 'OK'].indexOf(this.pageCode)) {
       this.orderEnginBaseId = this.pageCode
     }
-	},
-	watch: {
-		flag(){
-			this.isShowTab = false
-			this.$nextTick(()=>{
-				this.isShowTab = true
-			})
-		}
-	},
-	methods: {
-		// 切换状态
-		changeType(val) {
-			this.$refs.pageRef.refreshList()
-		},
-		backList() {
-			this.id = ''
-			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
-		},
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { "param": "a.type", "compare": "=", "value": 'NEW' }, { 'param': 'a.flag', "compare": "=", "value": this.flag }, { 'param': 'a.order_engin_base_id', "compare": "=", "value": this.orderEnginBaseId })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+  },
+  watch: {
+    flag() {
+      this.isShowTab = false
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  methods: {
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$refs.pageRef.refreshList()
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push(
+          { param: 'a.goods_type', compare: '=', value: 'P' },
+          { param: 'a.type', compare: '=', value: 'NEW' },
+          { param: 'a.flag', compare: '=', value: this.flag },
+          { param: 'a.order_engin_base_id', compare: '=', value: this.orderEnginBaseId }
+        )
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				edit: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = 1
-						this.openForm()
-					}
-				},
-				detail: {
-					conditions: ({ row, index, column }) => {
-						return row.flag != 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-				verify: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SUBMIT'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
-						this.openForm()
-					}
-				},
-			})
-		},
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = 1
+            this.openForm()
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return row.flag != 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        verify: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SUBMIT'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+            this.openForm()
+          }
+        }
+      })
+    },
 
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
-			this.formDialog = true;
-		},
-		// 下载导入模版
-		handleDownload() {
-			// downloadFiles('charging/standard/download');
-		},
-	}
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true
+    },
+    // 下载导入模版
+    handleDownload() {
+      // downloadFiles('charging/standard/download');
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .page {
-	height: 100%;
+  height: 100%;
 }
 
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 189 - 160
src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue

@@ -1,24 +1,38 @@
 <template>
-	<div class="page">
-		<template-page v-if="!formDialog && isShowTab" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
-			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
-			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
-			<div slot="moreSearch">
-				<el-radio-group v-model="flag" size="mini" @change="changeType">
-					<el-radio-button label="">全部</el-radio-button>
-					<el-radio-button label="SAVE">保存</el-radio-button>
-					<el-radio-button label="SUBMIT">提交</el-radio-button>
-					<el-radio-button label="WAIT">待审核</el-radio-button>
-					<el-radio-button label="OK">审核通过</el-radio-button>
-				</el-radio-group>
-				<br><br>
-			</div>
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<attachmentOldReturnDetail :id="id" @back="backList" :formType="formDialogType"
-				:title="'配件旧件返还' + formDialogTitles[formDialogType]"></attachmentOldReturnDetail>
-		</div>
-	</div>
+  <div class="page">
+    <template-page
+      v-if="!formDialog && isShowTab"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="110"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+      :exportList="exportList"
+    >
+      <div slot="moreSearch">
+        <el-radio-group v-model="flag" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="SAVE">保存</el-radio-button>
+          <el-radio-button label="SUBMIT">提交</el-radio-button>
+          <el-radio-button label="WAIT">待审核</el-radio-button>
+          <el-radio-button label="OK">审核通过</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <attachmentOldReturnDetail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'配件旧件返还' + formDialogTitles[formDialogType]"
+      ></attachmentOldReturnDetail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -28,157 +42,172 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from '@/api/auxiliaryFittings/attachmentNewReturn'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-	components: { TemplatePage, ImageUpload, attachmentOldReturnDetail },
-	mixins: [import_mixin,operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			id: '',
-			flag: this?.$route?.params?.pageCode || '',
-			isShowTab: true
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: this.addData
-						}),
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() { }
-	},
-	watch: {
-		flag(){
-			this.isShowTab = false
-			this.$nextTick(()=>{
-				this.isShowTab = true
-			})
-		}
-	},
-	methods: {
-		// 切换状态
-		changeType(val) {
-			this.$refs.pageRef.refreshList()
-		},
-		backList() {
-			this.id = ''
-			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
-		},
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { "param": "a.type", "compare": "=", "value": 'OLD' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+  components: { TemplatePage, ImageUpload, attachmentOldReturnDetail },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      id: '',
+      flag: this?.$route?.params?.pageCode || '',
+      isShowTab: true
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {}
+  },
+  watch: {
+    flag() {
+      this.isShowTab = false
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  methods: {
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$refs.pageRef.refreshList()
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push(
+          { param: 'a.goods_type', compare: '=', value: 'P' },
+          { param: 'a.type', compare: '=', value: 'OLD' },
+          { param: 'a.flag', compare: '=', value: this.flag }
+        )
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				edit: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = 1
-						this.openForm()
-					}
-				},
-				detail: {
-					conditions: ({ row, index, column }) => {
-						return row.flag != 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-				verify: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SUBMIT'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.partsRetId
-						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
-						this.openForm()
-					}
-				},
-			})
-		},
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = 1
+            this.openForm()
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return row.flag != 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        verify: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SUBMIT'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.partsRetId
+            this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+            this.openForm()
+          }
+        }
+      })
+    },
 
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
-			this.formDialog = true;
-		},
-		// 下载导入模版
-		handleDownload() {
-			// downloadFiles('charging/standard/download');
-		},
-	}
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true
+    },
+    // 下载导入模版
+    handleDownload() {
+      // downloadFiles('charging/standard/download');
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .page {
-	height: 100%;
+  height: 100%;
 }
 
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 403 - 362
src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue

@@ -1,38 +1,49 @@
 <template>
-	<div class="page">
-		<template-page v-if="!formDialog && isShowTab" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
-			:table-events="tableEvents" :operationColumnWidth="140" :options-evens-group="optionsEvensGroup"
-			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
-			<div slot="moreSearch">
-				<el-radio-group v-model="flag" size="mini" @change="changeType">
-					<el-radio-button label="">全部</el-radio-button>
-					<el-radio-button label="SAVE">保存</el-radio-button>
-					<el-radio-button label="SUBMIT">提交</el-radio-button>
-					<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
-					<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
-					<el-radio-button label="CANCEL">取消订单</el-radio-button>
-				</el-radio-group>
-				<br><br>
-			</div>
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<attachmentSalesOrderDetail :id="id" @back="backList" :formType="formDialogType"
-				:title="'配件销售订单' + formDialogTitles[formDialogType]"></attachmentSalesOrderDetail>
-		</div>
-		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
+  <div class="page">
+    <template-page
+      v-if="!formDialog && isShowTab"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="140"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+      :exportList="exportList"
+    >
+      <div slot="moreSearch">
+        <el-radio-group v-model="flag" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="SAVE">保存</el-radio-button>
+          <el-radio-button label="SUBMIT">提交</el-radio-button>
+          <el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
+          <el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
+          <el-radio-button label="CANCEL">取消订单</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <attachmentSalesOrderDetail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'配件销售订单' + formDialogTitles[formDialogType]"
+      ></attachmentSalesOrderDetail>
+    </div>
+    <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 
-		<el-dialog
-			title="导入结果"
-			:visible.sync="showImportResult"
-			width="600px">
-			<div class="importResultList">
-				<div class="item" v-for="(item, index) in importResultList" :key="index">{{item}}</div>
-			</div>
-			<span slot="footer" class="dialog-footer">
-				<el-button @click="showImportResult = false">关 闭</el-button>
-			</span>
-		</el-dialog>
-	</div>
+    <el-dialog title="导入结果" :visible.sync="showImportResult" width="600px">
+      <div class="importResultList">
+        <div class="item" v-for="(item, index) in importResultList" :key="index">{{ item }}</div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showImportResult = false">关 闭</el-button>
+      </span>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
@@ -42,235 +53,258 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit, listImportP, queryImportResult } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-import { getWebsit } from "@/api/customerManagement";
+import {
+  listPageV2,
+  pageExport,
+  getDetail,
+  add,
+  edit,
+  submit,
+  listImportP,
+  queryImportResult
+} from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { getWebsit } from '@/api/customerManagement'
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import { commonTemplateDownload } from '@/api/common.js'
 disAutoConnect()
 export default {
-	components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail, printPreview },
-	mixins: [import_mixin,operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			id: '',
-			flag: this?.$route?.params?.pageCode || '',
-			websitList: [],
-			isShowTab: true,
-			orderEnginBaseId: '',
-			payQrcode: JSON.parse(localStorage.getItem('greemall_user')).payQrcode,
-			billTitle: JSON.parse(localStorage.getItem('greemall_user')).billTitle,//打印名称
-			showImportResult: false,
-			importResultList: [],
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: this.addData
-						}),
-					]
-				],
-				[
-					[
-						this.optionsEvensAuth("imp", {
-							render: () => {
-							  return this.importButton(listImportP, '导入', null, null, (res) => {
-									this.$nextTick(() => {
-										this.checkImportResult(res.data);
-									})
-								})
-							}
-						})
-					],
-					[
-						this.optionsEvensAuth("template", {
-							click: () => {
-								this.handleDownload()
-							}
-						})
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() { },
-		filterArr() {
-			return function (arr, size) {
-				//判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
-				if (!arr.length || !size || size < 1) return []
-				let [start, end, result] = [null, null, []]
-				for (let i = 0; i < Math.ceil(arr.length / size); i++) {
-					start = i * size
-					end = start + size
-					result.push(arr.slice(start, end))
-				}
-				return result
-			}
-		}
-	},
-	created(){
-		if(this.$route.query.id){
-			this.id = this.$route.query.id
-			this.formDialogType = 2
-			this.openForm()
-		}
-		if(this.pageCode){
-			this.orderEnginBaseId = this.pageCode
-		}
-	},
-	watch: {
-		flag(){
-			this.isShowTab = false
-			this.$nextTick(()=>{
-				this.isShowTab = true
-			})
-		}
-	},
-	methods: {
-		// 切换状态
-		changeType(val) {
-			this.$refs.pageRef.refreshList()
-		},
-		backList() {
-			this.id = ''
-			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
-		},
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { 'param': 'a.flag', "compare": "=", "value": this.flag }, { 'param': 'a.order_engin_base_id', "compare": "=", "value": this.orderEnginBaseId })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
-		
-		operation() {
-			return this.operationBtn({
-				edit: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = 1
-						this.openForm()
-					}
-				},
-				detail: {
-					conditions: ({ row, index, column }) => {
-						return row.flag != 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-				verify: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'PAY_NOT_TAKE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
-						this.openForm()
-					}
-				},
-				print: {
-					click: ({ row, index, column }) => {
-						this.toPrint(row, 2)
-					}
-				},
-			})
-		},
+  components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail, printPreview },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      id: '',
+      flag: this?.$route?.params?.pageCode || '',
+      websitList: [],
+      isShowTab: true,
+      orderEnginBaseId: '',
+      payQrcode: JSON.parse(localStorage.getItem('greemall_user')).payQrcode,
+      billTitle: JSON.parse(localStorage.getItem('greemall_user')).billTitle, //打印名称
+      showImportResult: false,
+      importResultList: []
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.addData
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('imp', {
+              render: () => {
+                return this.importButton(listImportP, '导入', null, null, res => {
+                  this.$nextTick(() => {
+                    this.checkImportResult(res.data)
+                  })
+                })
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth('template', {
+              click: () => {
+                this.handleDownload()
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {},
+    filterArr() {
+      return function (arr, size) {
+        //判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
+        if (!arr.length || !size || size < 1) return []
+        let [start, end, result] = [null, null, []]
+        for (let i = 0; i < Math.ceil(arr.length / size); i++) {
+          start = i * size
+          end = start + size
+          result.push(arr.slice(start, end))
+        }
+        return result
+      }
+    }
+  },
+  created() {
+    if (this.$route.query.id) {
+      this.id = this.$route.query.id
+      this.formDialogType = 2
+      this.openForm()
+    }
+    if (this.pageCode) {
+      this.orderEnginBaseId = this.pageCode
+    }
+  },
+  watch: {
+    flag() {
+      this.isShowTab = false
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  methods: {
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$refs.pageRef.refreshList()
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push(
+          { param: 'a.goods_type', compare: '=', value: 'P' },
+          { param: 'a.flag', compare: '=', value: this.flag },
+          { param: 'a.order_engin_base_id', compare: '=', value: this.orderEnginBaseId }
+        )
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = 1
+            this.openForm()
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return row.flag != 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        verify: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'PAY_NOT_TAKE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+            this.openForm()
+          }
+        },
+        print: {
+          click: ({ row, index, column }) => {
+            this.toPrint(row, 2)
+          }
+        }
+      })
+    },
 
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
-			this.formDialog = true;
-		},
-		getWebsit() {
-			getWebsit({ type: 'C' }).then(res => {
-				this.websitList = res.data
-			})
-		},
-		// 点击打印
-		async toPrint(row, type) {
-			this.getWebsit()
-			let pagingData = []
-			const { data } = await getDetail({
-				salesId: row.salesId
-			})
-			pagingData = this.filterArr(data.items, 4)
-			// 初始化模板,否则生成的模板叠加
-			hiprint.init()
-			this.hiprintTemplate = new hiprint.PrintTemplate()
-			// 兼容批量打印
-			// let params = !type ? this.filterArr() : [row.salesId]
-			let len = pagingData.length
-			let loadingLen = len
-			// 使用 i-- 提升for效率
-			this.$startLoading()
-			for (let i = 0; i < len; i++) {
-				try {
-					let websitHtml = ''
-					let html = ''
-					let num = 0
-					let totalAmount = 0
-					pagingData[i].forEach(item => {
-						totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
-						num += Number(item.salesQty)
-						html += `
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    // 点击打印
+    async toPrint(row, type) {
+      this.getWebsit()
+      let pagingData = []
+      const { data } = await getDetail({
+        salesId: row.salesId
+      })
+      pagingData = this.filterArr(data.items, 4)
+      // 初始化模板,否则生成的模板叠加
+      hiprint.init()
+      this.hiprintTemplate = new hiprint.PrintTemplate()
+      // 兼容批量打印
+      // let params = !type ? this.filterArr() : [row.salesId]
+      let len = pagingData.length
+      let loadingLen = len
+      // 使用 i-- 提升for效率
+      this.$startLoading()
+      for (let i = 0; i < len; i++) {
+        try {
+          let websitHtml = ''
+          let html = ''
+          let num = 0
+          let totalAmount = 0
+          pagingData[i].forEach(item => {
+            totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
+            num += Number(item.salesQty)
+            html += `
 					<tr align="center">
 					<td>${item.goodsName || ''}</td>
 					<td>${item.goodsSpecification || ''}</td>
@@ -282,60 +316,60 @@ export default {
 					<td></td>
 					</tr>
 				`
-					})
-					this.websitList.slice(0, 5).forEach(item => {
-						websitHtml += `
+          })
+          this.websitList.slice(0, 5).forEach(item => {
+            websitHtml += `
 					<div style="display: flex;font-size: 14px;margin-bottom: 6px;">
 						<div style="margin-right: 10px;">${item.name}</div>
 						<div style="margin-right: 10px;">${item.websitPhone}</div>
 						<div>地址: ${item.address}</div>
 					</div>
 				`
-					})
-					// 模板基础配置
-					this.panel = this.hiprintTemplate.addPrintPanel({
-						height: 140,
-						width: 241,
-						fontFamily: '黑体',
-						fontSize: 13,
-						paperFooter: 340,
-						paperHeader: 10,
-						paperNumberDisabled: true
-					})
+          })
+          // 模板基础配置
+          this.panel = this.hiprintTemplate.addPrintPanel({
+            height: 140,
+            width: 241,
+            fontFamily: '黑体',
+            fontSize: 13,
+            paperFooter: 340,
+            paperHeader: 10,
+            paperNumberDisabled: true
+          })
 
-					// 获取收款单模板和基础配置
-					this.panel.addPrintHtml({
-						options: {
-							width: 633,
-							top: 30,
-							left: 20,
-							fontFamily: '黑体',
-							fontSize: 13,
-							content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
-						}
-					})
+          // 获取收款单模板和基础配置
+          this.panel.addPrintHtml({
+            options: {
+              width: 633,
+              top: 30,
+              left: 20,
+              fontFamily: '黑体',
+              fontSize: 13,
+              content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
+            }
+          })
 
-					loadingLen--
-				} catch (error) {
-					console.log(999, error)
-					this.$endLoading()
-					return
-				}
-			}
-			if (loadingLen === 0) {
-				this.$endLoading()
-			}
-			console.log(333)
-			// 预览打印内容
-			this.$refs.preView.show(this.hiprintTemplate, this.panel)
-		},
-		// 打印模板
-		setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
-			return `
+          loadingLen--
+        } catch (error) {
+          console.log(999, error)
+          this.$endLoading()
+          return
+        }
+      }
+      if (loadingLen === 0) {
+        this.$endLoading()
+      }
+      console.log(333)
+      // 预览打印内容
+      this.$refs.preView.show(this.hiprintTemplate, this.panel)
+    },
+    // 打印模板
+    setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
+      return `
 	   <div style="font-family:'黑体';font-size: 16px;">
 			<div style="display: flex;justify-content: space-between;align-items: center;">
 				<div style="width: 28%;"></div>
-				<h1 style="text-align:center;margin: 10px 0;">${this.billTitle?this.billTitle:data.websitName}销售单</h1>
+				<h1 style="text-align:center;margin: 10px 0;">${this.billTitle ? this.billTitle : data.websitName}销售单</h1>
 				<div>共 ${length}页 第 ${page + 1} 页</div>
 			</div>
 		  <div style="display: flex;justify-content: space-between;">
@@ -345,11 +379,11 @@ export default {
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>客户: ${data.workerName}</div>
-		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : data.payType == 'WECHAT' ? '微信': '工程支付'}</div>
+		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : data.payType == 'WECHAT' ? '微信' : '工程支付'}</div>
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin-bottom: 10px;">
 		  	<div>联系电话: ${data.workerMobile}</div>
-		  	<div>收货地址: ${data.province?(data.province + data.city + data.area + data.street + data.address):''}</div>
+		  	<div>收货地址: ${data.province ? data.province + data.city + data.area + data.street + data.address : ''}</div>
 			<div style="width: 28%;"></div>
 		  </div>
 	      <div >
@@ -359,7 +393,7 @@ export default {
 	          border-style: none;
 	          border: 1px solid rgb(0,0,0);
 	          font-weight: normal;
-	          
+
 	          text-decoration: none;
 	          vertical-align: middle;
 	          box-sizing: border-box;
@@ -396,85 +430,92 @@ export default {
 		  	<div>
 		  		${websitHtml}
 		  	</div>
-		  	${(data.payType == 'CASH' && this.payQrcode)?`<div style="">
-		  		<img style="width: 80px;height: 80px;" src="${this.payQrcode}"/>
-		  	</div>`:''}
+		  	${
+          data.payType == 'CASH' && this.payQrcode
+            ? `<div style="">
+		  		<img style="width: 80px;height: 80px;" src="${this.$showImgUrl(this.payQrcode)}"/>
+		  	</div>`
+            : ''
+        }
 		  </div>
 	      <div style="margin:100px 0 0 0">
 	        <div></div>
 	      </div>
 	   </div>
 	  `
-		},
-		handleRefreshList() {
-			this.recordSelected = []
-			this.$refs.pageRef.refreshList()
-		},
-		handleInitPrint() {
-			this.$nextTick(() => {
-				this.initPrint()
-			})
-		},
-		// 下载导入模版
-		handleDownload() {
-			commonTemplateDownload({ name: '配件销售订单导入模板.xlsx' }, `${this.$route.meta.title}`).then(res => {
-			    this.$message({
-			        message: '下载成功',
-			        type: 'success'
-			    })
-			}).catch(err => {
-			    this.$message.error('下载失败')
-			})
-		},
+    },
+    handleRefreshList() {
+      this.recordSelected = []
+      this.$refs.pageRef.refreshList()
+    },
+    handleInitPrint() {
+      this.$nextTick(() => {
+        this.initPrint()
+      })
+    },
+    // 下载导入模版
+    handleDownload() {
+      commonTemplateDownload({ name: '配件销售订单导入模板.xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+    },
 
-		// 查询导入结果
-		checkImportResult(importBatchId) {
-			const loading = this.$loading({
-				lock: true,
-				text: '正在查询导入结果',
-				spinner: 'el-icon-loading',
-				background: 'rgba(0, 0, 0, 0.7)'
-			})
-			queryImportResult({
-				importBatchId
-			}).then(result => {
-				if(result.data.waitCount == 0){
-					clearInterval(this.timer)
-					loading.close();
-					// result.data.errList = ['测试测试1', '测试测试1']
-					if(result.data?.errList?.length > 0) {
-						this.importResultList = result.data.errList;
-						this.showImportResult = true;
-					}else {
-						
-					}
-				}else {
-					this.timer = setTimeout(()=>{
-						this.checkImportResult(importBatchId);
-					}, 2000)
-				}
-			}).catch(err => {
-				loading.close();
-				clearInterval(this.timer)
-			})
-		},
-	}
+    // 查询导入结果
+    checkImportResult(importBatchId) {
+      const loading = this.$loading({
+        lock: true,
+        text: '正在查询导入结果',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      queryImportResult({
+        importBatchId
+      })
+        .then(result => {
+          if (result.data.waitCount == 0) {
+            clearInterval(this.timer)
+            loading.close()
+            // result.data.errList = ['测试测试1', '测试测试1']
+            if (result.data?.errList?.length > 0) {
+              this.importResultList = result.data.errList
+              this.showImportResult = true
+            } else {
+            }
+          } else {
+            this.timer = setTimeout(() => {
+              this.checkImportResult(importBatchId)
+            }, 2000)
+          }
+        })
+        .catch(err => {
+          loading.close()
+          clearInterval(this.timer)
+        })
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .page {
-	height: 100%;
+  height: 100%;
 }
 
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 
 .importResultList {
-	.item {
-		font-size: 16px;
-		margin-bottom: 10px;
-	}
+  .item {
+    font-size: 16px;
+    margin-bottom: 10px;
+  }
 }
 </style>

+ 404 - 360
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -1,38 +1,49 @@
 <template>
-	<div class="page">
-		<template-page v-if="isShowTab && !formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
-			:table-events="tableEvents" :operationColumnWidth="140" :options-evens-group="optionsEvensGroup"
-			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
-			<div slot="moreSearch">
-				<el-radio-group v-model="flag" size="mini" @change="changeType">
-					<el-radio-button label="">全部</el-radio-button>
-					<el-radio-button label="SAVE">保存</el-radio-button>
-					<el-radio-button label="SUBMIT">提交</el-radio-button>
-					<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
-					<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
-					<el-radio-button label="CANCEL">取消订单</el-radio-button>
-				</el-radio-group>
-				<br><br>
-			</div>
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType"
-				:title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
-		</div>
-		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
+  <div class="page">
+    <template-page
+      v-if="isShowTab && !formDialog"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="140"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+      :exportList="exportList"
+    >
+      <div slot="moreSearch">
+        <el-radio-group v-model="flag" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="SAVE">保存</el-radio-button>
+          <el-radio-button label="SUBMIT">提交</el-radio-button>
+          <el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
+          <el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
+          <el-radio-button label="CANCEL">取消订单</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <auxiliarySalesOrderDetail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'辅材销售订单' + formDialogTitles[formDialogType]"
+      ></auxiliarySalesOrderDetail>
+    </div>
+    <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 
-		<el-dialog
-			title="导入结果"
-			:visible.sync="showImportResult"
-			width="600px">
-			<div class="importResultList">
-				<div class="item" v-for="(item, index) in importResultList" :key="index">{{item}}</div>
-			</div>
-			<span slot="footer" class="dialog-footer">
-				<el-button @click="showImportResult = false">关 闭</el-button>
-			</span>
-		</el-dialog>
-	</div>
+    <el-dialog title="导入结果" :visible.sync="showImportResult" width="600px">
+      <div class="importResultList">
+        <div class="item" v-for="(item, index) in importResultList" :key="index">{{ item }}</div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showImportResult = false">关 闭</el-button>
+      </span>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
@@ -42,234 +53,258 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit, listImportM, queryImportResult } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-import { getWebsit } from "@/api/customerManagement";
+import {
+  listPageV2,
+  pageExport,
+  getDetail,
+  add,
+  edit,
+  submit,
+  listImportM,
+  queryImportResult
+} from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { getWebsit } from '@/api/customerManagement'
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import { commonTemplateDownload } from '@/api/common.js'
 disAutoConnect()
 export default {
-	components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
-	mixins: [import_mixin, operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			id: '',
-			flag: this?.$route?.params?.pageCode || '',
-			websitList: [],
-			isShowTab: true,
-			orderEnginBaseId: '',
-			payQrcode: JSON.parse(localStorage.getItem('greemall_user')).payQrcode,
-			billTitle: JSON.parse(localStorage.getItem('greemall_user')).billTitle,//打印名称
-			showImportResult: false,
-			importResultList: [],
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: this.addData
-						}),
-					]
-				],
-				[
-					[
-						this.optionsEvensAuth("imp", {
-							render: () => {
-							  return this.importButton(listImportM, '导入', null, null, (res) => {
-									this.$nextTick(() => {
-										this.checkImportResult(res.data);
-									})
-								})
-							}
-						})
-					],
-					[
-						this.optionsEvensAuth("template", {
-							click: () => {
-								this.handleDownload()
-							}
-						})
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() { },
-		filterArr() {
-			return function (arr, size) {
-				//判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
-				if (!arr.length || !size || size < 1) return []
-				let [start, end, result] = [null, null, []]
-				for (let i = 0; i < Math.ceil(arr.length / size); i++) {
-					start = i * size
-					end = start + size
-					result.push(arr.slice(start, end))
-				}
-				return result
-			}
-		}
-	},
-	created(){
-		if(this.$route.query.id){
-			this.id = this.$route.query.id
-			this.formDialogType = 2
-			this.openForm()
-		}
-    if (this.pageCode && !~['SAVE','SUBMIT','PAY_NOT_TAKE','PAY_TAKE','CANCEL'].indexOf(this.pageCode)) {
+  components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      id: '',
+      flag: this?.$route?.params?.pageCode || '',
+      websitList: [],
+      isShowTab: true,
+      orderEnginBaseId: '',
+      payQrcode: JSON.parse(localStorage.getItem('greemall_user')).payQrcode,
+      billTitle: JSON.parse(localStorage.getItem('greemall_user')).billTitle, //打印名称
+      showImportResult: false,
+      importResultList: []
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.addData
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('imp', {
+              render: () => {
+                return this.importButton(listImportM, '导入', null, null, res => {
+                  this.$nextTick(() => {
+                    this.checkImportResult(res.data)
+                  })
+                })
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth('template', {
+              click: () => {
+                this.handleDownload()
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {},
+    filterArr() {
+      return function (arr, size) {
+        //判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
+        if (!arr.length || !size || size < 1) return []
+        let [start, end, result] = [null, null, []]
+        for (let i = 0; i < Math.ceil(arr.length / size); i++) {
+          start = i * size
+          end = start + size
+          result.push(arr.slice(start, end))
+        }
+        return result
+      }
+    }
+  },
+  created() {
+    if (this.$route.query.id) {
+      this.id = this.$route.query.id
+      this.formDialogType = 2
+      this.openForm()
+    }
+    if (this.pageCode && !~['SAVE', 'SUBMIT', 'PAY_NOT_TAKE', 'PAY_TAKE', 'CANCEL'].indexOf(this.pageCode)) {
       this.orderEnginBaseId = this.pageCode
     }
-	},
-	watch: {
-		flag(){
-			this.isShowTab = false
-			this.$nextTick(()=>{
-				this.isShowTab = true
-			})
-		}
-	},
-	methods: {
-		// 切换状态
-		changeType(val) {
-			this.$refs.pageRef.refreshList()
-		},
-		backList() {
-			this.id = ''
-			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
-		},
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.flag', "compare": "=", "value": this.flag }, { 'param': 'a.order_engin_base_id', "compare": "=", "value": this.orderEnginBaseId })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+  },
+  watch: {
+    flag() {
+      this.isShowTab = false
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  methods: {
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$refs.pageRef.refreshList()
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push(
+          { param: 'a.goods_type', compare: '=', value: 'M' },
+          { param: 'a.flag', compare: '=', value: this.flag },
+          { param: 'a.order_engin_base_id', compare: '=', value: this.orderEnginBaseId }
+        )
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				edit: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = 1
-						this.openForm()
-					}
-				},
-				detail: {
-					conditions: ({ row, index, column }) => {
-						return row.flag != 'SAVE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-				confirmDelivery: {
-					conditions: ({ row, index, column }) => {
-						return row.flag == 'PAY_NOT_TAKE'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesId
-						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
-						this.openForm()
-					}
-				},
-				print: {
-					click: ({ row, index, column }) => {
-						this.toPrint(row, 2)
-					}
-				},
-			})
-		},
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = 1
+            this.openForm()
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return row.flag != 'SAVE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        confirmDelivery: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == 'PAY_NOT_TAKE'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesId
+            this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+            this.openForm()
+          }
+        },
+        print: {
+          click: ({ row, index, column }) => {
+            this.toPrint(row, 2)
+          }
+        }
+      })
+    },
 
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
-			this.formDialog = true;
-		},
-		getWebsit() {
-			getWebsit({ type: 'C' }).then(res => {
-				this.websitList = res.data
-			})
-		},
-		// 点击打印
-		async toPrint(row, type) {
-			this.getWebsit()
-			let pagingData = []
-			const { data } = await getDetail({
-				salesId: row.salesId
-			})
-			pagingData = this.filterArr(data.items, 4)
-			// 初始化模板,否则生成的模板叠加
-			hiprint.init()
-			this.hiprintTemplate = new hiprint.PrintTemplate()
-			// 兼容批量打印
-			// let params = !type ? this.filterArr() : [row.salesId]
-			let len = pagingData.length
-			let loadingLen = len
-			// 使用 i-- 提升for效率
-			this.$startLoading()
-			for (let i = 0; i < len; i++) {
-				try {
-					let websitHtml = ''
-					let html = ''
-					let num = 0
-					let totalAmount = 0
-					pagingData[i].forEach(item => {
-						totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
-						num += Number(item.salesQty)
-						html += `
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    // 点击打印
+    async toPrint(row, type) {
+      this.getWebsit()
+      let pagingData = []
+      const { data } = await getDetail({
+        salesId: row.salesId
+      })
+      pagingData = this.filterArr(data.items, 4)
+      // 初始化模板,否则生成的模板叠加
+      hiprint.init()
+      this.hiprintTemplate = new hiprint.PrintTemplate()
+      // 兼容批量打印
+      // let params = !type ? this.filterArr() : [row.salesId]
+      let len = pagingData.length
+      let loadingLen = len
+      // 使用 i-- 提升for效率
+      this.$startLoading()
+      for (let i = 0; i < len; i++) {
+        try {
+          let websitHtml = ''
+          let html = ''
+          let num = 0
+          let totalAmount = 0
+          pagingData[i].forEach(item => {
+            totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
+            num += Number(item.salesQty)
+            html += `
 					<tr align="center">
 					<td>${item.goodsName}</td>
 					<td>${item.goodsSpecification}</td>
@@ -281,60 +316,60 @@ export default {
 					<td></td>
 					</tr>
 				`
-					})
-					this.websitList.slice(0, 5).forEach(item => {
-						websitHtml += `
+          })
+          this.websitList.slice(0, 5).forEach(item => {
+            websitHtml += `
 					<div style="display: flex;font-size: 14px;margin-bottom: 6px;">
 						<div style="margin-right: 10px;">${item.name}</div>
 						<div style="margin-right: 10px;">${item.websitPhone}</div>
 						<div>地址: ${item.address}</div>
 					</div>
 				`
-					})
-					// 模板基础配置
-					this.panel = this.hiprintTemplate.addPrintPanel({
-						height: 140,
-						width: 241,
-						fontFamily: '黑体',
-						fontSize: 13,
-						paperFooter: 340,
-						paperHeader: 10,
-						paperNumberDisabled: true
-					})
+          })
+          // 模板基础配置
+          this.panel = this.hiprintTemplate.addPrintPanel({
+            height: 140,
+            width: 241,
+            fontFamily: '黑体',
+            fontSize: 13,
+            paperFooter: 340,
+            paperHeader: 10,
+            paperNumberDisabled: true
+          })
 
-					// 获取收款单模板和基础配置
-					this.panel.addPrintHtml({
-						options: {
-							width: 633,
-							top: 30,
-							left: 20,
-							fontFamily: '黑体',
-							fontSize: 13,
-							content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
-						}
-					})
+          // 获取收款单模板和基础配置
+          this.panel.addPrintHtml({
+            options: {
+              width: 633,
+              top: 30,
+              left: 20,
+              fontFamily: '黑体',
+              fontSize: 13,
+              content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
+            }
+          })
 
-					loadingLen--
-				} catch (error) {
-					console.log(999, error)
-					this.$endLoading()
-					return
-				}
-			}
-			if (loadingLen === 0) {
-				this.$endLoading()
-			}
-			console.log(333)
-			// 预览打印内容
-			this.$refs.preView.show(this.hiprintTemplate, this.panel)
-		},
-		// 打印模板
-		setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
-			return `
+          loadingLen--
+        } catch (error) {
+          console.log(999, error)
+          this.$endLoading()
+          return
+        }
+      }
+      if (loadingLen === 0) {
+        this.$endLoading()
+      }
+      console.log(333)
+      // 预览打印内容
+      this.$refs.preView.show(this.hiprintTemplate, this.panel)
+    },
+    // 打印模板
+    setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
+      return `
 	   <div style="font-family:'黑体';font-size: 16px;">
 			<div style="display: flex;justify-content: center;align-items: center;position: relative;">
-				<h1 style="text-align:center;margin: 10px 0;">${this.billTitle?this.billTitle:data.websitName}销售单</h1>
-				<div style="position: absolute;right:0;">共 ${length}页 第 ${page+1} 页</div>
+				<h1 style="text-align:center;margin: 10px 0;">${this.billTitle ? this.billTitle : data.websitName}销售单</h1>
+				<div style="position: absolute;right:0;">共 ${length}页 第 ${page + 1} 页</div>
 			</div>
 		  <div style="display: flex;justify-content: space-between;">
 			<div style="width: 28%;"></div>
@@ -343,11 +378,13 @@ export default {
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>客户: ${data.workerName}</div>
-		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : data.payType == 'WECHAT' ? '微信': '工程支付'}</div>
+		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : data.payType == 'WECHAT' ? '微信' : '工程支付'}</div>
 		  </div>
 		  <div style="display: flex;font-size: 16px;margin-bottom: 10px;">
 		  	<div>联系电话: ${data.workerMobile}</div>
-		  	<div style="margin-left: 50px;">收货地址: ${data.province?(data.province + data.city + data.area + data.street + data.address):''}</div>
+		  	<div style="margin-left: 50px;">收货地址: ${
+          data.province ? data.province + data.city + data.area + data.street + data.address : ''
+        }</div>
 		  </div>
 	      <div >
 	        <table border=".5" cellspacing="0" width="856"
@@ -356,7 +393,7 @@ export default {
 	          border-style: none;
 	          border: 1px solid rgb(0,0,0);
 	          font-weight: normal;
-	          
+
 	          text-decoration: none;
 	          vertical-align: middle;
 	          box-sizing: border-box;
@@ -393,85 +430,92 @@ export default {
 			<div>
 				${websitHtml}
 			</div>
-			${(data.payType == 'CASH' && this.payQrcode)?`<div style="">
-				<img style="width: 80px;height: 80px;" src="${this.payQrcode}"/>
-			</div>`:''}
+			${
+        data.payType == 'CASH' && this.payQrcode
+          ? `<div style="">
+				<img style="width: 80px;height: 80px;" src="${this.$showImgUrl(this.payQrcode)}"/>
+			</div>`
+          : ''
+      }
 		  </div>
 	      <div style="margin:100px 0 0 0">
 	        <div></div>
 	      </div>
 	   </div>
 	  `
-		},
-		handleRefreshList() {
-			this.recordSelected = []
-			this.$refs.pageRef.refreshList()
-		},
-		handleInitPrint() {
-			this.$nextTick(() => {
-				this.initPrint()
-			})
-		},
-		// 下载导入模版
-		handleDownload() {
-			commonTemplateDownload({ name: '辅材销售订单导入模板.xlsx' }, `${this.$route.meta.title}`).then(res => {
-			    this.$message({
-			        message: '下载成功',
-			        type: 'success'
-			    })
-			}).catch(err => {
-			    this.$message.error('下载失败')
-			})
-		},
+    },
+    handleRefreshList() {
+      this.recordSelected = []
+      this.$refs.pageRef.refreshList()
+    },
+    handleInitPrint() {
+      this.$nextTick(() => {
+        this.initPrint()
+      })
+    },
+    // 下载导入模版
+    handleDownload() {
+      commonTemplateDownload({ name: '辅材销售订单导入模板.xlsx' }, `${this.$route.meta.title}`)
+        .then(res => {
+          this.$message({
+            message: '下载成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$message.error('下载失败')
+        })
+    },
 
-		// 查询导入结果
-		checkImportResult(importBatchId) {
-			const loading = this.$loading({
-				lock: true,
-				text: '正在查询导入结果',
-				spinner: 'el-icon-loading',
-				background: 'rgba(0, 0, 0, 0.7)'
-			})
-			queryImportResult({
-				importBatchId
-			}).then(result => {
-				if(result.data.waitCount == 0){
-					clearInterval(this.timer)
-					loading.close();
-					// result.data.errList = ['测试测试1', '测试测试1']
-					if(result.data?.errList?.length > 0) {
-						this.importResultList = result.data.errList;
-						this.showImportResult = true;
-					}else {
-						
-					}
-				}else {
-					this.timer = setTimeout(()=>{
-						this.checkImportResult(importBatchId);
-					}, 2000)
-				}
-			}).catch(err => {
-				loading.close();
-				clearInterval(this.timer)
-			})
-		},
-	}
+    // 查询导入结果
+    checkImportResult(importBatchId) {
+      const loading = this.$loading({
+        lock: true,
+        text: '正在查询导入结果',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      queryImportResult({
+        importBatchId
+      })
+        .then(result => {
+          if (result.data.waitCount == 0) {
+            clearInterval(this.timer)
+            loading.close()
+            // result.data.errList = ['测试测试1', '测试测试1']
+            if (result.data?.errList?.length > 0) {
+              this.importResultList = result.data.errList
+              this.showImportResult = true
+            } else {
+            }
+          } else {
+            this.timer = setTimeout(() => {
+              this.checkImportResult(importBatchId)
+            }, 2000)
+          }
+        })
+        .catch(err => {
+          loading.close()
+          clearInterval(this.timer)
+        })
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .page {
-	height: 100%;
+  height: 100%;
 }
 
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 
 .importResultList {
-	.item {
-		font-size: 16px;
-		margin-bottom: 10px;
-	}
+  .item {
+    font-size: 16px;
+    margin-bottom: 10px;
+  }
 }
 </style>

+ 182 - 153
src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue

@@ -1,24 +1,38 @@
 <template>
-	<div class="page">
-		<template-page v-if="!formDialog && isShowTab" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
-			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
-			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
-			<div slot="moreSearch">
-				<el-radio-group v-model="retState" size="mini" @change="changeType">
-					<el-radio-button label="">全部</el-radio-button>
-					<el-radio-button label="SAVE">保存</el-radio-button>
-					<el-radio-button label="SUBMIT">提交</el-radio-button>
-					<el-radio-button label="WAIT">待审核</el-radio-button>
-					<el-radio-button label="OK">审核通过</el-radio-button>
-				</el-radio-group>
-				<br><br>
-			</div>
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<auxiliarySalesReturnOrderDetail :id="id" @back="backList" :formType="formDialogType"
-				:title="'辅材销售退货单' + formDialogTitles[formDialogType]"></auxiliarySalesReturnOrderDetail>
-		</div>
-	</div>
+  <div class="page">
+    <template-page
+      v-if="!formDialog && isShowTab"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="110"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+      :exportList="exportList"
+    >
+      <div slot="moreSearch">
+        <el-radio-group v-model="retState" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="SAVE">保存</el-radio-button>
+          <el-radio-button label="SUBMIT">提交</el-radio-button>
+          <el-radio-button label="WAIT">待审核</el-radio-button>
+          <el-radio-button label="OK">审核通过</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <auxiliarySalesReturnOrderDetail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'辅材销售退货单' + formDialogTitles[formDialogType]"
+      ></auxiliarySalesReturnOrderDetail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -28,150 +42,165 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from '@/api/auxiliaryFittings/auxiliarySalesReturnOrder'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-	components: { TemplatePage, ImageUpload, auxiliarySalesReturnOrderDetail },
-	mixins: [import_mixin, operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: true
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			id: '',
-			retState: this?.$route?.params?.pageCode || '',
-			isShowTab: true,
-			orderEnginBaseId: ''
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: this.addData
-						}),
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() { }
-	},
-	created(){
-		if(this.pageCode){
-			this.orderEnginBaseId = this.pageCode
-		}
-	},
-	watch: {
-		retState(){
-			this.isShowTab = false
-			this.$nextTick(()=>{
-				this.isShowTab = true
-			})
-		}
-	},
-	methods: {
-		// 切换状态
-		changeType(val) {
-			this.$refs.pageRef.refreshList()
-		},
-		backList() {
-			this.id = ''
-			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
-		},
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.ret_state', "compare": "=", "value": this.retState }, { 'param': 'a.order_engin_base_id', "compare": "=", "value": this.orderEnginBaseId })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'idCardImg') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+  components: { TemplatePage, ImageUpload, auxiliarySalesReturnOrderDetail },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      id: '',
+      retState: this?.$route?.params?.pageCode || '',
+      isShowTab: true,
+      orderEnginBaseId: ''
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {}
+  },
+  created() {
+    if (this.pageCode) {
+      this.orderEnginBaseId = this.pageCode
+    }
+  },
+  watch: {
+    retState() {
+      this.isShowTab = false
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  methods: {
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$refs.pageRef.refreshList()
+    },
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push(
+          { param: 'a.goods_type', compare: '=', value: 'M' },
+          { param: 'a.ret_state', compare: '=', value: this.retState },
+          { param: 'a.order_engin_base_id', compare: '=', value: this.orderEnginBaseId }
+        )
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				detail: {
-					click: ({ row, index, column }) => {
-						this.id = row.salesRetId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-				Confirm: {
-					conditions: ({ row, index, column }) => {
-						return row.retState == 'WAIT'
-					},
-					click: ({ row, index, column }) => {
-						this.id = row.salesRetId
-						this.formDialogType = 2
-						this.openForm()
-					}
-				},
-			})
-		},
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            this.id = row.salesRetId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        Confirm: {
+          conditions: ({ row, index, column }) => {
+            return row.retState == 'WAIT'
+          },
+          click: ({ row, index, column }) => {
+            this.id = row.salesRetId
+            this.formDialogType = 2
+            this.openForm()
+          }
+        }
+      })
+    },
 
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
-			this.formDialog = true;
-		},
-		// 下载导入模版
-		handleDownload() {
-			// downloadFiles('charging/standard/download');
-		},
-	}
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true
+    },
+    // 下载导入模版
+    handleDownload() {
+      // downloadFiles('charging/standard/download');
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .page {
-	height: 100%;
+  height: 100%;
 }
 
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 1077 - 920
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue

@@ -1,338 +1,446 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'OK'?'确认收货':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.partsRetId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websit" value-key="websitId" disabled @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in websitList"
-								      :key="item.websitId"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople">
-									<el-radio disabled label="WORKER">内部师傅</el-radio>
-									<el-radio disabled label="CUSTOMER">客户</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.buyPeople == 'CUSTOMER'">
-							<el-col :span="8">
-								<el-form-item label="客户姓名" prop="workerName" :required="true">
-									<el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="客户联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<template v-else>
-							<el-col :span="8">
-								<el-form-item label="师傅姓名" prop="worker" :required="true">
-									<el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<!-- <el-col :span="8">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="
+                    formData.flag == 'SAVE'
+                      ? '保存'
+                      : formData.flag == 'SUBMIT'
+                      ? '已提交'
+                      : formData.flag == 'OK'
+                      ? '确认收货'
+                      : ''
+                  "
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.partsRetId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="网点名称" prop="websitId" :required="true">
+                <el-select
+                  v-model="formData.websit"
+                  value-key="websitId"
+                  disabled
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.buyPeople">
+                  <el-radio disabled label="WORKER">内部师傅</el-radio>
+                  <el-radio disabled label="CUSTOMER">客户</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.buyPeople == 'CUSTOMER'">
+              <el-col :span="8">
+                <el-form-item label="客户姓名" prop="workerName" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="8">
+                <el-form-item label="师傅姓名" prop="worker" :required="true">
+                  <el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
 								<el-form-item label="师傅身份证" prop="identity" :required="true">
 									<el-input type="text" v-model="formData.identity" :disabled="formType == 2" placeholder="请输入"></el-input>
 								</el-form-item>
 							</el-col> -->
-							<el-col :span="8">
-								<el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="8">
-							<el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.salesType">
-								    <el-radio disabled label="零售">零售</el-radio>
-								    <el-radio disabled label="工程">工程</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="7">
-							<el-form-item label="销售订单号" :required="true">
-								<el-input type="text" v-model="formData.salesId" @change="getDetail" disabled placeholder="请输入销售订单号"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="1">
-							<el-button v-if="formType != 2" size="small" type="primary"  @click="isShowNo = true;getOrderList();">选择</el-button>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="销售金额">
-								<el-input type="text" :value="formData.totalAmount" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="时间">
-								<el-input type="text" :value="formData.payTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="入库仓库" prop="storage">
-								<el-select v-model="formData.storage" value-key="storageId":disabled="true" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="(item,index) in warehouseList"
-								      :key="index"
-								      :label="item.storageName"
-								      :value="item">
-								    </el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.salesType == '工程'">
-							<el-col :span="6">
-								<el-form-item label="工程名称" :required="true">
-									<el-input type="text" :value="formData.projectName" disabled></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="工程编号" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="负责人" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.manger" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="联系电话" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.mobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="项目时间" :required="true">
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.startTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="开始日期">
-									</el-date-picker>
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.endTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="结束日期">
-									</el-date-picker>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="项目地址" :required="true">
-									<el-row>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
-										</el-col>
-										<el-col :span="8">
-											<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
-										</el-col>
-									</el-row>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="">
-									<el-row :gutter="20">
-										<el-col :span="24">
-											<el-input type="text" v-model="formData.address" :disabled="true" placeholder="详细地址"></el-input>
-										</el-col>
-										<!-- <el-col :span="2">
+              <el-col :span="8">
+                <el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="8">
+              <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.salesType">
+                  <el-radio disabled label="零售">零售</el-radio>
+                  <el-radio disabled label="工程">工程</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label="销售订单号" :required="true">
+                <el-input
+                  type="text"
+                  v-model="formData.salesId"
+                  @change="getDetail"
+                  disabled
+                  placeholder="请输入销售订单号"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1">
+              <el-button
+                v-if="formType != 2"
+                size="small"
+                type="primary"
+                @click="
+                  isShowNo = true
+                  getOrderList()
+                "
+                >选择</el-button
+              >
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="销售金额">
+                <el-input type="text" :value="formData.totalAmount" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="时间">
+                <el-input type="text" :value="formData.payTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="入库仓库" prop="storage">
+                <el-select
+                  v-model="formData.storage"
+                  value-key="storageId"
+                  :disabled="true"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in warehouseList"
+                    :key="index"
+                    :label="item.storageName"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.salesType == '工程'">
+              <el-col :span="6">
+                <el-form-item label="工程名称" :required="true">
+                  <el-input type="text" :value="formData.projectName" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="工程编号" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="负责人" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.manger" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="联系电话" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.mobile" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="项目时间" :required="true">
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.startTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="开始日期"
+                  >
+                  </el-date-picker>
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.endTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="项目地址" :required="true">
+                  <el-row>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="">
+                  <el-row :gutter="20">
+                    <el-col :span="24">
+                      <el-input
+                        type="text"
+                        v-model="formData.address"
+                        :disabled="true"
+                        placeholder="详细地址"
+                      ></el-input>
+                    </el-col>
+                    <!-- <el-col :span="2">
 											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 										</el-col> -->
-									</el-row>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="附件">
-								<ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData.remark" :disabled="formType == 2" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>配件信息</span>
-			</div>
-			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="配件名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="true" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="数量" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.newRefundQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
-					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
-					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
-					<el-table-column prop="price" align="center" label="销售价格"></el-table-column>
-					<el-table-column prop="" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.newRefundQty && scope.row.price">
-							{{(scope.row.price * 100) * scope.row.newRefundQty / 100}}
-						</template>
-					</el-table-column>
-					<!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
-					<el-table-column prop="" align="center" label="退款金额" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.refundAmount" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
-			<h3>扫二维码支付</h3>
-			<el-image :src="payCodeUrl" fit="fit"></el-image>
-		</el-dialog>
-		<!-- 选择销售订单号 -->
-		<el-dialog title="选择销售订单" :visible.sync="isShowNo" width="80%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
-			<el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
-				<el-row :gutter="20">
-					<el-col :span="6">
-						<el-form-item label="网点名称" prop="websit_id">
-							<el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in websitList"
-							      :key="item.websitId"
-							      :label="item.name"
-							      :value="item.websitId">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅姓名" prop="worker_name">
-							<el-select v-model="formData1.worker_name" @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" filterable placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in workerList"
-							      :key="item.id"
-							      :label="item.nickName + '-' + item.mobile"
-							      :value="item.nickName">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅联系电话" prop="worker_mobile">
-							<el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="物料名称" prop="goods" align="center">
-							<el-select v-model="formData1.goods" filterable @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" value-key="goodsId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="销售订单号" prop="sales_id">
-							<el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<!-- <el-col :span="8">
+                  </el-row>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="附件">
+                <ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  v-model="formData.remark"
+                  :disabled="formType == 2"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>配件信息</span>
+      </div>
+      <!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="配件名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="true"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="" align="center" label="数量">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.newRefundQty"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
+          <el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
+          <el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
+          <el-table-column prop="price" align="center" label="销售价格"></el-table-column>
+          <el-table-column prop="" align="center" label="销售金额">
+            <template slot-scope="scope" v-if="scope.row.newRefundQty && scope.row.price">
+              {{ (scope.row.price * 100 * scope.row.newRefundQty) / 100 }}
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
+          <el-table-column prop="" align="center" label="退款金额">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.refundAmount"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="dataList.splice(scope.$index, 1)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button
+          v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')"
+          size="small"
+          type="primary"
+          @click="save()"
+          >保存</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()"
+          >提交</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary" @click="confirm()"
+          >确认收货</el-button
+        >
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog
+      title="微信支付"
+      :visible.sync="isPay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="payCodeUrl = ''"
+    >
+      <h3>扫二维码支付</h3>
+      <el-image :src="$showImgUrl(payCodeUrl)" fit="fit"></el-image>
+    </el-dialog>
+    <!-- 选择销售订单号 -->
+    <el-dialog
+      title="选择销售订单"
+      :visible.sync="isShowNo"
+      width="80%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="close"
+    >
+      <el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="网点名称" prop="websit_id">
+              <el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%">
+                <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item.websitId">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅姓名" prop="worker_name">
+              <el-select
+                v-model="formData1.worker_name"
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                filterable
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in workerList"
+                  :key="item.id"
+                  :label="item.nickName + '-' + item.mobile"
+                  :value="item.nickName"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅联系电话" prop="worker_mobile">
+              <el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物料名称" prop="goods" align="center">
+              <el-select
+                v-model="formData1.goods"
+                filterable
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                value-key="goodsId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in goodsList" :key="item.goodsId" :label="item.goodsName" :value="item">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="销售订单号" prop="sales_id">
+              <el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="8">
 						<el-form-item label="规格型号" align="center">
 							<el-select v-model="formData1.goods" @focus="()=>{
 								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
@@ -346,601 +454,650 @@
 							  </el-select>
 						</el-form-item>
 					</el-col> -->
-					<el-col :span="18">
-						<el-row type="flex" justify="end">
-							<el-col :span="3">
-								<el-button size="small" @click="resetScreenForm()">清空</el-button>
-								<el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
-							</el-col>
-						</el-row>
-					</el-col>
-				</el-row>
-			</el-form>
-			<div class="clearfix">
-				<span>订单信息</span>
-			</div>
-			<div class="table">
-				<el-table ref="treeTable" :data="orderList" element-loading-text="Loading" @select="handleSelectionChange" @row-click="handleSelectionChange('',$event)" border fit highlight-current-row stripe style="max-height: 380px;overflow-y: auto;">
-					<el-table-column type="selection" width="40"></el-table-column>
-					<el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
-					<el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="购买方">
-						<template slot-scope="scope">
-							{{scope.row.buyPeople == 'WORKER'?'内部师傅':'客户'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
-					<el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
-					<el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
-					<el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
-					<el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
-					<el-table-column prop="" align="center" label="订单来源">
-						<template slot-scope="scope">
-							{{scope.row.orderSource == 'ONLINE'?'在线订单':'自建订单'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payType" align="center" label="支付方式">
-						<template slot-scope="scope">
-							{{scope.row.payType == 'CASH'?'现金':scope.row.payType == 'WECHAT'?'微信':'工程支付'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
-					<el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
-					<el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
-					<el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
-				</el-table>
-				<div class="pagination clearfix">
-					<div class="fr">
-						<el-pagination
-							@size-change="handleSizeChange"
-							@current-change="handleCurrentChange"
-							:current-page="pageNum"
-							:page-sizes="[10, 20, 30, 50]"
-							:page-size="pageSize"
-							layout="total, sizes, prev, pager, next, jumper"
-							:total="listTotal"
-						></el-pagination>
-					</div>
-				</div>
-				<div slot="footer" class="dialog-footer" style="margin-top: 10px;">
-					<el-button size="small" @click="isShowNo = false">取 消</el-button>
-					<el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
-				</div>
-			</div>
-		</el-dialog>
-	</div>
+          <el-col :span="18">
+            <el-row type="flex" justify="end">
+              <el-col :span="3">
+                <el-button size="small" @click="resetScreenForm()">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
+              </el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="clearfix">
+        <span>订单信息</span>
+      </div>
+      <div class="table">
+        <el-table
+          ref="treeTable"
+          :data="orderList"
+          element-loading-text="Loading"
+          @select="handleSelectionChange"
+          @row-click="handleSelectionChange('', $event)"
+          border
+          fit
+          highlight-current-row
+          stripe
+          style="max-height: 380px; overflow-y: auto"
+        >
+          <el-table-column type="selection" width="40"></el-table-column>
+          <el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
+          <el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="购买方">
+            <template slot-scope="scope">
+              {{ scope.row.buyPeople == 'WORKER' ? '内部师傅' : '客户' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
+          <el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
+          <el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
+          <el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
+          <el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
+          <el-table-column prop="" align="center" label="订单来源">
+            <template slot-scope="scope">
+              {{ scope.row.orderSource == 'ONLINE' ? '在线订单' : '自建订单' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payType" align="center" label="支付方式">
+            <template slot-scope="scope">
+              {{ scope.row.payType == 'CASH' ? '现金' : scope.row.payType == 'WECHAT' ? '微信' : '工程支付' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
+          <el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
+          <el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
+        </el-table>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="pageNum"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="pageSize"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            ></el-pagination>
+          </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="margin-top: 10px">
+          <el-button size="small" @click="isShowNo = false">取 消</el-button>
+          <el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import ImageUpload from '@/components/file-upload'
-	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { add, edit, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
-	import { getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
-	import { storageListPageV2 } from '@/api/storage.js'
-	export default {
-		components: { ImageUpload, geographicalPosi },
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				websitList: [],
-				workerList: [],
-				orderList: [],
-				goodsList: [],
-				mainList: [],
-				warehouseList: [],
-				isPay: false,
-				payCodeUrl: '',
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					fileUrl: [],
-					salesId: '',
-					partsRetId: '',
-					flag: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					worker: {},
-					workerName: '',
-					workerId: '',
-					identity: '',
-					workerMobile: '',
-					totalAmount: '',
-					remark: '',
-					salesType: '零售',
-					province: '',
-					provinceId: '',
-					city: '',
-					cityId: '',
-					area: '',
-					areaId: '',
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					orderEnginBaseId: '',
-					storage: null,
-					storageId: '',
-					storageName: '',
-				},
-				formData1: {
-					websit_id: '',
-					worker_name: '',
-					worker_mobile: '',
-					sales_id: '',
-					goods: {},
-					goodsName: '',
-					goodsSpecification: ''
-				},
-				isEdit: 0,
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					identity: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					workerMobile: [
-						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-				},
-				isShowNo: false,
-				pageNum: 1,
-				pageSize: 10,
-				listTotal: 0
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getNewDetail()
-			}
-			this.getWebsit()
-			this.getinitlbslist()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(salesId){
-				const that = this
-				getDetail({salesId}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.items){
-						var ress = await that.getGoods(item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-						item.newRefundQty = 1
-					}
-					this.dataList = res.data.items
-				})
-			},
-			async getNewDetail(){
-				const that = this
-				getNewDetail({id: this.id}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.websitPartsRetItemList){
-						var ress = await that.getGoods(item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-					}
-					this.dataList = res.data.websitPartsRetItemList
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			getWarehouseList(websitId){
-				if(!websitId){return this.warehouseList = []}
-				storageListPageV2({
-			      pageNum: 1,
-			      pageSize: -1,
-			      params: [{param: "a.type", compare: "like", value: "配件"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
-			    }).then(res => {
-					this.warehouseList = res.data.records
-			    })
-			},
-			close(){
-				this.$refs.formData1.resetFields();
-			},
-			confirmOrder(){
-				this.isShowNo = false
-				this.getDetail(this.selectedRow.salesId)
-			},
-			getOrderList(){
-				listPageV2({pageNum: this.pageNum,pageSize: this.pageSize,params: [{param: 'a.sales_id',compare: '=',value: this.formData1.sales_id},{param: 'a.flag',compare: '=',value: 'PAY_TAKE'},{param: "a.goods_type", compare: "=", value: "P"},{param: 'a.websit_id',compare: '=',value: this.formData1.websit_id},{param: 'a.worker_name',compare: '=',value: this.formData1.worker_name},{param: 'a.worker_mobile',compare: '=',value: this.formData1.worker_mobile}], goodsName: this.formData1.goods.goodsName, goodsSpecification: this.formData1.goods.goodsSpecification, isFilter: true}).then(res => {
-					this.orderList = res.data.records
-					this.listTotal = res.data.total
-				})
-			},
-			getGoodsList(){
-				getGoodsList({
-					type: 'P',
-					websitId: this.formData1.websit_id
-				}).then(res => {
-					this.goodsList = res.data
-				})
-			},
-			handleSelectionChange (selection, row) {
-				this.$refs.treeTable.clearSelection()
-			 	 // 这里因为需求做的是必选一个,如有其他需求可做调整
-				this.$refs.treeTable.toggleRowSelection(row, true)    
-				this.selectedRow = row
-			},
-			// 更改每页数量
-			handleSizeChange(val) {
-				this.pageSize = val;
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			// 更改当前页
-			handleCurrentChange(val) {
-				this.pageNum = val;
-				this.getOrderList();
-			},
-			// 提交筛选表单
-			submitScreenForm() {
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			
-			// 重置筛选表单
-			resetScreenForm() {
-				this.$refs.formData1.resetFields();
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			changeWebsit(e){
-				// this.formData.websitId = e.websitId
-				// this.formData.websitName = e.name
-				this.getWorker()
-				this.getGoodsList()
-				this.formData1.goods = {}
-				// this.getCategory(e.websitId)
-			},
-			async getGoods(goodsName,type){
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-						console.log(this.dataList)
-					})
-				}
-			},
-			getWorker(){
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					this.workerList = res.data.records
-				})
-			},
-			changeWorker(e){
-				this.formData.identity = e.idCard
-				this.formData.workerMobile = e.mobile
-				this.formData.workerId = e.userId
-				this.formData.workerName = e.nickName
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].brandRelaName = e.brandRelaName
-				this.dataList[this.isEdit].productRelaName = e.productRelaName
-				this.dataList[this.isEdit].price = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-				this.dataList[this.isEdit].itemSourceType = e.itemSourceType
-				this.dataList[this.isEdit].itemSourceId = e.itemSourceId
-				this.dataList[this.isEdit].normType = e.normType
-			},
-			add(){
-				if(this.dataList.length != 0){this.isEdit += 1}
-				this.dataList.push({
-					goodsList: [],
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-					goodsSalesUnit: '',
-					brandRelaName: '',
-					productRelaName: '',
-					goodsCode: '',
-					price: '',
-					refundAmount: '',
-					saleAmount: '',
-					newRefundQty: 1,
-					qty: '',
-					goodsType: 'P',
-					itemSourceType: '',
-					itemSourceId: '',
-					normType: ''
-				})
-			},
-			confirm(){
-				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					edit({
-						flag: 'OK',
-						partsRetId: this.formData.partsRetId,
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('确认提货成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			async checkForm(){
-				let is_save = true
-				this.dataList.forEach(item=>{
-					if(!item.newRefundQty || item.newRefundQty < 1){
-						this.$message.warning('请输入配件数量并且数量大于0!')
-						is_save = false
-					}else if(!item.refundAmount || item.refundAmount <= 0){
-						this.$message.warning('请输入配件退货金额并且大于0!')
-						is_save = false
-					}
-				})
-				return is_save
-			},
-			async submit(){
-				let is_save = await this.checkForm()
-				if(!is_save){return false}
-				this.$confirm(`请确定是否提交, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					edit({
-						flag: 'SUBMIT',
-						salesId: this.formData.salesId,
-						partsRetId: this.formData.partsRetId,
-						goodsType: 'P',
-						type: 'NEW',
-						remark: this.formData.remark,
-						websitId: this.formData.websitId,
-						websitName: this.formData.websitName,
-						workerName: this.formData.workerName,
-						workerId: this.formData.workerId,
-						identity: this.formData.identity,
-						workerMobile: this.formData.workerMobile,
-						websitPartsRetItems: this.dataList,
-						fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-						storageId: this.formData.storageId,
-						storageName: this.formData.storageName,
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('提交成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			async save(){
-				let is_save = await this.checkForm()
-				if(!is_save){return false}
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								salesId: this.formData.salesId,
-								goodsType: 'P',
-								type: 'NEW',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitPartsRetItems: this.dataList,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								salesId: this.formData.salesId,
-								partsRetId: this.formData.partsRetId,
-								goodsType: 'P',
-								type: 'NEW',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitPartsRetItems: this.dataList,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import ImageUpload from '@/components/file-upload'
+import { listPageV2, getWorker, getCategory, getGoods, getDetail } from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { add, edit, getNewDetail } from '@/api/auxiliaryFittings/attachmentNewReturn'
+import { getGoodsList } from '@/api/auxiliaryFittings/auxiliarySalesReturnOrder'
+import { storageListPageV2 } from '@/api/storage.js'
+export default {
+  components: { ImageUpload, geographicalPosi },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      websitList: [],
+      workerList: [],
+      orderList: [],
+      goodsList: [],
+      mainList: [],
+      warehouseList: [],
+      isPay: false,
+      payCodeUrl: '',
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        fileUrl: [],
+        salesId: '',
+        partsRetId: '',
+        flag: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        worker: {},
+        workerName: '',
+        workerId: '',
+        identity: '',
+        workerMobile: '',
+        totalAmount: '',
+        remark: '',
+        salesType: '零售',
+        province: '',
+        provinceId: '',
+        city: '',
+        cityId: '',
+        area: '',
+        areaId: '',
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        orderEnginBaseId: '',
+        storage: null,
+        storageId: '',
+        storageName: ''
+      },
+      formData1: {
+        websit_id: '',
+        worker_name: '',
+        worker_mobile: '',
+        sales_id: '',
+        goods: {},
+        goodsName: '',
+        goodsSpecification: ''
+      },
+      isEdit: 0,
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        identity: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        workerMobile: [
+          { required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ]
+      },
+      isShowNo: false,
+      pageNum: 1,
+      pageSize: 10,
+      listTotal: 0
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getNewDetail()
+    }
+    this.getWebsit()
+    this.getinitlbslist()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail(salesId) {
+      const that = this
+      getDetail({ salesId }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.items) {
+          var ress = await that.getGoods(item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+          item.newRefundQty = 1
+        }
+        this.dataList = res.data.items
+      })
+    },
+    async getNewDetail() {
+      const that = this
+      getNewDetail({ id: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.websitPartsRetItemList) {
+          var ress = await that.getGoods(item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+        }
+        this.dataList = res.data.websitPartsRetItemList
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    getWarehouseList(websitId) {
+      if (!websitId) {
+        return (this.warehouseList = [])
+      }
+      storageListPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.type', compare: 'like', value: '配件' },
+          { param: 'a.status', compare: '=', value: 'true' },
+          { param: 'a.websit_id', compare: '=', value: websitId }
+        ]
+      }).then(res => {
+        this.warehouseList = res.data.records
+      })
+    },
+    close() {
+      this.$refs.formData1.resetFields()
+    },
+    confirmOrder() {
+      this.isShowNo = false
+      this.getDetail(this.selectedRow.salesId)
+    },
+    getOrderList() {
+      listPageV2({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        params: [
+          { param: 'a.sales_id', compare: '=', value: this.formData1.sales_id },
+          { param: 'a.flag', compare: '=', value: 'PAY_TAKE' },
+          { param: 'a.goods_type', compare: '=', value: 'P' },
+          { param: 'a.websit_id', compare: '=', value: this.formData1.websit_id },
+          { param: 'a.worker_name', compare: '=', value: this.formData1.worker_name },
+          { param: 'a.worker_mobile', compare: '=', value: this.formData1.worker_mobile }
+        ],
+        goodsName: this.formData1.goods.goodsName,
+        goodsSpecification: this.formData1.goods.goodsSpecification,
+        isFilter: true
+      }).then(res => {
+        this.orderList = res.data.records
+        this.listTotal = res.data.total
+      })
+    },
+    getGoodsList() {
+      getGoodsList({
+        type: 'P',
+        websitId: this.formData1.websit_id
+      }).then(res => {
+        this.goodsList = res.data
+      })
+    },
+    handleSelectionChange(selection, row) {
+      this.$refs.treeTable.clearSelection() // 这里因为需求做的是必选一个,如有其他需求可做调整
+      this.$refs.treeTable.toggleRowSelection(row, true)
+      this.selectedRow = row
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.pageNum = val
+      this.getOrderList()
+    },
+    // 提交筛选表单
+    submitScreenForm() {
+      this.pageNum = 1
+      this.getOrderList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.formData1.resetFields()
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    changeWebsit(e) {
+      // this.formData.websitId = e.websitId
+      // this.formData.websitName = e.name
+      this.getWorker()
+      this.getGoodsList()
+      this.formData1.goods = {}
+      // this.getCategory(e.websitId)
+    },
+    async getGoods(goodsName, type) {
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({
+            websitId: this.formData.websitId,
+            type: 'P',
+            goodsName: goodsName,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            saleType: this.formData.salesType,
+            storageId: this.formData.storageId
+          }).then(res => {
+            resolve({
+              data: res.data[0]
+            })
+          })
+        })
+      } else {
+        getGoods({
+          websitId: this.formData.websitId,
+          type: 'P',
+          orderEnginBaseId: this.formData.orderEnginBaseId,
+          saleType: this.formData.salesType,
+          storageId: this.formData.storageId
+        }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+          console.log(this.dataList)
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    changeWorker(e) {
+      this.formData.identity = e.idCard
+      this.formData.workerMobile = e.mobile
+      this.formData.workerId = e.userId
+      this.formData.workerName = e.nickName
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].brandRelaName = e.brandRelaName
+      this.dataList[this.isEdit].productRelaName = e.productRelaName
+      this.dataList[this.isEdit].price = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+      this.dataList[this.isEdit].itemSourceType = e.itemSourceType
+      this.dataList[this.isEdit].itemSourceId = e.itemSourceId
+      this.dataList[this.isEdit].normType = e.normType
+    },
+    add() {
+      if (this.dataList.length != 0) {
+        this.isEdit += 1
+      }
+      this.dataList.push({
+        goodsList: [],
+        goods: {},
+        goodsId: '',
+        goodsName: '',
+        goodsSalesUnit: '',
+        brandRelaName: '',
+        productRelaName: '',
+        goodsCode: '',
+        price: '',
+        refundAmount: '',
+        saleAmount: '',
+        newRefundQty: 1,
+        qty: '',
+        goodsType: 'P',
+        itemSourceType: '',
+        itemSourceId: '',
+        normType: ''
+      })
+    },
+    confirm() {
+      this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        edit({
+          flag: 'OK',
+          partsRetId: this.formData.partsRetId
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('确认提货成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    async checkForm() {
+      let is_save = true
+      this.dataList.forEach(item => {
+        if (!item.newRefundQty || item.newRefundQty < 1) {
+          this.$message.warning('请输入配件数量并且数量大于0!')
+          is_save = false
+        } else if (!item.refundAmount || item.refundAmount <= 0) {
+          this.$message.warning('请输入配件退货金额并且大于0!')
+          is_save = false
+        }
+      })
+      return is_save
+    },
+    async submit() {
+      let is_save = await this.checkForm()
+      if (!is_save) {
+        return false
+      }
+      this.$confirm(`请确定是否提交, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        edit({
+          flag: 'SUBMIT',
+          salesId: this.formData.salesId,
+          partsRetId: this.formData.partsRetId,
+          goodsType: 'P',
+          type: 'NEW',
+          remark: this.formData.remark,
+          websitId: this.formData.websitId,
+          websitName: this.formData.websitName,
+          workerName: this.formData.workerName,
+          workerId: this.formData.workerId,
+          identity: this.formData.identity,
+          workerMobile: this.formData.workerMobile,
+          websitPartsRetItems: this.dataList,
+          fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+          storageId: this.formData.storageId,
+          storageName: this.formData.storageName
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('提交成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    async save() {
+      let is_save = await this.checkForm()
+      if (!is_save) {
+        return false
+      }
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              salesId: this.formData.salesId,
+              goodsType: 'P',
+              type: 'NEW',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitPartsRetItems: this.dataList,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              salesId: this.formData.salesId,
+              partsRetId: this.formData.partsRetId,
+              goodsType: 'P',
+              type: 'NEW',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitPartsRetItems: this.dataList,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-	::v-deep .el-table__body-wrapper{
-		max-height: 300px !important;
-		overflow-y: auto !important;
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+::v-deep .el-table__body-wrapper {
+  max-height: 300px !important;
+  overflow-y: auto !important;
+}
+</style>

+ 1137 - 947
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue

@@ -1,410 +1,546 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'OK'?'确认收货':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.partsRetId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websit" disabled value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in websitList"
-								      :key="item.websitId"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople">
-									<el-radio disabled label="WORKER">内部师傅</el-radio>
-									<el-radio disabled label="CUSTOMER">客户</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.buyPeople == 'CUSTOMER'">
-							<el-col :span="8">
-								<el-form-item label="客户姓名" prop="workerName" :required="true">
-									<el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="客户联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<template v-else>
-							<el-col :span="8">
-								<el-form-item label="师傅姓名" prop="worker" :required="true">
-									<el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<!-- <el-col :span="8">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="
+                    formData.flag == 'SAVE'
+                      ? '保存'
+                      : formData.flag == 'SUBMIT'
+                      ? '已提交'
+                      : formData.flag == 'OK'
+                      ? '确认收货'
+                      : ''
+                  "
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.partsRetId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="网点名称" prop="websitId" :required="true">
+                <el-select
+                  v-model="formData.websit"
+                  disabled
+                  value-key="websitId"
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.buyPeople">
+                  <el-radio disabled label="WORKER">内部师傅</el-radio>
+                  <el-radio disabled label="CUSTOMER">客户</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.buyPeople == 'CUSTOMER'">
+              <el-col :span="8">
+                <el-form-item label="客户姓名" prop="workerName" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="8">
+                <el-form-item label="师傅姓名" prop="worker" :required="true">
+                  <el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
 								<el-form-item label="师傅身份证" prop="identity" :required="true">
 									<el-input type="text" v-model="formData.identity" :disabled="formType == 2" placeholder="请输入"></el-input>
 								</el-form-item>
 							</el-col> -->
-							<el-col :span="8">
-								<el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="8">
-							<el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.salesType">
-								    <el-radio disabled label="零售">零售</el-radio>
-								    <el-radio disabled label="工程">工程</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="7">
-							<el-form-item label="销售订单号" :required="true">
-								<el-input type="text" v-model="formData.salesId" @change="getDetail" disabled placeholder="请输入销售订单号"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="1">
-							<el-button v-if="formType != 2" size="small" type="primary"  @click="isShowNo = true;getOrderList();">选择</el-button>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="销售金额">
-								<el-input type="text" :value="formData.totalAmount" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="时间">
-								<el-input type="text" :value="formData.payTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="入库仓库" prop="storage">
-								<el-select v-model="formData.storage" value-key="storageId":disabled="true" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="(item,index) in warehouseList"
-								      :key="index"
-								      :label="item.storageName"
-								      :value="item">
-								    </el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.salesType == '工程'">
-							<el-col :span="6">
-								<el-form-item label="工程名称" :required="true">
-									<el-input type="text" :value="formData.projectName" disabled></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="工程编号" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="负责人" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.manger" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="联系电话" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.mobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="项目时间" :required="true">
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.startTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="开始日期">
-									</el-date-picker>
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.endTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="结束日期">
-									</el-date-picker>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="项目地址" prop="province" :required="true">
-									<el-row>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
-										</el-col>
-										<el-col :span="8">
-											<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
-										</el-col>
-									</el-row>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="" prop="address">
-									<el-row :gutter="20">
-										<el-col :span="24">
-											<el-input type="text" v-model="formData.address" :disabled="true" placeholder="详细地址"></el-input>
-										</el-col>
-										<!-- <el-col :span="2">
+              <el-col :span="8">
+                <el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="8">
+              <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.salesType">
+                  <el-radio disabled label="零售">零售</el-radio>
+                  <el-radio disabled label="工程">工程</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label="销售订单号" :required="true">
+                <el-input
+                  type="text"
+                  v-model="formData.salesId"
+                  @change="getDetail"
+                  disabled
+                  placeholder="请输入销售订单号"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1">
+              <el-button
+                v-if="formType != 2"
+                size="small"
+                type="primary"
+                @click="
+                  isShowNo = true
+                  getOrderList()
+                "
+                >选择</el-button
+              >
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="销售金额">
+                <el-input type="text" :value="formData.totalAmount" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="时间">
+                <el-input type="text" :value="formData.payTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="入库仓库" prop="storage">
+                <el-select
+                  v-model="formData.storage"
+                  value-key="storageId"
+                  :disabled="true"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in warehouseList"
+                    :key="index"
+                    :label="item.storageName"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.salesType == '工程'">
+              <el-col :span="6">
+                <el-form-item label="工程名称" :required="true">
+                  <el-input type="text" :value="formData.projectName" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="工程编号" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="负责人" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.manger" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="联系电话" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.mobile" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="项目时间" :required="true">
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.startTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="开始日期"
+                  >
+                  </el-date-picker>
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.endTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="项目地址" prop="province" :required="true">
+                  <el-row>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="" prop="address">
+                  <el-row :gutter="20">
+                    <el-col :span="24">
+                      <el-input
+                        type="text"
+                        v-model="formData.address"
+                        :disabled="true"
+                        placeholder="详细地址"
+                      ></el-input>
+                    </el-col>
+                    <!-- <el-col :span="2">
 											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 										</el-col> -->
-									</el-row>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="附件">
-								<ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData.remark" :disabled="formType == 2" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>配件信息</span>
-			</div>
-			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
-			<label>使用类型: </label>
-			<el-radio-group v-model="formData.orderUseType">
-			    <el-radio :disabled="formType == 2" label="INSIDE">保内</el-radio>
-			    <el-radio :disabled="formType == 2" label="OUT">保外</el-radio>
-			  </el-radio-group>
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="配件名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="true" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="数量" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.oldRefundQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
-					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
-					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
-					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
-					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.oldRefundQty && scope.row.goods && scope.row.goods.price">
-							{{(scope.row.goods.price * 100) * scope.row.oldRefundQty / 100}}
-						</template>
-					</el-table-column>
-					<!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
-					<el-table-column prop="" align="center" label="退款金额" v-if="formData.orderUseType == 'INSIDE'">
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.refundAmount" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>旧件信息</span>
-			</div>
-			<el-button v-if="formType != 2" size="small" type="primary" @click="add()">添加</el-button>
-			<div class="table">
-				<el-table :data="oldList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="工单号" align="center">
-						<template slot-scope="scope">
-							<el-input type="text" v-model="scope.row.orderId" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="工单品牌" align="center">
-						<template slot-scope="scope">
-							<el-input type="text" v-model="scope.row.orderBrand" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="用户姓名" align="center">
-						<template slot-scope="scope">
-							<el-input type="text" v-model="scope.row.name" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="用户电话" align="center">
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.phone" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<!-- <el-table-column label="配件名称" align="center">
+                  </el-row>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="附件">
+                <ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  v-model="formData.remark"
+                  :disabled="formType == 2"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>配件信息</span>
+      </div>
+      <!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+      <label>使用类型: </label>
+      <el-radio-group v-model="formData.orderUseType">
+        <el-radio :disabled="formType == 2" label="INSIDE">保内</el-radio>
+        <el-radio :disabled="formType == 2" label="OUT">保外</el-radio>
+      </el-radio-group>
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="配件名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="true"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="" align="center" label="数量">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.oldRefundQty"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
+          <el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
+          <el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
+          <el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
+          <el-table-column prop="goods.saleAmount" align="center" label="销售金额">
+            <template slot-scope="scope" v-if="scope.row.oldRefundQty && scope.row.goods && scope.row.goods.price">
+              {{ (scope.row.goods.price * 100 * scope.row.oldRefundQty) / 100 }}
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column> -->
+          <el-table-column prop="" align="center" label="退款金额" v-if="formData.orderUseType == 'INSIDE'">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.refundAmount"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="dataList.splice(scope.$index, 1)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>旧件信息</span>
+      </div>
+      <el-button v-if="formType != 2" size="small" type="primary" @click="add()">添加</el-button>
+      <div class="table">
+        <el-table :data="oldList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="工单号" align="center">
+            <template slot-scope="scope">
+              <el-input
+                type="text"
+                v-model="scope.row.orderId"
+                :disabled="formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="工单品牌" align="center">
+            <template slot-scope="scope">
+              <el-input
+                type="text"
+                v-model="scope.row.orderBrand"
+                :disabled="formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="用户姓名" align="center">
+            <template slot-scope="scope">
+              <el-input type="text" v-model="scope.row.name" :disabled="formType == 2" placeholder="请输入"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="用户电话" align="center">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.phone"
+                :disabled="formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column label="配件名称" align="center">
 						<template slot-scope="scope">
 							<el-input type="text" v-model="scope.row.partsName" :disabled="formType == 2" placeholder="请输入"></el-input>
 						</template>
 					</el-table-column> -->
-					<el-table-column label="配件名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods1" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="配件编码" align="center">
-						<template slot-scope="scope">
-							<el-input type="text" v-model="scope.row.partsCode" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="单位" align="center">
-						<template slot-scope="scope">
-							<el-input type="text" v-model="scope.row.unit" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="数量" align="center">
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.qty" :disabled="formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="danger" @click="oldList.splice(scope.$index,1)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
-			<h3>扫二维码支付</h3>
-			<el-image :src="payCodeUrl" fit="fit"></el-image>
-		</el-dialog>
-		<!-- 选择销售订单号 -->
-		<el-dialog title="选择销售订单" :visible.sync="isShowNo" width="80%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
-			<el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
-				<el-row :gutter="20">
-					<el-col :span="6">
-						<el-form-item label="网点名称" prop="websit_id">
-							<el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in websitList"
-							      :key="item.websitId"
-							      :label="item.name"
-							      :value="item.websitId">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅姓名" prop="worker_name">
-							<el-select v-model="formData1.worker_name" @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" filterable placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in workerList"
-							      :key="item.id"
-							      :label="item.nickName + '-' + item.mobile"
-							      :value="item.nickName">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅联系电话" prop="worker_mobile">
-							<el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="物料名称" prop="goods" align="center">
-							<el-select v-model="formData1.goods" filterable @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" value-key="goodsId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="销售订单号" prop="sales_id">
-							<el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<!-- <el-col :span="8">
+          <el-table-column label="配件名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods1"
+                value-key="goodsId"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="配件编码" align="center">
+            <template slot-scope="scope">
+              <el-input
+                type="text"
+                v-model="scope.row.partsCode"
+                :disabled="formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="单位" align="center">
+            <template slot-scope="scope">
+              <el-input type="text" v-model="scope.row.unit" :disabled="formType == 2" placeholder="请输入"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="数量" align="center">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.qty" :disabled="formType == 2" placeholder="请输入"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="danger" @click="oldList.splice(scope.$index, 1)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button
+          v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')"
+          size="small"
+          type="primary"
+          @click="save()"
+          >保存</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()"
+          >提交</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary" @click="confirm()"
+          >确认收货</el-button
+        >
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog
+      title="微信支付"
+      :visible.sync="isPay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="payCodeUrl = ''"
+    >
+      <h3>扫二维码支付</h3>
+      <el-image :src="$showImgUrl(payCodeUrl)" fit="fit"></el-image>
+    </el-dialog>
+    <!-- 选择销售订单号 -->
+    <el-dialog
+      title="选择销售订单"
+      :visible.sync="isShowNo"
+      width="80%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="close"
+    >
+      <el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="网点名称" prop="websit_id">
+              <el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%">
+                <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item.websitId">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅姓名" prop="worker_name">
+              <el-select
+                v-model="formData1.worker_name"
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                filterable
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in workerList"
+                  :key="item.id"
+                  :label="item.nickName + '-' + item.mobile"
+                  :value="item.nickName"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅联系电话" prop="worker_mobile">
+              <el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物料名称" prop="goods" align="center">
+              <el-select
+                v-model="formData1.goods"
+                filterable
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                value-key="goodsId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in goodsList" :key="item.goodsId" :label="item.goodsName" :value="item">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="销售订单号" prop="sales_id">
+              <el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="8">
 						<el-form-item label="规格型号" align="center">
 							<el-select v-model="formData1.goods" @focus="()=>{
 								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
@@ -418,560 +554,614 @@
 							  </el-select>
 						</el-form-item>
 					</el-col> -->
-					<el-col :span="18">
-						<el-row type="flex" justify="end">
-							<el-col :span="3">
-								<el-button size="small" @click="resetScreenForm()">清空</el-button>
-								<el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
-							</el-col>
-						</el-row>
-					</el-col>
-				</el-row>
-			</el-form>
-			<div class="clearfix">
-				<span>订单信息</span>
-			</div>
-			<div class="table">
-				<el-table ref="treeTable" :data="orderList" element-loading-text="Loading" @select="handleSelectionChange" @row-click="handleSelectionChange('',$event)" border fit highlight-current-row stripe style="max-height: 380px;overflow-y: auto;">
-					<el-table-column type="selection" width="40"></el-table-column>
-					<el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
-					<el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="购买方">
-						<template slot-scope="scope">
-							{{scope.row.buyPeople == 'WORKER'?'内部师傅':'客户'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
-					<el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
-					<el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
-					<el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
-					<el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
-					<el-table-column prop="" align="center" label="订单来源">
-						<template slot-scope="scope">
-							{{scope.row.orderSource == 'ONLINE'?'在线订单':'自建订单'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payType" align="center" label="支付方式">
-						<template slot-scope="scope">
-							{{scope.row.payType == 'CASH'?'现金':scope.row.payType == 'WECHAT'?'微信':'工程支付'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
-					<el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
-					<el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
-					<el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
-				</el-table>
-				<div class="pagination clearfix">
-					<div class="fr">
-						<el-pagination
-							@size-change="handleSizeChange"
-							@current-change="handleCurrentChange"
-							:current-page="pageNum"
-							:page-sizes="[10, 20, 30, 50]"
-							:page-size="pageSize"
-							layout="total, sizes, prev, pager, next, jumper"
-							:total="listTotal"
-						></el-pagination>
-					</div>
-				</div>
-				<div slot="footer" class="dialog-footer" style="margin-top: 10px;">
-					<el-button size="small" @click="isShowNo = false">取 消</el-button>
-					<el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
-				</div>
-			</div>
-		</el-dialog>
-	</div>
+          <el-col :span="18">
+            <el-row type="flex" justify="end">
+              <el-col :span="3">
+                <el-button size="small" @click="resetScreenForm()">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
+              </el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="clearfix">
+        <span>订单信息</span>
+      </div>
+      <div class="table">
+        <el-table
+          ref="treeTable"
+          :data="orderList"
+          element-loading-text="Loading"
+          @select="handleSelectionChange"
+          @row-click="handleSelectionChange('', $event)"
+          border
+          fit
+          highlight-current-row
+          stripe
+          style="max-height: 380px; overflow-y: auto"
+        >
+          <el-table-column type="selection" width="40"></el-table-column>
+          <el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
+          <el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="购买方">
+            <template slot-scope="scope">
+              {{ scope.row.buyPeople == 'WORKER' ? '内部师傅' : '客户' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
+          <el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
+          <el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
+          <el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
+          <el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
+          <el-table-column prop="" align="center" label="订单来源">
+            <template slot-scope="scope">
+              {{ scope.row.orderSource == 'ONLINE' ? '在线订单' : '自建订单' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payType" align="center" label="支付方式">
+            <template slot-scope="scope">
+              {{ scope.row.payType == 'CASH' ? '现金' : scope.row.payType == 'WECHAT' ? '微信' : '工程支付' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
+          <el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
+          <el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
+        </el-table>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="pageNum"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="pageSize"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            ></el-pagination>
+          </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="margin-top: 10px">
+          <el-button size="small" @click="isShowNo = false">取 消</el-button>
+          <el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import ImageUpload from '@/components/file-upload'
-	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { add, edit, getNewDetail, getAttachmentList } from "@/api/auxiliaryFittings/attachmentNewReturn";
-	import { getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
-	import { storageListPageV2 } from '@/api/storage.js'
-	export default {
-		components: { ImageUpload },
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				oldList: [],
-				websitList: [],
-				workerList: [],
-				orderList: [],
-				goodsList: [],
-				attachmentList: [],
-				warehouseList: [],
-				mainList: [],
-				isPay: false,
-				payCodeUrl: '',
-				salesDetail: {},
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					fileUrl: [],
-					salesId: '',
-					partsRetId: '',
-					flag: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					worker: {},
-					workerName: '',
-					workerId: '',
-					identity: '',
-					workerMobile: '',
-					remark: '',
-					totalAmount: '',
-					orderUseType: 'INSIDE',
-					salesType: '零售',
-					province: '',
-					provinceId: '',
-					city: '',
-					cityId: '',
-					area: '',
-					areaId: '',
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					orderEnginBaseId: '',
-					storage: null,
-					storageId: '',
-					storageName: '',
-				},
-				formData1: {
-					websit_id: '',
-					worker_name: '',
-					worker_mobile: '',
-					sales_id: '',
-					goods: {},
-					goodsName: '',
-					goodsSpecification: ''
-				},
-				isEdit: 0,
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					identity: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					workerMobile: [
-						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-				},
-				isShowNo: false,
-				pageNum: 1,
-				pageSize: 10,
-				listTotal: 0
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getNewDetail()
-			}
-			this.getWebsit()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(salesId){
-				const that = this
-				getDetail({salesId}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.items){
-						var ress = await that.getGoods(item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-						item.oldRefundQty = 1
-						item.refundAmount = 0
-					}
-					this.dataList = res.data.items
-				})
-			},
-			async getNewDetail(){
-				const that = this
-				getNewDetail({id: this.id}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.websitPartsRetItemList){
-						var ress = await that.getGoods(item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-					}
-					var ress = await that.getAttachmentList(res.data.websitId)
-					for(var item of res.data.websitPartsRetOldRecordList){
-						item.goods = {goodsId: item.goodsId}
-						item.goodsList = ress.data ? ress.data : []
-					}
-					this.dataList = res.data.websitPartsRetItemList
-					this.oldList = res.data.websitPartsRetOldRecordList
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			getWarehouseList(websitId){
-				if(!websitId){return this.warehouseList = []}
-				storageListPageV2({
-			      pageNum: 1,
-			      pageSize: -1,
-			      params: [{param: "a.type", compare: "like", value: "配件"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
-			    }).then(res => {
-					this.warehouseList = res.data.records
-			    })
-			},
-			close(){
-				this.$refs.formData1.resetFields();
-			},
-			confirmOrder(){
-				this.isShowNo = false
-				this.getDetail(this.selectedRow.salesId)
-			},
-			getOrderList(){
-				listPageV2({pageNum: this.pageNum,pageSize: this.pageSize,params: [{param: 'a.sales_id',compare: '=',value: this.formData1.sales_id},{param: 'a.flag',compare: '=',value: 'PAY_TAKE'},{param: "a.goods_type", compare: "=", value: "P"},{param: 'a.websit_id',compare: '=',value: this.formData1.websit_id},{param: 'a.worker_name',compare: '=',value: this.formData1.worker_name},{param: 'a.worker_mobile',compare: '=',value: this.formData1.worker_mobile}], goodsName: this.formData1.goods.goodsName, goodsSpecification: this.formData1.goods.goodsSpecification, isFilter: true}).then(res => {
-					this.orderList = res.data.records
-					this.listTotal = res.data.total
-				})
-			},
-			getGoodsList(){
-				getGoodsList({
-					type: 'P',
-					websitId: this.formData1.websit_id
-				}).then(res => {
-					this.goodsList = res.data
-				})
-			},
-			handleSelectionChange (selection, row) {
-				this.$refs.treeTable.clearSelection()
-			 	 // 这里因为需求做的是必选一个,如有其他需求可做调整
-				this.$refs.treeTable.toggleRowSelection(row, true)    
-				this.selectedRow = row
-			},
-			// 更改每页数量
-			handleSizeChange(val) {
-				this.pageSize = val;
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			// 更改当前页
-			handleCurrentChange(val) {
-				this.pageNum = val;
-				this.getOrderList();
-			},
-			// 提交筛选表单
-			submitScreenForm() {
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			
-			// 重置筛选表单
-			resetScreenForm() {
-				this.$refs.formData1.resetFields();
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			changeWebsit(e){
-				// this.formData.websitId = e.websitId
-				// this.formData.websitName = e.name
-				this.getWorker()
-				this.getGoodsList()
-				this.formData1.goods = {}
-				// this.getCategory(e.websitId)
-			},
-			async getGoods(goodsName,type){
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-						console.log(this.dataList)
-					})
-				}
-			},
-			getWorker(){
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					this.workerList = res.data.records
-				})
-			},
-			changeWorker(e){
-				this.formData.identity = e.idCard
-				this.formData.workerMobile = e.mobile
-				this.formData.workerId = e.userId
-				this.formData.workerName = e.nickName
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].brandRelaName = e.brandRelaName
-				this.dataList[this.isEdit].productRelaName = e.productRelaName
-				this.dataList[this.isEdit].price = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-			},
-			changeGoods1(e){
-				this.oldList[this.isEdit].goodsId = e.goodsId
-				this.oldList[this.isEdit].goodsName = e.goodsName
-				this.oldList[this.isEdit].unit = e.goodsStockUnit
-				this.oldList[this.isEdit].orderBrand = e.brandRelaName
-				this.oldList[this.isEdit].partsName = e.productRelaName
-				this.oldList[this.isEdit].partsCode = e.goodsCode
-				this.oldList[this.isEdit].qty = e.oldQty
-			},
-			add(){
-				this.oldList.push({
-					orderId: '',
-					orderBrand: '',
-					name: '',
-					phone: '',
-					partsName: '',
-					unit: '',
-					qty: '',
-					partsCode: '',
-					goodsList: [],
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-				})
-				this.getAttachmentList()
-			},
-			async getAttachmentList(websit_id){
-				const that = this
-				if(websit_id){
-					return new Promise((resolve, reject) => {
-						getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-							resolve({
-								data: res.data.records
-							})
-						})
-					})
-				}else{
-					getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-						this.oldList[this.isEdit].goodsList = res.data.records
-					})
-				}
-			},
-			async checkForm(){
-				let is_save = true
-				this.dataList.forEach(item=>{
-					if(!item.oldRefundQty || item.oldRefundQty < 1){
-						this.$message.warning('请输入配件数量并且数量大于0!')
-						is_save = false
-					}else if((!item.refundAmount || item.refundAmount <= 0) && this.formData.orderUseType == 'INSIDE'){
-						this.$message.warning('请输入配件退货金额并且大于0!')
-						is_save = false
-					}
-				})
-				return is_save
-				
-			},
-			confirm(){
-				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					edit({
-						flag: 'OK',
-						partsRetId: this.formData.partsRetId,
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('确认提货成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			async submit(){
-				console.log(this.oldList)
-				let is_save = await this.checkForm()
-				if(!is_save){return false}
-				this.$confirm(`请确定是否提交, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					console.log(2)
-					edit({
-						flag: 'SUBMIT',
-						salesId: this.formData.salesId,
-						partsRetId: this.formData.partsRetId,
-						goodsType: 'P',
-						type: 'OLD',
-						remark: this.formData.remark,
-						websitId: this.formData.websitId,
-						websitName: this.formData.websitName,
-						workerName: this.formData.workerName,
-						workerId: this.formData.workerId,
-						identity: this.formData.identity,
-						workerMobile: this.formData.workerMobile,
-						websitPartsRetItems: this.dataList,
-						websitPartsRetOldRecordList: this.oldList,
-						orderUseType: this.formData.orderUseType,
-						fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-						storageId: this.formData.storageId,
-						storageName: this.formData.storageName,
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('提交成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			async save(){
-				let is_save = await this.checkForm()
-				console.log(is_save)
-				if(!is_save){return false}
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								salesId: this.formData.salesId,
-								goodsType: 'P',
-								type: 'OLD',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitPartsRetItems: this.dataList,
-								websitPartsRetOldRecordList: this.oldList,
-								orderUseType: this.formData.orderUseType,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								salesId: this.formData.salesId,
-								partsRetId: this.formData.partsRetId,
-								goodsType: 'P',
-								type: 'OLD',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitPartsRetItems: this.dataList,
-								websitPartsRetOldRecordList: this.oldList,
-								orderUseType: this.formData.orderUseType,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			}
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import ImageUpload from '@/components/file-upload'
+import { listPageV2, getWorker, getCategory, getGoods, getDetail } from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { add, edit, getNewDetail, getAttachmentList } from '@/api/auxiliaryFittings/attachmentNewReturn'
+import { getGoodsList } from '@/api/auxiliaryFittings/auxiliarySalesReturnOrder'
+import { storageListPageV2 } from '@/api/storage.js'
+export default {
+  components: { ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      oldList: [],
+      websitList: [],
+      workerList: [],
+      orderList: [],
+      goodsList: [],
+      attachmentList: [],
+      warehouseList: [],
+      mainList: [],
+      isPay: false,
+      payCodeUrl: '',
+      salesDetail: {},
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        fileUrl: [],
+        salesId: '',
+        partsRetId: '',
+        flag: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        worker: {},
+        workerName: '',
+        workerId: '',
+        identity: '',
+        workerMobile: '',
+        remark: '',
+        totalAmount: '',
+        orderUseType: 'INSIDE',
+        salesType: '零售',
+        province: '',
+        provinceId: '',
+        city: '',
+        cityId: '',
+        area: '',
+        areaId: '',
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        orderEnginBaseId: '',
+        storage: null,
+        storageId: '',
+        storageName: ''
+      },
+      formData1: {
+        websit_id: '',
+        worker_name: '',
+        worker_mobile: '',
+        sales_id: '',
+        goods: {},
+        goodsName: '',
+        goodsSpecification: ''
+      },
+      isEdit: 0,
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        identity: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        workerMobile: [
+          { required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ]
+      },
+      isShowNo: false,
+      pageNum: 1,
+      pageSize: 10,
+      listTotal: 0
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getNewDetail()
+    }
+    this.getWebsit()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail(salesId) {
+      const that = this
+      getDetail({ salesId }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.items) {
+          var ress = await that.getGoods(item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+          item.oldRefundQty = 1
+          item.refundAmount = 0
+        }
+        this.dataList = res.data.items
+      })
+    },
+    async getNewDetail() {
+      const that = this
+      getNewDetail({ id: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.websitPartsRetItemList) {
+          var ress = await that.getGoods(item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+        }
+        var ress = await that.getAttachmentList(res.data.websitId)
+        for (var item of res.data.websitPartsRetOldRecordList) {
+          item.goods = { goodsId: item.goodsId }
+          item.goodsList = ress.data ? ress.data : []
+        }
+        this.dataList = res.data.websitPartsRetItemList
+        this.oldList = res.data.websitPartsRetOldRecordList
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    getWarehouseList(websitId) {
+      if (!websitId) {
+        return (this.warehouseList = [])
+      }
+      storageListPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.type', compare: 'like', value: '配件' },
+          { param: 'a.status', compare: '=', value: 'true' },
+          { param: 'a.websit_id', compare: '=', value: websitId }
+        ]
+      }).then(res => {
+        this.warehouseList = res.data.records
+      })
+    },
+    close() {
+      this.$refs.formData1.resetFields()
+    },
+    confirmOrder() {
+      this.isShowNo = false
+      this.getDetail(this.selectedRow.salesId)
+    },
+    getOrderList() {
+      listPageV2({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        params: [
+          { param: 'a.sales_id', compare: '=', value: this.formData1.sales_id },
+          { param: 'a.flag', compare: '=', value: 'PAY_TAKE' },
+          { param: 'a.goods_type', compare: '=', value: 'P' },
+          { param: 'a.websit_id', compare: '=', value: this.formData1.websit_id },
+          { param: 'a.worker_name', compare: '=', value: this.formData1.worker_name },
+          { param: 'a.worker_mobile', compare: '=', value: this.formData1.worker_mobile }
+        ],
+        goodsName: this.formData1.goods.goodsName,
+        goodsSpecification: this.formData1.goods.goodsSpecification,
+        isFilter: true
+      }).then(res => {
+        this.orderList = res.data.records
+        this.listTotal = res.data.total
+      })
+    },
+    getGoodsList() {
+      getGoodsList({
+        type: 'P',
+        websitId: this.formData1.websit_id
+      }).then(res => {
+        this.goodsList = res.data
+      })
+    },
+    handleSelectionChange(selection, row) {
+      this.$refs.treeTable.clearSelection() // 这里因为需求做的是必选一个,如有其他需求可做调整
+      this.$refs.treeTable.toggleRowSelection(row, true)
+      this.selectedRow = row
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.pageNum = val
+      this.getOrderList()
+    },
+    // 提交筛选表单
+    submitScreenForm() {
+      this.pageNum = 1
+      this.getOrderList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.formData1.resetFields()
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    changeWebsit(e) {
+      // this.formData.websitId = e.websitId
+      // this.formData.websitName = e.name
+      this.getWorker()
+      this.getGoodsList()
+      this.formData1.goods = {}
+      // this.getCategory(e.websitId)
+    },
+    async getGoods(goodsName, type) {
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({
+            websitId: this.formData.websitId,
+            type: 'P',
+            goodsName: goodsName,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            saleType: this.formData.salesType,
+            storageId: this.formData.storageId
+          }).then(res => {
+            resolve({
+              data: res.data[0]
+            })
+          })
+        })
+      } else {
+        getGoods({
+          websitId: this.formData.websitId,
+          type: 'P',
+          orderEnginBaseId: this.formData.orderEnginBaseId,
+          saleType: this.formData.salesType,
+          storageId: this.formData.storageId
+        }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+          console.log(this.dataList)
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    changeWorker(e) {
+      this.formData.identity = e.idCard
+      this.formData.workerMobile = e.mobile
+      this.formData.workerId = e.userId
+      this.formData.workerName = e.nickName
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].brandRelaName = e.brandRelaName
+      this.dataList[this.isEdit].productRelaName = e.productRelaName
+      this.dataList[this.isEdit].price = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+    },
+    changeGoods1(e) {
+      this.oldList[this.isEdit].goodsId = e.goodsId
+      this.oldList[this.isEdit].goodsName = e.goodsName
+      this.oldList[this.isEdit].unit = e.goodsStockUnit
+      this.oldList[this.isEdit].orderBrand = e.brandRelaName
+      this.oldList[this.isEdit].partsName = e.productRelaName
+      this.oldList[this.isEdit].partsCode = e.goodsCode
+      this.oldList[this.isEdit].qty = e.oldQty
+    },
+    add() {
+      this.oldList.push({
+        orderId: '',
+        orderBrand: '',
+        name: '',
+        phone: '',
+        partsName: '',
+        unit: '',
+        qty: '',
+        partsCode: '',
+        goodsList: [],
+        goods: {},
+        goodsId: '',
+        goodsName: ''
+      })
+      this.getAttachmentList()
+    },
+    async getAttachmentList(websit_id) {
+      const that = this
+      if (websit_id) {
+        return new Promise((resolve, reject) => {
+          getAttachmentList({
+            pageNum: 1,
+            pageSize: -1,
+            params: [{ param: 'a.websit_id', compare: '=', value: this.formData.websitId }]
+          }).then(res => {
+            resolve({
+              data: res.data.records
+            })
+          })
+        })
+      } else {
+        getAttachmentList({
+          pageNum: 1,
+          pageSize: -1,
+          params: [{ param: 'a.websit_id', compare: '=', value: this.formData.websitId }]
+        }).then(res => {
+          this.oldList[this.isEdit].goodsList = res.data.records
+        })
+      }
+    },
+    async checkForm() {
+      let is_save = true
+      this.dataList.forEach(item => {
+        if (!item.oldRefundQty || item.oldRefundQty < 1) {
+          this.$message.warning('请输入配件数量并且数量大于0!')
+          is_save = false
+        } else if ((!item.refundAmount || item.refundAmount <= 0) && this.formData.orderUseType == 'INSIDE') {
+          this.$message.warning('请输入配件退货金额并且大于0!')
+          is_save = false
+        }
+      })
+      return is_save
+    },
+    confirm() {
+      this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        edit({
+          flag: 'OK',
+          partsRetId: this.formData.partsRetId
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('确认提货成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    async submit() {
+      console.log(this.oldList)
+      let is_save = await this.checkForm()
+      if (!is_save) {
+        return false
+      }
+      this.$confirm(`请确定是否提交, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log(2)
+        edit({
+          flag: 'SUBMIT',
+          salesId: this.formData.salesId,
+          partsRetId: this.formData.partsRetId,
+          goodsType: 'P',
+          type: 'OLD',
+          remark: this.formData.remark,
+          websitId: this.formData.websitId,
+          websitName: this.formData.websitName,
+          workerName: this.formData.workerName,
+          workerId: this.formData.workerId,
+          identity: this.formData.identity,
+          workerMobile: this.formData.workerMobile,
+          websitPartsRetItems: this.dataList,
+          websitPartsRetOldRecordList: this.oldList,
+          orderUseType: this.formData.orderUseType,
+          fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+          storageId: this.formData.storageId,
+          storageName: this.formData.storageName
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('提交成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    async save() {
+      let is_save = await this.checkForm()
+      console.log(is_save)
+      if (!is_save) {
+        return false
+      }
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              salesId: this.formData.salesId,
+              goodsType: 'P',
+              type: 'OLD',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitPartsRetItems: this.dataList,
+              websitPartsRetOldRecordList: this.oldList,
+              orderUseType: this.formData.orderUseType,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              salesId: this.formData.salesId,
+              partsRetId: this.formData.partsRetId,
+              goodsType: 'P',
+              type: 'OLD',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitPartsRetItems: this.dataList,
+              websitPartsRetOldRecordList: this.oldList,
+              orderUseType: this.formData.orderUseType,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-	::v-deep .el-table__body-wrapper{
-		max-height: 300px !important;
-		overflow-y: auto !important;
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+::v-deep .el-table__body-wrapper {
+  max-height: 300px !important;
+  overflow-y: auto !important;
+}
+</style>

+ 1198 - 925
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -1,938 +1,1211 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'CANCEL'?'取消订单':formData.flag == 'PAY_NOT_TAKE'?'已支付,未提货':formData.flag == 'PAY_TAKE'?'已支付,已提货':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.salesId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websit" :disabled="formType == 2" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in websitList"
-								      :key="item.websitId"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople" @change="formData.workerName = '';formData.workerMobile=''">
-								    <el-radio :disabled="(formData.flag != 'SAVE' && formType!=0) || formData.salesType == '工程'" label="WORKER">内部师傅</el-radio>
-								    <el-radio :disabled="(formData.flag != 'SAVE' && formType!=0) || formData.salesType == '工程'" label="CUSTOMER">客户</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.buyPeople == 'CUSTOMER'">
-							<el-col :span="8">
-								<el-form-item label="客户姓名" prop="workerName" :required="true">
-									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerName" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="客户联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<template v-else>
-							<el-col :span="8">
-								<el-form-item label="师傅姓名" prop="worker" :required="true">
-									<el-select v-model="formData.worker" :disabled="formType == 2" value-key="nickName" @focus="()=>{
-										if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
-									}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
-									    <el-option
-									      v-for="item in workerList"
-									      :key="item.id"
-									      :label="item.nickName + '-' + item.mobile"
-									      :value="item">
-									    </el-option>
-									  </el-select>
-								</el-form-item>
-							</el-col>
-							<!-- <el-col :span="8">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="
+                    formData.flag == 'SAVE'
+                      ? '已保存'
+                      : formData.flag == 'SUBMIT'
+                      ? '已提交'
+                      : formData.flag == 'CANCEL'
+                      ? '取消订单'
+                      : formData.flag == 'PAY_NOT_TAKE'
+                      ? '已支付,未提货'
+                      : formData.flag == 'PAY_TAKE'
+                      ? '已支付,已提货'
+                      : ''
+                  "
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.salesId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="网点名称" prop="websitId" :required="true">
+                <el-select
+                  v-model="formData.websit"
+                  :disabled="formType == 2"
+                  value-key="websitId"
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
+                <el-radio-group
+                  v-model="formData.buyPeople"
+                  @change="
+                    formData.workerName = ''
+                    formData.workerMobile = ''
+                  "
+                >
+                  <el-radio
+                    :disabled="(formData.flag != 'SAVE' && formType != 0) || formData.salesType == '工程'"
+                    label="WORKER"
+                    >内部师傅</el-radio
+                  >
+                  <el-radio
+                    :disabled="(formData.flag != 'SAVE' && formType != 0) || formData.salesType == '工程'"
+                    label="CUSTOMER"
+                    >客户</el-radio
+                  >
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.buyPeople == 'CUSTOMER'">
+              <el-col :span="8">
+                <el-form-item label="客户姓名" prop="workerName" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    v-model="formData.workerName"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户联系电话" prop="workerMobile" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    v-model="formData.workerMobile"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="8">
+                <el-form-item label="师傅姓名" prop="worker" :required="true">
+                  <el-select
+                    v-model="formData.worker"
+                    :disabled="formType == 2"
+                    value-key="nickName"
+                    @focus="
+                      () => {
+                        if (!this.formData.websitId) {
+                          return this.$message.warning('请先选择网点名称!')
+                        }
+                      }
+                    "
+                    filterable
+                    @change="changeWorker"
+                    @blur="workerBlur"
+                    placeholder="请选择"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in workerList"
+                      :key="item.id"
+                      :label="item.nickName + '-' + item.mobile"
+                      :value="item"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
 								<el-form-item label="师傅身份证" prop="identity" :required="true">
 									<el-input type="text" v-model="formData.identity" :disabled="formType == 2" placeholder="请输入"></el-input>
 								</el-form-item>
 							</el-col> -->
-							<el-col :span="8">
-								<el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" v-model="formData.workerMobile" :disabled="formType == 2" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="8">
-							<el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.salesType" @change="changeSale">
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="零售">零售</el-radio>
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="工程">工程</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="单据金额">
-								<el-input type="text" :value="formData.totalAmount" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="订单来源" prop="orderSource" :required="true">
-								<el-select v-model="formData.orderSource" :disabled="true" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
-								      :key="item.id"
-								      :label="item.name"
-								      :value="item.id">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="支付方式" prop="payType" :required="true">
-								<el-radio-group v-model="formData.payType">
-								    <el-radio :disabled="formType == 2" label="CASH">现金</el-radio>
-								    <el-radio :disabled="formType == 2" label="WECHAT">微信</el-radio>
-									<el-radio v-if="formData.salesType == '工程'" :disabled="formData.flag != 'SAVE' && formType!=0" label="ENGIN">工程支付</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
-							<div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
-						</el-col>
-						<el-col :span="2" v-else>
-							<div style="opacity: 0;">隐藏</div>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="出库仓库" prop="storage">
-								<el-select v-model="formData.storage" value-key="storageId" @focus="()=>{
-										if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
-									}" @change="(e)=>{
-										dataList = [];
-										formData.storageId = e.storageId
-										formData.storageName = e.storageName
-									}" :disabled="(['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') || (formType!=0 && ['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1)" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="(item,index) in warehouseList"
-								      :key="index"
-								      :label="item.storageName"
-								      :value="item">
-								    </el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.salesType == '工程'">
-							<el-col :span="8">
-								<el-form-item label="工程名称" prop="project" :required="true">
-									<div style="display: flex;align-items: center;">
-										<el-select v-model="formData.project" value-key="id" @change="(e)=>{
-												formData.orderEnginBaseId = e.id
-											}" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
-										    <el-option
-											  v-for="(item,index) in projectList"
-										      :key="index"
-										      :label="item.projectName"
-										      :value="item">
-										    </el-option>
-										</el-select>
-										<i class="el-icon-circle-plus" @click="toAddProject" style="transform: scale(1.5);color: #1989FA;margin-left: 10px;cursor: pointer;"></i>
-									</div>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="工程编号" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="负责人" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.manger" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="联系电话" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.mobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="项目时间" :required="true">
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.project.startTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="开始日期">
-									</el-date-picker>
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.project.endTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="结束日期">
-									</el-date-picker>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="项目地址" :required="true">
-									<el-row>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.province" disabled placeholder="请选择省"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.city" disabled placeholder="请选择市"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.area" disabled placeholder="请选择区"></el-input>
-										</el-col>
-										<el-col :span="8">
-											<el-input type="text" v-model="formData.project.street" disabled placeholder="请选择街道"></el-input>
-										</el-col>
-									</el-row>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="">
-									<el-row :gutter="20">
-										<el-col :span="24">
-											<el-input type="text" v-model="formData.project.address" :disabled="true" placeholder="详细地址"></el-input>
-										</el-col>
-										<!-- <el-col :span="2">
+              <el-col :span="8">
+                <el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
+                  <el-input
+                    type="text"
+                    v-model="formData.workerMobile"
+                    :disabled="formType == 2"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="8">
+              <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.salesType" @change="changeSale">
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="零售">零售</el-radio>
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="工程">工程</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="单据金额">
+                <el-input type="text" :value="formData.totalAmount" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="订单来源" prop="orderSource" :required="true">
+                <el-select v-model="formData.orderSource" :disabled="true" placeholder="请选择" style="width: 100%">
+                  <el-option
+                    v-for="item in [
+                      { name: '在线订单', id: 'ONLINE' },
+                      { name: '自建订单', id: 'SELF' }
+                    ]"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="支付方式" prop="payType" :required="true">
+                <el-radio-group v-model="formData.payType">
+                  <el-radio :disabled="formType == 2" label="CASH">现金</el-radio>
+                  <el-radio :disabled="formType == 2" label="WECHAT">微信</el-radio>
+                  <el-radio
+                    v-if="formData.salesType == '工程'"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    label="ENGIN"
+                    >工程支付</el-radio
+                  >
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
+              <div style="height: 32px; display: flex; align-items: center; cursor: pointer" @click="wxPay()">
+                微信支付<i class="el-icon-full-screen"></i>
+              </div>
+            </el-col>
+            <el-col :span="2" v-else>
+              <div style="opacity: 0">隐藏</div>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="出库仓库" prop="storage">
+                <el-select
+                  v-model="formData.storage"
+                  value-key="storageId"
+                  @focus="
+                    () => {
+                      if (!this.formData.websitId) {
+                        return this.$message.warning('请先选择网点名称!')
+                      }
+                    }
+                  "
+                  @change="
+                    e => {
+                      dataList = []
+                      formData.storageId = e.storageId
+                      formData.storageName = e.storageName
+                    }
+                  "
+                  :disabled="
+                    (['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') ||
+                    (formType != 0 && ['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1)
+                  "
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in warehouseList"
+                    :key="index"
+                    :label="item.storageName"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.salesType == '工程'">
+              <el-col :span="8">
+                <el-form-item label="工程名称" prop="project" :required="true">
+                  <div style="display: flex; align-items: center">
+                    <el-select
+                      v-model="formData.project"
+                      value-key="id"
+                      @change="
+                        e => {
+                          formData.orderEnginBaseId = e.id
+                        }
+                      "
+                      :disabled="formData.flag != 'SAVE' && formType != 0"
+                      placeholder="请选择"
+                      style="width: 100%"
+                    >
+                      <el-option
+                        v-for="(item, index) in projectList"
+                        :key="index"
+                        :label="item.projectName"
+                        :value="item"
+                      >
+                      </el-option>
+                    </el-select>
+                    <i
+                      class="el-icon-circle-plus"
+                      @click="toAddProject"
+                      style="transform: scale(1.5); color: #1989fa; margin-left: 10px; cursor: pointer"
+                    ></i>
+                  </div>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="工程编号" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.projectNo"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="负责人" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.manger"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="联系电话" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.mobile"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="项目时间" :required="true">
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.project.startTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="开始日期"
+                  >
+                  </el-date-picker>
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.project.endTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="项目地址" :required="true">
+                  <el-row>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.province"
+                        disabled
+                        placeholder="请选择省"
+                      ></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.project.city" disabled placeholder="请选择市"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.project.area" disabled placeholder="请选择区"></el-input>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.street"
+                        disabled
+                        placeholder="请选择街道"
+                      ></el-input>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="">
+                  <el-row :gutter="20">
+                    <el-col :span="24">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.address"
+                        :disabled="true"
+                        placeholder="详细地址"
+                      ></el-input>
+                    </el-col>
+                    <!-- <el-col :span="2">
 											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 										</el-col> -->
-									</el-row>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData.remark" :disabled="formType == 2" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>配件信息</span>
-			</div>
-			<el-button size="small" v-if="formData.flag == 'SAVE' || formType==0" type="primary" @click="add()">添加</el-button>
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="配件名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="数量" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
-					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
-					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
-					<el-table-column prop="" align="center" label="销售价格">
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.price" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
-							{{(scope.row.price * 100) * scope.row.salesQty / 100}}
-						</template>
-					</el-table-column>
-					<!-- <el-table-column prop="goods.qty" align="center" label="全部库存数量"></el-table-column> -->
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0 && formData.flag == 'SAVE'">
-			<div slot="header" class="clearfix">
-				<span>收款信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="24">
-							<el-form-item label="收款金额" prop="price">
-								<el-input type="text" style="width: 30%" v-model="formData1.price" placeholder="请输入"></el-input>
-								<span style="color: #FF8F47;margin-left: 10px">注:操作【提交】时,系统方可记录收款信息</span>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="收款凭证">
-								<ImageUpload :fileList="formData1.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0">
-			<div slot="header" class="clearfix">
-				<span>收款记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column prop="status" label="收款结果" align="center">
-						<template slot-scope="scope">
-							{{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="price" label="收款金额" align="center"></el-table-column>
-					<el-table-column prop="" align="center" label="收款凭证" >
-						<template slot-scope="scope" v-if="scope.row.urlPrc">
-							<el-image style="width: 80px;" :src="scope.row.urlPrc" fit="scale-down" :preview-src-list="[scope.row.urlPrc]"></el-image>
-						</template>
-					</el-table-column>
-					<el-table-column prop="remark" label="备注" align="center"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
-				<el-button v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'" size="small" type="primary" @click="wxPay()">微信支付</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = '';clear()">
-			<h3 style="text-align: center;">扫二维码支付</h3>
-		<!-- 			<el-image :src="payCodeUrl" fit="fit"></el-image> -->
-			<div
-			  ref="payQRCode"
-			  style="display: flex; justify-content: center;"
-			/>
-			<div style="color: #EA8000;text-align: center;margin-top: 20px;">注:支付成功后,方可操作确认提货!</div>
-			<div style="display: flex;justify-content: flex-end;margin-top: 30px;">
-				<el-button size="mini" type="text" @click="isPay = false;clear()">取消</el-button>
-				<el-button size="small" type="primary"  @click="isPay = false;getDetail()">确定</el-button>
-			</div>
-		</el-dialog>
-	</div>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  v-model="formData.remark"
+                  :disabled="formType == 2"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>配件信息</span>
+      </div>
+      <el-button size="small" v-if="formData.flag == 'SAVE' || formType == 0" type="primary" @click="add()"
+        >添加</el-button
+      >
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="配件名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="" align="center" label="数量">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.salesQty"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
+          <el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
+          <el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
+          <el-table-column prop="" align="center" label="销售价格">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.price"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.saleAmount" align="center" label="销售金额">
+            <template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
+              {{ (scope.row.price * 100 * scope.row.salesQty) / 100 }}
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="goods.qty" align="center" label="全部库存数量"></el-table-column> -->
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0 && formData.flag == 'SAVE'">
+      <div slot="header" class="clearfix">
+        <span>收款信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form
+          ref="formData1"
+          :rules="rules1"
+          :model="formData1"
+          label-width="110px"
+          size="small"
+          label-position="left"
+        >
+          <el-row :gutter="20" justify="start">
+            <el-col :span="24">
+              <el-form-item label="收款金额" prop="price">
+                <el-input type="text" style="width: 30%" v-model="formData1.price" placeholder="请输入"></el-input>
+                <span style="color: #ff8f47; margin-left: 10px">注:操作【提交】时,系统方可记录收款信息</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="收款凭证">
+                <ImageUpload :fileList="formData1.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0">
+      <div slot="header" class="clearfix">
+        <span>收款记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="收款结果" align="center">
+            <template slot-scope="scope">
+              {{
+                scope.row.status == 'NO'
+                  ? '未付款'
+                  : scope.row.status == 'WAIT'
+                  ? '部分付款'
+                  : scope.row.status == 'OK'
+                  ? '已完成'
+                  : ''
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
+          <el-table-column prop="" align="center" label="收款凭证">
+            <template slot-scope="scope" v-if="scope.row.urlPrc">
+              <el-image
+                style="width: 80px"
+                :src="$showImgUrl(scope.row.urlPrc)"
+                fit="scale-down"
+                :preview-src-list="[$showImgUrl(scope.row.urlPrc)]"
+              ></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="收款人"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="收款时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button
+          v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')"
+          size="small"
+          type="primary"
+          @click="save()"
+          >保存</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()"
+          >提交</el-button
+        >
+        <el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary" @click="confirm()"
+          >确认收货</el-button
+        >
+        <el-button
+          v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'"
+          size="small"
+          type="primary"
+          @click="wxPay()"
+          >微信支付</el-button
+        >
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog
+      title="微信支付"
+      :visible.sync="isPay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="
+        payCodeUrl = ''
+        clear()
+      "
+    >
+      <h3 style="text-align: center">扫二维码支付</h3>
+      <!-- 			<el-image :src="payCodeUrl" fit="fit"></el-image> -->
+      <div ref="payQRCode" style="display: flex; justify-content: center" />
+      <div style="color: #ea8000; text-align: center; margin-top: 20px">注:支付成功后,方可操作确认提货!</div>
+      <div style="display: flex; justify-content: flex-end; margin-top: 30px">
+        <el-button
+          size="mini"
+          type="text"
+          @click="
+            isPay = false
+            clear()
+          "
+          >取消</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          @click="
+            isPay = false
+            getDetail()
+          "
+          >确定</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import QRCode from "qrcodejs2";
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import ImageUpload from '@/components/file-upload'
-	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode, getProject, getProjectCollectionList } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { storageListPageV2 } from '@/api/storage.js'
-	export default {
-		components: {geographicalPosi,ImageUpload},
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				websitList: [],
-				workerList: [],
-				projectList: [],
-				collectionList: [],
-				warehouseList: [],
-				isPay: false,
-				is_submit: true,
-				payCodeUrl: '',
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					file_url: [],
-					salesId: '',
-					flag: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					worker: {},
-					workerName: '',
-					workerId: '',
-					identity: '',
-					workerMobile: '',
-					orderSource: 'SELF',
-					payType: '',
-					totalAmount: '',
-					remark: '',
-					buyPeople: 'WORKER',
-					salesType: '零售',
-					province: '',
-					provinceId: '',
-					city: '',
-					cityId: '',
-					area: '',
-					areaId: '',
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					project: {},
-					orderEnginBaseId: '',
-					storage: null,
-					storageId: '',
-					storageName: '',
-				},
-				formData1: {
-					price: '',
-					remark: '',
-					fileUrl: []
-				},
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				isEdit: 0,
-				timer: '',
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					orderSource: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					payType: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					identity: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					workerMobile: [
-						{ required: true, message: '请输入联系电话', trigger: 'blur' },
-						{ required: true, message: '请输入联系电话', trigger: 'change' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-					workerName: [
-						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
-					],
-					storage: [
-						{ required: true, message: `请选择入库仓库`, trigger: 'change' },
-					]
-				},
-				rules1: {
-					price: [
-						{ pattern:/^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
-					],
-				}
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			this.getinitlbslist()
-			this.getWebsit()
-			this.getProject()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({salesId: this.id}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						project: {id: res.data.orderEnginBaseId,projectName: res.data.projectName,projectNo: res.data.projectNo,manger: res.data.manger,mobile: res.data.mobile,startTime: res.data.startTime,endTime: res.data.endTime,province: res.data.province,provinceId: res.data.provinceId,city: res.data.city,cityId: res.data.cityId,area: res.data.area,areaId: res.data.areaId,street: res.data.street,streetId: res.data.streetId,address: res.data.address,lat: res.data.lat,lng: res.data.lng},
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getWarehouseList(res.data.websitId)
-					if(res.data.salesType == '工程'){
-						this.getProjectCollectionList(res.data.orderEnginBaseId)
-					}
-					for(var item of res.data.items){
-						var ress = await that.getGoods(item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-					}
-					this.dataList = res.data.items
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			changeWebsit(e){
-				this.dataList = [];
-				this.formData.websitId = e.websitId
-				this.formData.websitName = e.name
-				this.formData.storageName = ''
-				this.formData.storageId = ''
-				this.getWorker()
-				this.getWarehouseList(e.websitId)
-			},
-			toAddProject(){
-				this.$router.push({
-					name: 'basicEngineeringData'
-				})
-			},
-			getProject(){
-				getProject({
-					pageNum: 1,
-					pageSize: -1,
-					params:[]
-				}).then(res => {
-					this.projectList = res.data.records
-				})
-			},
-			getProjectCollectionList(orderEnginBaseId){
-				getProjectCollectionList({orderEnginBaseId,goodsType: 'P'}).then(res => {
-					this.collectionList = res.data
-				})
-			},
-			getWarehouseList(websitId){
-				if(!websitId){return this.warehouseList = []}
-				storageListPageV2({
-			      pageNum: 1,
-			      pageSize: -1,
-			      params: [{param: "a.type", compare: "like", value: "配件"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
-			    }).then(res => {
-					this.warehouseList = res.data.records
-			    })
-			},
-			async getGoods(goodsName,type){
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-						console.log(this.dataList)
-					})
-				}
-			},
-			getWorker(){
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					this.workerList = res.data.records
-				})
-			},
-			changeWorker(e){
-				this.formData.identity = e.idCard
-				this.formData.workerMobile = e.mobile
-				this.formData.workerId = e.userId
-				this.formData.workerName = e.nickName
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].brandRelaName = e.brandRelaName
-				this.dataList[this.isEdit].productRelaName = e.productRelaName
-				this.dataList[this.isEdit].price = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-				this.dataList[this.isEdit].itemSourceType = e.itemSourceType
-				this.dataList[this.isEdit].itemSourceId = e.itemSourceId
-				this.dataList[this.isEdit].normType = e.normType
-			},
-			add(){
-				if(this.dataList.length != 0){this.isEdit = 0}
-				this.dataList.unshift({
-					goodsList: [],
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-					goodsSalesUnit: '',
-					brandRelaName: '',
-					productRelaName: '',
-					goodsCode: '',
-					price: '',
-					saleAmount: '',
-					salesQty: 1,
-					qty: '',
-					goodsType: 'P',
-					itemSourceType: '',
-					itemSourceId: '',
-					normType: ''
-				})
-				this.getGoods()
-			},
-			del(index){
-				if(index <= 1){this.isEdit == 0}else{this.isEdit -= 1}
-				this.dataList.splice(index,1)
-			},
-			confirmSubmit(){
-				if(this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/.test(this.formData1.price)){
-					return this.$message.warning('请输入大于0的数字!')
-				}
-				this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					submit({
-						salesId: this.formData.salesId,
-						price: this.formData1.price,
-						urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
-						remark: this.formData1.remark
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('提交成功!')
-							if(this.formData.payType == 'WECHAT'){
-								this.wxPay()
-							}else{
-								this.goBack()
-							}
-						}
-					})
-				});
-			},
-			submit(){
-				const that = this
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						edit({
-							salesId: this.formData.salesId,
-							goodsType: 'P',
-							orderSource: this.formData.orderSource,
-							payType: this.formData.payType,
-							remark: this.formData.remark,
-							websitId: this.formData.websitId,
-							websitName: this.formData.websitName,
-							workerName: this.formData.workerName,
-							workerId: this.formData.workerId,
-							identity: this.formData.identity,
-							workerMobile: this.formData.workerMobile,
-							buyPeople: this.formData.buyPeople,
-							items: this.dataList,
-							orderEnginBaseId: this.formData.orderEnginBaseId,
-							salesType: this.formData.salesType,
-							storageId: this.formData.storageId,
-							storageName: this.formData.storageName,
-						}).then(res => {
-							if(res.code == 200){
-								this.confirmSubmit()
-							}
-						})
-					}
-				})
-			},
-			confirm(){
-				if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
-				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					confirm({
-						salesId: this.formData.salesId,
-						storageId: this.formData.storageId
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('审核成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			checkPay(){
-				this.timer = setInterval(()=>{
-					getDetail({salesId: this.id}).then(res => {
-						if(res.data.payFlag == 'YES'){
-							this.$refs.payQRCode.innerHTML = '';
-							this.clear()
-							this.$message.success('支付成功!')
-							this.goBack()
-						}
-					})
-				},3000)
-			},
-			clear(){
-				clearInterval(this.timer)
-			},
-			wxPay(){
-				if(!this.is_submit){
-					return false
-				}
-				this.is_submit = false
-				setTimeout(()=>{
-					this.is_submit = true
-				},2000)
-				getCode({
-					salesId: this.formData.salesId
-				}).then(res => {
-					if(res.code == 200){
-						this.payCodeUrl = res.data.codeUrl
-						this.$refs.payQRCode.innerHTML = '';
-						this.$nextTick(() => {
-						  this.payUrl = res.data.codeUrl;
-						  new QRCode(this.$refs.payQRCode, {
-						    text: res.data.codeUrl,
-						    width: 200,
-						    height: 200,
-						    colorDark: "#333333", // 二维码颜色
-						    colorLight: "#ffffff", // 二维码背景色
-						    correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
-						  });
-						  this.checkPay()
-						});
-					}
-				})
-				this.isPay = true
-			},
-			save(){
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								goodsType: 'P',
-								orderSource: this.formData.orderSource,
-								payType: this.formData.payType,
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								buyPeople: this.formData.buyPeople,
-								items: this.dataList,
-								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType,
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								salesId: this.formData.salesId,
-								goodsType: 'P',
-								orderSource: this.formData.orderSource,
-								payType: this.formData.payType,
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								buyPeople: this.formData.buyPeople,
-								items: this.dataList,
-								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType,
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			},
-			changeSale(){
-				this.formData.buyPeople = 'CUSTOMER'
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import QRCode from 'qrcodejs2'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import ImageUpload from '@/components/file-upload'
+import {
+  getWorker,
+  getCategory,
+  getGoods,
+  getDetail,
+  add,
+  edit,
+  confirm,
+  submit,
+  getCode,
+  getProject,
+  getProjectCollectionList
+} from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { storageListPageV2 } from '@/api/storage.js'
+export default {
+  components: { geographicalPosi, ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      websitList: [],
+      workerList: [],
+      projectList: [],
+      collectionList: [],
+      warehouseList: [],
+      isPay: false,
+      is_submit: true,
+      payCodeUrl: '',
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        file_url: [],
+        salesId: '',
+        flag: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        worker: {},
+        workerName: '',
+        workerId: '',
+        identity: '',
+        workerMobile: '',
+        orderSource: 'SELF',
+        payType: '',
+        totalAmount: '',
+        remark: '',
+        buyPeople: 'WORKER',
+        salesType: '零售',
+        province: '',
+        provinceId: '',
+        city: '',
+        cityId: '',
+        area: '',
+        areaId: '',
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        project: {},
+        orderEnginBaseId: '',
+        storage: null,
+        storageId: '',
+        storageName: ''
+      },
+      formData1: {
+        price: '',
+        remark: '',
+        fileUrl: []
+      },
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      isEdit: 0,
+      timer: '',
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        orderSource: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        payType: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        identity: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        workerMobile: [
+          { required: true, message: '请输入联系电话', trigger: 'blur' },
+          { required: true, message: '请输入联系电话', trigger: 'change' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ],
+        workerName: [{ required: true, message: '请输入客户姓名', trigger: 'blur' }],
+        storage: [{ required: true, message: `请选择入库仓库`, trigger: 'change' }]
+      },
+      rules1: {
+        price: [{ pattern: /^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.getinitlbslist()
+    this.getWebsit()
+    this.getProject()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ salesId: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          project: {
+            id: res.data.orderEnginBaseId,
+            projectName: res.data.projectName,
+            projectNo: res.data.projectNo,
+            manger: res.data.manger,
+            mobile: res.data.mobile,
+            startTime: res.data.startTime,
+            endTime: res.data.endTime,
+            province: res.data.province,
+            provinceId: res.data.provinceId,
+            city: res.data.city,
+            cityId: res.data.cityId,
+            area: res.data.area,
+            areaId: res.data.areaId,
+            street: res.data.street,
+            streetId: res.data.streetId,
+            address: res.data.address,
+            lat: res.data.lat,
+            lng: res.data.lng
+          },
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getWarehouseList(res.data.websitId)
+        if (res.data.salesType == '工程') {
+          this.getProjectCollectionList(res.data.orderEnginBaseId)
+        }
+        for (var item of res.data.items) {
+          var ress = await that.getGoods(item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+        }
+        this.dataList = res.data.items
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    changeWebsit(e) {
+      this.dataList = []
+      this.formData.websitId = e.websitId
+      this.formData.websitName = e.name
+      this.formData.storageName = ''
+      this.formData.storageId = ''
+      this.getWorker()
+      this.getWarehouseList(e.websitId)
+    },
+    toAddProject() {
+      this.$router.push({
+        name: 'basicEngineeringData'
+      })
+    },
+    getProject() {
+      getProject({
+        pageNum: 1,
+        pageSize: -1,
+        params: []
+      }).then(res => {
+        this.projectList = res.data.records
+      })
+    },
+    getProjectCollectionList(orderEnginBaseId) {
+      getProjectCollectionList({ orderEnginBaseId, goodsType: 'P' }).then(res => {
+        this.collectionList = res.data
+      })
+    },
+    getWarehouseList(websitId) {
+      if (!websitId) {
+        return (this.warehouseList = [])
+      }
+      storageListPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.type', compare: 'like', value: '配件' },
+          { param: 'a.status', compare: '=', value: 'true' },
+          { param: 'a.websit_id', compare: '=', value: websitId }
+        ]
+      }).then(res => {
+        this.warehouseList = res.data.records
+      })
+    },
+    async getGoods(goodsName, type) {
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({
+            websitId: this.formData.websitId,
+            type: 'P',
+            goodsName: goodsName,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            saleType: this.formData.salesType,
+            storageId: this.formData.storageId
+          }).then(res => {
+            resolve({
+              data: res.data[0]
+            })
+          })
+        })
+      } else {
+        getGoods({
+          websitId: this.formData.websitId,
+          type: 'P',
+          orderEnginBaseId: this.formData.orderEnginBaseId,
+          saleType: this.formData.salesType,
+          storageId: this.formData.storageId
+        }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+          console.log(this.dataList)
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    changeWorker(e) {
+      this.formData.identity = e.idCard
+      this.formData.workerMobile = e.mobile
+      this.formData.workerId = e.userId
+      this.formData.workerName = e.nickName
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].brandRelaName = e.brandRelaName
+      this.dataList[this.isEdit].productRelaName = e.productRelaName
+      this.dataList[this.isEdit].price = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+      this.dataList[this.isEdit].itemSourceType = e.itemSourceType
+      this.dataList[this.isEdit].itemSourceId = e.itemSourceId
+      this.dataList[this.isEdit].normType = e.normType
+    },
+    add() {
+      if (this.dataList.length != 0) {
+        this.isEdit = 0
+      }
+      this.dataList.unshift({
+        goodsList: [],
+        goods: {},
+        goodsId: '',
+        goodsName: '',
+        goodsSalesUnit: '',
+        brandRelaName: '',
+        productRelaName: '',
+        goodsCode: '',
+        price: '',
+        saleAmount: '',
+        salesQty: 1,
+        qty: '',
+        goodsType: 'P',
+        itemSourceType: '',
+        itemSourceId: '',
+        normType: ''
+      })
+      this.getGoods()
+    },
+    del(index) {
+      if (index <= 1) {
+        this.isEdit == 0
+      } else {
+        this.isEdit -= 1
+      }
+      this.dataList.splice(index, 1)
+    },
+    confirmSubmit() {
+      if (this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/.test(this.formData1.price)) {
+        return this.$message.warning('请输入大于0的数字!')
+      }
+      this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        submit({
+          salesId: this.formData.salesId,
+          price: this.formData1.price,
+          urlPrc: this.formData1.fileUrl.length > 0 ? this.formData1.fileUrl[0].url : '',
+          remark: this.formData1.remark
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('提交成功!')
+            if (this.formData.payType == 'WECHAT') {
+              this.wxPay()
+            } else {
+              this.goBack()
+            }
+          }
+        })
+      })
+    },
+    submit() {
+      const that = this
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          edit({
+            salesId: this.formData.salesId,
+            goodsType: 'P',
+            orderSource: this.formData.orderSource,
+            payType: this.formData.payType,
+            remark: this.formData.remark,
+            websitId: this.formData.websitId,
+            websitName: this.formData.websitName,
+            workerName: this.formData.workerName,
+            workerId: this.formData.workerId,
+            identity: this.formData.identity,
+            workerMobile: this.formData.workerMobile,
+            buyPeople: this.formData.buyPeople,
+            items: this.dataList,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            salesType: this.formData.salesType,
+            storageId: this.formData.storageId,
+            storageName: this.formData.storageName
+          }).then(res => {
+            if (res.code == 200) {
+              this.confirmSubmit()
+            }
+          })
+        }
+      })
+    },
+    confirm() {
+      if (!this.formData.storageId) {
+        return this.$message.warning('请先选择出库仓库!')
+      }
+      this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        confirm({
+          salesId: this.formData.salesId,
+          storageId: this.formData.storageId
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('审核成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    checkPay() {
+      this.timer = setInterval(() => {
+        getDetail({ salesId: this.id }).then(res => {
+          if (res.data.payFlag == 'YES') {
+            this.$refs.payQRCode.innerHTML = ''
+            this.clear()
+            this.$message.success('支付成功!')
+            this.goBack()
+          }
+        })
+      }, 3000)
+    },
+    clear() {
+      clearInterval(this.timer)
+    },
+    wxPay() {
+      if (!this.is_submit) {
+        return false
+      }
+      this.is_submit = false
+      setTimeout(() => {
+        this.is_submit = true
+      }, 2000)
+      getCode({
+        salesId: this.formData.salesId
+      }).then(res => {
+        if (res.code == 200) {
+          this.payCodeUrl = res.data.codeUrl
+          this.$refs.payQRCode.innerHTML = ''
+          this.$nextTick(() => {
+            this.payUrl = res.data.codeUrl
+            new QRCode(this.$refs.payQRCode, {
+              text: res.data.codeUrl,
+              width: 200,
+              height: 200,
+              colorDark: '#333333', // 二维码颜色
+              colorLight: '#ffffff', // 二维码背景色
+              correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
+            })
+            this.checkPay()
+          })
+        }
+      })
+      this.isPay = true
+    },
+    save() {
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              goodsType: 'P',
+              orderSource: this.formData.orderSource,
+              payType: this.formData.payType,
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              buyPeople: this.formData.buyPeople,
+              items: this.dataList,
+              orderEnginBaseId: this.formData.orderEnginBaseId,
+              salesType: this.formData.salesType,
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              salesId: this.formData.salesId,
+              goodsType: 'P',
+              orderSource: this.formData.orderSource,
+              payType: this.formData.payType,
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              buyPeople: this.formData.buyPeople,
+              items: this.dataList,
+              orderEnginBaseId: this.formData.orderEnginBaseId,
+              salesType: this.formData.salesType,
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    },
+    changeSale() {
+      this.formData.buyPeople = 'CUSTOMER'
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 1304 - 1005
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -1,1018 +1,1317 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'CANCEL'?'取消订单':formData.flag == 'PAY_NOT_TAKE'?'已支付,未提货':formData.flag == 'PAY_TAKE'?'已支付,已提货':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.salesId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="网点名称" prop="websitId">
-								<el-select v-model="formData.websit" :disabled="formData.flag != 'SAVE' && formType!=0" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-									<el-option
-										v-for="item in websitList"
-										:key="item.websitId"
-										:label="item.name"
-										:value="item">
-									</el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople" @change="formData.workerName = '';formData.workerMobile=''">
-								    <el-radio :disabled="(formData.flag != 'SAVE' && formType!=0) || formData.salesType == '工程'" label="WORKER">内部师傅</el-radio>
-								    <el-radio :disabled="(formData.flag != 'SAVE' && formType!=0) || formData.salesType == '工程'" label="CUSTOMER">客户</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.buyPeople == 'CUSTOMER'">
-							<el-col :span="8">
-								<el-form-item label="客户姓名" prop="workerName">
-									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerName" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="客户联系电话" prop="workerMobile">
-									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<template v-else>
-							<el-col :span="8">
-								<el-form-item label="师傅姓名" prop="worker">
-									<el-select v-model="formData.worker" :disabled="formData.flag != 'SAVE' && formType!=0" value-key="nickName" @focus="()=>{
-										if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
-									}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
-									    <el-option
-									      v-for="item in workerList"
-									      :key="item.id"
-									      :label="item.nickName + '-' + item.mobile"
-									      :value="item">
-									    </el-option>
-									  </el-select>
-								</el-form-item>
-							</el-col>
-							<!-- <el-col :span="8">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="
+                    formData.flag == 'SAVE'
+                      ? '已保存'
+                      : formData.flag == 'SUBMIT'
+                      ? '已提交'
+                      : formData.flag == 'CANCEL'
+                      ? '取消订单'
+                      : formData.flag == 'PAY_NOT_TAKE'
+                      ? '已支付,未提货'
+                      : formData.flag == 'PAY_TAKE'
+                      ? '已支付,已提货'
+                      : ''
+                  "
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.salesId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="网点名称" prop="websitId">
+                <el-select
+                  v-model="formData.websit"
+                  :disabled="formData.flag != 'SAVE' && formType != 0"
+                  value-key="websitId"
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
+                <el-radio-group
+                  v-model="formData.buyPeople"
+                  @change="
+                    formData.workerName = ''
+                    formData.workerMobile = ''
+                  "
+                >
+                  <el-radio
+                    :disabled="(formData.flag != 'SAVE' && formType != 0) || formData.salesType == '工程'"
+                    label="WORKER"
+                    >内部师傅</el-radio
+                  >
+                  <el-radio
+                    :disabled="(formData.flag != 'SAVE' && formType != 0) || formData.salesType == '工程'"
+                    label="CUSTOMER"
+                    >客户</el-radio
+                  >
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.buyPeople == 'CUSTOMER'">
+              <el-col :span="8">
+                <el-form-item label="客户姓名" prop="workerName">
+                  <el-input
+                    type="text"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    v-model="formData.workerName"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户联系电话" prop="workerMobile">
+                  <el-input
+                    type="text"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    v-model="formData.workerMobile"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="8">
+                <el-form-item label="师傅姓名" prop="worker">
+                  <el-select
+                    v-model="formData.worker"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    value-key="nickName"
+                    @focus="
+                      () => {
+                        if (!this.formData.websitId) {
+                          return this.$message.warning('请先选择网点名称!')
+                        }
+                      }
+                    "
+                    filterable
+                    @change="changeWorker"
+                    @blur="workerBlur"
+                    placeholder="请选择"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in workerList"
+                      :key="item.id"
+                      :label="item.nickName + '-' + item.mobile"
+                      :value="item"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
 								<el-form-item label="师傅身份证" prop="identity" :required="true">
 									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.identity" placeholder="请输入"></el-input>
 								</el-form-item>
 							</el-col> -->
-							<el-col :span="8">
-								<el-form-item label="师傅联系电话" prop="workerMobile">
-									<el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="8">
-							<el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.salesType" @change="changeSale">
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="零售">零售</el-radio>
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="工程">工程</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据金额">
-								<el-input type="text" :value="formData.totalAmount" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="订单来源" prop="orderSource" :required="true">
-								<el-select v-model="formData.orderSource" :disabled="true" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
-								      :key="item.id"
-								      :label="item.name"
-								      :value="item.id">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="支付方式" prop="payType" :required="true">
-								<el-radio-group v-model="formData.payType">
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="CASH">现金</el-radio>
-								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="WECHAT">微信</el-radio>
-									<el-radio v-if="formData.salesType == '工程'" :disabled="formData.flag != 'SAVE' && formType!=0" label="ENGIN">工程支付</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
-							<div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
-						</el-col>
-						<el-col :span="2" v-else>
-							<div style="opacity: 0;">隐藏</div>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="出库仓库" prop="storage">
-								<el-select v-model="formData.storage" value-key="storageId" @focus="()=>{
-										if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
-									}" @change="(e)=>{
-										dataList = [];
-										formData.storageId = e.storageId
-										formData.storageName = e.storageName
-									}" :disabled="(['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') || (formType!=0 && ['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1)" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="(item,index) in warehouseList"
-								      :key="index"
-								      :label="item.storageName"
-								      :value="item">
-								    </el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.salesType == '工程'">
-							<el-col :span="8">
-								<el-form-item label="工程名称" prop="project" :required="true">
-									<div style="display: flex;align-items: center;">
-										<el-select v-model="formData.project" value-key="id" @change="(e)=>{
-												formData.orderEnginBaseId = e.id
-											}" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
-										    <el-option
-											  v-for="(item,index) in projectList"
-										      :key="index"
-										      :label="item.projectName"
-										      :value="item">
-										    </el-option>
-										</el-select>
-										<i class="el-icon-circle-plus" @click="toAddProject" style="transform: scale(1.5);color: #1989FA;margin-left: 10px;cursor: pointer;"></i>
-									</div>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="工程编号" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="负责人" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.manger" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="联系电话" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.project.mobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="项目时间" :required="true">
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.project.startTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="开始日期">
-									</el-date-picker>
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.project.endTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="结束日期">
-									</el-date-picker>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="项目地址" :required="true">
-									<el-row>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.province" disabled placeholder="请选择省"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.city" disabled placeholder="请选择市"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.project.area" disabled placeholder="请选择区"></el-input>
-										</el-col>
-										<el-col :span="8">
-											<el-input type="text" v-model="formData.project.street" disabled placeholder="请选择街道"></el-input>
-										</el-col>
-									</el-row>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="">
-									<el-row :gutter="20">
-										<el-col :span="24">
-											<el-input type="text" v-model="formData.project.address" :disabled="true" placeholder="详细地址"></el-input>
-										</el-col>
-										<!-- <el-col :span="2">
+              <el-col :span="8">
+                <el-form-item label="师傅联系电话" prop="workerMobile">
+                  <el-input
+                    type="text"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    v-model="formData.workerMobile"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="8">
+              <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.salesType" @change="changeSale">
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="零售">零售</el-radio>
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="工程">工程</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据金额">
+                <el-input type="text" :value="formData.totalAmount" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="订单来源" prop="orderSource" :required="true">
+                <el-select v-model="formData.orderSource" :disabled="true" placeholder="请选择" style="width: 100%">
+                  <el-option
+                    v-for="item in [
+                      { name: '在线订单', id: 'ONLINE' },
+                      { name: '自建订单', id: 'SELF' }
+                    ]"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="支付方式" prop="payType" :required="true">
+                <el-radio-group v-model="formData.payType">
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="CASH">现金</el-radio>
+                  <el-radio :disabled="formData.flag != 'SAVE' && formType != 0" label="WECHAT">微信</el-radio>
+                  <el-radio
+                    v-if="formData.salesType == '工程'"
+                    :disabled="formData.flag != 'SAVE' && formType != 0"
+                    label="ENGIN"
+                    >工程支付</el-radio
+                  >
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
+              <div style="height: 32px; display: flex; align-items: center; cursor: pointer" @click="wxPay()">
+                微信支付<i class="el-icon-full-screen"></i>
+              </div>
+            </el-col>
+            <el-col :span="2" v-else>
+              <div style="opacity: 0">隐藏</div>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="出库仓库" prop="storage">
+                <el-select
+                  v-model="formData.storage"
+                  value-key="storageId"
+                  @focus="
+                    () => {
+                      if (!this.formData.websitId) {
+                        return this.$message.warning('请先选择网点名称!')
+                      }
+                    }
+                  "
+                  @change="
+                    e => {
+                      dataList = []
+                      formData.storageId = e.storageId
+                      formData.storageName = e.storageName
+                    }
+                  "
+                  :disabled="
+                    (['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') ||
+                    (formType != 0 && ['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1)
+                  "
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in warehouseList"
+                    :key="index"
+                    :label="item.storageName"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.salesType == '工程'">
+              <el-col :span="8">
+                <el-form-item label="工程名称" prop="project" :required="true">
+                  <div style="display: flex; align-items: center">
+                    <el-select
+                      v-model="formData.project"
+                      value-key="id"
+                      @change="
+                        e => {
+                          formData.orderEnginBaseId = e.id
+                        }
+                      "
+                      :disabled="formData.flag != 'SAVE' && formType != 0"
+                      placeholder="请选择"
+                      style="width: 100%"
+                    >
+                      <el-option
+                        v-for="(item, index) in projectList"
+                        :key="index"
+                        :label="item.projectName"
+                        :value="item"
+                      >
+                      </el-option>
+                    </el-select>
+                    <i
+                      class="el-icon-circle-plus"
+                      @click="toAddProject"
+                      style="transform: scale(1.5); color: #1989fa; margin-left: 10px; cursor: pointer"
+                    ></i>
+                  </div>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="工程编号" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.projectNo"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="负责人" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.manger"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="联系电话" :required="true">
+                  <el-input
+                    type="text"
+                    :disabled="true"
+                    v-model="formData.project.mobile"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="项目时间" :required="true">
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.project.startTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="开始日期"
+                  >
+                  </el-date-picker>
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.project.endTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="项目地址" :required="true">
+                  <el-row>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.province"
+                        disabled
+                        placeholder="请选择省"
+                      ></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.project.city" disabled placeholder="请选择市"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.project.area" disabled placeholder="请选择区"></el-input>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.street"
+                        disabled
+                        placeholder="请选择街道"
+                      ></el-input>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="">
+                  <el-row :gutter="20">
+                    <el-col :span="24">
+                      <el-input
+                        type="text"
+                        v-model="formData.project.address"
+                        :disabled="true"
+                        placeholder="详细地址"
+                      ></el-input>
+                    </el-col>
+                    <!-- <el-col :span="2">
 											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 										</el-col> -->
-									</el-row>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>辅材信息</span>
-			</div>
-			<el-button size="small" v-if="formData.flag == 'SAVE' || formType==0" type="primary" @click="add()">添加</el-button>
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="大类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in mainList"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="小类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
-									if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
-								}" :disabled="isEdit != scope.$index || formType == 2" value-key="categoryId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.parentCategory.items"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="辅材名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="数量" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
-					<el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="" align="center" label="销售价格">
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.price" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
-							{{((scope.row.price * 100) * scope.row.salesQty / 100).toFixed(2)}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.qty" align="center" label="全部库存数量"></el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0 && formData.flag == 'SAVE'">
-			<div slot="header" class="clearfix">
-				<span>收款信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="24">
-							<el-form-item label="收款金额" prop="price">
-								<el-input type="text" style="width: 30%" v-model="formData1.price" placeholder="请输入"></el-input>
-								<span style="color: #FF8F47;margin-left: 10px">注:操作【提交】时,系统方可记录收款信息</span>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="收款凭证">
-								<ImageUpload :fileList="formData1.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0">
-			<div slot="header" class="clearfix">
-				<span>收款记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column prop="status" label="收款结果" align="center">
-						<template slot-scope="scope">
-							{{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="price" label="收款金额" align="center"></el-table-column>
-					<el-table-column prop="" align="center" label="收款凭证" >
-						<template slot-scope="scope" v-if="scope.row.urlPrc">
-							<el-image style="width: 80px;" :src="scope.row.urlPrc" fit="scale-down" :preview-src-list="[scope.row.urlPrc]"></el-image>
-						</template>
-					</el-table-column>
-					<el-table-column prop="remark" label="备注" align="center"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'" size="small" type="primary" @click="wxPay()">微信支付</el-button>
-				<el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary"  @click="confirm()">确认提货</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = '';clear()">
-			<h3 style="text-align: center;">扫二维码支付</h3>
-<!-- 			<el-image :src="payCodeUrl" fit="fit"></el-image> -->
-			<div
-			  ref="payQRCode"
-			  style="display: flex; justify-content: center;"
-			/>
-			<div style="color: #EA8000;text-align: center;margin-top: 20px;">注:支付成功后,方可操作确认提货!</div>
-			<div style="display: flex;justify-content: flex-end;margin-top: 30px;">
-				<el-button size="mini" type="text" @click="isPay = false;clear()">取消</el-button>
-				<el-button size="small" type="primary"  @click="isPay = false;getDetail()">确定</el-button>
-			</div>
-		</el-dialog>
-	</div>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  :disabled="formData.flag != 'SAVE' && formType != 0"
+                  v-model="formData.remark"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>辅材信息</span>
+      </div>
+      <el-button size="small" v-if="formData.flag == 'SAVE' || formType == 0" type="primary" @click="add()"
+        >添加</el-button
+      >
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="大类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.parentCategory"
+                value-key="categoryId"
+                @change="changeMain"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in mainList" :key="item.categoryId" :label="item.categoryName" :value="item">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="小类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goodsCategory"
+                @change="changeSmall"
+                @focus="
+                  () => {
+                    if (!scope.row.parentCategory) {
+                      return this.$message.warning('请先选择大类!')
+                    }
+                  }
+                "
+                :disabled="isEdit != scope.$index || formType == 2"
+                value-key="categoryId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.parentCategory.items"
+                  :key="item.categoryId"
+                  :label="item.categoryName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="辅材名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="" align="center" label="数量">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.salesQty"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
+          <el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
+          <el-table-column prop="" align="center" label="销售价格">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.price"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="" align="center" label="销售金额">
+            <template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
+              {{ ((scope.row.price * 100 * scope.row.salesQty) / 100).toFixed(2) }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.qty" align="center" label="全部库存数量"></el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0 && formData.flag == 'SAVE'">
+      <div slot="header" class="clearfix">
+        <span>收款信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form
+          ref="formData1"
+          :rules="rules1"
+          :model="formData1"
+          label-width="110px"
+          size="small"
+          label-position="left"
+        >
+          <el-row :gutter="20" justify="start">
+            <el-col :span="24">
+              <el-form-item label="收款金额" prop="price">
+                <el-input type="text" style="width: 30%" v-model="formData1.price" placeholder="请输入"></el-input>
+                <span style="color: #ff8f47; margin-left: 10px">注:操作【提交】时,系统方可记录收款信息</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="收款凭证">
+                <ImageUpload :fileList="formData1.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formData.salesType == '工程' && formType != 0">
+      <div slot="header" class="clearfix">
+        <span>收款记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="收款结果" align="center">
+            <template slot-scope="scope">
+              {{
+                scope.row.status == 'NO'
+                  ? '未付款'
+                  : scope.row.status == 'WAIT'
+                  ? '部分付款'
+                  : scope.row.status == 'OK'
+                  ? '已完成'
+                  : ''
+              }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
+          <el-table-column prop="" align="center" label="收款凭证">
+            <template slot-scope="scope" v-if="scope.row.urlPrc">
+              <el-image
+                style="width: 80px"
+                :src="$showImgUrl(scope.row.urlPrc)"
+                fit="scale-down"
+                :preview-src-list="[$showImgUrl(scope.row.urlPrc)]"
+              ></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="收款人"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="收款时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button
+          v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')"
+          size="small"
+          type="primary"
+          @click="save()"
+          >保存</el-button
+        >
+        <el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()"
+          >提交</el-button
+        >
+        <el-button
+          v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'"
+          size="small"
+          type="primary"
+          @click="wxPay()"
+          >微信支付</el-button
+        >
+        <el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary" @click="confirm()"
+          >确认提货</el-button
+        >
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog
+      title="微信支付"
+      :visible.sync="isPay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="
+        payCodeUrl = ''
+        clear()
+      "
+    >
+      <h3 style="text-align: center">扫二维码支付</h3>
+      <!-- 			<el-image :src="payCodeUrl" fit="fit"></el-image> -->
+      <div ref="payQRCode" style="display: flex; justify-content: center" />
+      <div style="color: #ea8000; text-align: center; margin-top: 20px">注:支付成功后,方可操作确认提货!</div>
+      <div style="display: flex; justify-content: flex-end; margin-top: 30px">
+        <el-button
+          size="mini"
+          type="text"
+          @click="
+            isPay = false
+            clear()
+          "
+          >取消</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          @click="
+            isPay = false
+            getDetail()
+          "
+          >确定</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import QRCode from "qrcodejs2";
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import ImageUpload from '@/components/file-upload'
-	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode, getProject, getProjectCollectionList } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { storageListPageV2 } from '@/api/storage.js'
-	export default {
-		components: {geographicalPosi,ImageUpload},
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				websitList: [],
-				workerList: [],
-				mainList: [],
-				projectList: [],
-				collectionList: [],
-				warehouseList: [],
-				isPay: false,
-				payCodeUrl: '',
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					file_url: [],
-					salesId: '',
-					flag: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					worker: {},
-					workerName: '',
-					workerId: '',
-					identity: '',
-					workerMobile: '',
-					orderSource: 'SELF',
-					payType: '',
-					remark: '',
-					totalAmount: '',
-					buyPeople: 'WORKER',
-					salesType: '零售',
-					province: '',
-					provinceId: '',
-					city: '',
-					cityId: '',
-					area: '',
-					areaId: '',
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					project: {},
-					orderEnginBaseId: '',
-					storage: null,
-					storageId: '',
-					storageName: '',
-				},
-				formData1: {
-					price: '',
-					remark: '',
-					fileUrl: []
-				},
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				isEdit: 0,
-				is_submit: true,
-				timer: '',
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					orderSource: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					payType: [
-						{ required: true, message: '请选择订单来源', trigger: 'change' }
-					],
-					identity: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					workerMobile: [
-						{ required: true, message: `请输入联系电话`, trigger: 'blur' },
-						{ required: true, message: `请输入联系电话`, trigger: 'change' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-					workerName: [
-						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
-					],
-					storage: [
-						{ required: true, message: `请选择入库仓库`, trigger: 'change' },
-					]
-				},
-				rules1: {
-					price: [
-						{ pattern:/^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
-					],
-				}
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			this.getinitlbslist()
-			this.getWebsit()
-			this.getProject()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({salesId: this.id}).then( async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						project: {id: res.data.orderEnginBaseId,projectName: res.data.projectName,projectNo: res.data.projectNo,manger: res.data.manger,mobile: res.data.mobile,startTime: res.data.startTime,endTime: res.data.endTime,province: res.data.province,provinceId: res.data.provinceId,city: res.data.city,cityId: res.data.cityId,area: res.data.area,areaId: res.data.areaId,street: res.data.street,streetId: res.data.streetId,address: res.data.address,lat: res.data.lat,lng: res.data.lng},
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getCategory(res.data.websitId)
-					this.getWarehouseList(res.data.websitId)
-					if(res.data.salesType == '工程'){
-						this.getProjectCollectionList(res.data.orderEnginBaseId)
-					}
-					this.formData.remark = res.data.remark
-					for(var item of res.data.items){
-						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName, items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
-						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
-						item.goods = ress.data
-						item.goodsList = ress.data ? [ress.data] : []
-					}
-					this.dataList = res.data.items
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			changeWebsit(e){
-				this.dataList = [];
-				this.formData.websitId = e.websitId
-				this.formData.websitName = e.name
-				this.formData.storageName = ''
-				this.formData.storageId = ''
-				this.getWorker()
-				this.getCategory(e.websitId)
-				this.getWarehouseList(e.websitId)
-			},
-			getCategory(websitId){
-				getCategory({websitId}).then(res => {
-					this.mainList = res.data
-				})
-			},
-			toAddProject(){
-				this.$router.push({
-					name: 'basicEngineeringData'
-				})
-			},
-			getProject(){
-				getProject({
-					pageNum: 1,
-					pageSize: -1,
-					params:[]
-				}).then(res => {
-					this.projectList = res.data.records
-				})
-			},
-			getWarehouseList(websitId){
-				if(!websitId){return this.warehouseList = []}
-				storageListPageV2({
-			      pageNum: 1,
-			      pageSize: -1,
-			      params: [{param: "a.type", compare: "like", value: "辅材"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
-			    }).then(res => {
-					this.warehouseList = res.data.records
-			    })
-			},
-			getProjectCollectionList(orderEnginBaseId){
-				getProjectCollectionList({orderEnginBaseId,goodsType: 'M'}).then(res => {
-					this.collectionList = res.data
-				})
-			},
-			async getGoods(categoryId,goodsName,type){
-				// if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-					})
-				}
-			},
-			getWorker(){
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					this.workerList = res.data.records
-				})
-			},
-			changeWorker(e){
-				this.formData.identity = e.idCard
-				this.formData.workerMobile = e.mobile
-				this.formData.workerId = e.userId
-				this.formData.workerName = e.nickName
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeMain(e){
-				this.dataList[this.isEdit].goodsList = [],
-				this.dataList[this.isEdit].parentCategory = e,
-				this.dataList[this.isEdit].parentCategoryId = e.categoryId,
-				this.dataList[this.isEdit].parentCategoryName = e.categoryName,
-				this.dataList[this.isEdit].goodsCategory = {},
-				this.dataList[this.isEdit].goodsCategoryName = '',
-				this.dataList[this.isEdit].goodsCategoryId = '',
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].price = '',
-				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].salesQty = ''
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsType = 'M'
-			},
-			async changeSmall(e){
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].price = '',
-				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].salesQty = ''
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsCategoryId = e.categoryId
-				this.dataList[this.isEdit].goodsCategoryName = e.categoryName
-				// if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
-				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-					this.dataList[this.isEdit].goodsList = res.data
-				})
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
-				this.dataList[this.isEdit].price = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-				this.dataList[this.isEdit].itemSourceType = e.itemSourceType
-				this.dataList[this.isEdit].itemSourceId = e.itemSourceId
-				this.dataList[this.isEdit].normType = e.normType
-			},
-			add(){
-				if(this.dataList.length != 0){this.isEdit = 0}
-				this.dataList.unshift({
-					goodsList: [],
-					parentCategory: {},
-					parentCategoryId: '',
-					parentCategoryName: '',
-					goodsCategory: {},
-					goodsCategoryName: '',
-					goodsCategoryId: '',
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-					goodsSalesUnit: '',
-					goodsSpecification: '',
-					goodsCode: '',
-					price: '',
-					saleAmount: '',
-					salesQty: 1,
-					qty: '',
-					goodsType: 'M',
-					itemSourceType: '',
-					itemSourceId: '',
-					normType: ''
-				})
-			},
-			del(index){
-				if(index <= 1){this.isEdit == 0}else{this.isEdit -= 1}
-				this.dataList.splice(index,1)
-			},
-			confirmSubmit(){
-				if(this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/.test(this.formData1.price)){
-					return this.$message.warning('请输入大于0的数字!')
-				}
-				this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					submit({
-						salesId: this.formData.salesId,
-						price: this.formData1.price,
-						urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
-						remark: this.formData1.remark
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('提交成功!')
-							if(this.formData.payType == 'WECHAT'){
-								this.wxPay()
-							}else{
-								this.goBack()
-							}
-						}
-					})
-				});
-			},
-			submit(){
-				const that = this
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						edit({
-							salesId: this.formData.salesId,
-							goodsType: 'M',
-							orderSource: this.formData.orderSource,
-							payType: this.formData.payType,
-							remark: this.formData.remark,
-							websitId: this.formData.websitId,
-							websitName: this.formData.websitName,
-							workerName: this.formData.workerName,
-							workerId: this.formData.workerId,
-							identity: this.formData.identity,
-							workerMobile: this.formData.workerMobile,
-							buyPeople: this.formData.buyPeople,
-							items: this.dataList,
-							orderEnginBaseId: this.formData.orderEnginBaseId,
-							salesType: this.formData.salesType,
-							storageId: this.formData.storageId,
-							storageName: this.formData.storageName,
-						}).then(res => {
-							if(res.code == 200){
-								this.$nextTick(() => {
-									that.confirmSubmit()
-								})
-								
-							}
-						})
-					}
-				})
-			},
-			confirm(){
-				if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
-				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					confirm({
-						salesId: this.formData.salesId,
-						storageId: this.formData.storageId
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('审核成功!')
-							this.goBack()
-						}
-					})
-				});
-			},
-			checkPay(){
-				this.timer = setInterval(()=>{
-					getDetail({salesId: this.id}).then(res => {
-						if(res.data.payFlag == 'YES'){
-							this.$refs.payQRCode.innerHTML = '';
-							this.clear()
-							this.$message.success('支付成功!')
-							this.goBack()
-						}
-					})
-				},3000)
-			},
-			clear(){
-				clearInterval(this.timer)
-			},
-			wxPay(){
-				if(!this.is_submit){
-					return false
-				}
-				this.is_submit = false
-				setTimeout(()=>{
-					this.is_submit = true
-				},2000)
-				getCode({
-					salesId: this.formData.salesId
-				}).then(res => {
-					if(res.code == 200){
-						this.payCodeUrl = res.data.codeUrl
-						this.$refs.payQRCode.innerHTML = '';
-						this.$nextTick(() => {
-						  this.payUrl = res.data.codeUrl;
-						  new QRCode(this.$refs.payQRCode, {
-						    text: res.data.codeUrl,
-						    width: 200,
-						    height: 200,
-						    colorDark: "#333333", // 二维码颜色
-						    colorLight: "#ffffff", // 二维码背景色
-						    correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
-						  });
-						  this.checkPay()
-						});
-					}
-				})
-				this.isPay = true
-			},
-			save(){
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								goodsType: 'M',
-								orderSource: this.formData.orderSource,
-								payType: this.formData.payType,
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								buyPeople: this.formData.buyPeople,
-								items: this.dataList,
-								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType,
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								salesId: this.formData.salesId,
-								goodsType: 'M',
-								orderSource: this.formData.orderSource,
-								payType: this.formData.payType,
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								buyPeople: this.formData.buyPeople,
-								items: this.dataList,
-								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType,
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			},
-			changeSale(){
-				this.formData.buyPeople = 'CUSTOMER'
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import QRCode from 'qrcodejs2'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import ImageUpload from '@/components/file-upload'
+import {
+  getWorker,
+  getCategory,
+  getGoods,
+  getDetail,
+  add,
+  edit,
+  confirm,
+  submit,
+  getCode,
+  getProject,
+  getProjectCollectionList
+} from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { storageListPageV2 } from '@/api/storage.js'
+export default {
+  components: { geographicalPosi, ImageUpload },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      websitList: [],
+      workerList: [],
+      mainList: [],
+      projectList: [],
+      collectionList: [],
+      warehouseList: [],
+      isPay: false,
+      payCodeUrl: '',
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        file_url: [],
+        salesId: '',
+        flag: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        worker: {},
+        workerName: '',
+        workerId: '',
+        identity: '',
+        workerMobile: '',
+        orderSource: 'SELF',
+        payType: '',
+        remark: '',
+        totalAmount: '',
+        buyPeople: 'WORKER',
+        salesType: '零售',
+        province: '',
+        provinceId: '',
+        city: '',
+        cityId: '',
+        area: '',
+        areaId: '',
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        project: {},
+        orderEnginBaseId: '',
+        storage: null,
+        storageId: '',
+        storageName: ''
+      },
+      formData1: {
+        price: '',
+        remark: '',
+        fileUrl: []
+      },
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      isEdit: 0,
+      is_submit: true,
+      timer: '',
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        orderSource: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        payType: [{ required: true, message: '请选择订单来源', trigger: 'change' }],
+        identity: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        workerMobile: [
+          { required: true, message: `请输入联系电话`, trigger: 'blur' },
+          { required: true, message: `请输入联系电话`, trigger: 'change' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ],
+        workerName: [{ required: true, message: '请输入客户姓名', trigger: 'blur' }],
+        storage: [{ required: true, message: `请选择入库仓库`, trigger: 'change' }]
+      },
+      rules1: {
+        price: [{ pattern: /^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.getinitlbslist()
+    this.getWebsit()
+    this.getProject()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ salesId: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          project: {
+            id: res.data.orderEnginBaseId,
+            projectName: res.data.projectName,
+            projectNo: res.data.projectNo,
+            manger: res.data.manger,
+            mobile: res.data.mobile,
+            startTime: res.data.startTime,
+            endTime: res.data.endTime,
+            province: res.data.province,
+            provinceId: res.data.provinceId,
+            city: res.data.city,
+            cityId: res.data.cityId,
+            area: res.data.area,
+            areaId: res.data.areaId,
+            street: res.data.street,
+            streetId: res.data.streetId,
+            address: res.data.address,
+            lat: res.data.lat,
+            lng: res.data.lng
+          },
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getCategory(res.data.websitId)
+        this.getWarehouseList(res.data.websitId)
+        if (res.data.salesType == '工程') {
+          this.getProjectCollectionList(res.data.orderEnginBaseId)
+        }
+        this.formData.remark = res.data.remark
+        for (var item of res.data.items) {
+          item.parentCategory = {
+            categoryId: item.parentCategoryId,
+            categoryName: item.parentCategoryName,
+            items: [{ categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }]
+          }
+          item.goodsCategory = { categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }
+          var ress = await that.getGoods(item.goodsCategoryId, item.goodsName, 1)
+          item.goods = ress.data
+          item.goodsList = ress.data ? [ress.data] : []
+        }
+        this.dataList = res.data.items
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    changeWebsit(e) {
+      this.dataList = []
+      this.formData.websitId = e.websitId
+      this.formData.websitName = e.name
+      this.formData.storageName = ''
+      this.formData.storageId = ''
+      this.getWorker()
+      this.getCategory(e.websitId)
+      this.getWarehouseList(e.websitId)
+    },
+    getCategory(websitId) {
+      getCategory({ websitId }).then(res => {
+        this.mainList = res.data
+      })
+    },
+    toAddProject() {
+      this.$router.push({
+        name: 'basicEngineeringData'
+      })
+    },
+    getProject() {
+      getProject({
+        pageNum: 1,
+        pageSize: -1,
+        params: []
+      }).then(res => {
+        this.projectList = res.data.records
+      })
+    },
+    getWarehouseList(websitId) {
+      if (!websitId) {
+        return (this.warehouseList = [])
+      }
+      storageListPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.type', compare: 'like', value: '辅材' },
+          { param: 'a.status', compare: '=', value: 'true' },
+          { param: 'a.websit_id', compare: '=', value: websitId }
+        ]
+      }).then(res => {
+        this.warehouseList = res.data.records
+      })
+    },
+    getProjectCollectionList(orderEnginBaseId) {
+      getProjectCollectionList({ orderEnginBaseId, goodsType: 'M' }).then(res => {
+        this.collectionList = res.data
+      })
+    },
+    async getGoods(categoryId, goodsName, type) {
+      // if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({
+            websitId: this.formData.websitId,
+            categoryId: categoryId,
+            type: 'M',
+            goodsName: goodsName,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            saleType: this.formData.salesType,
+            storageId: this.formData.storageId
+          }).then(res => {
+            resolve({
+              data: res.data[0]
+            })
+          })
+        })
+      } else {
+        getGoods({
+          websitId: this.formData.websitId,
+          categoryId: categoryId,
+          type: 'M',
+          orderEnginBaseId: this.formData.orderEnginBaseId,
+          saleType: this.formData.salesType,
+          storageId: this.formData.storageId
+        }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    changeWorker(e) {
+      this.formData.identity = e.idCard
+      this.formData.workerMobile = e.mobile
+      this.formData.workerId = e.userId
+      this.formData.workerName = e.nickName
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeMain(e) {
+      ;(this.dataList[this.isEdit].goodsList = []),
+        (this.dataList[this.isEdit].parentCategory = e),
+        (this.dataList[this.isEdit].parentCategoryId = e.categoryId),
+        (this.dataList[this.isEdit].parentCategoryName = e.categoryName),
+        (this.dataList[this.isEdit].goodsCategory = {}),
+        (this.dataList[this.isEdit].goodsCategoryName = ''),
+        (this.dataList[this.isEdit].goodsCategoryId = ''),
+        (this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].price = ''),
+        (this.dataList[this.isEdit].saleAmount = ''),
+        (this.dataList[this.isEdit].salesQty = '')
+      ;(this.dataList[this.isEdit].qty = ''), (this.dataList[this.isEdit].goodsType = 'M')
+    },
+    async changeSmall(e) {
+      ;(this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].price = ''),
+        (this.dataList[this.isEdit].saleAmount = ''),
+        (this.dataList[this.isEdit].salesQty = '')
+      ;(this.dataList[this.isEdit].qty = ''), (this.dataList[this.isEdit].goodsCategoryId = e.categoryId)
+      this.dataList[this.isEdit].goodsCategoryName = e.categoryName
+      // if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
+      getGoods({
+        websitId: this.formData.websitId,
+        categoryId: e.categoryId,
+        type: 'M',
+        orderEnginBaseId: this.formData.orderEnginBaseId,
+        saleType: this.formData.salesType,
+        storageId: this.formData.storageId
+      }).then(res => {
+        this.dataList[this.isEdit].goodsList = res.data
+      })
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
+      this.dataList[this.isEdit].price = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+      this.dataList[this.isEdit].itemSourceType = e.itemSourceType
+      this.dataList[this.isEdit].itemSourceId = e.itemSourceId
+      this.dataList[this.isEdit].normType = e.normType
+    },
+    add() {
+      if (this.dataList.length != 0) {
+        this.isEdit = 0
+      }
+      this.dataList.unshift({
+        goodsList: [],
+        parentCategory: {},
+        parentCategoryId: '',
+        parentCategoryName: '',
+        goodsCategory: {},
+        goodsCategoryName: '',
+        goodsCategoryId: '',
+        goods: {},
+        goodsId: '',
+        goodsName: '',
+        goodsSalesUnit: '',
+        goodsSpecification: '',
+        goodsCode: '',
+        price: '',
+        saleAmount: '',
+        salesQty: 1,
+        qty: '',
+        goodsType: 'M',
+        itemSourceType: '',
+        itemSourceId: '',
+        normType: ''
+      })
+    },
+    del(index) {
+      if (index <= 1) {
+        this.isEdit == 0
+      } else {
+        this.isEdit -= 1
+      }
+      this.dataList.splice(index, 1)
+    },
+    confirmSubmit() {
+      if (this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[0-9]\d*$/.test(this.formData1.price)) {
+        return this.$message.warning('请输入大于0的数字!')
+      }
+      this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        submit({
+          salesId: this.formData.salesId,
+          price: this.formData1.price,
+          urlPrc: this.formData1.fileUrl.length > 0 ? this.formData1.fileUrl[0].url : '',
+          remark: this.formData1.remark
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('提交成功!')
+            if (this.formData.payType == 'WECHAT') {
+              this.wxPay()
+            } else {
+              this.goBack()
+            }
+          }
+        })
+      })
+    },
+    submit() {
+      const that = this
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          edit({
+            salesId: this.formData.salesId,
+            goodsType: 'M',
+            orderSource: this.formData.orderSource,
+            payType: this.formData.payType,
+            remark: this.formData.remark,
+            websitId: this.formData.websitId,
+            websitName: this.formData.websitName,
+            workerName: this.formData.workerName,
+            workerId: this.formData.workerId,
+            identity: this.formData.identity,
+            workerMobile: this.formData.workerMobile,
+            buyPeople: this.formData.buyPeople,
+            items: this.dataList,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            salesType: this.formData.salesType,
+            storageId: this.formData.storageId,
+            storageName: this.formData.storageName
+          }).then(res => {
+            if (res.code == 200) {
+              this.$nextTick(() => {
+                that.confirmSubmit()
+              })
+            }
+          })
+        }
+      })
+    },
+    confirm() {
+      if (!this.formData.storageId) {
+        return this.$message.warning('请先选择出库仓库!')
+      }
+      this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        confirm({
+          salesId: this.formData.salesId,
+          storageId: this.formData.storageId
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('审核成功!')
+            this.goBack()
+          }
+        })
+      })
+    },
+    checkPay() {
+      this.timer = setInterval(() => {
+        getDetail({ salesId: this.id }).then(res => {
+          if (res.data.payFlag == 'YES') {
+            this.$refs.payQRCode.innerHTML = ''
+            this.clear()
+            this.$message.success('支付成功!')
+            this.goBack()
+          }
+        })
+      }, 3000)
+    },
+    clear() {
+      clearInterval(this.timer)
+    },
+    wxPay() {
+      if (!this.is_submit) {
+        return false
+      }
+      this.is_submit = false
+      setTimeout(() => {
+        this.is_submit = true
+      }, 2000)
+      getCode({
+        salesId: this.formData.salesId
+      }).then(res => {
+        if (res.code == 200) {
+          this.payCodeUrl = res.data.codeUrl
+          this.$refs.payQRCode.innerHTML = ''
+          this.$nextTick(() => {
+            this.payUrl = res.data.codeUrl
+            new QRCode(this.$refs.payQRCode, {
+              text: res.data.codeUrl,
+              width: 200,
+              height: 200,
+              colorDark: '#333333', // 二维码颜色
+              colorLight: '#ffffff', // 二维码背景色
+              correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
+            })
+            this.checkPay()
+          })
+        }
+      })
+      this.isPay = true
+    },
+    save() {
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              goodsType: 'M',
+              orderSource: this.formData.orderSource,
+              payType: this.formData.payType,
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              buyPeople: this.formData.buyPeople,
+              items: this.dataList,
+              orderEnginBaseId: this.formData.orderEnginBaseId,
+              salesType: this.formData.salesType,
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              salesId: this.formData.salesId,
+              goodsType: 'M',
+              orderSource: this.formData.orderSource,
+              payType: this.formData.payType,
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              buyPeople: this.formData.buyPeople,
+              items: this.dataList,
+              orderEnginBaseId: this.formData.orderEnginBaseId,
+              salesType: this.formData.salesType,
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    },
+    changeSale() {
+      this.formData.buyPeople = 'CUSTOMER'
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 1138 - 962
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue

@@ -1,975 +1,1151 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>单据信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left" :disabled="formType == 2">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据状态">
-								<el-input type="text" :value="formData.retState == 'WAIT'?'待确认':formData.retState == 'OK'?'已确认':''" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8" v-if="id">
-							<el-form-item label="单据编号">
-								<el-input type="text" :value="formData.salesRetId" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websit" disabled value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in websitList"
-								      :key="item.websitId"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople">
-									<el-radio disabled label="WORKER">内部师傅</el-radio>
-									<el-radio disabled label="CUSTOMER">客户</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.buyPeople == 'CUSTOMER'">
-							<el-col :span="8">
-								<el-form-item label="客户姓名" prop="workerName" :required="true">
-									<el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="客户联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<template v-else>
-							<el-col :span="8">
-								<el-form-item label="师傅姓名" prop="worker" :required="true">
-									<el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<!-- <el-col :span="8">
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>单据信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form
+          ref="formData"
+          :rules="rules"
+          :model="formData"
+          label-width="110px"
+          size="small"
+          label-position="left"
+          :disabled="formType == 2"
+        >
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据状态">
+                <el-input
+                  type="text"
+                  :value="formData.retState == 'WAIT' ? '待确认' : formData.retState == 'OK' ? '已确认' : ''"
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="id">
+              <el-form-item label="单据编号">
+                <el-input type="text" :value="formData.salesRetId" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属商户" :required="true">
+                <el-input type="text" :value="companyName" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="网点名称" prop="websitId" :required="true">
+                <el-select
+                  v-model="formData.websit"
+                  disabled
+                  value-key="websitId"
+                  @change="changeWebsit"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="购买方" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.buyPeople">
+                  <el-radio disabled label="WORKER">内部师傅</el-radio>
+                  <el-radio disabled label="CUSTOMER">客户</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.buyPeople == 'CUSTOMER'">
+              <el-col :span="8">
+                <el-form-item label="客户姓名" prop="workerName" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerName" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="客户联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" disabled v-model="formData.workerMobile" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <template v-else>
+              <el-col :span="8">
+                <el-form-item label="师傅姓名" prop="worker" :required="true">
+                  <el-input type="text" v-model="formData.workerName" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
 								<el-form-item label="师傅身份证" prop="identity" :required="true">
 									<el-input type="text" v-model="formData.identity" :disabled="formType == 2" placeholder="请输入"></el-input>
 								</el-form-item>
 							</el-col> -->
-							<el-col :span="8">
-								<el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
-									<el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="8">
-							<el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.salesType">
-								    <el-radio disabled label="零售">零售</el-radio>
-								    <el-radio disabled label="工程">工程</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="7">
-							<el-form-item label="销售订单号" :required="true">
-								<el-input type="text" v-model="formData.salesId" @change="getDetail" disabled placeholder="请输入销售订单号"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="1">
-							<el-button v-if="formType != 2" size="small" type="primary"  @click="isShowNo = true;getOrderList();">选择</el-button>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="销售金额">
-								<el-input type="text" :value="formData.totalAmount" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="5">
-							<el-form-item label="时间">
-								<el-input type="text" :value="formData.payTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="退货仓库" prop="storage">
-								<el-select v-model="formData.storage" value-key="storageId":disabled="true" placeholder="请选择" style="width: 100%;">
-								    <el-option
-									  v-for="(item,index) in warehouseList"
-								      :key="index"
-								      :label="item.storageName"
-								      :value="item">
-								    </el-option>
-								</el-select>
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.salesType == '工程'">
-							<el-col :span="6">
-								<el-form-item label="工程名称" :required="true">
-									<el-input type="text" :value="formData.projectName" disabled></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="工程编号" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="负责人" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="联系电话" :required="true">
-									<el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="项目时间" :required="true">
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.startTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="开始日期">
-									</el-date-picker>
-									<el-date-picker
-										style="width:50%"
-									    v-model="formData.endTime"
-									    type="date"
-										:disabled="true"
-										value-format="yyyy-MM-dd"
-									    placeholder="结束日期">
-									</el-date-picker>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="项目地址" :required="true">
-									<el-row>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
-										</el-col>
-										<el-col :span="5" style="margin-right: 12px;">
-											<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
-										</el-col>
-										<el-col :span="8">
-											<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
-										</el-col>
-									</el-row>
-								</el-form-item>
-							</el-col>
-							<el-col :span="24">
-								<el-form-item label="">
-									<el-row :gutter="20">
-										<el-col :span="24">
-											<el-input type="text" v-model="formData.address" :disabled="true" placeholder="详细地址"></el-input>
-										</el-col>
-										<!-- <el-col :span="2">
+              <el-col :span="8">
+                <el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
+                  <el-input type="text" v-model="formData.workerMobile" disabled placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="8">
+              <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px">
+                <el-radio-group v-model="formData.salesType">
+                  <el-radio disabled label="零售">零售</el-radio>
+                  <el-radio disabled label="工程">工程</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label="销售订单号" :required="true">
+                <el-input
+                  type="text"
+                  v-model="formData.salesId"
+                  @change="getDetail"
+                  disabled
+                  placeholder="请输入销售订单号"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1">
+              <el-button
+                v-if="formType != 2"
+                size="small"
+                type="primary"
+                @click="
+                  isShowNo = true
+                  getOrderList()
+                "
+                >选择</el-button
+              >
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="销售金额">
+                <el-input type="text" :value="formData.totalAmount" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="5">
+              <el-form-item label="时间">
+                <el-input type="text" :value="formData.payTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="退货仓库" prop="storage">
+                <el-select
+                  v-model="formData.storage"
+                  value-key="storageId"
+                  :disabled="true"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in warehouseList"
+                    :key="index"
+                    :label="item.storageName"
+                    :value="item"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.salesType == '工程'">
+              <el-col :span="6">
+                <el-form-item label="工程名称" :required="true">
+                  <el-input type="text" :value="formData.projectName" disabled></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="工程编号" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="负责人" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="联系电话" :required="true">
+                  <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="项目时间" :required="true">
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.startTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="开始日期"
+                  >
+                  </el-date-picker>
+                  <el-date-picker
+                    style="width: 50%"
+                    v-model="formData.endTime"
+                    type="date"
+                    :disabled="true"
+                    value-format="yyyy-MM-dd"
+                    placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="项目地址" :required="true">
+                  <el-row>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+                    </el-col>
+                    <el-col :span="5" style="margin-right: 12px">
+                      <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="">
+                  <el-row :gutter="20">
+                    <el-col :span="24">
+                      <el-input
+                        type="text"
+                        v-model="formData.address"
+                        :disabled="true"
+                        placeholder="详细地址"
+                      ></el-input>
+                    </el-col>
+                    <!-- <el-col :span="2">
 											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
 										</el-col> -->
-									</el-row>
-								</el-form-item>
-							</el-col>
-						</template>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单人">
-								<el-input type="text" :value="formData.createBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="制单时间">
-								<el-input type="text" :value="formData.createTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核人">
-								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" v-if="id">
-							<el-form-item label="审核时间">
-								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="附件">
-								<ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>辅材信息</span>
-			</div>
-			<!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
-			<div class="table">
-				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column label="大类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="true" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in mainList"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="小类名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
-									if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
-								}" :disabled="true" value-key="categoryId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.parentCategory.items"
-							      :key="item.categoryId"
-							      :label="item.categoryName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column label="辅材名称" align="center">
-						<template slot-scope="scope">
-							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="true" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in scope.row.goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
-					<el-table-column prop="" align="center" label="退货数量" >
-						<template slot-scope="scope">
-							<el-input type="number" v-model="scope.row.retQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.saleAmount" align="center" label="退货金额" >
-						<template slot-scope="scope" v-if="scope.row.retQty && scope.row.price">
-							{{(scope.row.price * 100) * scope.row.retQty / 100}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
-					<el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="salesQty" align="center" label="销售数量"></el-table-column>
-					<el-table-column prop="price" align="center" label="销售价格"></el-table-column>
-					<el-table-column prop="saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
-							{{(scope.row.price * 100) * (scope.row.salesQty*100) / 10000}}
-						</template>
-					</el-table-column>
-					<el-table-column label="操作" align="right" width="140">
-						<template slot-scope="scope" v-if="formType != 2">
-							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
-							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
-						</template>
-					</el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0 || (formType == 1 && formData.retState == 'WAIT')" size="small" type="primary" @click="save()">保存</el-button>
-				<el-button v-if="formData.retState == 'WAIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = ''">
-			<h3>扫二维码支付</h3>
-			<el-image :src="payCodeUrl" fit="fit"></el-image>
-		</el-dialog>
-		<!-- 选择销售订单号 -->
-		<el-dialog title="选择销售订单" :visible.sync="isShowNo" width="80%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
-			<el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
-				<el-row :gutter="20">
-					<el-col :span="6">
-						<el-form-item label="网点名称" prop="websit_id">
-							<el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in websitList"
-							      :key="item.websitId"
-							      :label="item.name"
-							      :value="item.websitId">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅姓名" prop="worker_name">
-							<el-select v-model="formData1.worker_name" @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" filterable placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in workerList"
-							      :key="item.id"
-							      :label="item.nickName + '-' + item.mobile"
-							      :value="item.nickName">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="师傅联系电话" prop="worker_mobile">
-							<el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="物料名称" prop="goods" align="center">
-							<el-select v-model="formData1.goods" filterable @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" value-key="goodsId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsName"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="规格型号" prop="goods" align="center">
-							<el-select v-model="formData1.goods" filterable @focus="()=>{
-								if(!this.formData1.websit_id){return this.$message.warning('请先选择网点名称!');}
-							}" value-key="goodsId" placeholder="请选择" style="width: 100%;">
-							    <el-option
-							      v-for="item in goodsList"
-							      :key="item.goodsId"
-							      :label="item.goodsSpecification"
-							      :value="item">
-							    </el-option>
-							  </el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="6">
-						<el-form-item label="销售订单号" prop="sales_id">
-							<el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-row type="flex" justify="end">
-							<el-col :span="5">
-								<el-button size="small" @click="resetScreenForm()">清空</el-button>
-								<el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
-							</el-col>
-						</el-row>
-					</el-col>
-				</el-row>
-			</el-form>
-			<div class="clearfix">
-				<span>订单信息</span>
-			</div>
-			<div class="table">
-				<el-table ref="treeTable" :data="orderList" element-loading-text="Loading" @select="handleSelectionChange" @row-click="handleSelectionChange('',$event)" border fit highlight-current-row stripe style="max-height: 380px;overflow-y: auto;">
-					<el-table-column type="selection" width="40"></el-table-column>
-					<el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
-					<el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
-					<el-table-column prop="" align="center" label="购买方">
-						<template slot-scope="scope">
-							{{scope.row.buyPeople == 'WORKER'?'内部师傅':'客户'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
-					<el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
-					<el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
-					<el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
-					<el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
-					<el-table-column prop="" align="center" label="订单来源">
-						<template slot-scope="scope">
-							{{scope.row.orderSource == 'ONLINE'?'在线订单':'自建订单'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payType" align="center" label="支付方式">
-						<template slot-scope="scope">
-							{{scope.row.payType == 'CASH'?'现金':scope.row.payType == 'WECHAT'?'微信':'工程支付'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
-					<el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
-					<el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
-					<el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
-				</el-table>
-				<div class="pagination clearfix">
-					<div class="fr">
-						<el-pagination
-							@size-change="handleSizeChange"
-							@current-change="handleCurrentChange"
-							:current-page="pageNum"
-							:page-sizes="[10, 20, 30, 50]"
-							:page-size="pageSize"
-							layout="total, sizes, prev, pager, next, jumper"
-							:total="listTotal"
-						></el-pagination>
-					</div>
-				</div>
-				<div slot="footer" class="dialog-footer" style="margin-top: 10px;">
-					<el-button size="small" @click="isShowNo = false">取 消</el-button>
-					<el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
-				</div>
-			</div>
-		</el-dialog>
-	</div>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+            </template>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单人">
+                <el-input type="text" :value="formData.createBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="制单时间">
+                <el-input type="text" :value="formData.createTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核人">
+                <el-input type="text" :value="formData.confirmBy" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" v-if="id">
+              <el-form-item label="审核时间">
+                <el-input type="text" :value="formData.confirmTime" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="附件">
+                <ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType !== 2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>辅材信息</span>
+      </div>
+      <!-- <el-button size="small" type="primary" @click="add()">添加</el-button> -->
+      <div class="table">
+        <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column label="大类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.parentCategory"
+                value-key="categoryId"
+                @change="changeMain"
+                :disabled="true"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in mainList" :key="item.categoryId" :label="item.categoryName" :value="item">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="小类名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goodsCategory"
+                @change="changeSmall"
+                @focus="
+                  () => {
+                    if (!scope.row.parentCategory) {
+                      return this.$message.warning('请先选择大类!')
+                    }
+                  }
+                "
+                :disabled="true"
+                value-key="categoryId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.parentCategory.items"
+                  :key="item.categoryId"
+                  :label="item.categoryName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="辅材名称" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.goods"
+                @change="changeGoods"
+                value-key="goodsId"
+                :disabled="true"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in scope.row.goodsList"
+                  :key="item.goodsId"
+                  :label="item.goodsName"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位"></el-table-column>
+          <el-table-column prop="" align="center" label="退货数量">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                v-model="scope.row.retQty"
+                :disabled="isEdit != scope.$index || formType == 2"
+                placeholder="请输入"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.saleAmount" align="center" label="退货金额">
+            <template slot-scope="scope" v-if="scope.row.retQty && scope.row.price">
+              {{ (scope.row.price * 100 * scope.row.retQty) / 100 }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
+          <el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
+          <el-table-column prop="salesQty" align="center" label="销售数量"></el-table-column>
+          <el-table-column prop="price" align="center" label="销售价格"></el-table-column>
+          <el-table-column prop="saleAmount" align="center" label="销售金额">
+            <template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
+              {{ (scope.row.price * 100 * (scope.row.salesQty * 100)) / 10000 }}
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="right" width="140">
+            <template slot-scope="scope" v-if="formType != 2">
+              <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                >编辑</el-button
+              >
+              <el-button size="mini" type="danger" @click="dataList.splice(scope.$index, 1)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button
+          v-if="formType == 0 || (formType == 1 && formData.retState == 'WAIT')"
+          size="small"
+          type="primary"
+          @click="save()"
+          >保存</el-button
+        >
+        <el-button v-if="formData.retState == 'WAIT'" size="small" type="primary" @click="confirm()"
+          >确认收货</el-button
+        >
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog
+      title="微信支付"
+      :visible.sync="isPay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="payCodeUrl = ''"
+    >
+      <h3>扫二维码支付</h3>
+      <el-image :src="$showImgUrl(payCodeUrl)" fit="fit"></el-image>
+    </el-dialog>
+    <!-- 选择销售订单号 -->
+    <el-dialog
+      title="选择销售订单"
+      :visible.sync="isShowNo"
+      width="80%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="close"
+    >
+      <el-form ref="formData1" :model="formData1" label-width="110px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="网点名称" prop="websit_id">
+              <el-select v-model="formData1.websit_id" @change="changeWebsit" placeholder="请选择" style="width: 100%">
+                <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item.websitId">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅姓名" prop="worker_name">
+              <el-select
+                v-model="formData1.worker_name"
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                filterable
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in workerList"
+                  :key="item.id"
+                  :label="item.nickName + '-' + item.mobile"
+                  :value="item.nickName"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="师傅联系电话" prop="worker_mobile">
+              <el-input type="text" v-model="formData1.worker_mobile" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物料名称" prop="goods" align="center">
+              <el-select
+                v-model="formData1.goods"
+                filterable
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                value-key="goodsId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in goodsList" :key="item.goodsId" :label="item.goodsName" :value="item">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="规格型号" prop="goods" align="center">
+              <el-select
+                v-model="formData1.goods"
+                filterable
+                @focus="
+                  () => {
+                    if (!this.formData1.websit_id) {
+                      return this.$message.warning('请先选择网点名称!')
+                    }
+                  }
+                "
+                value-key="goodsId"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option v-for="item in goodsList" :key="item.goodsId" :label="item.goodsSpecification" :value="item">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="销售订单号" prop="sales_id">
+              <el-input type="text" v-model="formData1.sales_id" placeholder="请输入"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-row type="flex" justify="end">
+              <el-col :span="5">
+                <el-button size="small" @click="resetScreenForm()">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm()">搜索</el-button>
+              </el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="clearfix">
+        <span>订单信息</span>
+      </div>
+      <div class="table">
+        <el-table
+          ref="treeTable"
+          :data="orderList"
+          element-loading-text="Loading"
+          @select="handleSelectionChange"
+          @row-click="handleSelectionChange('', $event)"
+          border
+          fit
+          highlight-current-row
+          stripe
+          style="max-height: 380px; overflow-y: auto"
+        >
+          <el-table-column type="selection" width="40"></el-table-column>
+          <el-table-column prop="salesId" align="center" label="销售单号" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="单据状态" width="120">已支付,已提货</el-table-column>
+          <el-table-column prop="websitName" align="center" label="网点名称" width="140"></el-table-column>
+          <el-table-column prop="" align="center" label="购买方">
+            <template slot-scope="scope">
+              {{ scope.row.buyPeople == 'WORKER' ? '内部师傅' : '客户' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="workerName" align="center" label="师傅姓名"></el-table-column>
+          <el-table-column prop="workerMobile" align="center" label="师傅联系电话" width="120"></el-table-column>
+          <el-table-column prop="salesType" align="center" label="销售类型"></el-table-column>
+          <el-table-column prop="salesTime" align="center" label="销售日期" width="160"></el-table-column>
+          <el-table-column prop="totalAmount" align="center" label="订单金额"></el-table-column>
+          <el-table-column prop="" align="center" label="订单来源">
+            <template slot-scope="scope">
+              {{ scope.row.orderSource == 'ONLINE' ? '在线订单' : '自建订单' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payType" align="center" label="支付方式">
+            <template slot-scope="scope">
+              {{ scope.row.payType == 'CASH' ? '现金' : scope.row.payType == 'WECHAT' ? '微信' : '工程支付' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payTime" align="center" label="支付时间" width="160"></el-table-column>
+          <el-table-column prop="payNo" align="center" label="支付单号" width="160"></el-table-column>
+          <el-table-column prop="createBy" align="center" label="创建人" width="160"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="创建时间" width="160"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="审核人" width="160"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="审核时间" width="160"></el-table-column>
+        </el-table>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="pageNum"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="pageSize"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            ></el-pagination>
+          </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="margin-top: 10px">
+          <el-button size="small" @click="isShowNo = false">取 消</el-button>
+          <el-button size="small" type="primary" @click="confirmOrder()">确定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { getWebsit } from "@/api/customerManagement";
-	import { lbsAmapRegion } from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import ImageUpload from '@/components/file-upload'
-	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
-	import { add, edit, getReturnDetail, getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
-	import { storageListPageV2 } from '@/api/storage.js'
-	export default {
-		components: { ImageUpload, geographicalPosi },
-		props: ['id','title','formType'],
-		data() {
-			return {
-				dataList: [],
-				websitList: [],
-				workerList: [],
-				orderList: [],
-				goodsList: [],
-				mainList: [],
-				projectList: [],
-				warehouseList: [],
-				isPay: false,
-				payCodeUrl: '',
-				salesDetail: {},
-				formData: {
-					websit: {},
-					websitId: '',
-					websitName: '',
-					fileUrl: [],
-					salesId: '',
-					salesRetId: '',
-					retState: '',
-					createBy: '',
-					createTime: '',
-					confirmBy: '',
-					confirmTime: '',
-					worker: {},
-					workerName: '',
-					workerId: '',
-					identity: '',
-					workerMobile: '',
-					remark: '',
-					totalAmount: '',
-					salesType: '零售',
-					province: '',
-					provinceId: '',
-					city: '',
-					cityId: '',
-					area: '',
-					areaId: '',
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					orderEnginBaseId: '',
-					storage: null,
-					storageId: '',
-					storageName: '',
-				},
-				formData1: {
-					websit_id: '',
-					worker_name: '',
-					worker_mobile: '',
-					sales_id: '',
-					goods: {},
-					goodsName: '',
-					goodsSpecification: ''
-				},
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				isEdit: 0,
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					websitId: [
-						{ required: true, message: '请选择网点', trigger: 'change' }
-					],
-					worker: [
-						{ required: true, message: '请选择师傅', trigger: 'change' }
-					],
-					identity: [
-						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
-						{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					],
-					workerMobile: [
-						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-				},
-				isShowNo: false,
-				pageNum: 1,
-				pageSize: 10,
-				listTotal: 0
-			};
-		},
-		computed: {},
-		created() {
-			if(this.id){
-				this.getReturnDetail()
-			}
-			this.getWebsit()
-			this.getinitlbslist()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(salesId){
-				const that = this
-				getDetail({salesId}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getCategory(res.data.websitId)
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.items){
-						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
-						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : [],
-						item.retQty = 1
-					}
-					this.dataList = res.data.items
-				})
-			},
-			async getReturnDetail(){
-				const that = this
-				getReturnDetail({id: this.id}).then(async res => {
-					Object.assign(this.formData, res.data, {
-						websit: {websitId: res.data.websitId,name: res.data.websitName},
-						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-						storage: {
-							storageId: res.data.storageId
-						}
-					})
-					this.getWorker()
-					this.getCategory(res.data.websitId)
-					this.getWarehouseList(res.data.websitId)
-					for(var item of res.data.websitSalesRetItems){
-						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
-						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
-						var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
-						item.goods = {...ress.data,oldPrice:ress.data.price}
-						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
-					}
-					this.dataList = res.data.websitSalesRetItems
-				})
-			},
-			getWebsit(){
-				getWebsit({type: 'C'}).then(res => {
-					this.websitList = res.data
-				})
-			},
-			getWarehouseList(websitId){
-				if(!websitId){return this.warehouseList = []}
-				storageListPageV2({
-			      pageNum: 1,
-			      pageSize: -1,
-			      params: [{param: "a.type", compare: "like", value: "配件"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
-			    }).then(res => {
-					this.warehouseList = res.data.records
-			    })
-			},
-			close(){
-				this.$refs.formData1.resetFields();
-			},
-			confirmOrder(){
-				this.isShowNo = false
-				this.getDetail(this.selectedRow.salesId)
-			},
-			getOrderList(){
-				listPageV2({pageNum: this.pageNum,pageSize: this.pageSize,params: [{param: 'a.sales_id',compare: '=',value: this.formData1.sales_id},{param: 'a.flag',compare: '=',value: 'PAY_TAKE'},{param: "a.goods_type", compare: "=", value: "M"},{param: 'a.websit_id',compare: '=',value: this.formData1.websit_id},{param: 'a.worker_name',compare: '=',value: this.formData1.worker_name},{param: 'a.worker_mobile',compare: '=',value: this.formData1.worker_mobile}], goodsName: this.formData1.goods.goodsName, goodsSpecification: this.formData1.goods.goodsSpecification, isFilter: true}).then(res => {
-					this.orderList = res.data.records
-					this.listTotal = res.data.total
-				})
-			},
-			getGoodsList(){
-				getGoodsList({
-					type: 'M',
-					websitId: this.formData1.websit_id
-				}).then(res => {
-					this.goodsList = res.data
-				})
-			},
-			handleSelectionChange (selection, row) {
-				this.$refs.treeTable.clearSelection()
-			 	 // 这里因为需求做的是必选一个,如有其他需求可做调整
-				this.$refs.treeTable.toggleRowSelection(row, true)    
-				this.selectedRow = row
-			},
-			// 更改每页数量
-			handleSizeChange(val) {
-				this.pageSize = val;
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			// 更改当前页
-			handleCurrentChange(val) {
-				this.pageNum = val;
-				this.getOrderList();
-			},
-			// 提交筛选表单
-			submitScreenForm() {
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			
-			// 重置筛选表单
-			resetScreenForm() {
-				this.$refs.formData1.resetFields();
-				this.pageNum = 1;
-				this.getOrderList();
-			},
-			changeWebsit(e){
-				this.getWorker()
-				this.getGoodsList()
-				this.formData1.goods = {}
-				// this.getCategory(e.websitId)
-			},
-			getCategory(websitId){
-				getCategory({websitId}).then(res => {
-					this.mainList = res.data
-				})
-			},
-			async getGoods(categoryId,goodsName,type){
-				const that = this
-				if(type == 1){
-					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-							resolve({
-								data: res.data[0]
-							})
-						})
-					})
-				}else{
-					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
-						that.dataList[that.isEdit].goodsList = res.data
-					})
-				}
-			},
-			getWorker(){
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData1.websit_id}]}).then(res => {
-					this.workerList = res.data.records
-				})
-			},
-			changeWorker(e){
-				this.formData.identity = e.idCard
-				this.formData.workerMobile = e.mobile
-				this.formData.workerId = e.userId
-				this.formData.workerName = e.nickName
-			},
-			workerBlur(e){
-				this.formData.worker = e.target.value
-				this.$forceUpdate()
-			},
-			changeMain(e){
-				this.dataList[this.isEdit].goodsList = [],
-				this.dataList[this.isEdit].parentCategory = e,
-				this.dataList[this.isEdit].parentCategoryId = e.categoryId,
-				this.dataList[this.isEdit].parentCategoryName = e.categoryName,
-				this.dataList[this.isEdit].goodsCategory = {},
-				this.dataList[this.isEdit].goodsCategoryName = '',
-				this.dataList[this.isEdit].goodsCategoryId = '',
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].price = '',
-				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].retQty = ''
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsType = 'M'
-			},
-			async changeSmall(e){
-				this.dataList[this.isEdit].goods = {},
-				this.dataList[this.isEdit].goodsId = '',
-				this.dataList[this.isEdit].goodsName = '',
-				this.dataList[this.isEdit].goodsSalesUnit = '',
-				this.dataList[this.isEdit].goodsSpecification = '',
-				this.dataList[this.isEdit].goodsCode = '',
-				this.dataList[this.isEdit].price = '',
-				this.dataList[this.isEdit].saleAmount = '',
-				this.dataList[this.isEdit].retQty = ''
-				this.dataList[this.isEdit].qty = '',
-				this.dataList[this.isEdit].goodsCategoryId = e.categoryId
-				this.dataList[this.isEdit].goodsCategoryName = e.categoryName
-				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
-					this.dataList[this.isEdit].goodsList = res.data
-				})
-			},
-			changeGoods(e){
-				console.log(e)
-				this.dataList[this.isEdit].goodsId = e.goodsId
-				this.dataList[this.isEdit].goodsName = e.goodsName
-				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
-				this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
-				this.dataList[this.isEdit].price = e.price
-				this.dataList[this.isEdit].goodsCode = e. goodsCode
-				this.dataList[this.isEdit].qty = e.qty
-				this.dataList[this.isEdit].itemSourceType = e.itemSourceType
-				this.dataList[this.isEdit].itemSourceId = e.itemSourceId
-				this.dataList[this.isEdit].normType = e.normType
-			},
-			add(){
-				if(this.dataList.length != 0){this.isEdit += 1}
-				this.dataList.push({
-					goodsList: [],
-					parentCategory: {},
-					parentCategoryId: '',
-					parentCategoryName: '',
-					goodsCategory: {},
-					goodsCategoryName: '',
-					goodsCategoryId: '',
-					goods: {},
-					goodsId: '',
-					goodsName: '',
-					goodsSalesUnit: '',
-					goodsSpecification: '',
-					goodsCode: '',
-					price: '',
-					saleAmount: '',
-					retQty: 1,
-					qty: '',
-					goodsType: 'M',
-					itemSourceType: '',
-					itemSourceId: '',
-					normType: ''
-				})
-			},
-			confirm(){
-				const that = this
-				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					edit({
-						retState: 'OK',
-						salesRetId: this.formData.salesRetId,
-					}).then(res => {
-						if(res.code == 200){
-							this.$message.success('确认提货成功!')
-							that.goBack()
-						}
-					})
-				});
-			},
-			save(){
-				const that = this
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							add({
-								salesId: this.formData.salesId,
-								goodsType: 'M',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitSalesRetItems: this.dataList,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									that.goBack()
-								}
-							})
-						}else if(this.formType == 1){
-							edit({
-								salesId: this.formData.salesId,
-								salesRetId: this.formData.salesRetId,
-								goodsType: 'M',
-								remark: this.formData.remark,
-								websitId: this.formData.websitId,
-								websitName: this.formData.websitName,
-								workerName: this.formData.workerName,
-								workerId: this.formData.workerId,
-								identity: this.formData.identity,
-								workerMobile: this.formData.workerMobile,
-								websitSalesRetItems: this.dataList,
-								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
-								storageId: this.formData.storageId,
-								storageName: this.formData.storageName,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									that.goBack()
-								}
-							})
-						}
-					}
-				})
-			},
-			getinitlbslist() {
-			  // 初始化请求省市区街道下拉选项数据
-			  lbsAmapRegion({ pid: 0 }).then(res => {
-			    this.provinceList = res.data
-			    // 创建工单时获取ip地址定位赋值
-			    if (!this.id && this.$IpAdd.province) {
-			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-			      if (item) {
-			        this.formData.provinceId = item.id
-			        this.formData.province = item.name
-			      }
-			    }
-			    if (this.formData.provinceId) {
-			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-			        this.cityList = res.data
-			        // 创建工单时获取ip地址定位赋值
-			        if (!this.id && this.$IpAdd.city) {
-			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-			          if (item2) {
-			            this.formData.cityId = item2.id
-			            this.formData.city = item2.name
-			          }
-			        }
-			        if (this.formData.cityId) {
-			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-			            this.areaList = res.data
-			          })
-			        }
-			        if (this.formData.areaId) {
-			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-			            this.streetList = res.data
-			          })
-			        }
-			      })
-			    }
-			  })
-			},
-			selectAddress(data){
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var { province, city, district, township } = data.data.addressComponent
-				// 获取选中省名称id
-				var { id, name } = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
-				  // 赋值市选项
-				  this.cityList = res.data
-				  // 获取选中市名称id
-				  var { id, name } = res.data.find(item => item.name === city)
-				  this.formData.cityId = id
-				  this.formData.city = name
-				  // 请求区选项
-				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
-				    // 赋值区选项
-				    this.areaList = res.data
-				    // 获取选中区名称id
-				    var { id, name } = res.data.find(item => item.name === district)
-				    this.formData.areaId = id
-				    this.formData.area = name
-				    // 请求街道选项
-				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
-				      // 赋值街道选项
-				      this.streetList = res.data
-				      // 获取选中街道名称id
-				      var { id, name } = res.data.find(item => item.name === township)
-				      this.formData.streetId = id
-				      this.formData.street = name
-				      // 赋值GPS详细地址
-				      this.formData.address = data.name
-				    })
-				  })
-				})
-			},
-		}
-	};
+import { getWebsit } from '@/api/customerManagement'
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import ImageUpload from '@/components/file-upload'
+import { listPageV2, getWorker, getCategory, getGoods, getDetail } from '@/api/auxiliaryFittings/auxiliarySalesOrder'
+import { add, edit, getReturnDetail, getGoodsList } from '@/api/auxiliaryFittings/auxiliarySalesReturnOrder'
+import { storageListPageV2 } from '@/api/storage.js'
+export default {
+  components: { ImageUpload, geographicalPosi },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      dataList: [],
+      websitList: [],
+      workerList: [],
+      orderList: [],
+      goodsList: [],
+      mainList: [],
+      projectList: [],
+      warehouseList: [],
+      isPay: false,
+      payCodeUrl: '',
+      salesDetail: {},
+      formData: {
+        websit: {},
+        websitId: '',
+        websitName: '',
+        fileUrl: [],
+        salesId: '',
+        salesRetId: '',
+        retState: '',
+        createBy: '',
+        createTime: '',
+        confirmBy: '',
+        confirmTime: '',
+        worker: {},
+        workerName: '',
+        workerId: '',
+        identity: '',
+        workerMobile: '',
+        remark: '',
+        totalAmount: '',
+        salesType: '零售',
+        province: '',
+        provinceId: '',
+        city: '',
+        cityId: '',
+        area: '',
+        areaId: '',
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        orderEnginBaseId: '',
+        storage: null,
+        storageId: '',
+        storageName: ''
+      },
+      formData1: {
+        websit_id: '',
+        worker_name: '',
+        worker_mobile: '',
+        sales_id: '',
+        goods: {},
+        goodsName: '',
+        goodsSpecification: ''
+      },
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      isEdit: 0,
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        websitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
+        worker: [{ required: true, message: '请选择师傅', trigger: 'change' }],
+        identity: [
+          { required: true, message: '请输入师傅身份证', trigger: 'blur' },
+          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+        ],
+        workerMobile: [
+          { required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ]
+      },
+      isShowNo: false,
+      pageNum: 1,
+      pageSize: 10,
+      listTotal: 0
+    }
+  },
+  computed: {},
+  created() {
+    if (this.id) {
+      this.getReturnDetail()
+    }
+    this.getWebsit()
+    this.getinitlbslist()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail(salesId) {
+      const that = this
+      getDetail({ salesId }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getCategory(res.data.websitId)
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.items) {
+          item.parentCategory = {
+            categoryId: item.parentCategoryId,
+            categoryName: item.parentCategoryName,
+            items: [{ categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }]
+          }
+          item.goodsCategory = { categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }
+          var ress = await that.getGoods(item.goodsCategoryId, item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          ;(item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []), (item.retQty = 1)
+        }
+        this.dataList = res.data.items
+      })
+    },
+    async getReturnDetail() {
+      const that = this
+      getReturnDetail({ id: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          websit: { websitId: res.data.websitId, name: res.data.websitName },
+          worker: { nickName: res.data.workerName, userId: res.data.workerId },
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          storage: {
+            storageId: res.data.storageId
+          }
+        })
+        this.getWorker()
+        this.getCategory(res.data.websitId)
+        this.getWarehouseList(res.data.websitId)
+        for (var item of res.data.websitSalesRetItems) {
+          item.parentCategory = {
+            categoryId: item.parentCategoryId,
+            categoryName: item.parentCategoryName,
+            items: [{ categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }]
+          }
+          item.goodsCategory = { categoryId: item.goodsCategoryId, categoryName: item.goodsCategoryName }
+          var ress = await that.getGoods(item.goodsCategoryId, item.goodsName, 1)
+          item.goods = { ...ress.data, oldPrice: ress.data.price }
+          item.goodsList = ress.data ? [{ ...ress.data, oldPrice: ress.data.price }] : []
+        }
+        this.dataList = res.data.websitSalesRetItems
+      })
+    },
+    getWebsit() {
+      getWebsit({ type: 'C' }).then(res => {
+        this.websitList = res.data
+      })
+    },
+    getWarehouseList(websitId) {
+      if (!websitId) {
+        return (this.warehouseList = [])
+      }
+      storageListPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.type', compare: 'like', value: '配件' },
+          { param: 'a.status', compare: '=', value: 'true' },
+          { param: 'a.websit_id', compare: '=', value: websitId }
+        ]
+      }).then(res => {
+        this.warehouseList = res.data.records
+      })
+    },
+    close() {
+      this.$refs.formData1.resetFields()
+    },
+    confirmOrder() {
+      this.isShowNo = false
+      this.getDetail(this.selectedRow.salesId)
+    },
+    getOrderList() {
+      listPageV2({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        params: [
+          { param: 'a.sales_id', compare: '=', value: this.formData1.sales_id },
+          { param: 'a.flag', compare: '=', value: 'PAY_TAKE' },
+          { param: 'a.goods_type', compare: '=', value: 'M' },
+          { param: 'a.websit_id', compare: '=', value: this.formData1.websit_id },
+          { param: 'a.worker_name', compare: '=', value: this.formData1.worker_name },
+          { param: 'a.worker_mobile', compare: '=', value: this.formData1.worker_mobile }
+        ],
+        goodsName: this.formData1.goods.goodsName,
+        goodsSpecification: this.formData1.goods.goodsSpecification,
+        isFilter: true
+      }).then(res => {
+        this.orderList = res.data.records
+        this.listTotal = res.data.total
+      })
+    },
+    getGoodsList() {
+      getGoodsList({
+        type: 'M',
+        websitId: this.formData1.websit_id
+      }).then(res => {
+        this.goodsList = res.data
+      })
+    },
+    handleSelectionChange(selection, row) {
+      this.$refs.treeTable.clearSelection() // 这里因为需求做的是必选一个,如有其他需求可做调整
+      this.$refs.treeTable.toggleRowSelection(row, true)
+      this.selectedRow = row
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.pageNum = val
+      this.getOrderList()
+    },
+    // 提交筛选表单
+    submitScreenForm() {
+      this.pageNum = 1
+      this.getOrderList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.formData1.resetFields()
+      this.pageNum = 1
+      this.getOrderList()
+    },
+    changeWebsit(e) {
+      this.getWorker()
+      this.getGoodsList()
+      this.formData1.goods = {}
+      // this.getCategory(e.websitId)
+    },
+    getCategory(websitId) {
+      getCategory({ websitId }).then(res => {
+        this.mainList = res.data
+      })
+    },
+    async getGoods(categoryId, goodsName, type) {
+      const that = this
+      if (type == 1) {
+        return new Promise((resolve, reject) => {
+          getGoods({
+            websitId: this.formData.websitId,
+            categoryId: categoryId,
+            type: 'M',
+            goodsName: goodsName,
+            orderEnginBaseId: this.formData.orderEnginBaseId,
+            saleType: this.formData.salesType,
+            storageId: this.formData.storageId
+          }).then(res => {
+            resolve({
+              data: res.data[0]
+            })
+          })
+        })
+      } else {
+        getGoods({
+          websitId: this.formData.websitId,
+          categoryId: categoryId,
+          type: 'M',
+          orderEnginBaseId: this.formData.orderEnginBaseId,
+          saleType: this.formData.salesType,
+          storageId: this.formData.storageId
+        }).then(res => {
+          that.dataList[that.isEdit].goodsList = res.data
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData1.websit_id }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    changeWorker(e) {
+      this.formData.identity = e.idCard
+      this.formData.workerMobile = e.mobile
+      this.formData.workerId = e.userId
+      this.formData.workerName = e.nickName
+    },
+    workerBlur(e) {
+      this.formData.worker = e.target.value
+      this.$forceUpdate()
+    },
+    changeMain(e) {
+      ;(this.dataList[this.isEdit].goodsList = []),
+        (this.dataList[this.isEdit].parentCategory = e),
+        (this.dataList[this.isEdit].parentCategoryId = e.categoryId),
+        (this.dataList[this.isEdit].parentCategoryName = e.categoryName),
+        (this.dataList[this.isEdit].goodsCategory = {}),
+        (this.dataList[this.isEdit].goodsCategoryName = ''),
+        (this.dataList[this.isEdit].goodsCategoryId = ''),
+        (this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].price = ''),
+        (this.dataList[this.isEdit].saleAmount = ''),
+        (this.dataList[this.isEdit].retQty = '')
+      ;(this.dataList[this.isEdit].qty = ''), (this.dataList[this.isEdit].goodsType = 'M')
+    },
+    async changeSmall(e) {
+      ;(this.dataList[this.isEdit].goods = {}),
+        (this.dataList[this.isEdit].goodsId = ''),
+        (this.dataList[this.isEdit].goodsName = ''),
+        (this.dataList[this.isEdit].goodsSalesUnit = ''),
+        (this.dataList[this.isEdit].goodsSpecification = ''),
+        (this.dataList[this.isEdit].goodsCode = ''),
+        (this.dataList[this.isEdit].price = ''),
+        (this.dataList[this.isEdit].saleAmount = ''),
+        (this.dataList[this.isEdit].retQty = '')
+      ;(this.dataList[this.isEdit].qty = ''), (this.dataList[this.isEdit].goodsCategoryId = e.categoryId)
+      this.dataList[this.isEdit].goodsCategoryName = e.categoryName
+      getGoods({
+        websitId: this.formData.websitId,
+        categoryId: e.categoryId,
+        type: 'M',
+        orderEnginBaseId: this.formData.orderEnginBaseId,
+        saleType: this.formData.salesType
+      }).then(res => {
+        this.dataList[this.isEdit].goodsList = res.data
+      })
+    },
+    changeGoods(e) {
+      console.log(e)
+      this.dataList[this.isEdit].goodsId = e.goodsId
+      this.dataList[this.isEdit].goodsName = e.goodsName
+      this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+      this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
+      this.dataList[this.isEdit].price = e.price
+      this.dataList[this.isEdit].goodsCode = e.goodsCode
+      this.dataList[this.isEdit].qty = e.qty
+      this.dataList[this.isEdit].itemSourceType = e.itemSourceType
+      this.dataList[this.isEdit].itemSourceId = e.itemSourceId
+      this.dataList[this.isEdit].normType = e.normType
+    },
+    add() {
+      if (this.dataList.length != 0) {
+        this.isEdit += 1
+      }
+      this.dataList.push({
+        goodsList: [],
+        parentCategory: {},
+        parentCategoryId: '',
+        parentCategoryName: '',
+        goodsCategory: {},
+        goodsCategoryName: '',
+        goodsCategoryId: '',
+        goods: {},
+        goodsId: '',
+        goodsName: '',
+        goodsSalesUnit: '',
+        goodsSpecification: '',
+        goodsCode: '',
+        price: '',
+        saleAmount: '',
+        retQty: 1,
+        qty: '',
+        goodsType: 'M',
+        itemSourceType: '',
+        itemSourceId: '',
+        normType: ''
+      })
+    },
+    confirm() {
+      const that = this
+      this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        edit({
+          retState: 'OK',
+          salesRetId: this.formData.salesRetId
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('确认提货成功!')
+            that.goBack()
+          }
+        })
+      })
+    },
+    save() {
+      const that = this
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            add({
+              salesId: this.formData.salesId,
+              goodsType: 'M',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitSalesRetItems: this.dataList,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                that.goBack()
+              }
+            })
+          } else if (this.formType == 1) {
+            edit({
+              salesId: this.formData.salesId,
+              salesRetId: this.formData.salesRetId,
+              goodsType: 'M',
+              remark: this.formData.remark,
+              websitId: this.formData.websitId,
+              websitName: this.formData.websitName,
+              workerName: this.formData.workerName,
+              workerId: this.formData.workerId,
+              identity: this.formData.identity,
+              workerMobile: this.formData.workerMobile,
+              websitSalesRetItems: this.dataList,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(','),
+              storageId: this.formData.storageId,
+              storageName: this.formData.storageName
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                that.goBack()
+              }
+            })
+          }
+        }
+      })
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-	::v-deep .el-table__body-wrapper{
-		max-height: 300px !important;
-		overflow-y: auto !important;
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+::v-deep .el-table__body-wrapper {
+  max-height: 300px !important;
+  overflow-y: auto !important;
+}
+</style>

+ 350 - 299
src/views/auxiliaryFittings/supplier/index.vue

@@ -1,25 +1,43 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList" :operationColumnWidth="80">
-			</template-page>
-			<div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				  <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				    <zj-form-module title="" label-width="100px" :showPackUp="false"
-				      :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
-				    </zj-form-module>
-				  </zj-form-container>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+            <zj-form-module
+              title=""
+              label-width="100px"
+              :showPackUp="false"
+              :form-data="formData"
+              :form-items="formItems"
+              :disabled="formDialogType == 2"
+            >
+            </zj-form-module>
+          </zj-form-container>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -27,7 +45,7 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit } from "@/api/auxiliaryFittings/supplier";
+import { listPageV2, pageExport, getDetail, add, edit } from '@/api/auxiliaryFittings/supplier'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
@@ -47,7 +65,7 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增", "编辑", "详情"],
+      formDialogTitles: ['新增', '编辑', '详情'],
       formDialog: false,
       formData: {
         companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -69,10 +87,10 @@ export default {
         status: 'ON',
         venderType: 'M',
         imageUrl: [],
-		checkList: []
+        checkList: []
       },
-		formType: 'add',
-		formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   computed: {
@@ -81,11 +99,11 @@ export default {
       return [
         [
           [
-            this.optionsEvensAuth("add", {
-								click: () => {
-									this.openForm('add')
-								}
-            }),
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
           ]
         ]
       ]
@@ -95,226 +113,248 @@ export default {
       return []
     },
     formItems() {
-      return [{
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: [...required]
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: [...required]
+          }
         },
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '状态',
-          prop: 'status',
-          rules: [...required]
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.status}>
+                <el-radio disabled={this.formDialogType == 2} label="ON">
+                  启用
+                </el-radio>
+                <el-radio disabled={this.formDialogType == 2} label="OFF">
+                  禁用
+                </el-radio>
+              </el-radio-group>
+            )
+          }
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          return (
-            <el-radio-group v-model={this.formData.status}>
-              <el-radio disabled={this.formDialogType == 2} label="ON">启用</el-radio>
-              <el-radio disabled={this.formDialogType == 2} label="OFF">禁用</el-radio>
-            </el-radio-group>
-          )
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入供应商名称', },
-        formItemAttributes: {
-          label: '供应商名称',
-          prop: 'venderName',
-          rules: [...required]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入联系人' },
-        formItemAttributes: {
-          label: '联系人',
-          prop: 'linkName',
-          rules: [...required]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入联系电话', maxlength: 11 },
-        formItemAttributes: {
-          label: '联系电话',
-          prop: 'linkTel',
-          rules: [...required, ...mobile]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '供应类型',
-          prop: 'venderType',
-          rules: [...required]
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入供应商名称' },
+          formItemAttributes: {
+            label: '供应商名称',
+            prop: 'venderName',
+            rules: [...required]
+          }
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          return (
-            // <el-radio-group v-model={this.formData.venderType}>
-            //   <el-radio disabled={this.formDialogType == 2} label="M">辅材</el-radio>
-            //   <el-radio disabled={this.formDialogType == 2} label="P">配件</el-radio>
-            //   <el-radio disabled={this.formDialogType == 2} label="A">辅材和配件</el-radio>
-            // </el-radio-group>
-			<el-checkbox-group v-model={this.formData.checkList}>
-			    <el-checkbox disabled={this.formDialogType == 2} label="辅材"></el-checkbox>
-			    <el-checkbox disabled={this.formDialogType == 2} label="配件"></el-checkbox>
-			    <el-checkbox disabled={this.formDialogType == 2} label="商品"></el-checkbox>
-			</el-checkbox-group>
-          )
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入地址' },
-        formItemAttributes: {
-          label: '地址',
-          prop: 'address',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入邮编' },
-        formItemAttributes: {
-          label: '邮编',
-          prop: 'zipNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入网址' },
-        formItemAttributes: {
-          label: '网址',
-          prop: 'www',
-          rules: [...httpUrl]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入电子邮箱' },
-        formItemAttributes: {
-          label: '电子邮箱',
-          prop: 'email',
-          rules: [...email]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入固定电话' },
-        formItemAttributes: {
-          label: '固定电话',
-          prop: 'telNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入传真' },
-        formItemAttributes: {
-          label: '传真',
-          prop: 'faxNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入法人名称' },
-        formItemAttributes: {
-          label: '法人',
-          prop: 'corporation',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入营业执照号' },
-        formItemAttributes: {
-          label: '营业执照号',
-          prop: 'licenseId',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入开户银行' },
-        formItemAttributes: {
-          label: '开户银行',
-          prop: 'khBank',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入开户行号' },
-        formItemAttributes: {
-          label: '开户行号',
-          prop: 'bankRow',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入银行账号' },
-        formItemAttributes: {
-          label: '银行账号',
-          prop: 'accNo',
-          rules: []
-        }
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'slot-component',
-        formItemAttributes: {
-          label: '营业执照',
-          prop: 'imageUrl',
-          rules: []
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入联系人' },
+          formItemAttributes: {
+            label: '联系人',
+            prop: 'linkName',
+            rules: [...required]
+          }
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          return (
-            <ImageUpload fileList={this.formData.imageUrl} limit={1} isEdit={this.formDialogType !== 2} />
-          )
-        }
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'remark',
-          rules: []
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入联系电话', maxlength: 11 },
+          formItemAttributes: {
+            label: '联系电话',
+            prop: 'linkTel',
+            rules: [...required, ...mobile]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '供应类型',
+            prop: 'venderType',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              // <el-radio-group v-model={this.formData.venderType}>
+              //   <el-radio disabled={this.formDialogType == 2} label="M">辅材</el-radio>
+              //   <el-radio disabled={this.formDialogType == 2} label="P">配件</el-radio>
+              //   <el-radio disabled={this.formDialogType == 2} label="A">辅材和配件</el-radio>
+              // </el-radio-group>
+              <el-checkbox-group v-model={this.formData.checkList}>
+                <el-checkbox disabled={this.formDialogType == 2} label="辅材"></el-checkbox>
+                <el-checkbox disabled={this.formDialogType == 2} label="配件"></el-checkbox>
+                <el-checkbox disabled={this.formDialogType == 2} label="商品"></el-checkbox>
+              </el-checkbox-group>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入地址' },
+          formItemAttributes: {
+            label: '地址',
+            prop: 'address',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入邮编' },
+          formItemAttributes: {
+            label: '邮编',
+            prop: 'zipNo',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入网址' },
+          formItemAttributes: {
+            label: '网址',
+            prop: 'www',
+            rules: [...httpUrl]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入电子邮箱' },
+          formItemAttributes: {
+            label: '电子邮箱',
+            prop: 'email',
+            rules: [...email]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入固定电话' },
+          formItemAttributes: {
+            label: '固定电话',
+            prop: 'telNo',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入传真' },
+          formItemAttributes: {
+            label: '传真',
+            prop: 'faxNo',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入法人名称' },
+          formItemAttributes: {
+            label: '法人',
+            prop: 'corporation',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入营业执照号' },
+          formItemAttributes: {
+            label: '营业执照号',
+            prop: 'licenseId',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入开户银行' },
+          formItemAttributes: {
+            label: '开户银行',
+            prop: 'khBank',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入开户行号' },
+          formItemAttributes: {
+            label: '开户行号',
+            prop: 'bankRow',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入银行账号' },
+          formItemAttributes: {
+            label: '银行账号',
+            prop: 'accNo',
+            rules: []
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '营业执照',
+            prop: 'imageUrl',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return <ImageUpload fileList={this.formData.imageUrl} limit={1} isEdit={this.formDialogType !== 2} />
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入备注内容', type: 'textarea', rows: 5 },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
         }
-      }]
+      ]
     }
   },
   methods: {
@@ -323,7 +363,7 @@ export default {
       try {
         var pam = JSON.parse(JSON.stringify(p))
         if (this.examineStatus) {
-          pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
+          pam.params.push({ param: 'b.examine_status', compare: '=', value: this.examineStatus })
         }
         return listPageV2(pam)
       } catch (error) {
@@ -338,7 +378,18 @@ export default {
         defaultData.render = (h, { row, index, column }) => {
           return (
             <div style="padding:0 6px;cursor: pointer;">
-              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
             </div>
           )
         }
@@ -354,14 +405,14 @@ export default {
       return this.operationBtn({
         detail: {
           click: ({ row, index, column }) => {
-            this.openForm('detail',row.venderId)
+            this.openForm('detail', row.venderId)
           }
         },
         edit: {
           click: ({ row, index, column }) => {
-            this.openForm('edit',row.venderId)
+            this.openForm('edit', row.venderId)
           }
-        },
+        }
       })
     },
 
@@ -373,58 +424,58 @@ export default {
     },
     // 打开 新增编辑 网点表单
     openForm(type, id) {
-    	this.$refs.tabPage.addTab({
-    		// 对应显示的模块
-    		activeKey: type,
-    		// 唯一标识
-    		key: type,
-    		// 页签名称
-    		label: ({ edit: "编辑", add: "新增", detail: "查看" })[type],
-    		// 打开时事件
-    		triggerEvent: () => {
-    			this.formCancel()
-    			this.$nextTick(()=>{
-    				this.formType = type
-    				this.formVisible = true
-    				if (type == 'add') {
-    					this.formDialogType = 0
-    				} else if(type == 'edit'){
-    					this.formDialogType = 1
-    					getDetail({ id }).then(res => {
-    					  Object.assign(this.formData, res.data, {
-    					    imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : [],
-							checkList: res.data.venderType.split(',')
-    					  })
-    					})
-    				}else{
-    					this.formDialogType = 2
-    					getDetail({ id }).then(res => {
-    					  Object.assign(this.formData, res.data, {
-    					    imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : [],
-							checkList: res.data.venderType.split(',')
-    					  })
-    					})
-    				}
-    			})
-    		},
-    		// 关闭时事件
-    		closeEvent: () => {
-    		
-    		}
-    	})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增', detail: '查看' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              getDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(',').map(item => ({ url: item })) : [],
+                  checkList: res.data.venderType.split(',')
+                })
+              })
+            } else {
+              this.formDialogType = 2
+              getDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(',').map(item => ({ url: item })) : [],
+                  checkList: res.data.venderType.split(',')
+                })
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
     },
     formConfirm(cancel) {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          ([add, edit][this.formDialogType])({
-            ...this.formData,
-			venderType: this.formData.checkList.join(','),
-            imageUrl: this.formData.imageUrl.map(item => item.url).join(",")
-          }).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-            cancel('list')
-            this.$refs.pageRef.refreshList()
-          })
+          ;[add, edit]
+            [this.formDialogType]({
+              ...this.formData,
+              venderType: this.formData.checkList.join(','),
+              imageUrl: this.formData.imageUrl.map(item => item.url).join(',')
+            })
+            .then(res => {
+              this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+              cancel('list')
+              this.$refs.pageRef.refreshList()
+            })
         }
       })
     }

+ 187 - 151
src/views/engineerFeeSettlement/monthlyPayrollSummary/index.vue

@@ -1,11 +1,17 @@
 <template>
-  <template-page v-if="showTable" ref="pageRef" :get-list="[getList, getList1, getList2][pageLevel]"
+  <template-page
+    v-if="showTable"
+    ref="pageRef"
+    :get-list="[getList, getList1, getList2][pageLevel]"
     :exportList="[undefined, exportList1, exportList2][pageLevel]"
     :options-evens-group="[optionsEvensGroup0, optionsEvensGroup1, optionsEvensGroup2][pageLevel]"
     :column-parsing="[columnParsing, columnParsing1, columnParsing2][pageLevel]"
-    :operation="([operation0, operation1, operation2][pageLevel])()"
-    :expCode="['', 'workerExp', 'detailExp'][pageLevel]" :table-attributes="tableAttributes" :table-events="tableEvents"
-    :moreParameters="moreParameters">
+    :operation="[operation0, operation1, operation2][pageLevel]()"
+    :expCode="['', 'workerExp', 'detailExp'][pageLevel]"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :moreParameters="moreParameters"
+  >
     <div slot="moreSearch" v-if="pageLevel == 0">
       <el-radio-group v-model="tagStatus" size="mini" @change="changeType">
         <el-radio-button label="">全部</el-radio-button>
@@ -13,7 +19,7 @@
         <el-radio-button label="PART">部分发放</el-radio-button>
         <el-radio-button label="END">已发放</el-radio-button>
       </el-radio-group>
-      <br><br>
+      <br /><br />
     </div>
     <div class="cartographer_big">
       <el-dialog title="发放" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
@@ -50,8 +56,8 @@ import {
   settleMonthWagesBatchReject,
   settleMonthWagesBatchSend,
   settleMonthWagesWorkerBatchSend
-} from "@/api/costPerDimension";
-import { tableDataParsing } from "@/utils/common.js"
+} from '@/api/costPerDimension'
+import { tableDataParsing } from '@/utils/common.js'
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin, operation_mixin],
@@ -74,14 +80,14 @@ export default {
       monthItem: {},
       workerItem: {},
       formData: {
-        sendDate: "",
+        sendDate: '',
         fileUrl: [],
-        remark: ""
+        remark: ''
       },
       formBool: false,
       evaluationColumns: [],
       evaluationData: [],
-      tagStatus: this?.pageCode || ""
+      tagStatus: this?.pageCode || ''
     }
   },
   computed: {
@@ -89,7 +95,7 @@ export default {
       return [
         [
           [
-            this.optionsEvensAuth("monthBatchRelease", {
+            this.optionsEvensAuth('monthBatchRelease', {
               click: () => {
                 if (this.recordSelected.length === 0) {
                   this.$message.warning('请勾选工单')
@@ -101,7 +107,7 @@ export default {
             })
           ],
           [
-            this.optionsEvensAuth("monthBatchRejection", {
+            this.optionsEvensAuth('monthBatchRejection', {
               click: () => {
                 if (this.recordSelected.length === 0) {
                   this.$message.warning('请勾选工单')
@@ -111,20 +117,20 @@ export default {
                   confirmButtonText: '确定',
                   cancelButtonText: '取消',
                   type: 'warning'
-                }).then(() => {
-                  settleMonthWagesBatchReject(this.recordSelected.map(item => item.id)).then(res => {
-                    this.$message({
-                      type: 'success',
-                      message: '操作成功!'
+                })
+                  .then(() => {
+                    settleMonthWagesBatchReject(this.recordSelected.map(item => item.id)).then(res => {
+                      this.$message({
+                        type: 'success',
+                        message: '操作成功!'
+                      })
+                      this.$refs?.pageRef?.refreshList()
                     })
-                    this.$refs?.pageRef?.refreshList()
                   })
-                }).catch(() => {
-
-                });
+                  .catch(() => {})
               }
             })
-          ],
+          ]
         ]
       ]
     },
@@ -133,16 +139,16 @@ export default {
         [
           [
             {
-              name: "返回月度汇总页面",
+              name: '返回月度汇总页面',
               click: () => {
                 this.pageLevel = 0
               }
             }
-          ],
+          ]
         ],
         [
           [
-            this.optionsEvensAuth("workerBatchRelease", {
+            this.optionsEvensAuth('workerBatchRelease', {
               click: () => {
                 if (this.recordSelected.length === 0) {
                   this.$message.warning('请勾选工单')
@@ -152,7 +158,7 @@ export default {
                 this.formBool = true
               }
             })
-          ],
+          ]
         ]
       ]
     },
@@ -161,13 +167,13 @@ export default {
         [
           [
             {
-              name: "返回师傅汇总页面",
+              name: '返回师傅汇总页面',
               click: () => {
                 this.pageLevel = 1
               }
             }
-          ],
-        ],
+          ]
+        ]
       ]
     },
     // 更多参数
@@ -175,91 +181,108 @@ export default {
       return []
     },
     formItems() {
-      return [{
-        name: 'el-date-picker',
-        md: 6,
-        attributes: {
-          type: "date",
-          'value-format': 'yyyy-MM-dd HH:mm:ss',
+      return [
+        {
+          name: 'el-date-picker',
+          md: 6,
+          attributes: {
+            type: 'date',
+            'value-format': 'yyyy-MM-dd HH:mm:ss'
+          },
+          formItemAttributes: {
+            label: '发放日期',
+            prop: 'sendDate',
+            rules: [...required]
+          }
         },
-        formItemAttributes: {
-          label: '发放日期',
-          prop: 'sendDate',
-          rules: [...required]
-        }
-      }, {
-        md: 24,
-        name: 'slot-component',
-        formItemAttributes: {
-          label: '发放凭证',
-          prop: 'fileUrl',
-          rules: []
+        {
+          md: 24,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '发放凭证',
+            prop: 'fileUrl',
+            rules: []
+          },
+          attributes: {},
+          render: (h, { props, onInput }) => {
+            return <ImageUpload fileList={this.formData.fileUrl} limit={1} fileType={['image']} />
+          }
         },
-        attributes: {},
-        render: (h, { props, onInput }) => {
-          return (
-            <ImageUpload fileList={this.formData.fileUrl} limit={1} fileType={["image"]} />
-          )
-        }
-      }, {
-        name: 'el-input',
-        md: 24,
-        attributes: {},
-        formItemAttributes: {
-          label: '备注',
-          prop: 'remark',
-          rules: []
-        }
-      }, {
-        md: 24,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '',
-          'label-width': '0px',
-          prop: '',
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {},
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
         },
-        render: (h, { props, onInput }) => {
-          return <hr />
-        }
-      }, {
-        md: 6,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '结算金额合计',
-          prop: '',
+        {
+          md: 24,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: ''
+          },
+          render: (h, { props, onInput }) => {
+            return <hr />
+          }
         },
-        render: (h, { props, onInput }) => {
-          return <div>{this.evaluationData.map(item => Number(item.settleAmount)).reduce((accumulator, currentValue) => accumulator + currentValue, 0)}</div>
-        }
-      }, {
-        md: 6,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '发放人数',
-          prop: '',
+        {
+          md: 6,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '结算金额合计',
+            prop: ''
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <div>
+                {this.evaluationData
+                  .map(item => Number(item.settleAmount))
+                  .reduce((accumulator, currentValue) => accumulator + currentValue, 0)}
+              </div>
+            )
+          }
         },
-        render: (h, { props, onInput }) => {
-          return <div>{this.pageLevel ? this.evaluationData.length : this.evaluationData.map(item => Number(item.settleByCount)).reduce((accumulator, currentValue) => accumulator + currentValue, 0)}</div>
-        }
-      }, {
-        md: 24,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '',
-          'label-width': '0px',
-          prop: '',
+        {
+          md: 6,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '发放人数',
+            prop: ''
+          },
+          render: (h, { props, onInput }) => {
+            return (
+              <div>
+                {this.pageLevel
+                  ? this.evaluationData.length
+                  : this.evaluationData
+                      .map(item => Number(item.settleByCount))
+                      .reduce((accumulator, currentValue) => accumulator + currentValue, 0)}
+              </div>
+            )
+          }
         },
-        render: (h, { props, onInput }) => {
-          return <zj-table
-            columns={this.evaluationColumns}
-            table-data={this.evaluationData}
-          />
+        {
+          md: 24,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: ''
+          },
+          render: (h, { props, onInput }) => {
+            return <zj-table columns={this.evaluationColumns} table-data={this.evaluationData} />
+          }
         }
-      }]
+      ]
     }
   },
   watch: {
@@ -283,44 +306,41 @@ export default {
       var pam = JSON.parse(JSON.stringify(p))
       try {
         if (this.tagStatus) {
-          pam.params.push({ "param": "a.status", "compare": "=", "value": this.tagStatus })
+          pam.params.push({ param: 'a.status', compare: '=', value: this.tagStatus })
         }
         cb && cb(pam)
         return settleMonthWagesGatherList(pam)
-      } catch (err) {
-      }
+      } catch (err) {}
     },
     getList1(p, cb) {
       var pam = JSON.parse(JSON.stringify(p))
       try {
-        pam.params.push({ "param": "a.settle_month_wages_id", "compare": "=", "value": this.monthItem.id })
+        pam.params.push({ param: 'a.settle_month_wages_id', compare: '=', value: this.monthItem.id })
         cb && cb(pam)
         return settleMonthWagesList(pam)
-      } catch (err) {
-      }
+      } catch (err) {}
     },
     exportList1: settleMonthWagesListExport,
     getList2(p, cb) {
       var pam = JSON.parse(JSON.stringify(p))
       try {
         pam.params.push(
-          { "param": "a.settle_month_wages_id", "compare": "=", "value": this.monthItem.id },
-          { "param": "month_settle_worker_id", "compare": "=", "value": this.workerItem.workerName}
+          { param: 'a.settle_month_wages_id', compare: '=', value: this.monthItem.id },
+          { param: 'month_settle_worker_id', compare: '=', value: this.workerItem.workerName }
         )
         cb && cb(pam)
         return settleExpenseList(pam)
-      } catch (err) {
-      }
+      } catch (err) {}
     },
     exportList2: settleExpenseListExport,
     selectable(row, index) {
-      return !["END"].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
+      return !['END'].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
     },
     operation0() {
       return this.operationBtn({
         monthRelease: {
           conditions: ({ row, index, column }) => {
-            return row.status != "END"
+            return row.status != 'END'
           },
           click: ({ row, index, column }) => {
             this.recordSelected = [{ ...row }]
@@ -329,9 +349,9 @@ export default {
           }
         },
         monthRejection: {
-          prompt: "是否确定驳回?",
+          prompt: '是否确定驳回?',
           conditions: ({ row, index, column }) => {
-            return row.status == "NOT"
+            return row.status == 'NOT'
           },
           click: ({ row, index, column }) => {
             settleMonthWagesBatchReject([row.id]).then(res => {
@@ -355,7 +375,7 @@ export default {
       return this.operationBtn({
         workerRelease: {
           conditions: ({ row, index, column }) => {
-            return row.status != "END"
+            return row.status != 'END'
           },
           click: ({ row, index, column }) => {
             this.recordSelected = [{ ...row }]
@@ -368,7 +388,7 @@ export default {
             this.workerItem = row
             this.pageLevel = 2
           }
-        },
+        }
       })
     },
     operation2() {
@@ -385,10 +405,15 @@ export default {
             <div style="padding:0 6px;cursor: pointer;">
               {row.fileUrl
                 ? row.fileUrl
-                  .split(',')
-                  .map(url => (
-                    <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />
-                  ))
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
                 : null}
             </div>
           )
@@ -414,36 +439,47 @@ export default {
     formConfirm() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          ; ([settleMonthWagesBatchSend, settleMonthWagesWorkerBatchSend][this.pageLevel])({
-            ...this.formData,
-            fileUrl: this.formData.fileUrl.length ? this.formData.fileUrl[0]?.url : "",
-            ids: this.recordSelected.map(item => item.id),
-            settleMonthWagesId: this.monthItem.id || undefined
-          }).then(res => {
-            this.$message({
-              type: 'success',
-              message: '发放成功!'
+          ;[settleMonthWagesBatchSend, settleMonthWagesWorkerBatchSend]
+            [this.pageLevel]({
+              ...this.formData,
+              fileUrl: this.formData.fileUrl.length ? this.formData.fileUrl[0]?.url : '',
+              ids: this.recordSelected.map(item => item.id),
+              settleMonthWagesId: this.monthItem.id || undefined
+            })
+            .then(res => {
+              this.$message({
+                type: 'success',
+                message: '发放成功!'
+              })
+              this.handleClose()
             })
-            this.handleClose()
-          })
         }
       })
     },
     getTableJieGou() {
-      ; (([settleMonthWagesGatherList, settleMonthWagesList])[this.pageLevel])({ "pageNum": 1, "pageSize": 1, "params": [] }).then(res => {
-        this.evaluationColumns = tableDataParsing(res.fieldBeans.filter(item => !~(([["aaa"], ["id", "settleMonthWagesId", "settleMonthWagesDetailId", "workerId"]])[this.pageLevel]).indexOf(item.jname))).map(item => {
-          return item
-        })
-        this.$nextTick(() => {
-          this.evaluationData = this.recordSelected.map(item => {
-            Object.keys(item).map(key => {
-              var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || "{}")[item[key]];
-              if (val) item[key] = val;
-            })
+      ;[settleMonthWagesGatherList, settleMonthWagesList]
+        [this.pageLevel]({ pageNum: 1, pageSize: 1, params: [] })
+        .then(res => {
+          this.evaluationColumns = tableDataParsing(
+            res.fieldBeans.filter(
+              item =>
+                !~[['aaa'], ['id', 'settleMonthWagesId', 'settleMonthWagesDetailId', 'workerId']][
+                  this.pageLevel
+                ].indexOf(item.jname)
+            )
+          ).map(item => {
             return item
           })
+          this.$nextTick(() => {
+            this.evaluationData = this.recordSelected.map(item => {
+              Object.keys(item).map(key => {
+                var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || '{}')[item[key]]
+                if (val) item[key] = val
+              })
+              return item
+            })
+          })
         })
-      })
     }
   }
 }
@@ -454,11 +490,11 @@ export default {
   box-sizing: border-box;
   padding-left: 16px;
 
-  ::v-deep &>.zj-page-fill-scroll {
+  ::v-deep & > .zj-page-fill-scroll {
     box-sizing: border-box;
     padding-right: 16px;
 
-    &>div:nth-child(1) {
+    & > div:nth-child(1) {
       margin-top: 20px;
     }
   }

+ 134 - 120
src/views/engineeringMaintenance/basicData/index.vue

@@ -1,14 +1,27 @@
 <template>
-	<div class="page">
-		<template-page v-if="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="150"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation()">
-		</template-page>
-		<div class="detail" v-else>
-			<detail :id="id" @back="backList" :formType="formDialogType" :title="'工程维保' + formDialogTitles[formDialogType]"></detail>
-		</div>
-	</div>	
-	
+  <div class="page">
+    <template-page
+      v-if="!formDialog"
+      ref="pageRef"
+      :get-list="getList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :operationColumnWidth="150"
+      :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters"
+      :column-parsing="columnParsing"
+      :operation="operation()"
+    >
+    </template-page>
+    <div class="detail" v-else>
+      <detail
+        :id="id"
+        @back="backList"
+        :formType="formDialogType"
+        :title="'工程维保' + formDialogTitles[formDialogType]"
+      ></detail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -18,7 +31,7 @@ import ImageUpload from '@/components/file-upload'
 import detail from './detail.vue'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, save } from "@/api/engineeringMaintenance/basicData";
+import { listPageV2, pageExport, getDetail, save } from '@/api/engineeringMaintenance/basicData'
 export default {
   components: { TemplatePage, ImageUpload, detail },
   mixins: [import_mixin, operation_mixin],
@@ -37,12 +50,10 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
+      formDialogTitles: ['新增', '编辑', '详情'],
       formDialog: false,
-      formData: {
-		
-      },
-	  id: ''
+      formData: {},
+      id: ''
     }
   },
   computed: {
@@ -50,64 +61,67 @@ export default {
     moreParameters() {
       return []
     },
-	// 事件组合
-	optionsEvensGroup() {
-		return [
-			[
-				[
-					this.optionsEvensAuth("add", {
-						click: () => {
-							this.addData()
-						}
-					})
-				],
-			]
-		]
-	},
-    formItems() {
-    }
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.addData()
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    formItems() {}
   },
   methods: {
     // 列表请求函数
-	getList: listPageV2,
+    getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$nextTick(()=>{
-			this.$refs.pageRef.refreshList()
-		})
-	},
+    backList() {
+      this.id = ''
+      this.formDialog = false
+      this.$nextTick(() => {
+        this.$refs.pageRef.refreshList()
+      })
+    },
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'serviceCode') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="cursor: pointer;display: flex">
-		              {row.serviceCode ? row.serviceCode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		 }
-		if (item.jname === 'startTime') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="cursor: pointer;display: flex">
-		              {row.startTime.substring(0,10)}
-		            </div>
-		          )
-		        }
-		 }
-		if (item.jname === 'endTime') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="cursor: pointer;display: flex">
-		              {row.endTime.substring(0,10)}
-		            </div>
-		          )
-		        }
-		 }
+      if (item.jname === 'serviceCode') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="cursor: pointer;display: flex">
+              {' '}
+              {row.serviceCode
+                ? row.serviceCode
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="cover"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}{' '}
+            </div>
+          )
+        }
+      }
+      if (item.jname === 'startTime') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <div style="cursor: pointer;display: flex">   {row.startTime.substring(0, 10)} </div>
+        }
+      }
+      if (item.jname === 'endTime') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <div style="cursor: pointer;display: flex">   {row.endTime.substring(0, 10)} </div>
+        }
+      }
       return defaultData
     },
     // 监听勾选变化
@@ -116,55 +130,55 @@ export default {
     },
     // 表格操作列
     operation() {
-		return this.operationBtn({
-			edit: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.id = row.id
-					this.formDialogType = 1
-					this.openForm()
-				}
-			},
-			detail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.id = row.id
-					this.formDialogType = 2
-					this.openForm()
-				}
-			},
-			// expenseApply: {
-			// 	btnType: 'text',
-			// 	click: ({ row, index, column }) => {
-			// 		this.$router.push({
-			// 			name: row.isAllFee=='YES'?"allInclusiveExpense":'applicationWithoutFee',
-			// 			query: {
-			// 				rpProjectRepairId:row.id
-			// 			}
-			// 		})
-			// 	}
-			// },
-			serviceOrderDetail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.$router.push({
-						name: 'workOrderPool',
-						params: {
-							pageName: row.id,
-							pageType: 'rpProjectRepairId',
-							pageCode: row.id,
-						},
-					})
-				}
-			}
-		})
+      return this.operationBtn({
+        edit: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.id = row.id
+            this.formDialogType = 1
+            this.openForm()
+          }
+        },
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.id = row.id
+            this.formDialogType = 2
+            this.openForm()
+          }
+        },
+        // expenseApply: {
+        // 	btnType: 'text',
+        // 	click: ({ row, index, column }) => {
+        // 		this.$router.push({
+        // 			name: row.isAllFee=='YES'?"allInclusiveExpense":'applicationWithoutFee',
+        // 			query: {
+        // 				rpProjectRepairId:row.id
+        // 			}
+        // 		})
+        // 	}
+        // },
+        serviceOrderDetail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.$router.push({
+              name: 'workOrderPool',
+              params: {
+                pageName: row.id,
+                pageType: 'rpProjectRepairId',
+                pageCode: row.id
+              }
+            })
+          }
+        }
+      })
     },
     addData() {
       this.formDialogType = 0
       this.openForm()
     },
     openForm() {
-      this.formDialog = true;
+      this.formDialog = true
     },
     formCancel() {
       this.$refs.formRef.$refs.inlineForm.clearValidate()
@@ -174,10 +188,10 @@ export default {
     formConfirm() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          (save)({
-			  ...this.formData,
-			  imgUrl:this.formData.imgUrl.map(item=>item.url).join(",")
-		  }).then(res => {
+          save({
+            ...this.formData,
+            imgUrl: this.formData.imgUrl.map(item => item.url).join(',')
+          }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             this.formCancel()
             this.$refs.pageRef.refreshList()
@@ -190,10 +204,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.page{
-		height: 100%;
-	}
+.tab {
+  padding: 20px 20px 0 20px;
+}
+.page {
+  height: 100%;
+}
 </style>

+ 66 - 31
src/views/login/index.vue

@@ -2,18 +2,29 @@
   <div class="login-container">
     <div class="flexBox">
       <div>
-        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on"
-          label-position="left" @submit.native.prevent="handleLogin">
+        <el-form
+          ref="loginForm"
+          :model="loginForm"
+          :rules="loginRules"
+          class="login-form"
+          auto-complete="on"
+          label-position="left"
+          @submit.native.prevent="handleLogin"
+        >
           <div class="flex">
             <div class="image-container">
               <div class="empty-height2 fiexlay">
-                <img v-if="companyList[0] && companyList[0].logo" class="logo" :src="companyList[0].logo"
-                  alt />
+                <img
+                  v-if="companyList[0] && companyList[0].logo"
+                  class="logo"
+                  :src="$showImgUrl(companyList[0].logo)"
+                  alt
+                />
                 {{ companyList[0] && companyList[0].sysName ? companyList[0].sysName : '' }}
               </div>
               <el-carousel :interval="5000" arrow="always" height="440px" class="carousel">
                 <el-carousel-item v-for="item in banner" :key="item.id">
-                  <el-image :z-index="1" :src="item.imgCarouselUrl" />
+                  <el-image :z-index="1" :src="$showImgUrl(item.imgCarouselUrl)" />
                 </el-carousel-item>
               </el-carousel>
             </div>
@@ -25,17 +36,31 @@
                   <span class="svg-container">
                     <svg-icon icon-class="user" />
                   </span>
-                  <el-input ref="username" v-model="loginForm.username" placeholder="请输入用户名" name="username" type="text"
-                    tabindex="1" auto-complete="on" />
+                  <el-input
+                    ref="username"
+                    v-model="loginForm.username"
+                    placeholder="请输入用户名"
+                    name="username"
+                    type="text"
+                    tabindex="1"
+                    auto-complete="on"
+                  />
                 </el-form-item>
 
                 <el-form-item prop="password">
                   <span class="svg-container">
                     <svg-icon icon-class="password" />
                   </span>
-                  <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
-                    placeholder="请输入密码" name="password" tabindex="2" auto-complete="off"
-                    />
+                  <el-input
+                    :key="passwordType"
+                    ref="password"
+                    v-model="loginForm.password"
+                    :type="passwordType"
+                    placeholder="请输入密码"
+                    name="password"
+                    tabindex="2"
+                    auto-complete="off"
+                  />
                   <span class="show-pwd" @click="showPwd">
                     <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
                   </span>
@@ -45,8 +70,15 @@
                   <span class="svg-container">
                     <svg-icon icon-class="password" />
                   </span>
-                  <el-input ref="codeValue" v-model="loginForm.codeValue" placeholder="请输入验证码" name="codeValue"
-                    type="text" tabindex="3" auto-complete="off" />
+                  <el-input
+                    ref="codeValue"
+                    v-model="loginForm.codeValue"
+                    placeholder="请输入验证码"
+                    name="codeValue"
+                    type="text"
+                    tabindex="3"
+                    auto-complete="off"
+                  />
                   <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt="" /></div>
                 </el-form-item>
 
@@ -71,26 +103,29 @@
             {{ companyList[0].pubSecurityRecord }}
           </el-link>
         </div>
-		<div class="info-item">
-			<el-link href="https://www.zfire.top/#/" :underline="false" target="_blank">
-				{{ companyList[0] && companyList[0].companyName ? companyList[0].companyName : '' }}
-			</el-link>
-		</div>
-		<div class="info-item">
-			<el-link href="https://mp.weixin.qq.com" :underline="false" target="_blank">
-			  微信公众号&小程序
-			</el-link>
-			<div style="margin: 0 20px">|</div>
-			<el-link href="https://pay.weixin.qq.com/" :underline="false" target="_blank">
-			  微信支付商户平台
-			</el-link>
-		</div>
+        <div class="info-item">
+          <el-link href="https://www.zfire.top/#/" :underline="false" target="_blank">
+            {{ companyList[0] && companyList[0].companyName ? companyList[0].companyName : '' }}
+          </el-link>
+        </div>
+        <div class="info-item">
+          <el-link href="https://mp.weixin.qq.com" :underline="false" target="_blank"> 微信公众号&小程序 </el-link>
+          <div style="margin: 0 20px">|</div>
+          <el-link href="https://pay.weixin.qq.com/" :underline="false" target="_blank"> 微信支付商户平台 </el-link>
+        </div>
         <div class="link_gs">
           <span v-if="dictList.length > 0" :underline="false" target="_blank">友链:</span>
-          <el-link style="margin-left: 10px" v-for="(v, i) in dictList" :key="i" :href="v.amityUrl" :underline="false"
-            target="_blank">
-            <el-image style="width: 14px; height: 16px" :src=" v.amityUrlLogo"></el-image>
-            {{ v.amityUrlName }}</el-link>
+          <el-link
+            style="margin-left: 10px"
+            v-for="(v, i) in dictList"
+            :key="i"
+            :href="v.amityUrl"
+            :underline="false"
+            target="_blank"
+          >
+            <el-image style="width: 14px; height: 16px" :src="$showImgUrl(v.amityUrlLogo)"></el-image>
+            {{ v.amityUrlName }}</el-link
+          >
         </div>
       </div>
     </div>
@@ -365,7 +400,7 @@ $back: #333;
     line-height: 40px;
   }
 
-  .el-checkbox__input.is-checked+.el-checkbox__label {
+  .el-checkbox__input.is-checked + .el-checkbox__label {
     color: #4684f4db;
   }
 

Різницю між файлами не показано, бо вона завелика
+ 546 - 395
src/views/mallManagement/activity/coupon_index/index.vue


+ 526 - 444
src/views/mallManagement/activity/groupbuy_add/index.vue

@@ -1,21 +1,22 @@
 <template>
   <div class="app-container">
-    <h3 style="margin-bottom: 30px">{{isEdit ? '编辑':'添加'}}团购活动</h3>
+    <h3 style="margin-bottom: 30px">{{ isEdit ? '编辑' : '添加' }}团购活动</h3>
 
     <div class="form-contaner">
       <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px">
         <el-form-item label="活动名称:" prop="name">
-          <el-input v-model="mainForm.name" placeholder="请填写活动名称" style="width: 400px;"></el-input>
+          <el-input v-model="mainForm.name" placeholder="请填写活动名称" style="width: 400px"></el-input>
         </el-form-item>
         <el-form-item label="活动时间:" prop="date">
           <el-date-picker
             v-model="mainForm.date"
             type="daterange"
             value-format="yyyy-MM-dd"
-            style="width: 400px;"
+            style="width: 400px"
             range-separator="至"
             start-placeholder="开始日期"
-            end-placeholder="结束日期">
+            end-placeholder="结束日期"
+          >
           </el-date-picker>
         </el-form-item>
         <el-upload
@@ -25,13 +26,20 @@
           :headers="myHeaders"
           :show-file-list="false"
           :on-success="uploadSuccess"
-          :before-upload="beforeUpload">
+          :before-upload="beforeUpload"
+        >
         </el-upload>
         <el-form-item label="活动图:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
-                <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
+              <div class="img" v-if="img1_url" @mouseover="img1_hover = true" @mouseout="img1_hover = false">
+                <el-image
+                  ref="img1"
+                  :src="$showImgUrl(img1_url)"
+                  :preview-src-list="[$showImgUrl(img1_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="img1_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
@@ -47,8 +55,14 @@
         <el-form-item label="海报图:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
-                <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
+              <div class="img" v-if="img2_url" @mouseover="img2_hover = true" @mouseout="img2_hover = false">
+                <el-image
+                  ref="img2"
+                  :src="$showImgUrl(img2_url)"
+                  :preview-src-list="[$showImgUrl(img2_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="img2_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
@@ -68,7 +82,13 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="备注:" prop="remark">
-          <el-input type="textarea" v-model="mainForm.remark" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请填写备注" style="width: 400px;"></el-input>
+          <el-input
+            type="textarea"
+            v-model="mainForm.remark"
+            :autosize="{ minRows: 4, maxRows: 8 }"
+            placeholder="请填写备注"
+            style="width: 400px"
+          ></el-input>
         </el-form-item>
       </el-form>
     </div>
@@ -79,10 +99,23 @@
       </div>
 
       <div class="table">
-        <el-table :data="memberList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="300px">
+        <el-table
+          :data="memberList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          max-height="300px"
+        >
           <el-table-column align="center" label="头像" prop="avatar">
             <template slot-scope="scope">
-              <el-image style="width: 40px; height: 40px; border-radius: 50%;" :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]" fit="cover"></el-image>
+              <el-image
+                style="width: 40px; height: 40px; border-radius: 50%"
+                :src="$showImgUrl(scope.row.avatar)"
+                :preview-src-list="[$showImgUrl(scope.row.avatar)]"
+                fit="cover"
+              ></el-image>
             </template>
           </el-table-column>
           <el-table-column align="center" label="团长名称" prop="nickName"></el-table-column>
@@ -90,7 +123,7 @@
 
           <el-table-column align="center" label="操作">
             <template slot-scope="scope">
-              <el-popconfirm title="确定删除吗?" @confirm="deleteMember(scope.$index)" >
+              <el-popconfirm title="确定删除吗?" @confirm="deleteMember(scope.$index)">
                 <el-button slot="reference" type="text">删除</el-button>
               </el-popconfirm>
             </template>
@@ -98,7 +131,6 @@
         </el-table>
       </div>
 
-
       <div class="btn-group">
         <el-button size="small" type="primary" @click="addGoods">选择商品</el-button>
       </div>
@@ -120,21 +152,23 @@
         </div>
         <div class="goods-item" v-for="(item, index) in goodsList" :key="index">
           <div class="goods-info">
-            <img :src="item.goodsImgSrc" alt="">
-            {{item.goodsName}}
+            <img :src="$showImgUrl(item.goodsImgSrc)" alt="" />
+            {{ item.goodsName }}
           </div>
           <div class="sort">
             <el-input type="number" size="small" v-model="item.sortNum"></el-input>
           </div>
           <div class="spec-list">
             <div class="spec-item" v-for="(it, idx) in item.specs" :key="idx">
-              <div class="col name">{{it.goodsSpecName}}-{{it.goodsSpecValue}}</div>
+              <div class="col name">{{ it.goodsSpecName }}-{{ it.goodsSpecValue }}</div>
               <div class="col input"><el-input type="number" size="small" v-model="it.orgGoodsPrice"></el-input></div>
               <div class="col input"><el-input type="number" size="small" v-model="it.comGroupPrice"></el-input></div>
               <div class="col input"><el-input type="number" size="small" v-model="it.comShareAmount"></el-input></div>
               <div class="col input"><el-input type="number" size="small" v-model="it.stock"></el-input></div>
               <div class="col input"><el-input type="number" size="small" v-model="it.salesNum"></el-input></div>
-              <div class="col btn"><el-button type="text" @click="toSetHead(it.promotionGroupSpecId)">团长设置</el-button></div>
+              <div class="col btn">
+                <el-button type="text" @click="toSetHead(it.promotionGroupSpecId)">团长设置</el-button>
+              </div>
             </div>
           </div>
           <div class="operation">
@@ -147,44 +181,77 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
+        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{
+          formLoading ? '保存中 ...' : '保 存'
+        }}</el-button>
         <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
 
-
     <!-- 选择商品 -->
-    <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="60%" :close-on-click-modal="false">
+    <el-dialog
+      title="选择商品"
+      :visible.sync="addGoodsVisible"
+      :show-close="false"
+      width="60%"
+      :close-on-click-modal="false"
+    >
       <div class="dialog-container clearfix">
         <div class="left fl">
           <div class="item" @click="changeClassify('')">全部分类</div>
           <div class="group" v-for="(item, index) in classifyList" :key="index">
             <div class="item" @click="toggleOpen(index)">
-              <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
+              <i :class="item.isOpen ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i> {{ item.name }}
             </div>
             <div class="child" v-if="item.isOpen">
-              <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
+              <div
+                class="item"
+                v-for="(childItem, childIndex) in item.children"
+                :key="childIndex"
+                @click="changeClassify(childItem.categoryId)"
+              >
+                {{ childItem.name }}
+              </div>
             </div>
           </div>
         </div>
 
         <div class="right fl">
           <div class="search">
-            <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
+            <el-input
+              placeholder="请输入商品名称进行搜索"
+              v-model="keyword"
+              class="input-with-select"
+              clearable
+              size="small"
+              style="width: 250px"
+            >
               <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
             </el-input>
           </div>
-          <div class="table" style="margin: 10px 0 20px;">
-            <el-table 
-              v-loading="table_listLoading" 
-              :data="table_dataList" 
-              element-loading-text="Loading" 
-              tooltip-effect="dark" 
-              style="width: 100%" 
+          <div class="table" style="margin: 10px 0 20px">
+            <el-table
+              v-loading="table_listLoading"
+              :data="table_dataList"
+              element-loading-text="Loading"
+              tooltip-effect="dark"
+              style="width: 100%"
               max-height="270"
-              @selection-change="handleChooseGoods">
-              <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
-              <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+              @selection-change="handleChooseGoods"
+            >
+              <el-table-column
+                align="center"
+                type="selection"
+                :selectable="checkboxSelect"
+                width="45"
+              ></el-table-column>
+              <el-table-column
+                align="center"
+                prop="goodsName"
+                label="商品名称"
+                min-width="200"
+                show-overflow-tooltip
+              ></el-table-column>
               <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
               <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
             </el-table>
@@ -197,7 +264,8 @@
                 :page-size="table_pageSize"
                 background
                 layout="prev, pager, next"
-                :total="table_listTotal">
+                :total="table_listTotal"
+              >
               </el-pagination>
             </div>
           </div>
@@ -211,7 +279,13 @@
     </el-dialog>
 
     <!-- 选择会员 -->
-    <el-dialog title="选择会员" :visible.sync="addMemberVisible" :show-close="false" width="65%" :close-on-click-modal="false">
+    <el-dialog
+      title="选择会员"
+      :visible.sync="addMemberVisible"
+      :show-close="false"
+      width="65%"
+      :close-on-click-modal="false"
+    >
       <div class="dialog-container2 clearfix">
         <el-form ref="screenForm" :model="member_screenForm" size="small" label-position="left">
           <el-row :gutter="20">
@@ -225,16 +299,17 @@
             </el-col>
           </el-row>
         </el-form>
-        <div class="table memberTable" style="margin: 10px 0 20px;">
-          <el-table 
-            v-loading="memberTable_listLoading" 
-            :data="memberTable_dataList" 
-            element-loading-text="Loading" 
-            tooltip-effect="dark" 
-            style="width: 100%" 
+        <div class="table memberTable" style="margin: 10px 0 20px">
+          <el-table
+            v-loading="memberTable_listLoading"
+            :data="memberTable_dataList"
+            element-loading-text="Loading"
+            tooltip-effect="dark"
+            style="width: 100%"
             max-height="360"
-            @selection-change="handleChooseMember">
-            <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
+            @selection-change="handleChooseMember"
+          >
+            <el-table-column align="center" type="selection" :selectable="checkboxSelect" width="45"></el-table-column>
             <el-table-column align="center" prop="nickName" label="会员名称" min-width="150"></el-table-column>
             <el-table-column align="center" prop="mobile" label="手机号码" min-width="100"></el-table-column>
           </el-table>
@@ -247,7 +322,8 @@
               :page-size="memberTable_pageSize"
               background
               layout="prev, pager, next"
-              :total="memberTable_listTotal">
+              :total="memberTable_listTotal"
+            >
             </el-pagination>
           </div>
         </div>
@@ -263,13 +339,20 @@
 
 <script>
 import { getToken } from '@/utils/auth'
-import { editActivity, addActivity, getClassifyList, getGoodsList, getActivityDetail, getMemberList } from '@/api/groupbuy'
+import {
+  editActivity,
+  addActivity,
+  getClassifyList,
+  getGoodsList,
+  getActivityDetail,
+  getMemberList
+} from '@/api/groupbuy'
 
 export default {
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { 'x-token': getToken() },
       isEdit: false,
       editId: '',
       formLoading: false,
@@ -277,15 +360,11 @@ export default {
         name: '',
         date: '',
         remark: '',
-        status: true,
+        status: true
       },
       mainFormRules: {
-        name: [
-          { required: true, message: '请填写活动名称', trigger: 'blur' }
-        ],
-        date: [
-          { required: true, message: '请选择活动时间', trigger: 'change' }
-        ],
+        name: [{ required: true, message: '请填写活动名称', trigger: 'blur' }],
+        date: [{ required: true, message: '请选择活动时间', trigger: 'change' }]
       },
 
       uploadImageType: null,
@@ -311,16 +390,16 @@ export default {
 
       memberList: [], // 会员数据
       addMemberVisible: false,
-      member_screenForm: { // 筛选表单数据
-        keyword: '', // 名称
+      member_screenForm: {
+        // 筛选表单数据
+        keyword: '' // 名称
       },
       memberTable_dataList: null, // 列表数据
       memberTable_listLoading: true, // 列表加载loading
       memberTable_currentPage: 1, // 当前页码
       memberTable_pageSize: 10, // 每页数量
       memberTable_listTotal: 0, // 列表总数
-      memberTable_choose: [], // table中 当前选择会员
-
+      memberTable_choose: [] // table中 当前选择会员
     }
   },
   computed: {
@@ -332,15 +411,15 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    },
+    }
   },
   created() {
-    const { id } = this.$route.query;
-    this.isEdit = id ? true : false;
-    this.editId = id;
+    const { id } = this.$route.query
+    this.isEdit = id ? true : false
+    this.editId = id
 
-    if(this.isEdit) {
-      this.getDetail(id);
+    if (this.isEdit) {
+      this.getDetail(id)
     }
   },
   methods: {
@@ -350,54 +429,54 @@ export default {
 
     // 获取详情
     getDetail(id) {
-      getActivityDetail({promotionGroupId: id}).then(res => {
+      getActivityDetail({ promotionGroupId: id }).then(res => {
         this.mainForm = {
           name: res.data.name,
           date: [res.data.startTime.slice(0, 10), res.data.endTime.slice(0, 10)],
           status: res.data.status,
-          remark: res.data.remark,
+          remark: res.data.remark
         }
-        this.img1_url = res.data.imgUrl;
-        this.img2_url = res.data.posterImgUrl;
-        this.goodsList = res.data.goods;
-        this.memberList = res.data.promotionGroupUsers;
+        this.img1_url = res.data.imgUrl
+        this.img2_url = res.data.posterImgUrl
+        this.goodsList = res.data.goods
+        this.memberList = res.data.promotionGroupUsers
       })
     },
 
     // 获取分类列表
     getClassifyList() {
-      getClassifyList({categoryLevel: 1, status: true}).then(res => {
+      getClassifyList({ categoryLevel: 1, status: true }).then(res => {
         res.data.forEach(item => {
-          item.isOpen = false;
-        });
-        this.classifyList = res.data;
-        this.classifyCurrent = '';
-        this.getGoodsList();
+          item.isOpen = false
+        })
+        this.classifyList = res.data
+        this.classifyCurrent = ''
+        this.getGoodsList()
       })
     },
 
     // 展开/收起 分类
     toggleOpen(index) {
-      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen
     },
 
     // 切换分类
     changeClassify(cid) {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分类');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分类')
       }
-      this.classifyCurrent = cid;
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.classifyCurrent = cid
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 搜索
     getGoodsListByScreen() {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可搜索');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可搜索')
       }
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 获取商品列表
@@ -406,69 +485,69 @@ export default {
         pageNum: this.table_currentPage,
         pageSize: this.table_pageSize,
         keyword: this.keyword,
-        categoryId: this.classifyCurrent,
+        categoryId: this.classifyCurrent
       }).then(res => {
-        let oldGoodsList = this.goodsList;
-        let newGoodsList = res.data.records;
-        for(let i = 0; i < oldGoodsList.length; i++) {
+        let oldGoodsList = this.goodsList
+        let newGoodsList = res.data.records
+        for (let i = 0; i < oldGoodsList.length; i++) {
           let oldItem = oldGoodsList[i]
-          for(let j = 0; j < newGoodsList.length; j++) {
+          for (let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.goodsId === oldItem.goodsId){
-              newGoodsList[j].selected = true;
-              break;
+            if (newItem.goodsId === oldItem.goodsId) {
+              newGoodsList[j].selected = true
+              break
             }
           }
         }
-        for(let j = 0; j < newGoodsList.length; j++) {
+        for (let j = 0; j < newGoodsList.length; j++) {
           let newItem = newGoodsList[j]
-          if(newItem.promotionGroup === true){
-            newGoodsList[j].selected = true;
+          if (newItem.promotionGroup === true) {
+            newGoodsList[j].selected = true
           }
         }
-        this.table_dataList = newGoodsList;
-        this.table_listTotal = res.data.total;
-        this.table_listLoading = false;
+        this.table_dataList = newGoodsList
+        this.table_listTotal = res.data.total
+        this.table_listLoading = false
       })
     },
 
     // 查询重复值并禁选
-    checkboxSelect (row, rowIndex) {
+    checkboxSelect(row, rowIndex) {
       if (row.selected) {
         return false // 禁用
-      }else{
+      } else {
         return true // 不禁用
       }
     },
 
     // 更改列表当前页
     handleTableCurrentChange(val) {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分页');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分页')
       }
-      this.table_currentPage = val;
-      this.getGoodsList();
+      this.table_currentPage = val
+      this.getGoodsList()
     },
 
     // table点击选择商品
     handleChooseGoods(val) {
-      this.table_chooseGoods = val;
+      this.table_chooseGoods = val
     },
 
     addGoods() {
-      this.addGoodsVisible = true;
-      this.getClassifyList();
+      this.addGoodsVisible = true
+      this.getClassifyList()
     },
 
     // 取消 选择商品
-    cancelAddGoods(){
-      this.addGoodsVisible = false;
+    cancelAddGoods() {
+      this.addGoodsVisible = false
     },
 
     // 提交 选择商品
     submitAddGoods() {
-      let oldGoodsList = this.goodsList;
-      let newGoodsList = [];
+      let oldGoodsList = this.goodsList
+      let newGoodsList = []
 
       this.table_chooseGoods.forEach(item => {
         let obj = {
@@ -489,18 +568,18 @@ export default {
             stock: it.stockNum,
             salesNum: it.soldNum
           }
-          obj.specs.push(c_obj);
+          obj.specs.push(c_obj)
         })
-        newGoodsList.push(obj);
+        newGoodsList.push(obj)
       })
-      this.goodsList = oldGoodsList.concat(newGoodsList);
-      this.addGoodsVisible = false;
-      console.log(this.goodsList);
+      this.goodsList = oldGoodsList.concat(newGoodsList)
+      this.addGoodsVisible = false
+      console.log(this.goodsList)
     },
 
     // 删除商品
     deleteGoods(index) {
-      this.goodsList.splice(index, 1);
+      this.goodsList.splice(index, 1)
     },
 
     // 获取会员列表
@@ -509,68 +588,68 @@ export default {
         pageNum: this.memberTable_currentPage,
         pageSize: this.memberTable_pageSize,
         keyword: this.member_screenForm.keyword,
-        promotionGroupLeader: true,
+        promotionGroupLeader: true
       }).then(res => {
-        let oldMemberList = this.memberList;
-        let newMemberList = res.data.records;
-        for(let i = 0; i < oldMemberList.length; i++) {
+        let oldMemberList = this.memberList
+        let newMemberList = res.data.records
+        for (let i = 0; i < oldMemberList.length; i++) {
           let oldItem = oldMemberList[i]
-          for(let j = 0; j < newMemberList.length; j++) {
+          for (let j = 0; j < newMemberList.length; j++) {
             let newItem = newMemberList[j]
-            if(newItem.userId === oldItem.userId){
-              newMemberList[j].selected = true;
-              break;
+            if (newItem.userId === oldItem.userId) {
+              newMemberList[j].selected = true
+              break
             }
           }
         }
-        this.memberTable_dataList = newMemberList;
-        this.memberTable_listTotal = res.data.total;
-        this.memberTable_listLoading = false;
+        this.memberTable_dataList = newMemberList
+        this.memberTable_listTotal = res.data.total
+        this.memberTable_listLoading = false
       })
     },
 
     // 选择会员 - 搜索
     getMemberListByScreen() {
-      if(this.memberTable_choose.length > 0) {
-        return this.$errorMsg('当前已选择会员,不可搜索');
+      if (this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可搜索')
       }
-      this.memberTable_currentPage = 1;
-      this.getMemberList();
+      this.memberTable_currentPage = 1
+      this.getMemberList()
     },
 
     // 更改列表当前页
     memberTableCurrentChange(val) {
-      if(this.memberTable_choose.length > 0) {
-        return this.$errorMsg('当前已选择会员,不可切换分页');
+      if (this.memberTable_choose.length > 0) {
+        return this.$errorMsg('当前已选择会员,不可切换分页')
       }
-      this.memberTable_currentPage = val;
-      this.getMemberList();
+      this.memberTable_currentPage = val
+      this.getMemberList()
     },
 
     // table点击选择会员
     handleChooseMember(val) {
-      this.memberTable_choose = val;
+      this.memberTable_choose = val
     },
 
     // 添加会员
     addMember() {
-      this.addMemberVisible = true;
+      this.addMemberVisible = true
 
-      if(this.memberList.length > 0) {
-        this.member_screenForm.type = this.memberList[0].type;
+      if (this.memberList.length > 0) {
+        this.member_screenForm.type = this.memberList[0].type
       }
-      
-      this.getMemberList();
+
+      this.getMemberList()
     },
 
     // 删除会员
     deleteMember(index) {
-      this.memberList.splice(index, 1);
+      this.memberList.splice(index, 1)
     },
 
     // 取消 选择会员
-    cancelAddMember(){
-      this.addMemberVisible = false;
+    cancelAddMember() {
+      this.addMemberVisible = false
     },
 
     // 提交 选择会员
@@ -578,57 +657,57 @@ export default {
       // if(this.memberTable_choose.length > 1) {
       //   return this.$errorMsg('每次只能选择一个会员');
       // }
-      let oldMemberList = this.memberList;
-      let newMemberList = this.memberTable_choose;
-      this.memberList = oldMemberList.concat(newMemberList);
-      this.addMemberVisible = false;
+      let oldMemberList = this.memberList
+      let newMemberList = this.memberTable_choose
+      this.memberList = oldMemberList.concat(newMemberList)
+      this.addMemberVisible = false
     },
 
     // 提交表单
     submitMainForm() {
-      if(!this.img1_url) {
-        return this.$errorMsg('请上传活动图');
+      if (!this.img1_url) {
+        return this.$errorMsg('请上传活动图')
       }
-      if(this.memberList.length < 1) {
-        return this.$warningNotify('至少选择一个团长');
+      if (this.memberList.length < 1) {
+        return this.$warningNotify('至少选择一个团长')
       }
-      if(this.goodsList.length < 1) {
-        return this.$warningNotify('至少选择一个商品');
+      if (this.goodsList.length < 1) {
+        return this.$warningNotify('至少选择一个商品')
       }
 
-      for(let i=0; i<this.goodsList.length; i++) {
-        for(let j=0; j<this.goodsList[i].specs.length; j++) {
-          if(this.goodsList[i].specs[j].orgGoodsPrice === '') {
-            this.formLoading = false;
-            this.$errorMsg('划线价格不能为空');
-            return;
+      for (let i = 0; i < this.goodsList.length; i++) {
+        for (let j = 0; j < this.goodsList[i].specs.length; j++) {
+          if (this.goodsList[i].specs[j].orgGoodsPrice === '') {
+            this.formLoading = false
+            this.$errorMsg('划线价格不能为空')
+            return
           }
-          if(this.goodsList[i].specs[j].comGroupPrice === '') {
-            this.formLoading = false;
-            this.$errorMsg('统一团购价不能为空');
-            return;
+          if (this.goodsList[i].specs[j].comGroupPrice === '') {
+            this.formLoading = false
+            this.$errorMsg('统一团购价不能为空')
+            return
           }
-          if(this.goodsList[i].specs[j].comShareAmount === '') {
-            this.formLoading = false;
-            this.$errorMsg('统一分佣金额不能为空');
-            return;
+          if (this.goodsList[i].specs[j].comShareAmount === '') {
+            this.formLoading = false
+            this.$errorMsg('统一分佣金额不能为空')
+            return
           }
-          if(this.goodsList[i].specs[j].stock === '') {
-            this.formLoading = false;
-            this.$errorMsg('库存不能为空');
-            return;
+          if (this.goodsList[i].specs[j].stock === '') {
+            this.formLoading = false
+            this.$errorMsg('库存不能为空')
+            return
           }
-          if(this.goodsList[i].specs[j].salesNum === '') {
-            this.formLoading = false;
-            this.$errorMsg('销量不能为空');
-            return;
+          if (this.goodsList[i].specs[j].salesNum === '') {
+            this.formLoading = false
+            this.$errorMsg('销量不能为空')
+            return
           }
         }
       }
 
-      this.$refs.mainForm.validate((valid) => {
+      this.$refs.mainForm.validate(valid => {
         if (valid) {
-          this.formLoading = true;
+          this.formLoading = true
 
           let params = {
             name: this.mainForm.name,
@@ -639,62 +718,66 @@ export default {
             posterImgUrl: this.img2_url,
             status: this.mainForm.status,
             goods: this.goodsList,
-            promotionGroupUsers: this.memberList,
+            promotionGroupUsers: this.memberList
           }
-          params = this.$deleteEmptyObj(params);
-
-          if(this.isEdit) {
-            params.promotionGroupId = this.editId;
-            editActivity(params).then(res => {
-              this.formLoading = false;
-              this.$successMsg('编辑成功');
-              setTimeout(()=>{
-                this.goBack();
-              }, 1000)
-            }).catch(err => {
-              this.formLoading = false;
-            })
-          } else {
-            addActivity(params).then(res => {
-              this.formLoading = false;
-              this.$successMsg('添加成功');
-              if(!this.saveDontBack) {
-                setTimeout(()=>{
-                  this.goBack();
-                }, 1000)
-              }else {
-                this.$router.go(-1);
+          params = this.$deleteEmptyObj(params)
+
+          if (this.isEdit) {
+            params.promotionGroupId = this.editId
+            editActivity(params)
+              .then(res => {
+                this.formLoading = false
+                this.$successMsg('编辑成功')
                 setTimeout(() => {
-                  this.$router.push({
-                    name:"groupbuy_add",
-                    query: {
-                      id: res.data
-                    }
-                  })
-                  this.editId = res.data;
-                  this.getDetail(res.data);
-                }, 100)
-              }
-            }).catch(err => {
-              this.saveDontBack = false;
-              this.formLoading = false;
-            })
+                  this.goBack()
+                }, 1000)
+              })
+              .catch(err => {
+                this.formLoading = false
+              })
+          } else {
+            addActivity(params)
+              .then(res => {
+                this.formLoading = false
+                this.$successMsg('添加成功')
+                if (!this.saveDontBack) {
+                  setTimeout(() => {
+                    this.goBack()
+                  }, 1000)
+                } else {
+                  this.$router.go(-1)
+                  setTimeout(() => {
+                    this.$router.push({
+                      name: 'groupbuy_add',
+                      query: {
+                        id: res.data
+                      }
+                    })
+                    this.editId = res.data
+                    this.getDetail(res.data)
+                  }, 100)
+                }
+              })
+              .catch(err => {
+                this.saveDontBack = false
+                this.formLoading = false
+              })
           }
-        }else {
-          this.$warningNotify('请先完善信息');
-          return false;
+        } else {
+          this.$warningNotify('请先完善信息')
+          return false
         }
       })
     },
 
     // 去设置团长
     toSetHead(id) {
-      if(!this.editId) {
-        this.saveDontBack = true;
-        return this.$errorMsg('请先保存该活动');
+      if (!this.editId) {
+        this.saveDontBack = true
+        return this.$errorMsg('请先保存该活动')
       }
       this.$router.push({
-        name:"groupbuy_set",
+        name: 'groupbuy_set',
         query: {
           id
         }
@@ -702,280 +785,279 @@ export default {
     },
 
     uploadImage(type) {
-      this.uploadImageType = type;
-      document.querySelector('.avatar-uploader input').click();
+      this.uploadImageType = type
+      document.querySelector('.avatar-uploader input').click()
     },
 
     // 上传图片
     uploadSuccess(res, file) {
-      this[this.uploadImageType + '_url'] = res.data.url;
+      this[this.uploadImageType + '_url'] = res.data.url
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/jpeg/png文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/jpeg/png文件!')
+        return false
       }
     },
 
     // 预览图片
     previewImage(type) {
-      this.$refs[type].showViewer = true;
+      this.$refs[type].showViewer = true
     },
 
     // 删除图片
     deleteImage(type) {
-      this[this.uploadImageType + '_url'] = '';
-    },
-  },
-
+      this[this.uploadImageType + '_url'] = ''
+    }
+  }
 }
 </script>
 
 <style scoped lang="scss">
-  .diy-table {
-    overflow-x: scroll;
-    border-left: 1px solid #f5f5f5;
-    margin-top: 20px;
-    width: 100%;
-    // min-width: 1185px;
-    max-width: 100%;
-    .table-head {
+.diy-table {
+  overflow-x: scroll;
+  border-left: 1px solid #f5f5f5;
+  margin-top: 20px;
+  width: 100%;
+  // min-width: 1185px;
+  max-width: 100%;
+  .table-head {
+    display: flex;
+    .item {
+      height: 40px;
+      line-height: 40px;
+      float: left;
+      font-weight: 500;
+      font-size: 14px;
+      background: #f5f5f5;
+      text-align: center;
+    }
+    .right {
+      float: left;
+      width: 74%;
+      min-width: 1000px;
+      flex-shrink: 0;
+      height: 40px;
+    }
+    .goods {
+      width: 15%;
+      min-width: 170px;
+    }
+    .sort {
+      width: 5%;
+      min-width: 80px;
+    }
+    .name {
+      width: 15%;
+      min-width: 150px;
+    }
+    .input {
+      width: 15%;
+      min-width: 150px;
+    }
+    .opera {
+      width: 10%;
+      min-width: 80px;
+      text-align: right;
+    }
+    .blank {
+      background: #f5f5f5;
+      width: 6%;
+      min-width: 90px;
+    }
+  }
+  .goods-item {
+    display: flex;
+    align-content: center;
+    .goods-info {
+      flex-shrink: 0;
+      width: 15%;
+      min-width: 170px;
+      padding: 0 10px;
       display: flex;
-      .item {
-        height: 40px;
-        line-height: 40px;
-        float: left;
-        font-weight: 500;
-        font-size: 14px;
-        background: #f5f5f5;
-        text-align: center;
+      align-items: center;
+      border-bottom: 1px solid #f5f5f5;
+      border-right: 1px solid #f5f5f5;
+      font-size: 14px;
+      &:last-child {
+        border-bottom: none;
       }
-      .right {
-        float: left;
-        width: 74%;
-        min-width: 1000px;
-        flex-shrink: 0;
+      img {
+        width: 40px;
         height: 40px;
-      }
-      .goods {
-        width: 15%;
-        min-width: 170px;
-      }
-      .sort {
-        width: 5%;
-        min-width: 80px;
-      }
-      .name {
-        width: 15%;
-        min-width: 150px;
-      }
-      .input {
-        width: 15%;
-        min-width: 150px;
-      }
-      .opera {
-        width: 10%;
-        min-width: 80px;
-        text-align: right;
-      }
-      .blank {
-        background: #f5f5f5;
-        width: 6%;
-        min-width: 90px;
+        margin-right: 10px;
+        flex-shrink: 0;
       }
     }
-    .goods-item {
+    .sort {
+      width: 5%;
+      min-width: 80px;
+      border-bottom: 1px solid #f5f5f5;
+      border-right: 1px solid #f5f5f5;
       display: flex;
-      align-content: center;
-      .goods-info {
-        flex-shrink: 0;
-        width: 15%;
-        min-width: 170px;
-        padding: 0 10px;
-        display: flex;
-        align-items: center;
-        border-bottom: 1px solid #f5f5f5;
-        border-right: 1px solid #f5f5f5;
-        font-size: 14px;
-        &:last-child {
-          border-bottom: none;
-        }
-        img {
-          width: 40px;
-          height: 40px;
-          margin-right: 10px;
-          flex-shrink: 0;
-        }
+      align-items: center;
+      padding: 10px;
+    }
+    .spec-list {
+      width: 74%;
+      min-width: 1000px;
+      border-bottom: 1px solid #f5f5f5;
+      border-right: 1px solid #f5f5f5;
+      &:last-child {
+        border-bottom: none;
       }
-      .sort {
-        width: 5%;
-        min-width: 80px;
-        border-bottom: 1px solid #f5f5f5;
-        border-right: 1px solid #f5f5f5;
+      .spec-item {
         display: flex;
         align-items: center;
-        padding: 10px;
-      }
-      .spec-list {
-        width: 74%;
-        min-width: 1000px;
         border-bottom: 1px solid #f5f5f5;
-        border-right: 1px solid #f5f5f5;
         &:last-child {
           border-bottom: none;
         }
-        .spec-item {
+        .col {
+          flex-shrink: 0;
+          height: 50px;
           display: flex;
           align-items: center;
-          border-bottom: 1px solid #f5f5f5;
+          justify-content: center;
+          padding: 0 10px;
+          border-right: 1px solid #f5f5f5;
           &:last-child {
-            border-bottom: none;
-          }
-          .col {
-            flex-shrink: 0;
-            height: 50px;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            padding: 0 10px;
-            border-right: 1px solid #f5f5f5;
-            &:last-child {
-              border-right: none;
-            }
-          }
-          .name {
-            width: 15%;
-            min-width: 150px;
-            font-size: 14px;
-            text-align: center;
-          }
-          .input {
-            width: 15%;
-            min-width: 150px;
-          }
-          .btn {
-            width: 10%;
-            min-width: 80px;
+            border-right: none;
           }
         }
-      }
-      .operation {
-        flex-shrink: 0;
-        width: 6%;
-        min-width: 90px;
-        padding: 0 10px;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        border-bottom: 1px solid #f5f5f5;
-        border-right: 1px solid #f5f5f5;
+        .name {
+          width: 15%;
+          min-width: 150px;
+          font-size: 14px;
+          text-align: center;
+        }
+        .input {
+          width: 15%;
+          min-width: 150px;
+        }
+        .btn {
+          width: 10%;
+          min-width: 80px;
+        }
       }
     }
-    .empty-text {
-      line-height: 60px;
-      text-align: center;
-      color: #909399;
+    .operation {
+      flex-shrink: 0;
+      width: 6%;
+      min-width: 90px;
+      padding: 0 10px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border-bottom: 1px solid #f5f5f5;
+      border-right: 1px solid #f5f5f5;
     }
   }
+  .empty-text {
+    line-height: 60px;
+    text-align: center;
+    color: #909399;
+  }
+}
 
-  .dialog-container {
-    .left {
-      width: 140px;
-      height: 350px;
-      overflow-y: scroll;
-      .group {
-        margin-top: 10px;
-      }
-      .child {
-        margin-top: 5px;
-        .item {
-          padding-left: 18px;
-        }
-      }
+.dialog-container {
+  .left {
+    width: 140px;
+    height: 350px;
+    overflow-y: scroll;
+    .group {
+      margin-top: 10px;
+    }
+    .child {
+      margin-top: 5px;
       .item {
-        cursor: pointer;
-        line-height: 24px;
+        padding-left: 18px;
       }
     }
-    .right {
-      width: calc(100% - 140px);
-      height: 350px;
-      box-sizing: border-box;
-      padding-left: 20px;
+    .item {
+      cursor: pointer;
+      line-height: 24px;
     }
   }
+  .right {
+    width: calc(100% - 140px);
+    height: 350px;
+    box-sizing: border-box;
+    padding-left: 20px;
+  }
+}
 
-  .images {
+.images {
+  display: flex;
+  flex-wrap: wrap;
+  .main-img {
     display: flex;
-    flex-wrap: wrap;
-    .main-img {
-      display: flex;
-      flex-direction: column;
-      justify-content: center;
-      align-items: center;
-      width: 120px;
-      margin-right: 20px;
-      .img {
-        border: 1px dashed #eaeaea;
-        border-radius: 5px;
-        overflow: hidden;
-        position: relative;
-        .el-image {
-          display: block;
-        }
-        .mask {
-          position: absolute;
-          left: 0;
-          top: 0;
-          width: 120px;
-          height: 120px;
-          background: rgba($color: #000000, $alpha: 0.3);
-          display: flex;
-          align-items: center;
-          justify-content: center;
-          i {
-            font-size: 20px;
-            color: #ffffff;
-            cursor: pointer;
-            margin: 0 8px;
-          }
-        }
-      }
-      .text {
-        font-size: 14px;
-        color: #666666;
-      }
-    }
-    .add {
-      width: 120px;
-      height: 120px;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    width: 120px;
+    margin-right: 20px;
+    .img {
       border: 1px dashed #eaeaea;
       border-radius: 5px;
-      cursor: pointer;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      i {
-        font-size: 30px;
-        color: #999;
-      }
-    }
-    .tmp-img {
+      overflow: hidden;
       position: relative;
-      .tmp {
+      .el-image {
+        display: block;
+      }
+      .mask {
         position: absolute;
         left: 0;
         top: 0;
-        line-height: 20px;
-        padding: 0 8px;
-        background: #f66460;
-        border-radius: 0 0 10px 0;
-        font-size: 12px;
-        color: #ffffff;
+        width: 120px;
+        height: 120px;
+        background: rgba($color: #000000, $alpha: 0.3);
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        i {
+          font-size: 20px;
+          color: #ffffff;
+          cursor: pointer;
+          margin: 0 8px;
+        }
       }
     }
+    .text {
+      font-size: 14px;
+      color: #666666;
+    }
+  }
+  .add {
+    width: 120px;
+    height: 120px;
+    border: 1px dashed #eaeaea;
+    border-radius: 5px;
+    cursor: pointer;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    i {
+      font-size: 30px;
+      color: #999;
+    }
   }
-</style>
+  .tmp-img {
+    position: relative;
+    .tmp {
+      position: absolute;
+      left: 0;
+      top: 0;
+      line-height: 20px;
+      padding: 0 8px;
+      background: #f66460;
+      border-radius: 0 0 10px 0;
+      font-size: 12px;
+      color: #ffffff;
+    }
+  }
+}
+</style>

+ 59 - 44
src/views/mallManagement/activity/seckill_index/index_2.vue

@@ -1,14 +1,22 @@
 <template>
-  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-    :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation()" :exportList="exportList">
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :options-evens-group="optionsEvensGroup"
+    :moreParameters="moreParameters"
+    :column-parsing="columnParsing"
+    :operation="operation()"
+    :exportList="exportList"
+  >
     <div slot="moreSearch">
       <el-radio-group v-model="type" size="mini" @change="changeType">
         <el-radio-button label="">全部</el-radio-button>
         <el-radio-button :label="true">启用</el-radio-button>
         <el-radio-button :label="false">禁用</el-radio-button>
       </el-radio-group>
-      <br><br>
+      <br /><br />
     </div>
   </template-page>
 </template>
@@ -16,14 +24,20 @@
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
-import { secKillGoodsSpecListPageV2, secKillGoodsSpecListPageV2Export, closeGoodsStatus, openGoodsStatus, deleteGoods } from '@/api/seckill'
+import {
+  secKillGoodsSpecListPageV2,
+  secKillGoodsSpecListPageV2Export,
+  closeGoodsStatus,
+  openGoodsStatus,
+  deleteGoods
+} from '@/api/seckill'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin,operation_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      type: "",
+      type: '',
       statistics: {},
       // 事件组合
       optionsEvensGroup: [],
@@ -37,14 +51,14 @@ export default {
         'selection-change': this.selectionChange
       },
       // 勾选选中行
-      recordSelected: [],
+      recordSelected: []
     }
   },
   computed: {
     // 更多参数
     moreParameters() {
       return []
-    },
+    }
   },
   methods: {
     // 切换状态
@@ -57,13 +71,12 @@ export default {
         var pam = JSON.parse(JSON.stringify(p))
         if (this.type !== '') {
           pam.status = this.type
-          pam.params.push({ "param": "a.status", "compare": "=", "value": this.type })
+          pam.params.push({ param: 'a.status', compare: '=', value: this.type })
         }
         return secKillGoodsSpecListPageV2(pam)
       } catch (error) {
         console.log(error)
       } finally {
-
       }
     },
     // 列表导出函数
@@ -72,9 +85,11 @@ export default {
     columnParsing(item, defaultData) {
       if (item.jname === 'imgUrl') {
         defaultData.render = (h, { row, column, index }) => {
-          return <div style="width: 100px; height: 100px; overflow: hidden">
-            <el-image style="width: 100px; height: 100px" src={row.imgUrl} fit="fit"></el-image>
-          </div>
+          return (
+            <div style="width: 100px; height: 100px; overflow: hidden">
+              <el-image style="width: 100px; height: 100px" src={this.$showImgUrl(row.imgUrl)} fit="fit"></el-image>
+            </div>
+          )
         }
       }
       return defaultData
@@ -83,36 +98,36 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-	// 表格操作列
-	operation() {
-		return this.operationBtn({
-		  del: {
-		  	btnType: 'text',
-		  	prompt: '确定删除吗?',
-		    click: ({ row, index, column }) => {
-		      deleteGoods({ secKillSpecId: row.secKillSpecId }).then(res => {
-		        this.$message({ type: 'success', message: `删除成功!` })
-		        this.$refs.pageRef.refreshList()
-		      })
-		    }
-		  },
-		  status: {
-				btnType: 'text',
-				name: ({ row, index, column }) => {
-					return row.status ? "关闭" : "开启"
-				},
-					prompt:  ({ row, index, column }) => {
-					return `是否确定${row.status ? "关闭" : "开启"}?`
-				},
-		    click: ({ row, index, column }) => {
-		      (row.status ? closeGoodsStatus : openGoodsStatus)({ secKillSpecId: row.secKillSpecId }).then(res => {
-		        this.$message({ type: 'success', message: `${row.status ? "关闭" : "开启"}成功!` })
-		        this.$refs.pageRef.refreshList()
-		      })
-		    }
-		  },
-		})
-	},
+    // 表格操作列
+    operation() {
+      return this.operationBtn({
+        del: {
+          btnType: 'text',
+          prompt: '确定删除吗?',
+          click: ({ row, index, column }) => {
+            deleteGoods({ secKillSpecId: row.secKillSpecId }).then(res => {
+              this.$message({ type: 'success', message: `删除成功!` })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        },
+        status: {
+          btnType: 'text',
+          name: ({ row, index, column }) => {
+            return row.status ? '关闭' : '开启'
+          },
+          prompt: ({ row, index, column }) => {
+            return `是否确定${row.status ? '关闭' : '开启'}?`
+          },
+          click: ({ row, index, column }) => {
+            ;(row.status ? closeGoodsStatus : openGoodsStatus)({ secKillSpecId: row.secKillSpecId }).then(res => {
+              this.$message({ type: 'success', message: `${row.status ? '关闭' : '开启'}成功!` })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        }
+      })
+    }
   }
 }
 </script>

+ 5 - 5
src/views/mallManagement/activity/special_set/index.vue

@@ -43,8 +43,8 @@
               <div class="img" v-if="img1_url" @mouseover="img1_hover = true" @mouseout="img1_hover = false">
                 <el-image
                   ref="img1"
-                  :src="img1_url"
-                  :preview-src-list="[img1_url]"
+                  :src="$showImgUrl(img1_url)"
+                  :preview-src-list="[$showImgUrl(img1_url)]"
                   style="width: 120px; height: 120px"
                   fit="contain"
                 ></el-image>
@@ -69,8 +69,8 @@
               <div class="img" v-if="img2_url" @mouseover="img2_hover = true" @mouseout="img2_hover = false">
                 <el-image
                   ref="img2"
-                  :src="img2_url"
-                  :preview-src-list="[img2_url]"
+                  :src="$showImgUrl(img2_url)"
+                  :preview-src-list="[$showImgUrl(img2_url)]"
                   style="width: 120px; height: 120px"
                   fit="contain"
                 ></el-image>
@@ -121,7 +121,7 @@
       </div>
       <div class="goods-item" v-for="(item, index) in goodsList" :key="index">
         <div class="goods-info">
-          <img :src="item.imgUrl" alt="" />
+          <img :src="$showImgUrl(item.imgUrl)" alt="" />
           {{ item.goodsName }}
         </div>
         <div class="spec-list">

+ 646 - 544
src/views/mallManagement/activityOrder/detail.vue

@@ -1,551 +1,653 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>基本信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="6">
-							<el-form-item label="所属商户" :required="true" >
-								<el-input type="text" :value="formData.companyWechatName?formData.companyWechatName:companyName" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" style="height: 51px;">
-							<el-form-item label="活动名称" prop="promotionActivityId">
-								<el-select v-model="formData.active" :disabled="formType!=0" value-key="id" @change="(e)=>{
-									formData.promotionActivityId = e.id
-									formData.activeDate = [e.startTime,e.endTime]
-									this.getActiveDetail(e.id)
-								}" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="item in activeList"
-								      :key="item.id"
-								      :label="item.name"
-								      :value="item">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" style="height: 51px;">
-							<el-form-item label="活动网点" prop="customWebsitName">
-								<el-select v-model="formData.customWebsitName" :disabled="formType!=0" placeholder="请选择" style="width: 100%;">
-								    <el-option
-								      v-for="(item,index) in websitList"
-								      :key="index"
-								      :label="item.websitName"
-								      :value="item.websitName">
-								    </el-option>
-								  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6" style="margin-bottom: 1px;">
-							<el-form-item label="活动时间" prop="" class="is-required">
-								<el-date-picker
-									style="width: 100%"
-								    v-model="formData.activeDate"
-									disabled
-								    type="daterange"
-								    range-separator="至"
-								    start-placeholder="开始日期"
-								    end-placeholder="结束日期">
-								</el-date-picker>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="客户名称" prop="userName">
-								<el-input type="text" :disabled="formType!=0" v-model="formData.userName" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="联系人" prop="linkName">
-								<el-input type="text" :disabled="formType!=0" v-model="formData.linkName" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="客户电话" prop="userMobile">
-								<el-input type="text" :disabled="formType!=0" :maxlength="11" v-model="formData.userMobile" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="客户电话2" prop="userMobile2">
-								<el-input type="text" :disabled="formType!=0" v-model="formData.userMobile2" placeholder="请输入电话 (固话加区号)"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="客户地址" prop="userAddress">
-								<el-input type="text" v-model="formData.userAddress" :disabled="formType!=0" placeholder="详细地址"></el-input>
-							</el-form-item>
-						</el-col>
-						<template v-if="formType!=0">
-							<el-col :span="6">
-								<el-form-item label="提交人" prop="createBy">
-									<el-input type="text" v-model="formData.createBy" :disabled="true" placeholder="提交人"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="6">
-								<el-form-item label="提交时间" prop="createTime">
-									<el-input type="text" v-model="formData.createTime" :disabled="true" placeholder="提交时间"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-						
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="activeItems.length > 0">
-			<div slot="header" class="clearfix">
-				<span>报名信息</span>
-			</div>
-			<div v-for="(item, index) in activeItems" :key="index">
-			  <div class="picker-container" v-if="item.type == 1 || item.type == 2">
-			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}({{{1: '单选', 2: '多选'}[item.type]}})</div>
-			    <div class="img-list" v-if="item.answer && item.answer.length > 0 && item.answer[0].option_files && item.answer[0].option_files.length > 0 && item.answer[0].option_files[0].url">
-			      <div
-			        class="item1"
-			        :class="it.active ? 'active' : ''"
-			        v-for="(it, idx) in item.answer"
-			        :key="idx"
-			        @click="clickOption(index, idx)">
-			        <el-image v-if="item.answerType != 2" class="image" :src="returnUrl(it)" mode="aspectFill"></el-image>
-			        <div class="text" v-if="item.answerType != 3">{{it.option_value}}</div>
-			      </div>
-			    </div>
-			    <div class="text-list" v-else>
-			      <div
-			        class="item"
-			        :class="it.active ? 'active' : ''"
-			        v-for="(it, idx) in item.answer"
-			        :key="idx"
-			        @click="clickOption(index, idx)">
-			        {{it.option_value}}
-			      </div>
-			    </div>
-			  </div>
-			  <div class="input-container" v-else-if="item.type == 3">
-			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div>
-				<el-input type="text" v-model="item.inputValue" show-word-limit :maxlength="item.answer[0].option_limit" :disabled="formType!=0" :placeholder="`请输入${item.question}`"></el-input>
-			  </div>
-			  <div class="input-container" v-else-if="item.type == 4">
-			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div><br/>
-				<ImageUpload :fileList="item.inputValue" :limit="Number(item.answer[0].option_limit)" :isEdit="formType==0" :fileType="['image']"/>
-			  </div>
-			  <div class="input-container" v-else>
-			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div><br/>
-			  	<ImageUpload :fileList="item.inputValue" :limit="Number(item.answer[0].option_limit)" :isEdit="formType==0" :fileType="['video']"/>
-			  </div>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formType != 0">
-			<div slot="header" class="clearfix">
-				<span>跟进记录</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="24">
-							<el-form-item label="最新跟进结果" prop="status" class="is-required">
-								<el-radio-group v-model="formData.status">
-								    <el-radio :disabled="status == 'END'" label="ING">继续跟进</el-radio>
-								    <el-radio :disabled="status == 'END'" label="END">无需跟进</el-radio>
-								</el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注" prop="remark" :rules="[{ required: true, message: `请输入备注内容`, trigger: 'blur' }]">
-								<el-input type="textarea" :rows="3" :disabled="status == 'END'" v-model="formData.remark" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-			<div class="table">
-				<div>跟进记录</div><br/>
-				<el-table :data="formData.records" element-loading-text="Loading" border fit highlight-current-row stripe>
-					<el-table-column prop="status" label="跟进结果" align="center">
-						<template slot-scope="scope">
-							{{scope.row.status == 'ING'?'继续跟进':scope.row.status == 'END'?'无需跟进':''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="remark" label="备注" align="center"></el-table-column>
-					<el-table-column prop="createBy" align="center" label="跟进人" ></el-table-column>
-					<el-table-column prop="createTime" align="center" label="跟进时间" ></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-				<el-button v-if="formType == 0 || status == 'ING'" size="small" type="primary" @click="submit()">提交</el-button>
-			</div>
-		</div>
-	</div>
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>基本信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="6">
+              <el-form-item label="所属商户" :required="true">
+                <el-input
+                  type="text"
+                  :value="formData.companyWechatName ? formData.companyWechatName : companyName"
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" style="height: 51px">
+              <el-form-item label="活动名称" prop="promotionActivityId">
+                <el-select
+                  v-model="formData.active"
+                  :disabled="formType != 0"
+                  value-key="id"
+                  @change="
+                    e => {
+                      formData.promotionActivityId = e.id
+                      formData.activeDate = [e.startTime, e.endTime]
+                      this.getActiveDetail(e.id)
+                    }
+                  "
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in activeList" :key="item.id" :label="item.name" :value="item"> </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" style="height: 51px">
+              <el-form-item label="活动网点" prop="customWebsitName">
+                <el-select
+                  v-model="formData.customWebsitName"
+                  :disabled="formType != 0"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in websitList"
+                    :key="index"
+                    :label="item.websitName"
+                    :value="item.websitName"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" style="margin-bottom: 1px">
+              <el-form-item label="活动时间" prop="" class="is-required">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="formData.activeDate"
+                  disabled
+                  type="daterange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="客户名称" prop="userName">
+                <el-input
+                  type="text"
+                  :disabled="formType != 0"
+                  v-model="formData.userName"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="联系人" prop="linkName">
+                <el-input
+                  type="text"
+                  :disabled="formType != 0"
+                  v-model="formData.linkName"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="客户电话" prop="userMobile">
+                <el-input
+                  type="text"
+                  :disabled="formType != 0"
+                  :maxlength="11"
+                  v-model="formData.userMobile"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="客户电话2" prop="userMobile2">
+                <el-input
+                  type="text"
+                  :disabled="formType != 0"
+                  v-model="formData.userMobile2"
+                  placeholder="请输入电话 (固话加区号)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="客户地址" prop="userAddress">
+                <el-input
+                  type="text"
+                  v-model="formData.userAddress"
+                  :disabled="formType != 0"
+                  placeholder="详细地址"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <template v-if="formType != 0">
+              <el-col :span="6">
+                <el-form-item label="提交人" prop="createBy">
+                  <el-input type="text" v-model="formData.createBy" :disabled="true" placeholder="提交人"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="提交时间" prop="createTime">
+                  <el-input
+                    type="text"
+                    v-model="formData.createTime"
+                    :disabled="true"
+                    placeholder="提交时间"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="activeItems.length > 0">
+      <div slot="header" class="clearfix">
+        <span>报名信息</span>
+      </div>
+      <div v-for="(item, index) in activeItems" :key="index">
+        <div class="picker-container" v-if="item.type == 1 || item.type == 2">
+          <div class="label">
+            <span v-if="item.isRequire">*</span>{{ item.question }}({{ { 1: '单选', 2: '多选' }[item.type] }})
+          </div>
+          <div
+            class="img-list"
+            v-if="
+              item.answer &&
+              item.answer.length > 0 &&
+              item.answer[0].option_files &&
+              item.answer[0].option_files.length > 0 &&
+              item.answer[0].option_files[0].url
+            "
+          >
+            <div
+              class="item1"
+              :class="it.active ? 'active' : ''"
+              v-for="(it, idx) in item.answer"
+              :key="idx"
+              @click="clickOption(index, idx)"
+            >
+              <el-image
+                v-if="item.answerType != 2"
+                class="image"
+                :src="$showImgUrl(returnUrl(it))"
+                mode="aspectFill"
+              ></el-image>
+              <div class="text" v-if="item.answerType != 3">{{ it.option_value }}</div>
+            </div>
+          </div>
+          <div class="text-list" v-else>
+            <div
+              class="item"
+              :class="it.active ? 'active' : ''"
+              v-for="(it, idx) in item.answer"
+              :key="idx"
+              @click="clickOption(index, idx)"
+            >
+              {{ it.option_value }}
+            </div>
+          </div>
+        </div>
+        <div class="input-container" v-else-if="item.type == 3">
+          <div class="label"><span v-if="item.isRequire">*</span>{{ item.question }}</div>
+          <el-input
+            type="text"
+            v-model="item.inputValue"
+            show-word-limit
+            :maxlength="item.answer[0].option_limit"
+            :disabled="formType != 0"
+            :placeholder="`请输入${item.question}`"
+          ></el-input>
+        </div>
+        <div class="input-container" v-else-if="item.type == 4">
+          <div class="label"><span v-if="item.isRequire">*</span>{{ item.question }}</div>
+          <br />
+          <ImageUpload
+            :fileList="item.inputValue"
+            :limit="Number(item.answer[0].option_limit)"
+            :isEdit="formType == 0"
+            :fileType="['image']"
+          />
+        </div>
+        <div class="input-container" v-else>
+          <div class="label"><span v-if="item.isRequire">*</span>{{ item.question }}</div>
+          <br />
+          <ImageUpload
+            :fileList="item.inputValue"
+            :limit="Number(item.answer[0].option_limit)"
+            :isEdit="formType == 0"
+            :fileType="['video']"
+          />
+        </div>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formType != 0">
+      <div slot="header" class="clearfix">
+        <span>跟进记录</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="24">
+              <el-form-item label="最新跟进结果" prop="status" class="is-required">
+                <el-radio-group v-model="formData.status">
+                  <el-radio :disabled="status == 'END'" label="ING">继续跟进</el-radio>
+                  <el-radio :disabled="status == 'END'" label="END">无需跟进</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                label="备注"
+                prop="remark"
+                :rules="[{ required: true, message: `请输入备注内容`, trigger: 'blur' }]"
+              >
+                <el-input
+                  type="textarea"
+                  :rows="3"
+                  :disabled="status == 'END'"
+                  v-model="formData.remark"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div class="table">
+        <div>跟进记录</div>
+        <br />
+        <el-table :data="formData.records" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="跟进结果" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.status == 'ING' ? '继续跟进' : scope.row.status == 'END' ? '无需跟进' : '' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="remark" label="备注" align="center"></el-table-column>
+          <el-table-column prop="createBy" align="center" label="跟进人"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="跟进时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+        <el-button v-if="formType == 0 || status == 'ING'" size="small" type="primary" @click="submit()"
+          >提交</el-button
+        >
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	import ImageUpload from '@/components/file-upload'
-	import { getDetail, add, follow, getActiveList, getActiveDetail } from "@/api/activityOrder";
-	export default {
-		components: {ImageUpload},
-		props: ['id','title','formType','activeId'],
-		data() {
-			return {
-				dataList: [],
-				activeList: [],
-				activeItems: [],
-				websitList: [],
-				formData: {
-					active: {},
-					activeDate: [],
-					promotionActivityId: '',
-					customWebsitName: '',
-					userName: '',
-					linkName: '',
-					userMobile: '',
-					userMobile2: '',
-					userAddress: '',
-					status: '',
-					remark: ''
-				},
-				status: '',
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					userMobile: [
-						{ required: true, message: `请输入客户电话`, trigger: 'blur' },
-						{ required: true, message: `请输入客户电话`, trigger: 'change' },
-						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					],
-					userName: [
-						{ required: true, message: '请输入客户名称', trigger: 'blur' }
-					],
-					linkName: [
-						{ required: true, message: '请输入联系人', trigger: 'blur' }
-					],
-					userAddress: [
-						{ required: true, message: '请输入客户地址', trigger: 'blur' }
-					],
-					promotionActivityId: [
-						{ required: true, message: '请选择活动名称', trigger: 'change' }
-					]
-				}
-			};
-		},
-		computed: {
-			returnUrl(){
-				return function(it){
-					return it.option_files.length > 0?it.option_files[0].url:''
-				}
-			}
-		},
-		created() {
-			if(this.id){
-				this.getDetail()
-			}
-			if(this.activeId){
-				this.formData.active = {id: this.activeId}
-				this.formData.promotionActivityId = this.activeId
-				if(this.formType == 0){
-					this.getActiveDetail(this.activeId)
-				}
-			}
-			this.getActiveList()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			async getDetail(){
-				const that = this
-				getDetail({promotionActivityId: this.id}).then( async res => {
-					Object.assign(this.formData, res.data, {
-						active: {id: res.data.promotionQuestionnaireId}
-					})
-					this.websitList = res.data.promotionQuestionnaireQrcodes
-					this.status = res.data.status
-					res.data.items.forEach(item=>{
-						item.answer = JSON.parse(item.answer)
-						
-						item.answer.forEach(it => {
-							if(item.type == 3){
-								item.inputValue = it.option_value
-							}else if(item.type == 4 || item.type == 5){
-								let img = []
-								it.option_value.forEach(t=>{
-									img.push({url: t})
-								})
-								console.log(it.option_value,img)
-								item.inputValue = img
-							}
-						})
-					})
-					this.activeItems = res.data.items
-					getActiveDetail({id:res.data.promotionQuestionnaireId}).then(res => {
-						this.formData.activeDate = [res.data.startTime,res.data.endTime]
-					})
-					// this.getActiveDetail(res.data.promotionQuestionnaireId,res.data.items)
-				})
-			},
-			getActiveList(){
-				getActiveList({pageNum: 1,pageSize: -1,status: 1}).then(res => {
-					this.activeList = res.data.records
-				})
-			},
-			getActiveDetail(id,items){
-				getActiveDetail({id}).then(res => {
-					this.formData.activeDate = [res.data.startTime,res.data.endTime]
-					this.websitList = res.data.promotionQuestionnaireQrcodes
-					res.data.promotionQuestionnaireItems.forEach((item,index)=>{
-						item.answer = JSON.parse(item.answer)
-						if(items){
-							item.answer.forEach(it1 => {
-								items.forEach(it2=>{
-									JSON.parse(it2.answer).forEach(t=>{
-										if(item.id == it2.id && t.active && it1.option_value == t.option_value){
-											console.log(t.option_value)
-											it1.active = true;
-										}
-										if(it2.type == 3){
-											item.inputValue = t.option_value
-										}else if(it2 == 4 || it2 == 5){
-											item.inputValue = [{url: t.option_value}]
-										}
-									})
-								})
-							})
-						}else{
-							if(item.type == 4 || item.type == 5){
-								item.inputValue = []
-							}else{
-								item.inputValue = '';
-							}
-							item.answer.forEach(it => {
-							  it.active = false;
-							})
-						}
-					})
-					this.activeItems = res.data.promotionQuestionnaireItems
-					console.log(this.activeItems,111)
-				})
-			},
-			clickOption(index, idx) {
-				if(this.id){return false}
-			  // 单选题
-			  if(this.activeItems[index].type == 1) {
-			    this.activeItems[index].answer.forEach((item, ind_) => {
-			      this.activeItems[index].answer.splice(ind_, 1, {...item, active: ind_ == idx ? (this.activeItems[index].isRequire ? true : !item.active) : false})
-			    })
-			  }
-			  // 多选题
-			  else {
-			    this.activeItems[index].answer.splice(idx, 1, {...this.activeItems[index].answer[idx], active: !this.activeItems[index].answer[idx].active})
-			  }
-			},
-			submit(){
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if(this.formType == 0){
-							for(let i = 0; i < this.activeItems.length; i++) {
-							  if(this.activeItems[i].isRequire) {
-							    // 单选题多选题
-							    if((this.activeItems[i].type == 1 || this.activeItems[i].type == 2) && this.activeItems[i].answer.every(o => !o.active)) {
-							      return this.$message.warning(`请选择${this.activeItems[i].question}`)
-							    }
-							    // 填写题
-							    if(this.activeItems[i].type == 3 && !this.activeItems[i].inputValue) {
-									return this.$message.warning(`请输入${this.activeItems[i].question}`)
-							    }
-								// 图片视频
-								if((this.activeItems[i].type == 4 || this.activeItems[i].type == 5) && this.activeItems[i].inputValue.length==0) {
-									return this.$message.warning(`请上传${this.activeItems[i].question}`)
-								}
-							  }
-							}
-							// 生成题目提交信息
-							let items = [];
-							let activeItems = JSON.parse(JSON.stringify(this.activeItems));
-							for(let index = 0; index < activeItems.length; index++) {
-							  // 单选题多选题
-							  if ((activeItems[index].type == 1 || activeItems[index].type == 2)) {
-							    // activeItems[index].answer = activeItems[index].answer.filter(o => o.active);
-							    activeItems[index].answer = JSON.stringify(activeItems[index].answer);
-							    items.push(activeItems[index]);
-							  }
-							  // 填写题
-							  if (activeItems[index].type == 3) {
-							    activeItems[index].answer[0].option_value = activeItems[index].inputValue;
-							    activeItems[index].answer = JSON.stringify(activeItems[index].answer);
-							    items.push(activeItems[index]);
-							  }
-							  // 图片视频
-							  if (activeItems[index].type == 4 || activeItems[index].type == 5) {
-								  let option_value = []
-								  activeItems[index].inputValue.forEach(item=>{
-									  option_value.push(item.url)
-								  })
-							    activeItems[index].answer[0].option_value = option_value
-							    activeItems[index].answer = JSON.stringify(activeItems[index].answer);
-							    items.push(activeItems[index]);
-							  }
-							}
-							add({
-								promotionQuestionnaireId: this.formData.promotionActivityId,
-								userName: this.formData.userName,
-								linkName: this.formData.linkName,
-								userMobile: this.formData.userMobile,
-								userMobile2: this.formData.userMobile2,
-								userAddress: this.formData.userAddress,
-								customWebsitName: this.formData.customWebsitName,
-								items
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}else{
-							follow({
-								ids: [this.id],
-								status: this.formData.status,
-								remark: this.formData.remark,
-							}).then(res => {
-								if(res.code == 200){
-									this.dataList = []
-									this.$message.success('提交成功!')
-									this.goBack()
-								}
-							})
-						}
-					}
-				})
-			}
-		}
-	};
+import ImageUpload from '@/components/file-upload'
+import { getDetail, add, follow, getActiveList, getActiveDetail } from '@/api/activityOrder'
+export default {
+  components: { ImageUpload },
+  props: ['id', 'title', 'formType', 'activeId'],
+  data() {
+    return {
+      dataList: [],
+      activeList: [],
+      activeItems: [],
+      websitList: [],
+      formData: {
+        active: {},
+        activeDate: [],
+        promotionActivityId: '',
+        customWebsitName: '',
+        userName: '',
+        linkName: '',
+        userMobile: '',
+        userMobile2: '',
+        userAddress: '',
+        status: '',
+        remark: ''
+      },
+      status: '',
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        userMobile: [
+          { required: true, message: `请输入客户电话`, trigger: 'blur' },
+          { required: true, message: `请输入客户电话`, trigger: 'change' },
+          { pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+        ],
+        userName: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
+        linkName: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+        userAddress: [{ required: true, message: '请输入客户地址', trigger: 'blur' }],
+        promotionActivityId: [{ required: true, message: '请选择活动名称', trigger: 'change' }]
+      }
+    }
+  },
+  computed: {
+    returnUrl() {
+      return function (it) {
+        return it.option_files.length > 0 ? it.option_files[0].url : ''
+      }
+    }
+  },
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    if (this.activeId) {
+      this.formData.active = { id: this.activeId }
+      this.formData.promotionActivityId = this.activeId
+      if (this.formType == 0) {
+        this.getActiveDetail(this.activeId)
+      }
+    }
+    this.getActiveList()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    async getDetail() {
+      const that = this
+      getDetail({ promotionActivityId: this.id }).then(async res => {
+        Object.assign(this.formData, res.data, {
+          active: { id: res.data.promotionQuestionnaireId }
+        })
+        this.websitList = res.data.promotionQuestionnaireQrcodes
+        this.status = res.data.status
+        res.data.items.forEach(item => {
+          item.answer = JSON.parse(item.answer)
+
+          item.answer.forEach(it => {
+            if (item.type == 3) {
+              item.inputValue = it.option_value
+            } else if (item.type == 4 || item.type == 5) {
+              let img = []
+              it.option_value.forEach(t => {
+                img.push({ url: t })
+              })
+              console.log(it.option_value, img)
+              item.inputValue = img
+            }
+          })
+        })
+        this.activeItems = res.data.items
+        getActiveDetail({ id: res.data.promotionQuestionnaireId }).then(res => {
+          this.formData.activeDate = [res.data.startTime, res.data.endTime]
+        })
+        // this.getActiveDetail(res.data.promotionQuestionnaireId,res.data.items)
+      })
+    },
+    getActiveList() {
+      getActiveList({ pageNum: 1, pageSize: -1, status: 1 }).then(res => {
+        this.activeList = res.data.records
+      })
+    },
+    getActiveDetail(id, items) {
+      getActiveDetail({ id }).then(res => {
+        this.formData.activeDate = [res.data.startTime, res.data.endTime]
+        this.websitList = res.data.promotionQuestionnaireQrcodes
+        res.data.promotionQuestionnaireItems.forEach((item, index) => {
+          item.answer = JSON.parse(item.answer)
+          if (items) {
+            item.answer.forEach(it1 => {
+              items.forEach(it2 => {
+                JSON.parse(it2.answer).forEach(t => {
+                  if (item.id == it2.id && t.active && it1.option_value == t.option_value) {
+                    console.log(t.option_value)
+                    it1.active = true
+                  }
+                  if (it2.type == 3) {
+                    item.inputValue = t.option_value
+                  } else if (it2 == 4 || it2 == 5) {
+                    item.inputValue = [{ url: t.option_value }]
+                  }
+                })
+              })
+            })
+          } else {
+            if (item.type == 4 || item.type == 5) {
+              item.inputValue = []
+            } else {
+              item.inputValue = ''
+            }
+            item.answer.forEach(it => {
+              it.active = false
+            })
+          }
+        })
+        this.activeItems = res.data.promotionQuestionnaireItems
+        console.log(this.activeItems, 111)
+      })
+    },
+    clickOption(index, idx) {
+      if (this.id) {
+        return false
+      }
+      // 单选题
+      if (this.activeItems[index].type == 1) {
+        this.activeItems[index].answer.forEach((item, ind_) => {
+          this.activeItems[index].answer.splice(ind_, 1, {
+            ...item,
+            active: ind_ == idx ? (this.activeItems[index].isRequire ? true : !item.active) : false
+          })
+        })
+      }
+      // 多选题
+      else {
+        this.activeItems[index].answer.splice(idx, 1, {
+          ...this.activeItems[index].answer[idx],
+          active: !this.activeItems[index].answer[idx].active
+        })
+      }
+    },
+    submit() {
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formType == 0) {
+            for (let i = 0; i < this.activeItems.length; i++) {
+              if (this.activeItems[i].isRequire) {
+                // 单选题多选题
+                if (
+                  (this.activeItems[i].type == 1 || this.activeItems[i].type == 2) &&
+                  this.activeItems[i].answer.every(o => !o.active)
+                ) {
+                  return this.$message.warning(`请选择${this.activeItems[i].question}`)
+                }
+                // 填写题
+                if (this.activeItems[i].type == 3 && !this.activeItems[i].inputValue) {
+                  return this.$message.warning(`请输入${this.activeItems[i].question}`)
+                }
+                // 图片视频
+                if (
+                  (this.activeItems[i].type == 4 || this.activeItems[i].type == 5) &&
+                  this.activeItems[i].inputValue.length == 0
+                ) {
+                  return this.$message.warning(`请上传${this.activeItems[i].question}`)
+                }
+              }
+            }
+            // 生成题目提交信息
+            let items = []
+            let activeItems = JSON.parse(JSON.stringify(this.activeItems))
+            for (let index = 0; index < activeItems.length; index++) {
+              // 单选题多选题
+              if (activeItems[index].type == 1 || activeItems[index].type == 2) {
+                // activeItems[index].answer = activeItems[index].answer.filter(o => o.active);
+                activeItems[index].answer = JSON.stringify(activeItems[index].answer)
+                items.push(activeItems[index])
+              }
+              // 填写题
+              if (activeItems[index].type == 3) {
+                activeItems[index].answer[0].option_value = activeItems[index].inputValue
+                activeItems[index].answer = JSON.stringify(activeItems[index].answer)
+                items.push(activeItems[index])
+              }
+              // 图片视频
+              if (activeItems[index].type == 4 || activeItems[index].type == 5) {
+                let option_value = []
+                activeItems[index].inputValue.forEach(item => {
+                  option_value.push(item.url)
+                })
+                activeItems[index].answer[0].option_value = option_value
+                activeItems[index].answer = JSON.stringify(activeItems[index].answer)
+                items.push(activeItems[index])
+              }
+            }
+            add({
+              promotionQuestionnaireId: this.formData.promotionActivityId,
+              userName: this.formData.userName,
+              linkName: this.formData.linkName,
+              userMobile: this.formData.userMobile,
+              userMobile2: this.formData.userMobile2,
+              userAddress: this.formData.userAddress,
+              customWebsitName: this.formData.customWebsitName,
+              items
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          } else {
+            follow({
+              ids: [this.id],
+              status: this.formData.status,
+              remark: this.formData.remark
+            }).then(res => {
+              if (res.code == 200) {
+                this.dataList = []
+                this.$message.success('提交成功!')
+                this.goBack()
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.page-footer {
-		height: 70px;
-	}
-	.input-container {
-	  margin-top: 20px;
-	  .label {
-	    font-size: 14px;
-	    font-weight: bold;
-	    span {
-	      color: red;
-	    }
-	  }
-	}
-	.picker-container {
-	  margin-top: 20px;
-	  .label {
-	    font-size: 14px;
-	    font-weight: bold;
-	    span {
-	      color: red;
-	    }
-	  }
-	  .text-list {
-	    display: flex;
-	    flex-wrap: wrap;
-	    .item {
-	      margin-top: 20px;
-	      margin-right: 20px;
-	      height: 40px;
-	      border-radius: 30px;
-	      background: #f5f5f5;
-	      font-size: 14px;
-	      display: flex;
-	      align-items: center;
-	      justify-content: center;
-	      box-sizing: border-box;
-		  cursor: pointer;
-		  padding: 0 40px;
-	      &.active {
-	        border: 1px solid #f6390d;
-	        color: #f6390d;
-	        background: #ffffff;
-	      }
-	    }
-	  }
-	  .img-list {
-	    display: flex;
-	    flex-wrap: wrap;
-	    .item,.item1 {
-	      margin-top: 10px;
-	      margin-right: 10px;
-	      border-radius: 20px;
-		  height: 40px;
-	      display: flex;
-	      flex-direction: column;
-	      align-items: center;
-	      justify-content: center;
-	      box-sizing: border-box;
-	      padding: 0 40px;
-		  background-color: #f3f3f3;
-		  cursor: pointer;
-	      .image {
-	        width: 100%;
-	        height: 60px;
-	      }
-	      .text {
-	        font-size: 14px;
-	      }
-	      &.active {
-	        border: 1px solid #f6390d;
-			background-color: #ffffff;
-	        .text {
-	          color: #f6390d;
-	        }
-	      }
-	    }
-		.item1{
-			height: 130px;
-			border-radius: 6px;
-			padding: 6px;
-			.image {
-			  width: 120px;
-			  height: 100px;
-			}
-		}
-	  }
-	}
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.page-footer {
+  height: 70px;
+}
+.input-container {
+  margin-top: 20px;
+  .label {
+    font-size: 14px;
+    font-weight: bold;
+    span {
+      color: red;
+    }
+  }
+}
+.picker-container {
+  margin-top: 20px;
+  .label {
+    font-size: 14px;
+    font-weight: bold;
+    span {
+      color: red;
+    }
+  }
+  .text-list {
+    display: flex;
+    flex-wrap: wrap;
+    .item {
+      margin-top: 20px;
+      margin-right: 20px;
+      height: 40px;
+      border-radius: 30px;
+      background: #f5f5f5;
+      font-size: 14px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      box-sizing: border-box;
+      cursor: pointer;
+      padding: 0 40px;
+      &.active {
+        border: 1px solid #f6390d;
+        color: #f6390d;
+        background: #ffffff;
+      }
+    }
+  }
+  .img-list {
+    display: flex;
+    flex-wrap: wrap;
+    .item,
+    .item1 {
+      margin-top: 10px;
+      margin-right: 10px;
+      border-radius: 20px;
+      height: 40px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      box-sizing: border-box;
+      padding: 0 40px;
+      background-color: #f3f3f3;
+      cursor: pointer;
+      .image {
+        width: 100%;
+        height: 60px;
+      }
+      .text {
+        font-size: 14px;
+      }
+      &.active {
+        border: 1px solid #f6390d;
+        background-color: #ffffff;
+        .text {
+          color: #f6390d;
+        }
+      }
+    }
+    .item1 {
+      height: 130px;
+      border-radius: 6px;
+      padding: 6px;
+      .image {
+        width: 120px;
+        height: 100px;
+      }
+    }
+  }
+}
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 4 - 4
src/views/mallManagement/configCenter/brand/index.vue

@@ -7,13 +7,13 @@
 			      <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEdit('add')">添加品牌</el-button>
 			    </div>
 			  </div>
-			
+
 			  <div class="table">
 			    <el-table ref="noticeTable" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
 			      <el-table-column align="center" label="服务品牌" prop="brandName" min-width="180"></el-table-column>
 			      <el-table-column align="center" label="图片" prop="imageUrl">
 			        <template slot-scope="scope">
-			          <el-image style="width: 40px; height: 40px; display: block; margin: 0 auto;" :src="scope.row.imageUrl" :preview-src-list="[scope.row.imageUrl]" fit="cover">
+			          <el-image style="width: 40px; height: 40px; display: block; margin: 0 auto;" :src="$showImgUrl(scope.row.imageUrl)" :preview-src-list="[$showImgUrl(scope.row.imageUrl)]" fit="cover">
 			            <div slot="error" style="height: 100%;font-size: 40px;">
 			              <i class="el-icon-picture-outline"></i>
 			            </div>
@@ -72,7 +72,7 @@
 							    :show-file-list="false"
 							    :on-success="uploadSuccess"
 							    :before-upload="beforeUpload">
-							    <img v-if="addForm.imgUrl" :src="addForm.imgUrl" class="avatar">
+							    <img v-if="addForm.imgUrl" :src="$showImgUrl(addForm.imgUrl)" class="avatar">
 							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
 							  </el-upload>
 							</el-form-item>
@@ -233,4 +233,4 @@ export default {
 
 <style scoped lang="scss">
 
-</style>
+</style>

+ 274 - 227
src/views/mallManagement/configCenter/chargingStandard/index.vue

@@ -1,36 +1,60 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList">
-			</template-page>
-			<div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				  <zj-form-module title="" label-width="100px" :showPackUp="false"
-				    :form-data="formData" :form-items="formItems">
-				  </zj-form-module>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="100px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { chargingStandardList2, getMainList, getMainDetail, saveMain, deleteMain, getTypeList, getBrandList } from "@/api/miniapp";
+import {
+  chargingStandardList2,
+  getMainList,
+  getMainDetail,
+  saveMain,
+  deleteMain,
+  getTypeList,
+  getBrandList
+} from '@/api/miniapp'
 import { getClassifyList } from '@/api/goods'
 import ImageUpload from '@/components/file-upload'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin,operation_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
       // 表格属性
@@ -46,140 +70,152 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增", "编辑", "查看"],
+      formDialogTitles: ['新增', '编辑', '查看'],
       formDialog: false,
       formData: {
-        chargingStandardTypeId: "",
-        brandId: "",
-        oneCategoryId: "",
-        twoCategoryId: "",
+        chargingStandardTypeId: '',
+        brandId: '',
+        oneCategoryId: '',
+        twoCategoryId: '',
         status: true,
-        imageUrl: [],
+        imageUrl: []
       },
       businessTypeList: [], // 业务类型列表
       brandList: [], // 品牌列表
       mainList: [], // 一级分类列表
       smallList: [], // 二级分类列表
-	  formType: 'add',
-	  formVisible: false,
+      formType: 'add',
+      formVisible: false
+    }
+  },
+  watch: {
+    'formData.imageUrl'() {
+      this.$refs?.formRef?.validateField(['imageUrl'])
     }
   },
-	watch: {
-		'formData.imageUrl'(){
-			this.$refs?.formRef?.validateField(["imageUrl"])
-		}
-	},
   computed: {
-	// 事件组合
-	optionsEvensGroup() {
-		return [
-			[
-				[
-					this.optionsEvensAuth("add", {
-						click: () => {
-							this.openForm('add')
-						}
-					})
-				],
-			]
-		]
-	},
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
     },
     formItems() {
-      return [{
-        md: 6,
-        isShow: true,
-        name: 'el-select',
-        options: this.businessTypeList,
-        attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2, },
-        formItemAttributes: {
-          label: '业务类型',
-          prop: 'chargingStandardTypeId',
-          rules: [...required]
-        }
-      },
-      {
-        md: 6,
-        isShow: true,
-        name: 'el-select',
-        options: this.brandList,
-        attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2, },
-        formItemAttributes: {
-          label: '服务品牌',
-          prop: 'brandId',
-          rules: [...required]
-        }
-      },
-      {
-        md: 6,
-        isShow: true,
-        name: 'el-select',
-        options: this.mainList,
-        attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2, },
-        formItemAttributes: {
-          label: '一级分类',
-          prop: 'oneCategoryId',
-          rules: [...required]
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select',
+          options: this.businessTypeList,
+          attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+          formItemAttributes: {
+            label: '业务类型',
+            prop: 'chargingStandardTypeId',
+            rules: [...required]
+          }
         },
-        events: {
-          change: async val => {
-            this.smallList = []
-            this.formData.twoCategoryId = ""
-            if (val) {
-              this.smallList = this.mainList.find(item => {
-                return item.value == val;
-              })?.data?.children?.map(item => ({
-                label: item.name,
-                value: item.categoryId,
-                data: item
-              })) || [];
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select',
+          options: this.brandList,
+          attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+          formItemAttributes: {
+            label: '服务品牌',
+            prop: 'brandId',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select',
+          options: this.mainList,
+          attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+          formItemAttributes: {
+            label: '一级分类',
+            prop: 'oneCategoryId',
+            rules: [...required]
+          },
+          events: {
+            change: async val => {
+              this.smallList = []
+              this.formData.twoCategoryId = ''
+              if (val) {
+                this.smallList =
+                  this.mainList
+                    .find(item => {
+                      return item.value == val
+                    })
+                    ?.data?.children?.map(item => ({
+                      label: item.name,
+                      value: item.categoryId,
+                      data: item
+                    })) || []
+              }
             }
           }
-        }
-      },
-      {
-        md: 6,
-        isShow: true,
-        name: 'el-select',
-        options: this.smallList,
-        attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2, },
-        formItemAttributes: {
-          label: '二级分类',
-          prop: 'twoCategoryId',
-          rules: [...required]
-        }
-      },
-      {
-        md: 6,
-        isShow: true,
-        name: 'el-radio',
-        options: [{ label: "开启", value: true }, { label: "禁用", value: false }],
-        attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
-        formItemAttributes: {
-          label: '状态',
-          prop: 'status',
-          rules: [...required]
-        }
-      },
-      {
-        md: 24,
-        isShow: true,
-        name: 'slot-component',
-        formItemAttributes: {
-          label: '图片',
-          prop: 'imageUrl',
-          rules: [...required]
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          return (
-            <ImageUpload fileList={this.formData.imageUrl} uid="imgSrc_chargingStandard_materials_drawing_images" limit={1} isEdit={this.formDialogType !== 2} />
-          )
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select',
+          options: this.smallList,
+          attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+          formItemAttributes: {
+            label: '二级分类',
+            prop: 'twoCategoryId',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '开启', value: true },
+            { label: '禁用', value: false }
+          ],
+          attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '图片',
+            prop: 'imageUrl',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <ImageUpload
+                fileList={this.formData.imageUrl}
+                uid="imgSrc_chargingStandard_materials_drawing_images"
+                limit={1}
+                isEdit={this.formDialogType !== 2}
+              />
+            )
+          }
         }
-      },
       ]
     }
   },
@@ -187,14 +223,24 @@ export default {
     // 列表请求函数
     getList: chargingStandardList2,
     // 列表导出函数
-    exportList() { },
+    exportList() {},
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
       if (item.jname === 'imageUrl') {
         defaultData.render = (h, { row, index, column }) => {
           return (
             <div style="padding:0 6px;cursor: pointer;">
-              {row.imageUrl ? row.imageUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} style="width:80px;height:auto;" />) : null}
+              {row.imageUrl
+                ? row.imageUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        style="width:80px;height:auto;"
+                      />
+                    ))
+                : null}
             </div>
           )
         }
@@ -207,115 +253,116 @@ export default {
     },
     // 表格操作列
     operation() {
-		return this.operationBtn({
-			detail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.openForm('detail',row.id)
-				}
-			},
-			edit: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.openForm('edit',row.id)
-				}
-			},
-			del: {
-				btnType: 'text',
-				prompt: '确定删除吗?',
-				click: ({ row, index, column }) => {
-					deleteMain({ id: row.id }).then(res => {
-						this.$message({
-							type: 'success',
-							message: `删除成功!`,
-						})
-						this.$refs.pageRef.refreshList()
-					})
-				}
-			}
-		})
+      return this.operationBtn({
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openForm('detail', row.id)
+          }
+        },
+        edit: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.id)
+          }
+        },
+        del: {
+          btnType: 'text',
+          prompt: '确定删除吗?',
+          click: ({ row, index, column }) => {
+            deleteMain({ id: row.id }).then(res => {
+              this.$message({
+                type: 'success',
+                message: `删除成功!`
+              })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        }
+      })
+    },
+    // 取消 新增编辑
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    // 打开 新增编辑 网点表单
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增', detail: '查看' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+              this.initData()
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              getMainDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : []
+                })
+                this.initData()
+              })
+            } else {
+              this.formDialogType = 2
+              getMainDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : []
+                })
+                this.initData()
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
     },
-	// 取消 新增编辑
-	formCancel() {
-	  this.formVisible = false
-	  this.$refs?.formRef?.resetFields()
-	  this.$data.formData = this.$options.data().formData
-	},
-	// 打开 新增编辑 网点表单
-	openForm(type, id) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit: "编辑", add: "新增", detail: "查看" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				this.formCancel()
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					if (type == 'add') {
-						this.formDialogType = 0
-						this.initData()
-					} else if(type == 'edit'){
-						this.formDialogType = 1
-						getMainDetail({ id }).then(res => {
-							Object.assign(this.formData, res.data, {
-								imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
-							})
-							this.initData()
-						})
-					}else{
-						this.formDialogType = 2
-						getMainDetail({ id }).then(res => {
-							Object.assign(this.formData, res.data, {
-								imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
-							})
-							this.initData()
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-			
-			}
-		})
-	},
     initData() {
       Promise.all([
         getTypeList(),
         getBrandList(),
         getClassifyList({
           type: 2,
-          name: '',
+          name: ''
         })
       ]).then(([res1, res2, res3]) => {
         this.businessTypeList = res1.data.map(item => ({
           label: item.name,
           value: item.id,
           data: item
-        }));
+        }))
         this.brandList = res2.data.map(item => ({
           label: item.brandName,
           value: item.id,
           data: item
-        }));
+        }))
         this.mainList = res3.data.map(item => ({
           label: item.name,
           value: item.categoryId,
           data: item
-        }));
+        }))
         if (this.formData.oneCategoryId) {
-          this.smallList = this.mainList.find(item => {
-            return item.value == this.formData.oneCategoryId;
-          })?.data?.children?.map(item => ({
-            label: item.name,
-            value: item.categoryId,
-            data: item
-          })) || [];
+          this.smallList =
+            this.mainList
+              .find(item => {
+                return item.value == this.formData.oneCategoryId
+              })
+              ?.data?.children?.map(item => ({
+                label: item.name,
+                value: item.categoryId,
+                data: item
+              })) || []
         }
       })
     },
@@ -324,19 +371,19 @@ export default {
         if (valid) {
           var pam = {
             ...this.formData,
-            imageUrl: this.formData.imageUrl.map(item => item.url).join(","),
-          };
+            imageUrl: this.formData.imageUrl.map(item => item.url).join(',')
+          }
           saveMain({ ...pam, type: 1 }).then(res => {
             this.$message({
               type: 'success',
-              message: this.formDialogTitles[this.formDialogType] + `成功!`,
+              message: this.formDialogTitles[this.formDialogType] + `成功!`
             })
             cancel('list')
             this.$refs.pageRef.refreshList()
           })
         }
       })
-    },
+    }
   }
 }
 </script>

+ 164 - 110
src/views/mallManagement/configCenter/mallConfig/index.vue

@@ -12,18 +12,27 @@
             <el-radio-group v-model="currentTemplate" @change="changeTemplate()">
               <div class="item">
                 <el-radio :label="1" disabled>模版一</el-radio>
-                <el-image :src="require('@/assets/template/tmp_1_thumb.png')"
-                  :preview-src-list="[require('@/assets/template/tmp_1.png')]" fit="cover"></el-image>
+                <el-image
+                  :src="require('@/assets/template/tmp_1_thumb.png')"
+                  :preview-src-list="[require('@/assets/template/tmp_1.png')]"
+                  fit="cover"
+                ></el-image>
               </div>
               <div class="item">
                 <el-radio :label="2">模版二</el-radio>
-                <el-image :src="require('@/assets/template/tmp_2_thumb.png')"
-                  :preview-src-list="[require('@/assets/template/tmp_2.png')]" fit="cover"></el-image>
+                <el-image
+                  :src="require('@/assets/template/tmp_2_thumb.png')"
+                  :preview-src-list="[require('@/assets/template/tmp_2.png')]"
+                  fit="cover"
+                ></el-image>
               </div>
               <div class="item">
                 <el-radio :label="3" disabled>模版三</el-radio>
-                <el-image :src="require('@/assets/template/tmp_3_thumb.png')"
-                  :preview-src-list="[require('@/assets/template/tmp_3.png')]" fit="cover"></el-image>
+                <el-image
+                  :src="require('@/assets/template/tmp_3_thumb.png')"
+                  :preview-src-list="[require('@/assets/template/tmp_3.png')]"
+                  fit="cover"
+                ></el-image>
               </div>
             </el-radio-group>
           </el-form-item>
@@ -273,15 +282,26 @@
 
       <div v-show="step == 'second'">
         <el-form label-width="120px" label-position="right">
-          <el-upload class="avatar-uploader" :action="baseURL + 'common/upload'" :headers="myHeaders"
-            :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
+          <el-upload
+            class="avatar-uploader"
+            :action="baseURL + 'common/upload'"
+            :headers="myHeaders"
+            :show-file-list="false"
+            :on-success="uploadSuccess"
+            :before-upload="beforeUpload"
+          >
           </el-upload>
           <el-form-item label="主logo:" prop="imgUrl">
             <div class="images">
               <div class="main-img">
-                <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
-                  <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px"
-                    fit="contain"></el-image>
+                <div class="img" v-if="img1_url" @mouseover="img1_hover = true" @mouseout="img1_hover = false">
+                  <el-image
+                    ref="img1"
+                    :src="$showImgUrl(img1_url)"
+                    :preview-src-list="[$showImgUrl(img1_url)]"
+                    style="width: 120px; height: 120px"
+                    fit="contain"
+                  ></el-image>
                   <div class="mask" v-show="img1_hover">
                     <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
                     <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
@@ -292,9 +312,12 @@
                 </div>
               </div>
               <div class="tmp-img">
-                <el-image :src="require('@/assets/template/template_1.png')"
+                <el-image
+                  :src="require('@/assets/template/template_1.png')"
                   :preview-src-list="[require('@/assets/template/template_1.png')]"
-                  style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                  style="width: 120px; height: 120px; display: block"
+                  fit="contain"
+                ></el-image>
                 <div class="tmp">示例图</div>
               </div>
             </div>
@@ -305,9 +328,14 @@
           <el-form-item label="通用logo:" prop="imgUrl">
             <div class="images">
               <div class="main-img">
-                <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
-                  <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px"
-                    fit="contain"></el-image>
+                <div class="img" v-if="img2_url" @mouseover="img2_hover = true" @mouseout="img2_hover = false">
+                  <el-image
+                    ref="img2"
+                    :src="$showImgUrl(img2_url)"
+                    :preview-src-list="[$showImgUrl(img2_url)]"
+                    style="width: 120px; height: 120px"
+                    fit="contain"
+                  ></el-image>
                   <div class="mask" v-show="img2_hover">
                     <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
                     <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
@@ -318,9 +346,12 @@
                 </div>
               </div>
               <div class="tmp-img">
-                <el-image :src="require('@/assets/template/template_2.png')"
+                <el-image
+                  :src="require('@/assets/template/template_2.png')"
                   :preview-src-list="[require('@/assets/template/template_2.png')]"
-                  style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                  style="width: 120px; height: 120px; display: block"
+                  fit="contain"
+                ></el-image>
                 <div class="tmp">示例图</div>
               </div>
             </div>
@@ -331,9 +362,14 @@
           <el-form-item label="头像logo:" prop="imgUrl">
             <div class="images">
               <div class="main-img">
-                <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
-                  <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px"
-                    fit="contain"></el-image>
+                <div class="img" v-if="img3_url" @mouseover="img3_hover = true" @mouseout="img3_hover = false">
+                  <el-image
+                    ref="img3"
+                    :src="$showImgUrl(img3_url)"
+                    :preview-src-list="[$showImgUrl(img3_url)]"
+                    style="width: 120px; height: 120px"
+                    fit="contain"
+                  ></el-image>
                   <div class="mask" v-show="img3_hover">
                     <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
                     <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
@@ -344,9 +380,12 @@
                 </div>
               </div>
               <div class="tmp-img">
-                <el-image :src="require('@/assets/template/template_3.png')"
+                <el-image
+                  :src="require('@/assets/template/template_3.png')"
                   :preview-src-list="[require('@/assets/template/template_3.png')]"
-                  style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                  style="width: 120px; height: 120px; display: block"
+                  fit="contain"
+                ></el-image>
                 <div class="tmp">示例图</div>
               </div>
             </div>
@@ -359,10 +398,20 @@
 
       <div class="page-footer">
         <div class="footer" :class="classObj">
-          <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first' && $restrict('save')">{{ formLoading
-            ? '保存中 ...' : '保 存' }}</el-button>
-          <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second' && $restrict('save')">{{ formLoading
-            ? '保存中 ...' : '保 存' }}</el-button>
+          <el-button
+            type="primary"
+            @click="submitStep1Form"
+            :loading="formLoading"
+            v-if="step == 'first' && $restrict('save')"
+            >{{ formLoading ? '保存中 ...' : '保 存' }}</el-button
+          >
+          <el-button
+            type="primary"
+            @click="submitStep2Form"
+            :loading="formLoading"
+            v-if="step == 'second' && $restrict('save')"
+            >{{ formLoading ? '保存中 ...' : '保 存' }}</el-button
+          >
         </div>
       </div>
     </div>
@@ -370,23 +419,22 @@
     <div v-else>
       <div class="nodata">超级管理员无法进行商城配置</div>
     </div>
-
   </div>
 </template>
 
 <script>
-import { getToken, getUserid } from '@/utils/auth';
-import { getTemplate, editAccount, editTemplate, getDetail } from "@/api/merchant";
+import { getToken, getUserid } from '@/utils/auth'
+import { getTemplate, editAccount, editTemplate, getDetail } from '@/api/merchant'
 import { getInfo } from '@/api/user'
 export default {
   data() {
     return {
-      isAdmin: JSON.parse(localStorage.getItem("greemall_user")).type === 2,
+      isAdmin: JSON.parse(localStorage.getItem('greemall_user')).type === 2,
       baseURL: process.env.VUE_APP_BASE_API,
       myHeaders: { 'x-token': getToken() },
       step: 'first',
-      companyId: JSON.parse(localStorage.getItem("greemall_user")).companyWechatId,
-      currentTemplate: JSON.parse(localStorage.getItem("greemall_user")).useTemplate,
+      companyId: JSON.parse(localStorage.getItem('greemall_user')).companyWechatId,
+      currentTemplate: JSON.parse(localStorage.getItem('greemall_user')).useTemplate,
 
       switch_dialog: true,
       switch_banner: true,
@@ -425,20 +473,20 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    },
+    }
   },
 
   created() {
-    if (this.isAdmin) return false;
-    this.getTemplate();
+    if (this.isAdmin) return false
+    this.getTemplate()
   },
 
   watch: {
     step() {
       if (this.step === 'first') {
-        this.getTemplate();
+        this.getTemplate()
       } else {
-        this.getLogoDetail();
+        this.getLogoDetail()
       }
     }
   },
@@ -450,130 +498,136 @@ export default {
         companyId: this.companyId
       }).then(res => {
         if (res.data) {
-          this.templateList = res.data;
+          this.templateList = res.data
         }
-        this.initHome();
+        this.initHome()
       })
     },
 
     // 切换模版
     changeTemplate() {
-      this.initHome();
+      this.initHome()
     },
 
     // 初始化配置
     initHome() {
-      let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate);
-      this.switch_dialog = this.templateList[index].popupStatus;
-      this.switch_banner = this.templateList[index].carouseStatus;
-      this.switch_activity1 = this.templateList[index].active1Status;
-      this.switch_classify = this.templateList[index].categoryStatus;
-      this.switch_activity2 = this.templateList[index].active2Status;
-      this.switch_special = this.templateList[index].onlyStatus;
-      this.switch_seckill = this.templateList[index].killStatus;
-      this.switch_coupon = this.templateList[index].couponStatus;
-      this.switch_manager = this.templateList[index].customerStatus;
-      this.switch_notice = this.templateList[index].notiveStatus;
-      this.switch_newclassify = this.templateList[index].newsStatus;
-      this.switch_recom = this.templateList[index].okStatus;
-      this.switch_selected = this.templateList[index].topicsStatus;
-      this.switch_bottom = this.templateList[index].bottomBannerStatus;
+      let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate)
+      this.switch_dialog = this.templateList[index].popupStatus
+      this.switch_banner = this.templateList[index].carouseStatus
+      this.switch_activity1 = this.templateList[index].active1Status
+      this.switch_classify = this.templateList[index].categoryStatus
+      this.switch_activity2 = this.templateList[index].active2Status
+      this.switch_special = this.templateList[index].onlyStatus
+      this.switch_seckill = this.templateList[index].killStatus
+      this.switch_coupon = this.templateList[index].couponStatus
+      this.switch_manager = this.templateList[index].customerStatus
+      this.switch_notice = this.templateList[index].notiveStatus
+      this.switch_newclassify = this.templateList[index].newsStatus
+      this.switch_recom = this.templateList[index].okStatus
+      this.switch_selected = this.templateList[index].topicsStatus
+      this.switch_bottom = this.templateList[index].bottomBannerStatus
     },
 
     // 保存首页配置
     submitStep1Form() {
-      let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate);
+      let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate)
       let params = {
         companyWechatId: this.companyId,
         useTemplate: this.currentTemplate,
-        companyWechatTemplatesList: [{
-          companyWechatTemplateId: this.templateList[index].companyWechatTemplateId,
-          templateType: this.templateList[index].templateType,
-          popupStatus: this.switch_dialog,
-          carouseStatus: this.switch_banner,
-          active1Status: this.switch_activity1,
-          categoryStatus: this.switch_classify,
-          active2Status: this.switch_activity2,
-          onlyStatus: this.switch_special,
-          killStatus: this.switch_seckill,
-          couponStatus: this.switch_coupon,
-          customerStatus: this.switch_manager,
-          notiveStatus: this.switch_notice,
-          newsStatus: this.switch_newclassify,
-          okStatus: this.switch_recom,
-          topicsStatus: this.switch_selected,
-          bottomBannerStatus: this.switch_bottom,
-        }],
+        companyWechatTemplatesList: [
+          {
+            companyWechatTemplateId: this.templateList[index].companyWechatTemplateId,
+            templateType: this.templateList[index].templateType,
+            popupStatus: this.switch_dialog,
+            carouseStatus: this.switch_banner,
+            active1Status: this.switch_activity1,
+            categoryStatus: this.switch_classify,
+            active2Status: this.switch_activity2,
+            onlyStatus: this.switch_special,
+            killStatus: this.switch_seckill,
+            couponStatus: this.switch_coupon,
+            customerStatus: this.switch_manager,
+            notiveStatus: this.switch_notice,
+            newsStatus: this.switch_newclassify,
+            okStatus: this.switch_recom,
+            topicsStatus: this.switch_selected,
+            bottomBannerStatus: this.switch_bottom
+          }
+        ]
       }
-      this.formLoading = true;
-      editTemplate(params).then(res => {
-        this.getTemplate();
-        this.$successMsg('保存成功');
-        getInfo(getUserid()).then(response => {
-          localStorage.setItem("greemall_user", JSON.stringify(response.data));
+      this.formLoading = true
+      editTemplate(params)
+        .then(res => {
+          this.getTemplate()
+          this.$successMsg('保存成功')
+          getInfo(getUserid()).then(response => {
+            localStorage.setItem('greemall_user', JSON.stringify(response.data))
+          })
+        })
+        .finally(res => {
+          this.formLoading = false
         })
-      }).finally(res => {
-        this.formLoading = false;
-      })
     },
 
     // 获取logo信息
     getLogoDetail() {
       getDetail({ adminUserId: getUserid() }).then(res => {
-        this.img1_url = res.data.minLogo1;
-        this.img2_url = res.data.minLogo2;
-        this.img3_url = res.data.minLogo3;
+        this.img1_url = res.data.minLogo1
+        this.img2_url = res.data.minLogo2
+        this.img3_url = res.data.minLogo3
       })
     },
 
     uploadImage(type) {
-      this.uploadImageType = type;
-      document.querySelector('.avatar-uploader input').click();
+      this.uploadImageType = type
+      document.querySelector('.avatar-uploader input').click()
     },
 
     // 上传图片
     uploadSuccess(res, file) {
-      this[this.uploadImageType + '_url'] = res.data.url;
+      this[this.uploadImageType + '_url'] = res.data.url
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/jpeg/png文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/jpeg/png文件!')
+        return false
       }
     },
 
     // 预览图片
     previewImage(type) {
-      this.$refs[type].showViewer = true;
+      this.$refs[type].showViewer = true
     },
 
     submitStep2Form() {
       if (!this.img1_url) {
-        return this.$errorMsg('请上传主logo');
+        return this.$errorMsg('请上传主logo')
       }
       if (!this.img2_url) {
-        return this.$errorMsg('请上传通用logo');
+        return this.$errorMsg('请上传通用logo')
       }
       if (!this.img3_url) {
-        return this.$errorMsg('请上传头像logo');
+        return this.$errorMsg('请上传头像logo')
       }
-      this.formLoading = true;
+      this.formLoading = true
       let params = {
         companyWechatId: this.companyId,
         mainLog: this.img1_url,
         commonLog: this.img2_url,
-        minLogo: this.img3_url,
+        minLogo: this.img3_url
       }
-      editTemplate(params).then(res => {
-        this.getLogoDetail();
-        this.$successMsg('保存成功');
-      }).finally(res => {
-        this.formLoading = false;
-      })
-    },
+      editTemplate(params)
+        .then(res => {
+          this.getLogoDetail()
+          this.$successMsg('保存成功')
+        })
+        .finally(res => {
+          this.formLoading = false
+        })
+    }
   }
 }
 </script>
@@ -709,7 +763,7 @@ export default {
       border-bottom: 1px solid #eaeaea;
     }
 
-    >div {
+    > div {
       flex: 1;
       display: flex;
       align-items: center;
@@ -726,7 +780,7 @@ export default {
         color: #666666;
 
         &.on {
-          color: #409EFF;
+          color: #409eff;
         }
       }
     }
@@ -737,4 +791,4 @@ export default {
   font-size: 18px;
   color: #666666;
 }
-</style>
+</style>

+ 400 - 320
src/views/mallManagement/configCenter/serviceProduct/index.vue

@@ -1,171 +1,265 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<div v-if="activeKey == 'list'" class="app-container">
-			  <div class="btn-group clearfix">
-			    <div class="fl">
-			      <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add1')">添加分类</el-button>
-			    </div>
-			    <div class="fr">
-			      <el-input placeholder="请输入分类名称进行搜索" v-model="screenForm.keyword" size="small" style="width: 240px;" clearable>
-			        <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
-			      </el-input>
-			    </div>
-			  </div>
-			
-			  <div class="table">
-			    <el-table :data="dataList" row-key="categoryId" border default-expand-all :tree-props="{children: 'children'}">
-			      <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
-			      <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
-			        <template slot-scope="scope">
-			          <el-image style="width: 40px; height: 40px; display: block; margin: 0 auto;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover">
-			            <div slot="error" style="height: 100%;font-size: 40px;">
-			              <i class="el-icon-picture-outline"></i>
-			            </div>
-			          </el-image>
-			        </template>
-			      </el-table-column>
-			      <el-table-column align="center" prop="createTime" label="创建时间" min-width="160"></el-table-column>
-			      <!-- <el-table-column align="center" prop="goodsNum" label="商品数"></el-table-column> -->
-			      <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
-			      <el-table-column align="center" prop="companyName" label="商户" min-width="120"></el-table-column>
-			      <el-table-column align="center" label="状态" class-name="status-col">
-			        <template slot-scope="scope">
-			          <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '显示':'隐藏' }}</el-tag>
-			        </template>
-			      </el-table-column>
-			      <el-table-column align="right" label="操作" width="150" fixed="right">
-			        <template slot-scope="scope">
-			          <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1 && $restrict('add')" @click="addOrEditChild('add2', scope.row.categoryId)"></el-button>
-			          <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1 && $restrict('edit')" @click="addOrEditParent('edit1', scope.row.categoryId)"></el-button>
-			          <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2 && $restrict('edit')" @click="addOrEditChild('edit2', scope.row.categoryId)"></el-button>
-			          <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
-			            <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
-			          </el-popconfirm>
-			
-			        </template>
-			      </el-table-column>
-			    </el-table>
-			  </div>
-			</div>
-			<!-- 新增编辑 一级分类 -->
-			<div v-if="addParentFormVisible" class="app-container">
-				<el-form ref="addParentForm" :model="addParentForm" :rules="addParentFormRules" label-position="left" label-width="80px">
-					<el-row :gutter="20">
-						<el-col :span="6">
-							<el-form-item label="一级分类" prop="oneClassify">
-							  <el-input type="text" placeholder="请输入一级分类名称" v-model="addParentForm.oneClassify" maxlength="10" show-word-limit style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="状态" prop="status">
-							  <el-radio-group v-model="addParentForm.status">
-							    <el-radio :label="true">显示</el-radio>
-							    <el-radio :label="false">隐藏</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="排序" prop="sort">
-							  <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="分类图片" prop="imgUrl">
-							  <el-upload
-							    class="avatar-uploader"
-							    style="height:122px"
-							    :action="baseURL + 'common/upload'"
-							    :headers="myHeaders"
-							    :show-file-list="false"
-							    :on-success="uploadSuccess"
-							    :before-upload="beforeUpload">
-							    <img v-if="addParentForm.imgUrl" :src="addParentForm.imgUrl" class="avatar">
-							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-							  </el-upload>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-				<div slot="footer" class="dialog-footer">
-				  <el-button @click="data.removeTab()">取 消</el-button>
-				  <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
-				</div>
-			</div>
-			<!-- 新增编辑 二级分类 -->
-			<div v-if="addChildFormVisible" class="app-container">
-				<el-form ref="addChildForm" :model="addChildForm" :rules="addChildFormRules" label-position="left" label-width="80px">
-					<el-row :gutter="20">
-						<el-col :span="6">
-							<el-form-item label="一级分类" prop="oneClassify">
-							  <el-select v-model="addChildForm.oneClassify" placeholder="请选择一级分类" disabled style="width: 250px;">
-							    <el-option :label="item.name" :value="item.categoryId" v-for="(item, index) in classifyList" :key="index"></el-option>
-							  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="二级分类" prop="twoClassify">
-							  <el-input type="text" placeholder="请输入二级分类名称" v-model="addChildForm.twoClassify" maxlength="10" show-word-limit style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="状态" prop="status">
-							  <el-radio-group v-model="addChildForm.status">
-							    <el-radio :label="true">显示</el-radio>
-							    <el-radio :label="false">隐藏</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="排序" prop="sort">
-							  <el-input placeholder="请输入排序" v-model.number="addChildForm.sort" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="分类图片" prop="imgUrl">
-							  <el-upload
-							    class="avatar-uploader"
-							    style="height:122px"
-							    :action="baseURL + 'common/upload'"
-							    :headers="myHeaders"
-							    :show-file-list="false"
-							    :on-success="uploadSuccess"
-							    :before-upload="beforeUpload">
-							    <img v-if="addChildForm.imgUrl" :src="addChildForm.imgUrl" class="avatar">
-							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-							  </el-upload>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-				<div slot="footer" class="dialog-footer">
-				  <el-button @click="data.removeTab()">取 消</el-button>
-				  <el-button type="primary" @click="submitAddChildForm(data.removeTab)">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <div v-if="activeKey == 'list'" class="app-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button
+              v-if="$restrict('add')"
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              @click="addOrEditParent('add1')"
+              >添加分类</el-button
+            >
+          </div>
+          <div class="fr">
+            <el-input
+              placeholder="请输入分类名称进行搜索"
+              v-model="screenForm.keyword"
+              size="small"
+              style="width: 240px"
+              clearable
+            >
+              <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
+            </el-input>
+          </div>
+        </div>
+
+        <div class="table">
+          <el-table
+            :data="dataList"
+            row-key="categoryId"
+            border
+            default-expand-all
+            :tree-props="{ children: 'children' }"
+          >
+            <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
+            <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
+              <template slot-scope="scope">
+                <el-image
+                  style="width: 40px; height: 40px; display: block; margin: 0 auto"
+                  :src="$showImgUrl(scope.row.imgUrl)"
+                  :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                  fit="cover"
+                >
+                  <div slot="error" style="height: 100%; font-size: 40px">
+                    <i class="el-icon-picture-outline"></i>
+                  </div>
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="createTime" label="创建时间" min-width="160"></el-table-column>
+            <!-- <el-table-column align="center" prop="goodsNum" label="商品数"></el-table-column> -->
+            <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
+            <el-table-column align="center" prop="companyName" label="商户" min-width="120"></el-table-column>
+            <el-table-column align="center" label="状态" class-name="status-col">
+              <template slot-scope="scope">
+                <el-tag :type="scope.row.status ? 'success' : 'danger'">{{
+                  scope.row.status ? '显示' : '隐藏'
+                }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column align="right" label="操作" width="150" fixed="right">
+              <template slot-scope="scope">
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-plus"
+                  v-if="scope.row.level == 1 && $restrict('add')"
+                  @click="addOrEditChild('add2', scope.row.categoryId)"
+                ></el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-edit"
+                  v-if="scope.row.level == 1 && $restrict('edit')"
+                  @click="addOrEditParent('edit1', scope.row.categoryId)"
+                ></el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-edit"
+                  v-if="scope.row.level == 2 && $restrict('edit')"
+                  @click="addOrEditChild('edit2', scope.row.categoryId)"
+                ></el-button>
+                <el-popconfirm
+                  v-if="$restrict('del')"
+                  style="margin-left: 10px"
+                  title="确定删除吗?"
+                  @confirm="handleDelete(scope.row.categoryId)"
+                >
+                  <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 新增编辑 一级分类 -->
+      <div v-if="addParentFormVisible" class="app-container">
+        <el-form
+          ref="addParentForm"
+          :model="addParentForm"
+          :rules="addParentFormRules"
+          label-position="left"
+          label-width="80px"
+        >
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="一级分类" prop="oneClassify">
+                <el-input
+                  type="text"
+                  placeholder="请输入一级分类名称"
+                  v-model="addParentForm.oneClassify"
+                  maxlength="10"
+                  show-word-limit
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="状态" prop="status">
+                <el-radio-group v-model="addParentForm.status">
+                  <el-radio :label="true">显示</el-radio>
+                  <el-radio :label="false">隐藏</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="排序" prop="sort">
+                <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="分类图片" prop="imgUrl">
+                <el-upload
+                  class="avatar-uploader"
+                  style="height: 122px"
+                  :action="baseURL + 'common/upload'"
+                  :headers="myHeaders"
+                  :show-file-list="false"
+                  :on-success="uploadSuccess"
+                  :before-upload="beforeUpload"
+                >
+                  <img v-if="addParentForm.imgUrl" :src="$showImgUrl(addParentForm.imgUrl)" class="avatar" />
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
+        </div>
+      </div>
+      <!-- 新增编辑 二级分类 -->
+      <div v-if="addChildFormVisible" class="app-container">
+        <el-form
+          ref="addChildForm"
+          :model="addChildForm"
+          :rules="addChildFormRules"
+          label-position="left"
+          label-width="80px"
+        >
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="一级分类" prop="oneClassify">
+                <el-select
+                  v-model="addChildForm.oneClassify"
+                  placeholder="请选择一级分类"
+                  disabled
+                  style="width: 250px"
+                >
+                  <el-option
+                    :label="item.name"
+                    :value="item.categoryId"
+                    v-for="(item, index) in classifyList"
+                    :key="index"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="二级分类" prop="twoClassify">
+                <el-input
+                  type="text"
+                  placeholder="请输入二级分类名称"
+                  v-model="addChildForm.twoClassify"
+                  maxlength="10"
+                  show-word-limit
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="状态" prop="status">
+                <el-radio-group v-model="addChildForm.status">
+                  <el-radio :label="true">显示</el-radio>
+                  <el-radio :label="false">隐藏</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="排序" prop="sort">
+                <el-input placeholder="请输入排序" v-model.number="addChildForm.sort" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="分类图片" prop="imgUrl">
+                <el-upload
+                  class="avatar-uploader"
+                  style="height: 122px"
+                  :action="baseURL + 'common/upload'"
+                  :headers="myHeaders"
+                  :show-file-list="false"
+                  :on-success="uploadSuccess"
+                  :before-upload="beforeUpload"
+                >
+                  <img v-if="addChildForm.imgUrl" :src="$showImgUrl(addChildForm.imgUrl)" class="avatar" />
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="submitAddChildForm(data.removeTab)">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
 import { getToken } from '@/utils/auth'
-import { getClassifyList, addClassify, editClassify, deleteClassify, getClassifyDetail, getSmallType } from '@/api/goods'
-import { ORDER_MAIN_TYPE } from "@/utils/select_data";
-import { findElem } from '@/utils/util.js';
+import {
+  getClassifyList,
+  addClassify,
+  editClassify,
+  deleteClassify,
+  getClassifyDetail,
+  getSmallType
+} from '@/api/goods'
+import { ORDER_MAIN_TYPE } from '@/utils/select_data'
+import { findElem } from '@/utils/util.js'
 
 export default {
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { 'x-token': getToken() },
 
       dataList: [], // 列表数据
       listLoading: true, // 列表加载loading
-      screenForm: { // 筛选表单数据
-        keyword: '', // 关键词
+      screenForm: {
+        // 筛选表单数据
+        keyword: '' // 关键词
       },
 
-      editParentId:  null,
+      editParentId: null,
       addParentFormType: 'add',
       addParentFormVisible: false,
       addParentForm: {
@@ -173,18 +267,14 @@ export default {
         twoClassify: '',
         imgUrl: '',
         status: true,
-        sort: 0,
+        sort: 0
       },
       addParentFormRules: {
-        oneClassify: [
-          { required: true, message: '请填写一级分类名称', trigger: 'blur' },
-        ],
-        imgUrl: [
-          { required: true, message: '请上传分类图片', trigger: 'change' }
-        ]
+        oneClassify: [{ required: true, message: '请填写一级分类名称', trigger: 'blur' }],
+        imgUrl: [{ required: true, message: '请上传分类图片', trigger: 'change' }]
       },
 
-      editChildId:  null,
+      editChildId: null,
       addChildFormType: 'add',
       addChildFormVisible: false,
       addChildForm: {
@@ -192,119 +282,111 @@ export default {
         twoClassify: '',
         imgUrl: '',
         status: true,
-        sort: 0,
+        sort: 0
       },
       addChildFormRules: {
-        oneClassify: [
-          { required: true, message: '请选择一级分类', trigger: 'change' }
-        ],
-        twoClassify: [
-          { required: true, message: '请填写二级分类', trigger: 'blur' }
-        ],
-        imgUrl: [
-          { required: true, message: '请上传分类图片', trigger: 'change' }
-        ],
+        oneClassify: [{ required: true, message: '请选择一级分类', trigger: 'change' }],
+        twoClassify: [{ required: true, message: '请填写二级分类', trigger: 'blur' }],
+        imgUrl: [{ required: true, message: '请上传分类图片', trigger: 'change' }]
       },
 
       classifyList: [],
 
       orderMainType: ORDER_MAIN_TYPE,
       orderSmallType: [],
-	  formType: 'add',
-	  formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
-
     getList() {
-      this.listLoading = true;
+      this.listLoading = true
 
       let params = {
         type: 2,
-        name: this.screenForm.keyword,
-      };
+        name: this.screenForm.keyword
+      }
 
       getClassifyList(params).then(res => {
-        this.dataList = res.data;
+        this.dataList = res.data
       })
     },
 
     // 筛选后重新获取列表
     getListByScreen() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
     // 打开 新增编辑 一级分类
     addOrEditParent(type, cid) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit1: "编辑一级分类", add1: "添加一级分类" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					this.addParentFormType = type;
-					this.addParentFormVisible = true;
-					if(type == 'edit1'){
-						this.editParentId = cid;
-						getClassifyDetail({categoryId: cid}).then(res => {
-						  this.addParentForm = {
-						    oneClassify: res.data.name,
-						    status: res.data.status,
-						    imgUrl: res.data.imgUrl,
-						    sort: res.data.sortNum
-						  }
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-				this.cancelAddParentForm()
-			}
-		})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit1: '编辑一级分类', add1: '添加一级分类' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.addParentFormType = type
+            this.addParentFormVisible = true
+            if (type == 'edit1') {
+              this.editParentId = cid
+              getClassifyDetail({ categoryId: cid }).then(res => {
+                this.addParentForm = {
+                  oneClassify: res.data.name,
+                  status: res.data.status,
+                  imgUrl: res.data.imgUrl,
+                  sort: res.data.sortNum
+                }
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.cancelAddParentForm()
+        }
+      })
     },
 
     // 取消 新增编辑 一级分类
-    cancelAddParentForm(){
-      this.addParentFormVisible = false;
-      this.$refs?.addParentForm?.resetFields();
+    cancelAddParentForm() {
+      this.addParentFormVisible = false
+      this.$refs?.addParentForm?.resetFields()
     },
 
     // 提交 一级分类
     submitAddParentForm(cancel) {
-      this.$refs.addParentForm.validate((valid) => {
+      this.$refs.addParentForm.validate(valid => {
         if (valid) {
           let params = {
             type: 2,
             name: this.addParentForm.oneClassify,
             imgUrl: this.addParentForm.imgUrl,
             status: this.addParentForm.status,
-            sortNum: this.addParentForm.sort,
+            sortNum: this.addParentForm.sort
           }
-          if(this.addParentFormType == 'edit1') {
-            params.categoryId = this.editParentId;
+          if (this.addParentFormType == 'edit1') {
+            params.categoryId = this.editParentId
             editClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('编辑成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('编辑成功')
             })
-          }else {
+          } else {
             addClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('添加成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('添加成功')
             })
           }
         }
@@ -313,8 +395,8 @@ export default {
 
     // 改变大类
     changeOrderType() {
-      this.addChildForm.smallType = '';
-      this.getSmallType();
+      this.addChildForm.smallType = ''
+      this.getSmallType()
     },
 
     getSmallType() {
@@ -322,67 +404,66 @@ export default {
         mainNumber: this.addChildForm.orderType,
         categoryId: this.addChildForm.oneClassify
       }).then(res => {
-        this.orderSmallType = res.data;
+        this.orderSmallType = res.data
       })
     },
 
     // 打开 新增编辑 二级分类
     addOrEditChild(type, cid) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit2: "编辑二级分类", add2: "添加二级分类" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					this.addChildFormType = type;
-					this.addChildFormVisible = true;
-					getClassifyList({name: '', type: 2}).then(res => {
-					  this.classifyList = res.data;
-					})
-					if(type == 'add2') {
-					  this.addChildForm.oneClassify = cid;
-					}
-					if(type == 'edit2'){
-						this.editChildId = cid;
-						getClassifyDetail({categoryId: cid}).then(res => {
-						  this.addChildForm = {
-						    oneClassify: res.data.parentId,
-						    twoClassify: res.data.name,
-						    imgUrl: res.data.imgUrl,
-						    status: res.data.status,
-						    sort: res.data.sortNum
-						  }
-						  this.getSmallType();
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-				this.cancelAddChildForm()
-			}
-		})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit2: '编辑二级分类', add2: '添加二级分类' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.addChildFormType = type
+            this.addChildFormVisible = true
+            getClassifyList({ name: '', type: 2 }).then(res => {
+              this.classifyList = res.data
+            })
+            if (type == 'add2') {
+              this.addChildForm.oneClassify = cid
+            }
+            if (type == 'edit2') {
+              this.editChildId = cid
+              getClassifyDetail({ categoryId: cid }).then(res => {
+                this.addChildForm = {
+                  oneClassify: res.data.parentId,
+                  twoClassify: res.data.name,
+                  imgUrl: res.data.imgUrl,
+                  status: res.data.status,
+                  sort: res.data.sortNum
+                }
+                this.getSmallType()
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.cancelAddChildForm()
+        }
+      })
     },
 
     // 取消 新增编辑 二级分类
-    cancelAddChildForm(){
-      this.addChildFormVisible = false;
-      this.$refs?.addChildForm?.resetFields();
+    cancelAddChildForm() {
+      this.addChildFormVisible = false
+      this.$refs?.addChildForm?.resetFields()
     },
 
     // 提交 二级分类
     submitAddChildForm(cancel) {
-      this.$refs.addChildForm.validate((valid) => {
+      this.$refs.addChildForm.validate(valid => {
         if (valid) {
           let params = {}
-          if(this.addChildFormType == 'edit2') {
+          if (this.addChildFormType == 'edit2') {
             params = {
               type: 2,
               categoryId: this.editChildId,
@@ -392,27 +473,29 @@ export default {
               sortNum: this.addChildForm.sort
             }
             editClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddChildForm();
-              this.getList();
-              this.$successMsg('编辑成功');
+              cancel('list')
+              this.cancelAddChildForm()
+              this.getList()
+              this.$successMsg('编辑成功')
             })
-          }else {
+          } else {
             params = {
-              children: [{
-                type: 2,
-                parentId: this.addChildForm.oneClassify,
-                name: this.addChildForm.twoClassify,
-                imgUrl: this.addChildForm.imgUrl,
-                status: this.addChildForm.status,
-                sortNum: this.addChildForm.sort
-              }]
+              children: [
+                {
+                  type: 2,
+                  parentId: this.addChildForm.oneClassify,
+                  name: this.addChildForm.twoClassify,
+                  imgUrl: this.addChildForm.imgUrl,
+                  status: this.addChildForm.status,
+                  sortNum: this.addChildForm.sort
+                }
+              ]
             }
             addClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddChildForm();
-              this.getList();
-              this.$successMsg('添加成功');
+              cancel('list')
+              this.cancelAddChildForm()
+              this.getList()
+              this.$successMsg('添加成功')
             })
           }
         }
@@ -421,10 +504,10 @@ export default {
 
     // 操作 - 删除
     handleDelete(id) {
-		console.log(id)
-      deleteClassify({categoryId: id}).then(res => {
-        this.getList();
-        this.$successMsg();
+      console.log(id)
+      deleteClassify({ categoryId: id }).then(res => {
+        this.getList()
+        this.$successMsg()
       })
     },
 
@@ -437,33 +520,30 @@ export default {
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/png文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/png文件!')
+        return false
       }
-    },
-
+    }
   }
-
 }
-
 </script>
 
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>
 
 <style lang="scss">
-  .el-image-viewer__wrapper .el-icon-circle-close {
-    color: #ffffff !important;
-    font-size: 60px;
-  }
-  .el-table__row.expanded {
-    background: #f5f5f5;
-  }
+.el-image-viewer__wrapper .el-icon-circle-close {
+  color: #ffffff !important;
+  font-size: 60px;
+}
+.el-table__row.expanded {
+  background: #f5f5f5;
+}
 
-  th:first-child, th:last-child {
-    text-align: center !important;
-  }
+th:first-child,
+th:last-child {
+  text-align: center !important;
+}
 </style>

+ 213 - 196
src/views/mallManagement/configCenter/slideshowConfig/index.vue

@@ -30,56 +30,56 @@
           <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
         </div>
       </div>
-	  <el-dialog
-	      width="50%"
-	      title="商品列表"
-	      :visible.sync="innerVisible"
-	      append-to-body>
-	      <el-input v-model="search" placeholder="输入名称搜索">
-	        <el-button slot="append" icon="el-icon-search" @click="searchGoods()"></el-button>
-	      </el-input>
-	      <div class="table" style="margin-top: 10px">
-	        <el-table
-	          :data="goodsList"
-	          height="400px"
-	          style="width: 100%">
-	          <el-table-column align="center">
-	            <template slot="header"></template>
-	            <template slot-scope="scope">
-	              <el-button type="primary" size="small" @click="selGoods(scope.row)" :disabled="scope.row.promotionGroup" >选择</el-button>
-	            </template>
-	          </el-table-column>
-	          <el-table-column label="商品名称" prop="goodsName"></el-table-column>
-	          <el-table-column label="商品图片" prop="imgUrl" align="center">
-	            <template slot-scope="scope">
-	              <div class="demo-image__preview">
-	                <el-image style="width: 40px; height: 40px" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]">
-	                  <div slot="error" class="image-slot">
-	                    <i class="el-icon-picture-outline"></i>
-	                  </div>
-	                </el-image>
-	              </div>
-	            </template>
-	          </el-table-column>
-	        </el-table>
-	      </div>
-	      <div class="pagination clearfix">
-	        <div class="fr">
-	          <el-pagination
-	            @size-change="innerHandleSizeChange"
-	            @current-change="innerHandleCurrentChange"
-	            :current-page="innerCurrentPage"
-	            :page-sizes="[10, 20, 30, 50]"
-	            :page-size="10"
-	            layout="total, sizes, prev, pager, next, jumper"
-	            :total="innerListTotal">
-	          </el-pagination>
-	        </div>
-	      </div>
-		  <div slot="footer" class="dialog-footer">
-		    <el-button @click="innerVisible = false">取 消</el-button>
-		  </div>
-	    </el-dialog>
+      <el-dialog width="50%" title="商品列表" :visible.sync="innerVisible" append-to-body>
+        <el-input v-model="search" placeholder="输入名称搜索">
+          <el-button slot="append" icon="el-icon-search" @click="searchGoods()"></el-button>
+        </el-input>
+        <div class="table" style="margin-top: 10px">
+          <el-table :data="goodsList" height="400px" style="width: 100%">
+            <el-table-column align="center">
+              <template slot="header"></template>
+              <template slot-scope="scope">
+                <el-button type="primary" size="small" @click="selGoods(scope.row)" :disabled="scope.row.promotionGroup"
+                  >选择</el-button
+                >
+              </template>
+            </el-table-column>
+            <el-table-column label="商品名称" prop="goodsName"></el-table-column>
+            <el-table-column label="商品图片" prop="imgUrl" align="center">
+              <template slot-scope="scope">
+                <div class="demo-image__preview">
+                  <el-image
+                    style="width: 40px; height: 40px"
+                    :src="$showImgUrl(scope.row.imgUrl)"
+                    :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                  >
+                    <div slot="error" class="image-slot">
+                      <i class="el-icon-picture-outline"></i>
+                    </div>
+                  </el-image>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="innerHandleSizeChange"
+              @current-change="innerHandleCurrentChange"
+              :current-page="innerCurrentPage"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="innerListTotal"
+            >
+            </el-pagination>
+          </div>
+        </div>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="innerVisible = false">取 消</el-button>
+        </div>
+      </el-dialog>
     </template>
   </zj-tab-page>
 </template>
@@ -97,7 +97,7 @@ import {
   getBannerDetail,
   deleteBanner,
   getGoodsList,
-	getUsedGoodsList,
+  getUsedGoodsList,
   batchDeleteBanner
 } from '@/api/setting'
 import ImageUpload from '@/components/file-upload'
@@ -127,23 +127,23 @@ export default {
         imgSrc: [],
         state: true,
         sortNum: '',
-		port: 'SHOP',
+        port: 'SHOP',
         type: '',
         goodsId: '',
         appId: '',
         linkUrl: '',
-		selGoodsName: '',
-		goodsId: ''
+        selGoodsName: '',
+        goodsId: ''
       },
       goodsList: [],
       formType: 'add',
       formVisible: false,
-	  innerCurrentPage: 1, // 内联当前页码
-	  innerPageSize: 10, // 内联每页数量
-	  innerListTotal: 0, // 内联列表总数
-	  innerVisible: false,
-	  goodsList: [],
-	  search: '',
+      innerCurrentPage: 1, // 内联当前页码
+      innerPageSize: 10, // 内联每页数量
+      innerListTotal: 0, // 内联列表总数
+      innerVisible: false,
+      goodsList: [],
+      search: ''
     }
   },
   computed: {
@@ -199,53 +199,56 @@ export default {
             rules: []
           }
         },
-		{
-		  md: 8,
-		  isShow: true,
-		  name: 'el-radio',
-		  options: [
-			{ label: '轮播图', value: 'SHOP' },
-		    { label: '以旧换新入口', value: 'YJHX' },
-		    { label: '二手商城', value: 'ESHOP' }
-		  ],
-		  attributes: { filterable: true, placeholder: '请选择' },
-		  formItemAttributes: {
-		    label: '类型',
-		    prop: 'port',
-		    rules: []
-		  },
-		   events: {
-			   change: e=>{
-				   this.clearGoodsId()
-				   if(e=='YJHX'){
-					   this.formData.type = 4
-				   }else{
-					   this.formData.type = 1
-				   }
-			   }
-		   }
-		},
+        {
+          md: 8,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '轮播图', value: 'SHOP' },
+            { label: '以旧换新入口', value: 'YJHX' },
+            { label: '二手商城', value: 'ESHOP' }
+          ],
+          attributes: { filterable: true, placeholder: '请选择' },
+          formItemAttributes: {
+            label: '类型',
+            prop: 'port',
+            rules: []
+          },
+          events: {
+            change: e => {
+              this.clearGoodsId()
+              if (e == 'YJHX') {
+                this.formData.type = 4
+              } else {
+                this.formData.type = 1
+              }
+            }
+          }
+        },
         {
           md: 6,
           isShow: true,
           name: 'slot-component',
-      //     options: [
-						// { label: '分类列表', value: 1 },
-      //       { label: '商品链接', value: 1 },
-      //       // { label: '凡科活动链接', value: 2 },
-      //       { label: '专区活动链接', value: 3 }
-      //     ],
+          //     options: [
+          // { label: '分类列表', value: 1 },
+          //       { label: '商品链接', value: 1 },
+          //       // { label: '凡科活动链接', value: 2 },
+          //       { label: '专区活动链接', value: 3 }
+          //     ],
           formItemAttributes: {
             label: '链接类型',
             prop: 'type',
             rules: []
-          },render: (h, { props, onInput }) => {
+          },
+          render: (h, { props, onInput }) => {
             var { value } = props
-            return <el-radio-group v-model={this.formData.type}>
-				{this.formData.port == 'YJHX'?<el-radio label={4}>分类列表</el-radio>:null}
-				<el-radio label={3}>专区活动</el-radio>
-				<el-radio label={1}>商品链接</el-radio>
-			</el-radio-group>
+            return (
+              <el-radio-group v-model={this.formData.type}>
+                {this.formData.port == 'YJHX' ? <el-radio label={4}>分类列表</el-radio> : null}
+                <el-radio label={3}>专区活动</el-radio>
+                <el-radio label={1}>商品链接</el-radio>
+              </el-radio-group>
+            )
           }
         },
         ...(() => {
@@ -259,38 +262,49 @@ export default {
                 isShow: true,
                 name: 'slot-component',
                 options: this.goodsList,
-                attributes: {  },
+                attributes: {},
                 formItemAttributes: {
                   label: '链接商品',
                   prop: 'goodsId',
                   rules: []
                 },
-				render: (h, { props, onInput }) => {
-				  var { value } = props
-				  return (
-						<div>
-							<el-button type="primary" onClick={()=>{
-								console.log(11)
-								this.showGoods()
-							}} size="small">查找商品</el-button>
-							<el-button onClick={()=>{
-								this.clearGoodsId()
-							}} size="small">清除</el-button>
-						</div>
-					)
-				}
+                render: (h, { props, onInput }) => {
+                  var { value } = props
+                  return (
+                    <div>
+                      <el-button
+                        type="primary"
+                        onClick={() => {
+                          console.log(11)
+                          this.showGoods()
+                        }}
+                        size="small"
+                      >
+                        查找商品
+                      </el-button>
+                      <el-button
+                        onClick={() => {
+                          this.clearGoodsId()
+                        }}
+                        size="small"
+                      >
+                        清除
+                      </el-button>
+                    </div>
+                  )
+                }
               },
-				{
-				  md: 6,
-				  isShow: true,
-				  name: 'el-input',
-				  attributes: { placeholder: '请输入',disabled: true },
-				  formItemAttributes: {
-				    label: '链接商品名称',
-				    prop: 'goodsName',
-				    rules: []
-				  }
-				},
+              {
+                md: 6,
+                isShow: true,
+                name: 'el-input',
+                attributes: { placeholder: '请输入', disabled: true },
+                formItemAttributes: {
+                  label: '链接商品名称',
+                  prop: 'goodsName',
+                  rules: []
+                }
+              }
             ]
           } else if (this.formData.type == 2) {
             this.formData.goodsId = ''
@@ -447,25 +461,25 @@ export default {
                 Object.assign(this.formData, res.data, {
                   imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : []
                 })
-				if(res.data.port == 'ESHOP'){
-					getUsedGoodsList({
-						pageNum: 1,
-						pageSize: -1,
-						params:  [{param: "a.id", compare: "=", value: res.data.goodsId}]
-					}).then(ress => {
-						this.formData.goodsId = ress.data.records[0].goodsId
-						this.formData.goodsName = ress.data.records[0].goodsName
-					})
-				}else{
-					getGoodsList({
-						pageNum: 1,
-						pageSize: -1,
-						goodsId: res.data.goodsId,
-					}).then(ress => {
-					  this.formData.goodsId = ress.data.records[0].goodsId
-					  this.formData.goodsName = ress.data.records[0].goodsName
-					})
-				}
+                if (res.data.port == 'ESHOP') {
+                  getUsedGoodsList({
+                    pageNum: 1,
+                    pageSize: -1,
+                    params: [{ param: 'a.id', compare: '=', value: res.data.goodsId }]
+                  }).then(ress => {
+                    this.formData.goodsId = ress.data.records[0].goodsId
+                    this.formData.goodsName = ress.data.records[0].goodsName
+                  })
+                } else {
+                  getGoodsList({
+                    pageNum: 1,
+                    pageSize: -1,
+                    goodsId: res.data.goodsId
+                  }).then(ress => {
+                    this.formData.goodsId = ress.data.records[0].goodsId
+                    this.formData.goodsName = ress.data.records[0].goodsName
+                  })
+                }
               })
             }
           })
@@ -514,59 +528,62 @@ export default {
         this.$errorMsg('请选择要删除的轮播图')
       }
     },
-		showGoods() {
-		  this.search = '';
-		  this.innerVisible = true
-		  this.showGoodsList()
-		},
-		clearGoodsId() {
-		  this.formData.goodsId = ''
-		  this.formData.goodsName = ''
-		},
-		searchGoods() {
-		  this.innerCurrentPage = 1;
-		  this.showGoodsList()
-		},
-		selGoods(row) {
-		  this.innerVisible = false
-		  this.search = ''
-		  this.formData.goodsId = this.formData.port == 'ESHOP'?row.id:row.goodsId
-		  this.formData.goodsName = row.goodsName
-		},
-		showGoodsList() {
-		  let params = {
-		    goodsName: this.search,
-		    pageNum: this.innerCurrentPage,
-		    pageSize: this.innerPageSize,
-		  };
-			if(this.formData.port == 'ESHOP'){
-				getUsedGoodsList({
-					pageNum: this.innerCurrentPage,
-					pageSize: this.innerPageSize,
-					params:  [{param: "a.goods_name", compare: "like", value: this.search}, {param: "a.status", compare: "=", value: "ON"}]
-				}).then(res => {
-					this.goodsList = res.data.records;
-					this.innerListTotal = res.data.total;
-				})
-			}else{
-				getGoodsList(params).then(res => {
-				  this.goodsList = res.data.records;
-				  this.innerListTotal = res.data.total;
-				})
-			}
-		},
-		// 更改内嵌每页数量
-		innerHandleSizeChange(val) {
-		  this.innerPageSize = val;
-		  this.innerCurrentPage = 1;
-		  this.showGoodsList();
-		},
-		
-		// 更改内嵌当前页
-		innerHandleCurrentChange(val) {
-		  this.innerCurrentPage = val;
-		  this.showGoodsList();
-		},
+    showGoods() {
+      this.search = ''
+      this.innerVisible = true
+      this.showGoodsList()
+    },
+    clearGoodsId() {
+      this.formData.goodsId = ''
+      this.formData.goodsName = ''
+    },
+    searchGoods() {
+      this.innerCurrentPage = 1
+      this.showGoodsList()
+    },
+    selGoods(row) {
+      this.innerVisible = false
+      this.search = ''
+      this.formData.goodsId = this.formData.port == 'ESHOP' ? row.id : row.goodsId
+      this.formData.goodsName = row.goodsName
+    },
+    showGoodsList() {
+      let params = {
+        goodsName: this.search,
+        pageNum: this.innerCurrentPage,
+        pageSize: this.innerPageSize
+      }
+      if (this.formData.port == 'ESHOP') {
+        getUsedGoodsList({
+          pageNum: this.innerCurrentPage,
+          pageSize: this.innerPageSize,
+          params: [
+            { param: 'a.goods_name', compare: 'like', value: this.search },
+            { param: 'a.status', compare: '=', value: 'ON' }
+          ]
+        }).then(res => {
+          this.goodsList = res.data.records
+          this.innerListTotal = res.data.total
+        })
+      } else {
+        getGoodsList(params).then(res => {
+          this.goodsList = res.data.records
+          this.innerListTotal = res.data.total
+        })
+      }
+    },
+    // 更改内嵌每页数量
+    innerHandleSizeChange(val) {
+      this.innerPageSize = val
+      this.innerCurrentPage = 1
+      this.showGoodsList()
+    },
+
+    // 更改内嵌当前页
+    innerHandleCurrentChange(val) {
+      this.innerCurrentPage = val
+      this.showGoodsList()
+    }
   }
 }
 </script>

+ 478 - 393
src/views/mallManagement/goods/classify_index/index.vue

@@ -1,212 +1,313 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<div v-if="activeKey == 'list'" class="app-container">
-				<div class="btn-group clearfix">
-				  <div class="fl">
-				    <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add1')">添加分类</el-button>
-				  </div>
-				  <div class="fr">
-				    <el-input placeholder="请输入分类名称进行搜索" v-model="screenForm.keyword" size="small" style="width: 240px;" clearable>
-				      <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
-				    </el-input>
-				  </div>
-				</div>
-				
-				<div class="table">
-				  <el-table :data="dataList" row-key="categoryId" border default-expand-all :tree-props="{children: 'children'}">
-				    <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
-				    <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
-				      <template slot-scope="scope">
-				        <el-image style="width: 40px; height: 40px; display: block; margin: 0 auto;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover">
-				          <div slot="error" style="height: 100%;font-size: 40px;">
-				            <i class="el-icon-picture-outline"></i>
-				          </div>
-				        </el-image>
-				      </template>
-				    </el-table-column>
-				    <el-table-column align="center" prop="createTime" label="创建时间" min-width="160"></el-table-column>
-						<el-table-column align="center" prop="createTime" label="服务首页展示">
-							<template slot-scope="scope" v-if="scope.row.level == 1">
-							  {{ scope.row.isServiceShow ? '展示':'不展示' }}
-							</template>
-						</el-table-column>
-				    <!-- <el-table-column align="center" prop="goodsNum" label="商品数"></el-table-column> -->
-				    <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
-				    <el-table-column align="center" prop="companyName" label="商户" min-width="120"></el-table-column>
-				    <el-table-column align="center" label="状态" class-name="status-col">
-				      <template slot-scope="scope">
-				        <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '显示':'隐藏' }}</el-tag>
-				      </template>
-				    </el-table-column>
-				    <el-table-column align="right" label="操作" width="150" fixed="right">
-				      <template slot-scope="scope">
-				        <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1 && $restrict('add')" @click="addOrEditChild('add2', scope.row.categoryId)"></el-button>
-				        <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1 && $restrict('edit')" @click="addOrEditParent('edit1', scope.row.categoryId)"></el-button>
-				        <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2 && $restrict('edit')" @click="addOrEditChild('edit2', scope.row.categoryId)"></el-button>
-				        <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
-				          <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
-				        </el-popconfirm>
-				
-				      </template>
-				    </el-table-column>
-				  </el-table>
-				</div>
-			</div>
-			<!-- 新增编辑 一级分类 -->
-			<div v-if="addParentFormVisible" class="app-container">
-				<el-form ref="addParentForm" :model="addParentForm" :rules="addParentFormRules" label-position="left" label-width="100px">
-					<el-row :gutter="20">
-						<el-col :span="6">
-							<el-form-item label="一级分类" prop="oneClassify">
-							  <el-input type="text" placeholder="请输入一级分类名称" v-model="addParentForm.oneClassify" maxlength="10" show-word-limit style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="税务编号" prop="taxNumber">
-							  <el-input placeholder="请输入税务编号" v-model="addParentForm.taxNumber" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="税率" prop="taxPercent">
-							  <el-input placeholder="请输入税率" v-model="addParentForm.taxPercent" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="状态" prop="status">
-							  <el-radio-group v-model="addParentForm.status">
-							    <el-radio :label="true">显示</el-radio>
-							    <el-radio :label="false">隐藏</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="服务首页展示" prop="isServiceShow">
-							  <el-radio-group v-model="addParentForm.isServiceShow">
-							    <el-radio :label="true">展示</el-radio>
-							    <el-radio :label="false">不展示</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="排序" prop="sort">
-							  <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="分类图片" prop="imgUrl">
-							  <el-upload
-							    class="avatar-uploader"
-							    style="height:122px"
-							    :action="baseURL + 'common/upload'"
-							    :headers="myHeaders"
-							    :show-file-list="false"
-							    :on-success="uploadSuccess"
-							    :before-upload="beforeUpload">
-							    <img v-if="addParentForm.imgUrl" :src="addParentForm.imgUrl" class="avatar">
-							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-							  </el-upload>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-				<div slot="footer" class="dialog-footer">
-				  <el-button @click="data.removeTab()">取 消</el-button>
-				  <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
-				</div>
-			</div>
-			<!-- 新增编辑 二级分类 -->
-			<div v-if="addChildFormVisible" class="app-container">
-				<el-form ref="addChildForm" :model="addChildForm" :rules="addChildFormRules" label-position="left" label-width="80px">
-					<el-row :gutter="20">
-						<el-col :span="6">
-							<el-form-item label="一级分类" prop="oneClassify">
-							  <el-select v-model="addChildForm.oneClassify" placeholder="请选择一级分类" disabled style="width: 250px;">
-							    <el-option :label="item.name" :value="item.categoryId" v-for="(item, index) in classifyList" :key="index"></el-option>
-							  </el-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="二级分类" prop="twoClassify">
-							  <el-input type="text" placeholder="请输入二级分类名称" v-model="addChildForm.twoClassify" maxlength="10" show-word-limit style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="工单类型" prop="workOrderType">
-							  <el-radio-group v-model="addChildForm.workOrderType">
-							    <el-radio :label="'INSTALL'">安装</el-radio>
-							    <el-radio :label="'REPAIR'">维修</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="税务编号" prop="taxNumber">
-							  <el-input placeholder="请输入税务编号" v-model="addChildForm.taxNumber" style="width: 250px;" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="税率" prop="taxPercent">
-							  <el-input placeholder="请输入税率" v-model="addChildForm.taxPercent" style="width: 250px;" disabled></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="状态" prop="status">
-							  <el-radio-group v-model="addChildForm.status">
-							    <el-radio :label="true">显示</el-radio>
-							    <el-radio :label="false">隐藏</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="排序" prop="sort">
-							  <el-input placeholder="请输入排序" v-model.number="addChildForm.sort" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="分类图片" prop="imgUrl">
-							  <el-upload
-							    class="avatar-uploader"
-							    style="height:122px"
-							    :action="baseURL + 'common/upload'"
-							    :headers="myHeaders"
-							    :show-file-list="false"
-							    :on-success="uploadSuccess"
-							    :before-upload="beforeUpload">
-							    <img v-if="addChildForm.imgUrl" :src="addChildForm.imgUrl" class="avatar">
-							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-							  </el-upload>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-				<div slot="footer" class="dialog-footer">
-				  <el-button @click="data.removeTab()">取 消</el-button>
-				  <el-button type="primary" @click="submitAddChildForm(data.removeTab)">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <div v-if="activeKey == 'list'" class="app-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button
+              v-if="$restrict('add')"
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              @click="addOrEditParent('add1')"
+              >添加分类</el-button
+            >
+          </div>
+          <div class="fr">
+            <el-input
+              placeholder="请输入分类名称进行搜索"
+              v-model="screenForm.keyword"
+              size="small"
+              style="width: 240px"
+              clearable
+            >
+              <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
+            </el-input>
+          </div>
+        </div>
+
+        <div class="table">
+          <el-table
+            :data="dataList"
+            row-key="categoryId"
+            border
+            default-expand-all
+            :tree-props="{ children: 'children' }"
+          >
+            <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
+            <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
+              <template slot-scope="scope">
+                <el-image
+                  style="width: 40px; height: 40px; display: block; margin: 0 auto"
+                  :src="$showImgUrl(scope.row.imgUrl)"
+                  :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                  fit="cover"
+                >
+                  <div slot="error" style="height: 100%; font-size: 40px">
+                    <i class="el-icon-picture-outline"></i>
+                  </div>
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="createTime" label="创建时间" min-width="160"></el-table-column>
+            <el-table-column align="center" prop="createTime" label="服务首页展示">
+              <template slot-scope="scope" v-if="scope.row.level == 1">
+                {{ scope.row.isServiceShow ? '展示' : '不展示' }}
+              </template>
+            </el-table-column>
+            <!-- <el-table-column align="center" prop="goodsNum" label="商品数"></el-table-column> -->
+            <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
+            <el-table-column align="center" prop="companyName" label="商户" min-width="120"></el-table-column>
+            <el-table-column align="center" label="状态" class-name="status-col">
+              <template slot-scope="scope">
+                <el-tag :type="scope.row.status ? 'success' : 'danger'">{{
+                  scope.row.status ? '显示' : '隐藏'
+                }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column align="right" label="操作" width="150" fixed="right">
+              <template slot-scope="scope">
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-plus"
+                  v-if="scope.row.level == 1 && $restrict('add')"
+                  @click="addOrEditChild('add2', scope.row.categoryId)"
+                ></el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-edit"
+                  v-if="scope.row.level == 1 && $restrict('edit')"
+                  @click="addOrEditParent('edit1', scope.row.categoryId)"
+                ></el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-edit"
+                  v-if="scope.row.level == 2 && $restrict('edit')"
+                  @click="addOrEditChild('edit2', scope.row.categoryId)"
+                ></el-button>
+                <el-popconfirm
+                  v-if="$restrict('del')"
+                  style="margin-left: 10px"
+                  title="确定删除吗?"
+                  @confirm="handleDelete(scope.row.categoryId)"
+                >
+                  <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 新增编辑 一级分类 -->
+      <div v-if="addParentFormVisible" class="app-container">
+        <el-form
+          ref="addParentForm"
+          :model="addParentForm"
+          :rules="addParentFormRules"
+          label-position="left"
+          label-width="100px"
+        >
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="一级分类" prop="oneClassify">
+                <el-input
+                  type="text"
+                  placeholder="请输入一级分类名称"
+                  v-model="addParentForm.oneClassify"
+                  maxlength="10"
+                  show-word-limit
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="税务编号" prop="taxNumber">
+                <el-input
+                  placeholder="请输入税务编号"
+                  v-model="addParentForm.taxNumber"
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="税率" prop="taxPercent">
+                <el-input placeholder="请输入税率" v-model="addParentForm.taxPercent" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="状态" prop="status">
+                <el-radio-group v-model="addParentForm.status">
+                  <el-radio :label="true">显示</el-radio>
+                  <el-radio :label="false">隐藏</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="服务首页展示" prop="isServiceShow">
+                <el-radio-group v-model="addParentForm.isServiceShow">
+                  <el-radio :label="true">展示</el-radio>
+                  <el-radio :label="false">不展示</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="排序" prop="sort">
+                <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="分类图片" prop="imgUrl">
+                <el-upload
+                  class="avatar-uploader"
+                  style="height: 122px"
+                  :action="baseURL + 'common/upload'"
+                  :headers="myHeaders"
+                  :show-file-list="false"
+                  :on-success="uploadSuccess"
+                  :before-upload="beforeUpload"
+                >
+                  <img v-if="addParentForm.imgUrl" :src="$showImgUrl(addParentForm.imgUrl)" class="avatar" />
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
+        </div>
+      </div>
+      <!-- 新增编辑 二级分类 -->
+      <div v-if="addChildFormVisible" class="app-container">
+        <el-form
+          ref="addChildForm"
+          :model="addChildForm"
+          :rules="addChildFormRules"
+          label-position="left"
+          label-width="80px"
+        >
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="一级分类" prop="oneClassify">
+                <el-select
+                  v-model="addChildForm.oneClassify"
+                  placeholder="请选择一级分类"
+                  disabled
+                  style="width: 250px"
+                >
+                  <el-option
+                    :label="item.name"
+                    :value="item.categoryId"
+                    v-for="(item, index) in classifyList"
+                    :key="index"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="二级分类" prop="twoClassify">
+                <el-input
+                  type="text"
+                  placeholder="请输入二级分类名称"
+                  v-model="addChildForm.twoClassify"
+                  maxlength="10"
+                  show-word-limit
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="工单类型" prop="workOrderType">
+                <el-radio-group v-model="addChildForm.workOrderType">
+                  <el-radio :label="'INSTALL'">安装</el-radio>
+                  <el-radio :label="'REPAIR'">维修</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="税务编号" prop="taxNumber">
+                <el-input
+                  placeholder="请输入税务编号"
+                  v-model="addChildForm.taxNumber"
+                  style="width: 250px"
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="税率" prop="taxPercent">
+                <el-input
+                  placeholder="请输入税率"
+                  v-model="addChildForm.taxPercent"
+                  style="width: 250px"
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="状态" prop="status">
+                <el-radio-group v-model="addChildForm.status">
+                  <el-radio :label="true">显示</el-radio>
+                  <el-radio :label="false">隐藏</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="排序" prop="sort">
+                <el-input placeholder="请输入排序" v-model.number="addChildForm.sort" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="分类图片" prop="imgUrl">
+                <el-upload
+                  class="avatar-uploader"
+                  style="height: 122px"
+                  :action="baseURL + 'common/upload'"
+                  :headers="myHeaders"
+                  :show-file-list="false"
+                  :on-success="uploadSuccess"
+                  :before-upload="beforeUpload"
+                >
+                  <img v-if="addChildForm.imgUrl" :src="$showImgUrl(addChildForm.imgUrl)" class="avatar" />
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="submitAddChildForm(data.removeTab)">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
 import { getToken } from '@/utils/auth'
 import { getClassifyList, addClassify, editClassify, deleteClassify, getClassifyDetail } from '@/api/goods'
-import { ORDER_MAIN_TYPE } from "@/utils/select_data";
-import { getMainList } from "@/api/workOrder/settlementStandardInstall";
+import { ORDER_MAIN_TYPE } from '@/utils/select_data'
+import { getMainList } from '@/api/workOrder/settlementStandardInstall'
 
 export default {
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { 'x-token': getToken() },
 
       dataList: [], // 列表数据
       listLoading: true, // 列表加载loading
-      screenForm: { // 筛选表单数据
-        keyword: '', // 关键词
+      screenForm: {
+        // 筛选表单数据
+        keyword: '' // 关键词
       },
 
-      editParentId:  null,
+      editParentId: null,
       addParentFormType: 'add1',
       addParentFormVisible: false,
       addParentForm: {
@@ -215,20 +316,16 @@ export default {
         imgUrl: '',
         taxNumber: '',
         taxPercent: '',
-		isServiceShow: true,
+        isServiceShow: true,
         status: true,
-        sort: 0,
+        sort: 0
       },
       addParentFormRules: {
-        oneClassify: [
-          { required: true, message: '请填写一级分类名称', trigger: 'blur' },
-        ],
-        imgUrl: [
-          { required: true, message: '请上传分类图片', trigger: 'change' }
-        ]
+        oneClassify: [{ required: true, message: '请填写一级分类名称', trigger: 'blur' }],
+        imgUrl: [{ required: true, message: '请上传分类图片', trigger: 'change' }]
       },
 
-      editChildId:  null,
+      editChildId: null,
       addChildFormType: 'add',
       addChildFormVisible: false,
       addChildForm: {
@@ -239,135 +336,125 @@ export default {
         taxNumber: '',
         taxPercent: '',
         status: true,
-        sort: 0,
+        sort: 0
       },
       addChildFormRules: {
-        oneClassify: [
-          { required: true, message: '请选择一级分类', trigger: 'change' }
-        ],
-        twoClassify: [
-          { required: true, message: '请填写二级分类', trigger: 'blur' }
-        ],
-        workOrderType: [
-          { required: true, message: '请选择工单类型', trigger: 'change' }
-        ],
-        imgUrl: [
-          { required: true, message: '请上传分类图片', trigger: 'change' }
-        ],
+        oneClassify: [{ required: true, message: '请选择一级分类', trigger: 'change' }],
+        twoClassify: [{ required: true, message: '请填写二级分类', trigger: 'blur' }],
+        workOrderType: [{ required: true, message: '请选择工单类型', trigger: 'change' }],
+        imgUrl: [{ required: true, message: '请上传分类图片', trigger: 'change' }]
       },
 
       classifyList: [],
 
       // orderMainType: ORDER_MAIN_TYPE,
-			orderMainType: [],
+      orderMainType: [],
       orderSmallType: [],
-			formType: 'add',
-			formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   created() {
-    this.getList();
-	this.getMainList()
+    this.getList()
+    this.getMainList()
   },
   methods: {
-
     getList() {
-      this.listLoading = true;
+      this.listLoading = true
 
       let params = {
-        name: this.screenForm.keyword,
-      };
+        name: this.screenForm.keyword
+      }
 
       getClassifyList(params).then(res => {
-        this.dataList = res.data;
+        this.dataList = res.data
+      })
+    },
+
+    getMainList() {
+      getMainList({ type: 2 }).then(res => {
+        this.orderMainType = res.data
       })
     },
-		
-	getMainList(){
-		getMainList({type: 2}).then(res => {
-			this.orderMainType = res.data
-		})
-	},
 
     // 筛选后重新获取列表
     getListByScreen() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
 
     // 打开 新增编辑 一级分类
     addOrEditParent(type, cid) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit1: "编辑一级分类", add1: "添加一级分类" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					this.addParentFormType = type;
-					this.addParentFormVisible = true;
-					if(type == 'edit1'){
-						this.editParentId = cid;
-						getClassifyDetail({categoryId: cid}).then(res => {
-						  this.addParentForm = {
-						    oneClassify: res.data.name,
-						    status: res.data.status,
-						    imgUrl: res.data.imgUrl,
-						    taxNumber: res.data.taxNumber,
-						    taxPercent: res.data.taxPercent,
-							isServiceShow: res.data.isServiceShow,
-						    sort: res.data.sortNum
-						  }
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-				this.cancelAddParentForm()
-			}
-		})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit1: '编辑一级分类', add1: '添加一级分类' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.addParentFormType = type
+            this.addParentFormVisible = true
+            if (type == 'edit1') {
+              this.editParentId = cid
+              getClassifyDetail({ categoryId: cid }).then(res => {
+                this.addParentForm = {
+                  oneClassify: res.data.name,
+                  status: res.data.status,
+                  imgUrl: res.data.imgUrl,
+                  taxNumber: res.data.taxNumber,
+                  taxPercent: res.data.taxPercent,
+                  isServiceShow: res.data.isServiceShow,
+                  sort: res.data.sortNum
+                }
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.cancelAddParentForm()
+        }
+      })
     },
 
     // 取消 新增编辑 一级分类
-    cancelAddParentForm(){
-      this.addParentFormVisible = false;
-      this.$refs?.addParentForm?.resetFields();
+    cancelAddParentForm() {
+      this.addParentFormVisible = false
+      this.$refs?.addParentForm?.resetFields()
     },
 
     // 提交 一级分类
     submitAddParentForm(cancel) {
-      this.$refs.addParentForm.validate((valid) => {
+      this.$refs.addParentForm.validate(valid => {
         if (valid) {
           let params = {
             name: this.addParentForm.oneClassify,
             imgUrl: this.addParentForm.imgUrl,
             taxNumber: this.addParentForm.taxNumber,
             taxPercent: this.addParentForm.taxPercent,
-			isServiceShow: this.addParentForm.isServiceShow,
+            isServiceShow: this.addParentForm.isServiceShow,
             status: this.addParentForm.status,
-            sortNum: this.addParentForm.sort,
+            sortNum: this.addParentForm.sort
           }
-          if(this.addParentFormType == 'edit1') {
-            params.categoryId = this.editParentId;
+          if (this.addParentFormType == 'edit1') {
+            params.categoryId = this.editParentId
             editClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('编辑成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('编辑成功')
             })
-          }else {
+          } else {
             addClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('添加成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('添加成功')
             })
           }
         }
@@ -376,106 +463,107 @@ export default {
 
     // 打开 新增编辑 二级分类
     addOrEditChild(type, cid) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit2: "编辑二级分类", add2: "添加二级分类" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					this.getMainList()
-					this.addChildFormType = type;
-					this.addChildFormVisible = true;
-					getClassifyList({name: ''}).then(res => {
-					  this.classifyList = res.data;
-					})
-					if(type == 'add2') {
-					  this.addChildForm.oneClassify = cid;
-					  let item = this.dataList[this.$findElem(this.dataList, 'categoryId', cid)];
-					  this.addChildForm.taxNumber = item.taxNumber;
-					  this.addChildForm.taxPercent = item.taxPercent;
-					}
-					if(type == 'edit2'){
-						this.editChildId = cid;
-						getClassifyDetail({categoryId: cid}).then(res => {
-							console.log(this.orderMainType,'获取大类')
-							this.orderMainType.forEach(item =>{
-								if(item.categoryId == res.data.mainNumber){
-									this.orderSmallType = item.children
-								}
-							})
-							this.addChildForm = {
-								oneClassify: res.data.parentId,
-								twoClassify: res.data.name,
-								workOrderType: res.data.workOrderType,
-								imgUrl: res.data.imgUrl,
-								taxNumber: res.data.taxNumber,
-								taxPercent: res.data.taxPercent,
-								status: res.data.status,
-								sort: res.data.sortNum
-							}
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-				this.cancelAddChildForm()
-			}
-		})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit2: '编辑二级分类', add2: '添加二级分类' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.getMainList()
+            this.addChildFormType = type
+            this.addChildFormVisible = true
+            getClassifyList({ name: '' }).then(res => {
+              this.classifyList = res.data
+            })
+            if (type == 'add2') {
+              this.addChildForm.oneClassify = cid
+              let item = this.dataList[this.$findElem(this.dataList, 'categoryId', cid)]
+              this.addChildForm.taxNumber = item.taxNumber
+              this.addChildForm.taxPercent = item.taxPercent
+            }
+            if (type == 'edit2') {
+              this.editChildId = cid
+              getClassifyDetail({ categoryId: cid }).then(res => {
+                console.log(this.orderMainType, '获取大类')
+                this.orderMainType.forEach(item => {
+                  if (item.categoryId == res.data.mainNumber) {
+                    this.orderSmallType = item.children
+                  }
+                })
+                this.addChildForm = {
+                  oneClassify: res.data.parentId,
+                  twoClassify: res.data.name,
+                  workOrderType: res.data.workOrderType,
+                  imgUrl: res.data.imgUrl,
+                  taxNumber: res.data.taxNumber,
+                  taxPercent: res.data.taxPercent,
+                  status: res.data.status,
+                  sort: res.data.sortNum
+                }
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.cancelAddChildForm()
+        }
+      })
     },
 
     // 取消 新增编辑 二级分类
-    cancelAddChildForm(){
-      this.addChildFormVisible = false;
-      this.$refs?.addChildForm?.resetFields();
+    cancelAddChildForm() {
+      this.addChildFormVisible = false
+      this.$refs?.addChildForm?.resetFields()
     },
 
     // 提交 二级分类
     submitAddChildForm(cancel) {
-      this.$refs.addChildForm.validate((valid) => {
+      this.$refs.addChildForm.validate(valid => {
         if (valid) {
           let params = {}
-          if(this.addChildFormType == 'edit2') {
+          if (this.addChildFormType == 'edit2') {
             params = {
-                categoryId: this.editChildId,
-                name: this.addChildForm.twoClassify,
-                workOrderType: this.addChildForm.workOrderType,
-                imgUrl: this.addChildForm.imgUrl,
-                taxNumber: this.addChildForm.taxNumber,
-                taxPercent: this.addChildForm.taxPercent,
-                status: this.addChildForm.status,
-                sortNum: this.addChildForm.sort
+              categoryId: this.editChildId,
+              name: this.addChildForm.twoClassify,
+              workOrderType: this.addChildForm.workOrderType,
+              imgUrl: this.addChildForm.imgUrl,
+              taxNumber: this.addChildForm.taxNumber,
+              taxPercent: this.addChildForm.taxPercent,
+              status: this.addChildForm.status,
+              sortNum: this.addChildForm.sort
             }
             editClassify(params).then(res => {
-			  cancel('list')
-              this.cancelAddChildForm();
-              this.getList();
-              this.$successMsg('编辑成功');
+              cancel('list')
+              this.cancelAddChildForm()
+              this.getList()
+              this.$successMsg('编辑成功')
             })
-          }else {
+          } else {
             params = {
-              children: [{
-                parentId: this.addChildForm.oneClassify,
-                name: this.addChildForm.twoClassify,
-                imgUrl: this.addChildForm.imgUrl,
-                taxNumber: this.addChildForm.taxNumber,
-                taxPercent: this.addChildForm.taxPercent,
-                status: this.addChildForm.status,
-                sortNum: this.addChildForm.sort
-              }]
+              children: [
+                {
+                  parentId: this.addChildForm.oneClassify,
+                  name: this.addChildForm.twoClassify,
+                  imgUrl: this.addChildForm.imgUrl,
+                  taxNumber: this.addChildForm.taxNumber,
+                  taxPercent: this.addChildForm.taxPercent,
+                  status: this.addChildForm.status,
+                  sortNum: this.addChildForm.sort
+                }
+              ]
             }
             addClassify(params).then(res => {
-			  cancel('list')
-              this.cancelAddChildForm();
-              this.getList();
-              this.$successMsg('添加成功');
+              cancel('list')
+              this.cancelAddChildForm()
+              this.getList()
+              this.$successMsg('添加成功')
             })
           }
         }
@@ -484,9 +572,9 @@ export default {
 
     // 操作 - 删除
     handleDelete(id) {
-      deleteClassify({categoryId: id}).then(res => {
-        this.getList();
-        this.$successMsg();
+      deleteClassify({ categoryId: id }).then(res => {
+        this.getList()
+        this.$successMsg()
       })
     },
 
@@ -499,33 +587,30 @@ export default {
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png', 'gif'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png', 'gif']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/jpeg/png/gif文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/jpeg/png/gif文件!')
+        return false
       }
-    },
-
+    }
   }
-
 }
-
 </script>
 
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>
 
 <style lang="scss">
-  .el-image-viewer__wrapper .el-icon-circle-close {
-    color: #ffffff !important;
-    font-size: 60px;
-  }
-  .el-table__row.expanded {
-    background: #f5f5f5;
-  }
+.el-image-viewer__wrapper .el-icon-circle-close {
+  color: #ffffff !important;
+  font-size: 60px;
+}
+.el-table__row.expanded {
+  background: #f5f5f5;
+}
 
-  th:first-child, th:last-child {
-    text-align: center !important;
-  }
+th:first-child,
+th:last-child {
+  text-align: center !important;
+}
 </style>

+ 561 - 390
src/views/mallManagement/goods/goodsWarehouse/detail.vue

@@ -1,22 +1,40 @@
 <template>
-	<template-page v-if="isShowTab" ref="pageRef" :get-list="getList"
-		:table-attributes="tableAttributes" :table-events="tableEvents" :options-evens-group="optionsEvensGroup"
-		:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation":operationColumnWidth="80" :fieldBeansHook="fieldBeansHook">
-		<div class="footer">
-			<el-button size="mini" @click="cancel()">取消</el-button>
-			<el-button size="mini" @click="formConfirm()" type="primary">确定</el-button>
-		</div>
-		<!-- 选择商品 -->
-		<el-dialog title="商品详情" :visible.sync="isShowDetail" width="100%" style="height: 100vh;" :close-on-click-modal="false" :modal-append-to-body="false" :append-to-body="true">
-			<div style="max-height: 82vh;overflow-y: auto;">
-				<el-form ref="formRef" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
-					<el-card class="box-card" id="box">
-						<div slot="header" class="clearfix">
-							<span>基础信息</span>
-						</div>
-						<div class="mymain-container">
-							<el-row :gutter="20" justify="start">
-								<!-- <el-col :span="24">
+  <template-page
+    v-if="isShowTab"
+    ref="pageRef"
+    :get-list="getList"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :options-evens-group="optionsEvensGroup"
+    :moreParameters="moreParameters"
+    :column-parsing="columnParsing"
+    :operation="operation"
+    :operationColumnWidth="80"
+    :fieldBeansHook="fieldBeansHook"
+  >
+    <div class="footer">
+      <el-button size="mini" @click="cancel()">取消</el-button>
+      <el-button size="mini" @click="formConfirm()" type="primary">确定</el-button>
+    </div>
+    <!-- 选择商品 -->
+    <el-dialog
+      title="商品详情"
+      :visible.sync="isShowDetail"
+      width="100%"
+      style="height: 100vh"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      :append-to-body="true"
+    >
+      <div style="max-height: 82vh; overflow-y: auto">
+        <el-form ref="formRef" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-card class="box-card" id="box">
+            <div slot="header" class="clearfix">
+              <span>基础信息</span>
+            </div>
+            <div class="mymain-container">
+              <el-row :gutter="20" justify="start">
+                <!-- <el-col :span="24">
 									<el-form-item label="商品可选状态" prop="status" :required="true">
 										<div class="flex_ac">
 											<el-radio-group v-model="formData.status">
@@ -27,381 +45,534 @@
 										</div>
 									</el-form-item>
 								</el-col> -->
-								<el-col :span="6">
-									<el-form-item label="品牌" prop="brandName" :rules="[{ required: true, message: `请输入品牌`, trigger: 'blur' }]">
-										<el-input type="text" v-model="formData.brandName" disabled placeholder="请输入"></el-input>
-									</el-form-item>
-								</el-col>
-								<el-col :span="6">
-									<el-form-item label="是否虚拟商品" prop="isVr" :required="true">
-										<el-radio-group v-model="formData.isVr">
-										    <el-radio disabled :label="true">是</el-radio>
-										    <el-radio disabled :label="false">否</el-radio>
-										</el-radio-group>
-									</el-form-item>
-								</el-col>
-								<el-col :span="6">
-									<el-form-item label="商品大类" prop="category1" :rules="[{ required: true, message: `请输入商品大类`, trigger: 'blur' }]">
-										<el-input type="text" v-model="formData.category1" disabled placeholder="请输入"></el-input>
-									</el-form-item>
-								</el-col>
-								<el-col :span="6">
-									<el-form-item label="商品小类" prop="category2" :rules="[{ required: true, message: `请输入商品小类`, trigger: 'blur' }]">
-										<el-input type="text" v-model="formData.category2" disabled placeholder="请输入"></el-input>
-									</el-form-item>
-								</el-col>
-								<el-col :span="24">
-									<el-form-item label="商品名称" prop="goodsName" :rules="[{ required: true, message: `请输入商品名称`, trigger: 'blur' }]">
-										<el-input type="textarea" :rows="3" v-model="formData.goodsName" disabled placeholder="请输入"></el-input>
-										<div class="hui">商品名称将显示在商品详情,让用户更直接了解商品内涵</div>
-									</el-form-item>
-								</el-col>
-								<el-col :span="24">
-									<el-form-item label="商品描述" prop="describeText">
-										<el-input type="textarea" :rows="3" v-model="formData.describeText" disabled placeholder="请输入"></el-input>
-										<div class="hui">商品描述将显示在商品详情,让用户更了解商品细节</div>
-									</el-form-item>
-								</el-col>
-								<el-col :span="12">
-									<el-form-item label="商品主图" prop="imgUrl" :rules="[{ required: true, message: `请上传商品主图`, trigger: 'change' }]">
-										<ImageUpload :fileList="formData.imgUrl" :limit="1" :isEdit="false" :fileType="['image']"/>
-										<div class="suggest">建议尺寸800*800</div>
-									</el-form-item>
-								</el-col>
-								<el-col :span="12">
-									<el-form-item label="商品视频" prop="vedio">
-										<ImageUpload :fileList="formData.vedio" :limit="1" :isEdit="false" :fileType="['video']"/>
-										<div class="suggest">建议视频宽高比16:9,建议时长9-30秒</div>
-									</el-form-item>
-								</el-col>
-								<el-col :span="24">
-									<el-form-item label="轮播图" prop="imgs" :rules="[{ required: true, message: `请上传轮播图`, trigger: 'change' }]">
-										<ImageUpload :fileList="formData.imgs" :limit="6" :isEdit="false" :fileType="['image']"/>
-										<div class="suggest">建议尺寸800*800,最多上传6张</div>
-									</el-form-item>
-								</el-col>
-							</el-row>
-						</div>
-					</el-card>
-					<el-card class="box-card">
-						<div slot="header" class="clearfix">
-							<span>价格库存</span>
-						</div>
-						<div class="mymain-container">
-							<el-row :gutter="20" justify="start">
-								<el-col :span="24">
-									<el-form-item label="规格类型" prop="goodsLibrarySpecList" class="is-required">
-									</el-form-item>
-								</el-col>
-								<el-table :data="formData.goodsLibrarySpecList" element-loading-text="Loading" border fit highlight-current-row stripe>
-									<el-table-column prop="" align="center" label="*大类">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.mainName'" :rules="[{ required: true, message: `请输入大类`, trigger: 'blur' }]" label-width="0">
-												<el-input type="text" v-model="scope.row.mainName" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*小类">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.smallName'" :rules="[{ required: true, message: `请输入小类`, trigger: 'blur' }]" label-width="0">
-												<el-input type="text" v-model="scope.row.smallName" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*规格型号">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.specValue'" :rules="[{ required: true, message: `请输入规格型号`, trigger: 'blur' }]" label-width="0">
-												<el-input type="text" v-model="scope.row.specValue" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考销售价格">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.price'" :rules="[{ required: true, message: `请输入参考销售价格`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-												<el-input type="number" v-model="scope.row.price" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考划线价格">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.orgPrice'" :rules="[{ required: true, message: `请输入参考划线价格`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-												<el-input type="number" v-model="scope.row.orgPrice" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考成本价">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.costPrice'" :rules="[{ required: true, message: `请输入参考成本价`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-												<el-input type="number" v-model="scope.row.costPrice" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考佣金">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.shareAmount'" :rules="[{ required: true, message: `请输入参考佣金`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-												<el-input type="number" v-model="scope.row.shareAmount" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考内部佣金">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.innerShareAmount'" :rules="[{ required: true, message: `请输入参考内部佣金`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-												<el-input type="number" v-model="scope.row.innerShareAmount" disabled placeholder="请输入"></el-input>
-											</el-form-item>
-										</template>
-									</el-table-column>
-									<el-table-column prop="" align="center" label="*参考规格图片">
-										<template slot-scope="scope">
-											<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.imgUrl'" :rules="[{ required: true, message: `请上传参考规格图片`, trigger: 'change' }]" label-width="0">
-												<div class="flex_ac">
-													<ImageUpload :fileList="scope.row.imgUrl" :limit="1" :download="false" :viewOnline="false" :isEdit="false" modType="text" :fileType="['image']"/>
-												</div>
-											</el-form-item>
-										</template>
-									</el-table-column>
-								</el-table>
-							</el-row>
-						</div>
-					</el-card>
-					<el-card class="box-card">
-						<div slot="header" class="clearfix">
-							<span>详情内容</span>
-						</div>
-						<div class="mymain-container">
-							<el-row :gutter="20" justify="start">
-								<el-form-item label="详情内容" prop="content" :rules="[{ required: true, message: `请输入详情内容`, trigger: 'change' }]">
-									<quillEditor v-model="formData.content"></quillEditor>
-									<input type="hidden" v-model="formData.content">
-								</el-form-item>
-							</el-row>
-						</div>
-					</el-card>
-				</el-form>
-			</div>
-			<div class="footer">
-				<el-button size="mini" @click="isShowDetail = false">返回</el-button>
-			</div>
-		</el-dialog>
-	</template-page>
+                <el-col :span="6">
+                  <el-form-item
+                    label="品牌"
+                    prop="brandName"
+                    :rules="[{ required: true, message: `请输入品牌`, trigger: 'blur' }]"
+                  >
+                    <el-input type="text" v-model="formData.brandName" disabled placeholder="请输入"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item label="是否虚拟商品" prop="isVr" :required="true">
+                    <el-radio-group v-model="formData.isVr">
+                      <el-radio disabled :label="true">是</el-radio>
+                      <el-radio disabled :label="false">否</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    label="商品大类"
+                    prop="category1"
+                    :rules="[{ required: true, message: `请输入商品大类`, trigger: 'blur' }]"
+                  >
+                    <el-input type="text" v-model="formData.category1" disabled placeholder="请输入"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    label="商品小类"
+                    prop="category2"
+                    :rules="[{ required: true, message: `请输入商品小类`, trigger: 'blur' }]"
+                  >
+                    <el-input type="text" v-model="formData.category2" disabled placeholder="请输入"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item
+                    label="商品名称"
+                    prop="goodsName"
+                    :rules="[{ required: true, message: `请输入商品名称`, trigger: 'blur' }]"
+                  >
+                    <el-input
+                      type="textarea"
+                      :rows="3"
+                      v-model="formData.goodsName"
+                      disabled
+                      placeholder="请输入"
+                    ></el-input>
+                    <div class="hui">商品名称将显示在商品详情,让用户更直接了解商品内涵</div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item label="商品描述" prop="describeText">
+                    <el-input
+                      type="textarea"
+                      :rows="3"
+                      v-model="formData.describeText"
+                      disabled
+                      placeholder="请输入"
+                    ></el-input>
+                    <div class="hui">商品描述将显示在商品详情,让用户更了解商品细节</div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item
+                    label="商品主图"
+                    prop="imgUrl"
+                    :rules="[{ required: true, message: `请上传商品主图`, trigger: 'change' }]"
+                  >
+                    <ImageUpload :fileList="formData.imgUrl" :limit="1" :isEdit="false" :fileType="['image']" />
+                    <div class="suggest">建议尺寸800*800</div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="商品视频" prop="vedio">
+                    <ImageUpload :fileList="formData.vedio" :limit="1" :isEdit="false" :fileType="['video']" />
+                    <div class="suggest">建议视频宽高比16:9,建议时长9-30秒</div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item
+                    label="轮播图"
+                    prop="imgs"
+                    :rules="[{ required: true, message: `请上传轮播图`, trigger: 'change' }]"
+                  >
+                    <ImageUpload :fileList="formData.imgs" :limit="6" :isEdit="false" :fileType="['image']" />
+                    <div class="suggest">建议尺寸800*800,最多上传6张</div>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+          </el-card>
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <span>价格库存</span>
+            </div>
+            <div class="mymain-container">
+              <el-row :gutter="20" justify="start">
+                <el-col :span="24">
+                  <el-form-item label="规格类型" prop="goodsLibrarySpecList" class="is-required"> </el-form-item>
+                </el-col>
+                <el-table
+                  :data="formData.goodsLibrarySpecList"
+                  element-loading-text="Loading"
+                  border
+                  fit
+                  highlight-current-row
+                  stripe
+                >
+                  <el-table-column prop="" align="center" label="*大类">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.mainName'"
+                        :rules="[{ required: true, message: `请输入大类`, trigger: 'blur' }]"
+                        label-width="0"
+                      >
+                        <el-input type="text" v-model="scope.row.mainName" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*小类">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.smallName'"
+                        :rules="[{ required: true, message: `请输入小类`, trigger: 'blur' }]"
+                        label-width="0"
+                      >
+                        <el-input type="text" v-model="scope.row.smallName" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*规格型号">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.specValue'"
+                        :rules="[{ required: true, message: `请输入规格型号`, trigger: 'blur' }]"
+                        label-width="0"
+                      >
+                        <el-input type="text" v-model="scope.row.specValue" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考销售价格">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.price'"
+                        :rules="[
+                          { required: true, message: `请输入参考销售价格`, trigger: 'blur' },
+                          {
+                            pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                            message: '请输入大于等于0的数',
+                            trigger: 'blur'
+                          }
+                        ]"
+                        label-width="0"
+                      >
+                        <el-input type="number" v-model="scope.row.price" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考划线价格">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.orgPrice'"
+                        :rules="[
+                          { required: true, message: `请输入参考划线价格`, trigger: 'blur' },
+                          {
+                            pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                            message: '请输入大于等于0的数',
+                            trigger: 'blur'
+                          }
+                        ]"
+                        label-width="0"
+                      >
+                        <el-input type="number" v-model="scope.row.orgPrice" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考成本价">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.costPrice'"
+                        :rules="[
+                          { required: true, message: `请输入参考成本价`, trigger: 'blur' },
+                          {
+                            pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                            message: '请输入大于等于0的数',
+                            trigger: 'blur'
+                          }
+                        ]"
+                        label-width="0"
+                      >
+                        <el-input type="number" v-model="scope.row.costPrice" disabled placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考佣金">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.shareAmount'"
+                        :rules="[
+                          { required: true, message: `请输入参考佣金`, trigger: 'blur' },
+                          {
+                            pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                            message: '请输入大于等于0的数',
+                            trigger: 'blur'
+                          }
+                        ]"
+                        label-width="0"
+                      >
+                        <el-input
+                          type="number"
+                          v-model="scope.row.shareAmount"
+                          disabled
+                          placeholder="请输入"
+                        ></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考内部佣金">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.innerShareAmount'"
+                        :rules="[
+                          { required: true, message: `请输入参考内部佣金`, trigger: 'blur' },
+                          {
+                            pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                            message: '请输入大于等于0的数',
+                            trigger: 'blur'
+                          }
+                        ]"
+                        label-width="0"
+                      >
+                        <el-input
+                          type="number"
+                          v-model="scope.row.innerShareAmount"
+                          disabled
+                          placeholder="请输入"
+                        ></el-input>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="" align="center" label="*参考规格图片">
+                    <template slot-scope="scope">
+                      <el-form-item
+                        :prop="'goodsLibrarySpecList.' + scope.$index + '.imgUrl'"
+                        :rules="[{ required: true, message: `请上传参考规格图片`, trigger: 'change' }]"
+                        label-width="0"
+                      >
+                        <div class="flex_ac">
+                          <ImageUpload
+                            :fileList="scope.row.imgUrl"
+                            :limit="1"
+                            :download="false"
+                            :viewOnline="false"
+                            :isEdit="false"
+                            modType="text"
+                            :fileType="['image']"
+                          />
+                        </div>
+                      </el-form-item>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </div>
+          </el-card>
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <span>详情内容</span>
+            </div>
+            <div class="mymain-container">
+              <el-row :gutter="20" justify="start">
+                <el-form-item
+                  label="详情内容"
+                  prop="content"
+                  :rules="[{ required: true, message: `请输入详情内容`, trigger: 'change' }]"
+                >
+                  <quillEditor v-model="formData.content"></quillEditor>
+                  <input type="hidden" v-model="formData.content" />
+                </el-form-item>
+              </el-row>
+            </div>
+          </el-card>
+        </el-form>
+      </div>
+      <div class="footer">
+        <el-button size="mini" @click="isShowDetail = false">返回</el-button>
+      </div>
+    </el-dialog>
+  </template-page>
 </template>
 
 <script>
-	import TemplatePage from '@/components/template/template-page-1.vue'
-	import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-	import { listPageV2, pageExport, save, del, getDetail, batch, sync } from "@/api/goodsWarehouse";
-	import operation_mixin from '@/components/template/operation_mixin.js'
-	import ImageUpload from '@/components/file-upload'
-	import quillEditor from '@/components/v-quill-editor'
-	export default {
-		components: {
-			TemplatePage,ImageUpload,quillEditor
-		},
-		mixins: [operation_mixin],
-		props: ['isSelectShop'],
-		data() {
-			return {
-				// 表格属性
-				tableAttributes: {
-					// 启用勾选列
-					selectColumn: true,
-					selectable: this.selectable
-				},
-				// 表格事件
-				tableEvents: {
-					'selection-change': this.selectionChange
-				},
-				// 勾选选中行
-				recordSelected: [],
-				/** 表单变量 */
-				formDialogType: 0,
-				formDialogTitles: ["新增", "编辑"],
-				formDialog: false,
-				formData: {
-					status: true,
-					brandName: '',
-					category1: '',
-					category2: '',
-					isVr: true,
-					goodsName: '',
-					describeText: '',
-					imgUrl: [],
-					vedio: [],
-					imgs: [],
-					content: '',
-					goodsLibrarySpecList: []
-				},
-				rules: {},
-				status: '',
-				formType: 'add',
-				formVisible: false,
-				stepIndex: 0,
-				isEdit: 0,
-				editSpecImageIdx: 0,
-				isShowTab: true,
-				isShowDetail: false
-			}
-		},
-		watch: {
-			isSelectShop(){
-				this.isShowTab = false
-				this.recordSelected = []
-				this.$nextTick(()=>{
-					this.isShowTab = true
-				})
-			}
-		},
-		computed: {
-			// 事件组合
-			optionsEvensGroup() {
-				return [
-					
-				]
-			},
-			// 更多参数
-			moreParameters() {
-				return []
-			},
-			formItems() {
-				return []
-			}
-		},
-		methods: {
-			// 列表请求函数
-			getList(p, cb) {
-				try {
-					var pam = JSON.parse(JSON.stringify(p))
-					pam.params.push({ 'param': 'a.status', "compare": "=", "value": true })
-					cb && cb(pam)
-					return listPageV2(pam)
-				} catch (error) {
-					console.log(error)
-				}
-			},
-			// 列表导出函数
-			exportList: pageExport,
-			changeType(){
-				this.$refs.pageRef.refreshList()
-			},
-			selectable(row){
-				return this.recordSelected.length ? !!this.recordSelected.find(item=>item.goodsLibraryId==row.goodsLibraryId) : true
-			},
-			fieldBeansHook(row){
-				row.forEach(item=>{
-					if(item.jname == 'status'){
-						item.isQuery = false
-					}
-				})
-				console.log(row,111)
-			},
-			// 表格列解析渲染数据更改
-			columnParsing(item, defaultData) {
-				if (item.jname === 'imgUrl') {
-					defaultData.render = (h, { row, index, column }) => {
-						return (
-							<div style="padding:6px;cursor: pointer;">
-							  {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:60px;height:60px;" />) : null}
-							</div>
-						)
-					}
-				}
-				return defaultData
-			},
-			// 监听勾选变化
-			selectionChange(data) {
-				this.recordSelected = data
-			},
-			// 表格操作列
-			operation(h, { row, index, column }) {
-			  return (
-			    <div class='operation-btns'>
-			      <el-button type="text" onClick={() => {
-			        this.isShowDetail = true
-					getDetail({
-						goodsLibraryId: row.goodsLibraryId
-					}).then(res => {
-						let imgs = []
-						let goodsLibrarySpecList = []
-						res.data.imgs.split(",").forEach(item=>{
-							imgs.push({
-								url: item
-							})
-						})
-						res.data.goodsLibrarySpecList.forEach(item=>{
-							goodsLibrarySpecList.push({
-								...item,
-								imgUrl: item.imgUrl?[{url: item.imgUrl}]:[]
-							})
-						})
-						Object.assign(this.formData, res.data,{
-							imgUrl: res.data.imgUrl?[{url: res.data.imgUrl}]:[],
-							imgs: res.data.imgs?imgs:[],
-							vedio: res.data.vedio?[{url: res.data.vedio}]:[],
-							goodsLibrarySpecList
-						})
-						this.$nextTick(()=>{
-							document.querySelector('#box').scrollIntoView({
-								behavior: "smooth"
-							});
-						})
-					})
-			      }}>查看详情</el-button>
-			    </div>
-			  )
-			},
-			formCancel() {
-				this.formVisible = false
-				this.$refs?.formRef?.resetFields()
-				this.$data.formData = this.$options.data().formData
-			},
-			formConfirm() {
-				if (this.recordSelected.length == 0) {
-					return this.$message.warning('请至少勾选一条数据!');
-				}
-				this.$emit('selectShop',this.recordSelected[0].goodsLibraryId)
-			},
-			cancel(){
-				this.$emit('selectShop')
-			}
-		}
-	}
+import TemplatePage from '@/components/template/template-page-1.vue'
+import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
+import { listPageV2, pageExport, save, del, getDetail, batch, sync } from '@/api/goodsWarehouse'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import quillEditor from '@/components/v-quill-editor'
+export default {
+  components: {
+    TemplatePage,
+    ImageUpload,
+    quillEditor
+  },
+  mixins: [operation_mixin],
+  props: ['isSelectShop'],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true,
+        selectable: this.selectable
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑'],
+      formDialog: false,
+      formData: {
+        status: true,
+        brandName: '',
+        category1: '',
+        category2: '',
+        isVr: true,
+        goodsName: '',
+        describeText: '',
+        imgUrl: [],
+        vedio: [],
+        imgs: [],
+        content: '',
+        goodsLibrarySpecList: []
+      },
+      rules: {},
+      status: '',
+      formType: 'add',
+      formVisible: false,
+      stepIndex: 0,
+      isEdit: 0,
+      editSpecImageIdx: 0,
+      isShowTab: true,
+      isShowDetail: false
+    }
+  },
+  watch: {
+    isSelectShop() {
+      this.isShowTab = false
+      this.recordSelected = []
+      this.$nextTick(() => {
+        this.isShowTab = true
+      })
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return []
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push({ param: 'a.status', compare: '=', value: true })
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    changeType() {
+      this.$refs.pageRef.refreshList()
+    },
+    selectable(row) {
+      return this.recordSelected.length
+        ? !!this.recordSelected.find(item => item.goodsLibraryId == row.goodsLibraryId)
+        : true
+    },
+    fieldBeansHook(row) {
+      row.forEach(item => {
+        if (item.jname == 'status') {
+          item.isQuery = false
+        }
+      })
+      console.log(row, 111)
+    },
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'imgUrl') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:6px;cursor: pointer;">
+              {row.imgUrl
+                ? row.imgUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:60px;height:60px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 表格操作列
+    operation(h, { row, index, column }) {
+      return (
+        <div class="operation-btns">
+          <el-button
+            type="text"
+            onClick={() => {
+              this.isShowDetail = true
+              getDetail({
+                goodsLibraryId: row.goodsLibraryId
+              }).then(res => {
+                let imgs = []
+                let goodsLibrarySpecList = []
+                res.data.imgs.split(',').forEach(item => {
+                  imgs.push({
+                    url: item
+                  })
+                })
+                res.data.goodsLibrarySpecList.forEach(item => {
+                  goodsLibrarySpecList.push({
+                    ...item,
+                    imgUrl: item.imgUrl ? [{ url: item.imgUrl }] : []
+                  })
+                })
+                Object.assign(this.formData, res.data, {
+                  imgUrl: res.data.imgUrl ? [{ url: res.data.imgUrl }] : [],
+                  imgs: res.data.imgs ? imgs : [],
+                  vedio: res.data.vedio ? [{ url: res.data.vedio }] : [],
+                  goodsLibrarySpecList
+                })
+                this.$nextTick(() => {
+                  document.querySelector('#box').scrollIntoView({
+                    behavior: 'smooth'
+                  })
+                })
+              })
+            }}
+          >
+            查看详情
+          </el-button>
+        </div>
+      )
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    formConfirm() {
+      if (this.recordSelected.length == 0) {
+        return this.$message.warning('请至少勾选一条数据!')
+      }
+      this.$emit('selectShop', this.recordSelected[0].goodsLibraryId)
+    },
+    cancel() {
+      this.$emit('selectShop')
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		padding: 20px;
-		padding-bottom: 60px;
-		box-sizing: border-box;
-	}
-	.flex_ac{
-		display: flex;
-		align-items: center;
-	}
-	.box-card{
-		margin-top: 30px;
-	}
-	.hui{
-		color: #888888;
-	}
-	.suggest{
-		display: inline-block;
-		padding: 0 10px;
-		margin-top: 10px;
-		background-color: #ffdee5;
-		color: #cd1e46;
-	}
-	.footer {
-		padding: 15px 40px;
-		box-sizing: border-box;
-		text-align: right;
-	}
-	::v-deep .zj-page-fill{
-		max-height: 360px !important;
-		overflow-y: auto;
-	}
-	::v-deep .el-dialog{
-		margin-top: 0 !important;
-	}
-	::v-deep .el-dialog__wrapper{
-		overflow: hidden !important;
-	}
-</style>
+.page {
+  padding: 20px;
+  padding-bottom: 60px;
+  box-sizing: border-box;
+}
+.flex_ac {
+  display: flex;
+  align-items: center;
+}
+.box-card {
+  margin-top: 30px;
+}
+.hui {
+  color: #888888;
+}
+.suggest {
+  display: inline-block;
+  padding: 0 10px;
+  margin-top: 10px;
+  background-color: #ffdee5;
+  color: #cd1e46;
+}
+.footer {
+  padding: 15px 40px;
+  box-sizing: border-box;
+  text-align: right;
+}
+::v-deep .zj-page-fill {
+  max-height: 360px !important;
+  overflow-y: auto;
+}
+::v-deep .el-dialog {
+  margin-top: 0 !important;
+}
+::v-deep .el-dialog__wrapper {
+  overflow: hidden !important;
+}
+</style>

+ 822 - 615
src/views/mallManagement/goods/goodsWarehouse/index.vue

@@ -1,622 +1,829 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList"
-				:table-attributes="tableAttributes" :table-events="tableEvents" :options-evens-group="optionsEvensGroup"
-				:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()"
-				:exportList="exportList" :operationColumnWidth="80">
-				<div slot="moreSearch">
-					<el-radio-group v-model="status" size="mini" @change="changeType">
-						<el-radio-button label="">全部</el-radio-button>
-						<el-radio-button :label="false">已关闭</el-radio-button>
-						<el-radio-button :label="true">已开启</el-radio-button>
-					</el-radio-group>
-					<br><br>
-				</div>
-			</template-page>
-			<div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
-				<div class="page">
-					<el-steps :active="stepIndex" align-center>
-						<el-step title="编辑基础信息" description=""></el-step>
-						<el-step title="编辑价格库存" description=""></el-step>
-						<el-step title="编辑商品详情" description=""></el-step>
-					</el-steps>
-					<el-card class="box-card">
-						<div slot="header" class="clearfix">
-							<span>{{stepIndex == 0?'基础信息':stepIndex == 1?'价格库存':stepIndex == 2?'详情内容':''}}</span>
-						</div>
-						<div class="mymain-container">
-							<el-form ref="formRef" :rules="rules" :model="formData" label-width="110px" size="small"
-								label-position="left">
-								<el-row :gutter="20" justify="start">
-									<div v-show="stepIndex == 0">
-										<el-col :span="24">
-											<el-form-item label="商品可选状态" prop="status" :required="true">
-												<div class="flex_ac">
-													<el-radio-group v-model="formData.status">
-													    <el-radio :label="true">开启</el-radio>
-													    <el-radio :label="false">关闭</el-radio>
-													</el-radio-group>
-													<div class="hui" style="margin-left: 80px;">开启状态,商户可选择本商品;关闭则不允许商户选择;</div>
-												</div>
-											</el-form-item>
-										</el-col>
-										<el-col :span="6">
-											<el-form-item label="品牌" prop="brandName" :rules="[{ required: true, message: `请输入品牌`, trigger: 'blur' }]">
-												<el-input type="text" v-model="formData.brandName" placeholder="请输入"></el-input>
-											</el-form-item>
-										</el-col>
-										<el-col :span="6">
-											<el-form-item label="是否虚拟商品" prop="isVr" :required="true">
-												<el-radio-group v-model="formData.isVr">
-												    <el-radio :label="true">是</el-radio>
-												    <el-radio :label="false">否</el-radio>
-												</el-radio-group>
-											</el-form-item>
-										</el-col>
-										<el-col :span="6">
-											<el-form-item label="商品大类" prop="category1" :rules="[{ required: true, message: `请输入商品大类`, trigger: 'blur' }]">
-												<el-input type="text" v-model="formData.category1" placeholder="请输入"></el-input>
-											</el-form-item>
-										</el-col>
-										<el-col :span="6">
-											<el-form-item label="商品小类" prop="category2" :rules="[{ required: true, message: `请输入商品小类`, trigger: 'blur' }]">
-												<el-input type="text" v-model="formData.category2" placeholder="请输入"></el-input>
-											</el-form-item>
-										</el-col>
-										<el-col :span="24">
-											<el-form-item label="商品名称" prop="goodsName" :rules="[{ required: true, message: `请输入商品名称`, trigger: 'blur' }]">
-												<el-input type="textarea" :rows="3" v-model="formData.goodsName" placeholder="请输入"></el-input>
-												<div class="hui">商品名称将显示在商品详情,让用户更直接了解商品内涵</div>
-											</el-form-item>
-										</el-col>
-										<el-col :span="24">
-											<el-form-item label="商品描述" prop="describeText">
-												<el-input type="textarea" :rows="3" v-model="formData.describeText" placeholder="请输入"></el-input>
-												<div class="hui">商品描述将显示在商品详情,让用户更了解商品细节</div>
-											</el-form-item>
-										</el-col>
-										<el-col :span="12">
-											<el-form-item label="商品主图" prop="imgUrl" :rules="[{ required: true, message: `请上传商品主图`, trigger: 'change' }]">
-												<ImageUpload :fileList="formData.imgUrl" :limit="1" :isEdit="true" :fileType="['image']"/>
-												<div class="suggest">建议尺寸800*800</div>
-											</el-form-item>
-										</el-col>
-										<el-col :span="12">
-											<el-form-item label="商品视频" prop="vedio">
-												<ImageUpload :fileList="formData.vedio" :limit="1" :isEdit="true" :fileType="['video']"/>
-												<div class="suggest">建议视频宽高比16:9,建议时长9-30秒</div>
-											</el-form-item>
-										</el-col>
-										<el-col :span="24">
-											<el-form-item label="轮播图" prop="imgs" :rules="[{ required: true, message: `请上传轮播图`, trigger: 'change' }]">
-												<ImageUpload :fileList="formData.imgs" :limit="6" :isEdit="true" :fileType="['image']"/>
-												<div class="suggest">建议尺寸800*800,最多上传6张</div>
-											</el-form-item>
-										</el-col>
-									</div>
-									<div v-show="stepIndex == 1">
-										<el-col :span="24">
-											<el-form-item label="规格类型" prop="goodsLibrarySpecList" class="is-required">
-												<el-button size="mini" @click="add()" type="primary">添加规格</el-button>
-											</el-form-item>
-										</el-col>
-										<el-form ref="formData" :model="formData" label-width="110px" size="small">
-											<el-table :data="formData.goodsLibrarySpecList" element-loading-text="Loading" border fit highlight-current-row stripe>
-												<el-table-column prop="" align="center" label="*大类">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.mainName'" :rules="[{ required: true, message: `请输入大类`, trigger: 'blur' }]" label-width="0">
-															<el-input type="text" v-model="scope.row.mainName" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*小类">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.smallName'" :rules="[{ required: true, message: `请输入小类`, trigger: 'blur' }]" label-width="0">
-															<el-input type="text" v-model="scope.row.smallName" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*规格型号">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.specValue'" :rules="[{ required: true, message: `请输入规格型号`, trigger: 'blur' }]" label-width="0">
-															<el-input type="text" v-model="scope.row.specValue" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考销售价格">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.price'" :rules="[{ required: true, message: `请输入参考销售价格`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-															<el-input type="number" v-model="scope.row.price" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考划线价格">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.orgPrice'" :rules="[{ required: true, message: `请输入参考划线价格`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-															<el-input type="number" v-model="scope.row.orgPrice" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考成本价">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.costPrice'" :rules="[{ required: true, message: `请输入参考成本价`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-															<el-input type="number" v-model="scope.row.costPrice" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考佣金">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.shareAmount'" :rules="[{ required: true, message: `请输入参考佣金`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-															<el-input type="number" v-model="scope.row.shareAmount" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考内部佣金">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.innerShareAmount'" :rules="[{ required: true, message: `请输入参考内部佣金`, trigger: 'blur' },{ pattern:/^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g, message: '请输入大于等于0的数', trigger: 'blur' }]" label-width="0">
-															<el-input type="number" v-model="scope.row.innerShareAmount" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column prop="" align="center" label="*参考规格图片">
-													<template slot-scope="scope">
-														<el-form-item :prop="'goodsLibrarySpecList.' + scope.$index + '.imgUrl'" :rules="[{ required: true, message: `请上传参考规格图片`, trigger: 'change' }]" label-width="0">
-															<div class="flex_ac">
-																<ImageUpload :fileList="scope.row.imgUrl" :limit="1" :download="false" :viewOnline="false" :isEdit="true" modType="text" :fileType="['image']"/>
-															</div>
-														</el-form-item>
-													</template>
-												</el-table-column>
-												<el-table-column label="操作" align="center" width="160">
-													<template slot-scope="scope">
-														<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="edit(scope.$index)">编辑</el-button>
-														<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
-													</template>
-												</el-table-column>
-											</el-table>
-										</el-form>
-									</div>
-									<div v-show="stepIndex == 2">
-										<el-form-item label="详情内容" prop="content" :rules="[{ required: true, message: `请输入详情内容`, trigger: 'change' }]">
-											<quillEditor v-model="formData.content"></quillEditor>
-											<input type="hidden" v-model="formData.content">
-										</el-form-item>
-									</div>
-								</el-row>
-							</el-form>
-						</div>
-					</el-card>
-				</div>
-				<div class="footer">
-					<el-button v-if="stepIndex > 0" size="mini" @click="up()">上一步</el-button>
-					<el-button v-if="stepIndex < 2" size="mini" @click="next()">下一步</el-button>
-					<el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">提交</el-button>
-					<el-button size="mini" @click="data.removeTab()">关闭</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+        <div slot="moreSearch">
+          <el-radio-group v-model="status" size="mini" @change="changeType">
+            <el-radio-button label="">全部</el-radio-button>
+            <el-radio-button :label="false">已关闭</el-radio-button>
+            <el-radio-button :label="true">已开启</el-radio-button>
+          </el-radio-group>
+          <br /><br />
+        </div>
+      </template-page>
+      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
+        <div class="page">
+          <el-steps :active="stepIndex" align-center>
+            <el-step title="编辑基础信息" description=""></el-step>
+            <el-step title="编辑价格库存" description=""></el-step>
+            <el-step title="编辑商品详情" description=""></el-step>
+          </el-steps>
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <span>{{
+                stepIndex == 0 ? '基础信息' : stepIndex == 1 ? '价格库存' : stepIndex == 2 ? '详情内容' : ''
+              }}</span>
+            </div>
+            <div class="mymain-container">
+              <el-form
+                ref="formRef"
+                :rules="rules"
+                :model="formData"
+                label-width="110px"
+                size="small"
+                label-position="left"
+              >
+                <el-row :gutter="20" justify="start">
+                  <div v-show="stepIndex == 0">
+                    <el-col :span="24">
+                      <el-form-item label="商品可选状态" prop="status" :required="true">
+                        <div class="flex_ac">
+                          <el-radio-group v-model="formData.status">
+                            <el-radio :label="true">开启</el-radio>
+                            <el-radio :label="false">关闭</el-radio>
+                          </el-radio-group>
+                          <div class="hui" style="margin-left: 80px">
+                            开启状态,商户可选择本商品;关闭则不允许商户选择;
+                          </div>
+                        </div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="6">
+                      <el-form-item
+                        label="品牌"
+                        prop="brandName"
+                        :rules="[{ required: true, message: `请输入品牌`, trigger: 'blur' }]"
+                      >
+                        <el-input type="text" v-model="formData.brandName" placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="6">
+                      <el-form-item label="是否虚拟商品" prop="isVr" :required="true">
+                        <el-radio-group v-model="formData.isVr">
+                          <el-radio :label="true">是</el-radio>
+                          <el-radio :label="false">否</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="6">
+                      <el-form-item
+                        label="商品大类"
+                        prop="category1"
+                        :rules="[{ required: true, message: `请输入商品大类`, trigger: 'blur' }]"
+                      >
+                        <el-input type="text" v-model="formData.category1" placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="6">
+                      <el-form-item
+                        label="商品小类"
+                        prop="category2"
+                        :rules="[{ required: true, message: `请输入商品小类`, trigger: 'blur' }]"
+                      >
+                        <el-input type="text" v-model="formData.category2" placeholder="请输入"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item
+                        label="商品名称"
+                        prop="goodsName"
+                        :rules="[{ required: true, message: `请输入商品名称`, trigger: 'blur' }]"
+                      >
+                        <el-input
+                          type="textarea"
+                          :rows="3"
+                          v-model="formData.goodsName"
+                          placeholder="请输入"
+                        ></el-input>
+                        <div class="hui">商品名称将显示在商品详情,让用户更直接了解商品内涵</div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="商品描述" prop="describeText">
+                        <el-input
+                          type="textarea"
+                          :rows="3"
+                          v-model="formData.describeText"
+                          placeholder="请输入"
+                        ></el-input>
+                        <div class="hui">商品描述将显示在商品详情,让用户更了解商品细节</div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                      <el-form-item
+                        label="商品主图"
+                        prop="imgUrl"
+                        :rules="[{ required: true, message: `请上传商品主图`, trigger: 'change' }]"
+                      >
+                        <ImageUpload :fileList="formData.imgUrl" :limit="1" :isEdit="true" :fileType="['image']" />
+                        <div class="suggest">建议尺寸800*800</div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                      <el-form-item label="商品视频" prop="vedio">
+                        <ImageUpload :fileList="formData.vedio" :limit="1" :isEdit="true" :fileType="['video']" />
+                        <div class="suggest">建议视频宽高比16:9,建议时长9-30秒</div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item
+                        label="轮播图"
+                        prop="imgs"
+                        :rules="[{ required: true, message: `请上传轮播图`, trigger: 'change' }]"
+                      >
+                        <ImageUpload :fileList="formData.imgs" :limit="6" :isEdit="true" :fileType="['image']" />
+                        <div class="suggest">建议尺寸800*800,最多上传6张</div>
+                      </el-form-item>
+                    </el-col>
+                  </div>
+                  <div v-show="stepIndex == 1">
+                    <el-col :span="24">
+                      <el-form-item label="规格类型" prop="goodsLibrarySpecList" class="is-required">
+                        <el-button size="mini" @click="add()" type="primary">添加规格</el-button>
+                      </el-form-item>
+                    </el-col>
+                    <el-form ref="formData" :model="formData" label-width="110px" size="small">
+                      <el-table
+                        :data="formData.goodsLibrarySpecList"
+                        element-loading-text="Loading"
+                        border
+                        fit
+                        highlight-current-row
+                        stripe
+                      >
+                        <el-table-column prop="" align="center" label="*大类">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.mainName'"
+                              :rules="[{ required: true, message: `请输入大类`, trigger: 'blur' }]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="text"
+                                v-model="scope.row.mainName"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*小类">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.smallName'"
+                              :rules="[{ required: true, message: `请输入小类`, trigger: 'blur' }]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="text"
+                                v-model="scope.row.smallName"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*规格型号">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.specValue'"
+                              :rules="[{ required: true, message: `请输入规格型号`, trigger: 'blur' }]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="text"
+                                v-model="scope.row.specValue"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考销售价格">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.price'"
+                              :rules="[
+                                { required: true, message: `请输入参考销售价格`, trigger: 'blur' },
+                                {
+                                  pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                                  message: '请输入大于等于0的数',
+                                  trigger: 'blur'
+                                }
+                              ]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="number"
+                                v-model="scope.row.price"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考划线价格">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.orgPrice'"
+                              :rules="[
+                                { required: true, message: `请输入参考划线价格`, trigger: 'blur' },
+                                {
+                                  pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                                  message: '请输入大于等于0的数',
+                                  trigger: 'blur'
+                                }
+                              ]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="number"
+                                v-model="scope.row.orgPrice"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考成本价">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.costPrice'"
+                              :rules="[
+                                { required: true, message: `请输入参考成本价`, trigger: 'blur' },
+                                {
+                                  pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                                  message: '请输入大于等于0的数',
+                                  trigger: 'blur'
+                                }
+                              ]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="number"
+                                v-model="scope.row.costPrice"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考佣金">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.shareAmount'"
+                              :rules="[
+                                { required: true, message: `请输入参考佣金`, trigger: 'blur' },
+                                {
+                                  pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                                  message: '请输入大于等于0的数',
+                                  trigger: 'blur'
+                                }
+                              ]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="number"
+                                v-model="scope.row.shareAmount"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考内部佣金">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.innerShareAmount'"
+                              :rules="[
+                                { required: true, message: `请输入参考内部佣金`, trigger: 'blur' },
+                                {
+                                  pattern: /^(([0-9]\d*)|([0][.]{1}[0-9]{0,2}[1-9]+)|([1-9]\d*[.]{1}[0-9]+))$/g,
+                                  message: '请输入大于等于0的数',
+                                  trigger: 'blur'
+                                }
+                              ]"
+                              label-width="0"
+                            >
+                              <el-input
+                                type="number"
+                                v-model="scope.row.innerShareAmount"
+                                :disabled="isEdit != scope.$index"
+                                placeholder="请输入"
+                              ></el-input>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="" align="center" label="*参考规格图片">
+                          <template slot-scope="scope">
+                            <el-form-item
+                              :prop="'goodsLibrarySpecList.' + scope.$index + '.imgUrl'"
+                              :rules="[{ required: true, message: `请上传参考规格图片`, trigger: 'change' }]"
+                              label-width="0"
+                            >
+                              <div class="flex_ac">
+                                <ImageUpload
+                                  :fileList="scope.row.imgUrl"
+                                  :limit="1"
+                                  :download="false"
+                                  :viewOnline="false"
+                                  :isEdit="true"
+                                  modType="text"
+                                  :fileType="['image']"
+                                />
+                              </div>
+                            </el-form-item>
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="操作" align="center" width="160">
+                          <template slot-scope="scope">
+                            <el-button
+                              size="mini"
+                              type="primary"
+                              v-if="scope.$index != isEdit"
+                              @click="edit(scope.$index)"
+                              >编辑</el-button
+                            >
+                            <el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+                          </template>
+                        </el-table-column>
+                      </el-table>
+                    </el-form>
+                  </div>
+                  <div v-show="stepIndex == 2">
+                    <el-form-item
+                      label="详情内容"
+                      prop="content"
+                      :rules="[{ required: true, message: `请输入详情内容`, trigger: 'change' }]"
+                    >
+                      <quillEditor v-model="formData.content"></quillEditor>
+                      <input type="hidden" v-model="formData.content" />
+                    </el-form-item>
+                  </div>
+                </el-row>
+              </el-form>
+            </div>
+          </el-card>
+        </div>
+        <div class="footer">
+          <el-button v-if="stepIndex > 0" size="mini" @click="up()">上一步</el-button>
+          <el-button v-if="stepIndex < 2" size="mini" @click="next()">下一步</el-button>
+          <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">提交</el-button>
+          <el-button size="mini" @click="data.removeTab()">关闭</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
-	import TemplatePage from '@/components/template/template-page-1.vue'
-	import import_mixin from '@/components/template/import_mixin.js'
-	import ImageUpload from '@/components/file-upload'
-	import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-	import { listPageV2, pageExport, save, del, getDetail, batch, sync } from "@/api/goodsWarehouse";
-	import operation_mixin from '@/components/template/operation_mixin.js'
-	import quillEditor from '@/components/v-quill-editor'
-	export default {
-		components: {
-			TemplatePage,ImageUpload,quillEditor
-		},
-		mixins: [import_mixin, operation_mixin],
-		data() {
-			return {
-				// 表格属性
-				tableAttributes: {
-					// 启用勾选列
-					selectColumn: true
-				},
-				// 表格事件
-				tableEvents: {
-					'selection-change': this.selectionChange
-				},
-				// 勾选选中行
-				recordSelected: [],
-				/** 表单变量 */
-				formDialogType: 0,
-				formDialogTitles: ["新增", "编辑"],
-				formDialog: false,
-				formData: {
-					status: true,
-					brandName: '',
-					category1: '',
-					category2: '',
-					isVr: true,
-					goodsName: '',
-					describeText: '',
-					imgUrl: [],
-					vedio: [],
-					imgs: [],
-					content: '',
-					goodsLibrarySpecList: []
-				},
-				rules: {},
-				status: '',
-				formType: 'add',
-				formVisible: false,
-				stepIndex: 0,
-				isEdit: 0
-			}
-		},
-		computed: {
-			// 事件组合
-			optionsEvensGroup() {
-				return [
-					[
-						[
-							this.optionsEvensAuth("add", {
-								click: () => {
-									this.openForm('add')
-								}
-							})
-						]
-					],
-					[
-						[
-							this.optionsEvensAuth("openMore", {
-								click: () => {
-									this.openMore()
-								}
-							})
-						]
-					],
-					[
-						[
-							this.optionsEvensAuth("closeMore", {
-								click: () => {
-									this.closeMore()
-								}
-							})
-						]
-					],
-					[
-						[
-							this.optionsEvensAuth("synchronization", {
-								click: () => {
-									this.sync()
-								}
-							})
-						]
-					]
-				]
-			},
-			// 更多参数
-			moreParameters() {
-				return []
-			},
-			formItems() {
-				return []
-			}
-		},
-		methods: {
-			// 列表请求函数
-			getList(p, cb) {
-				try {
-					var pam = JSON.parse(JSON.stringify(p))
-					pam.params.push({ 'param': 'a.status', "compare": "=", "value": this.status })
-					cb && cb(pam)
-					return listPageV2(pam)
-				} catch (error) {
-					console.log(error)
-				}
-			},
-			// 列表导出函数
-			exportList: pageExport,
-			changeType(){
-				this.$refs.pageRef.refreshList()
-			},
-			// 表格列解析渲染数据更改
-			columnParsing(item, defaultData) {
-				if (item.jname === 'imgUrl') {
-					defaultData.render = (h, { row, index, column }) => {
-						return (
-							<div style="padding:6px;cursor: pointer;">
-							  {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:60px;height:60px;" />) : null}
-							</div>
-						)
-					}
-				}
-				if (item.jname === 'goodsName') {
-					defaultData.render = (h, { row, index, column }) => {
-						return (
-							<div style="padding:6px;">
-								{row.goodsName}
-							</div>
-						)
-					}
-					defaultData.columnAttributes.width = 300
-					console.log(defaultData,11)
-				}
-				return defaultData
-			},
-			up(){
-				this.stepIndex -= 1
-			},
-			next(){
-				this.stepIndex += 1
-			},
-			add(){
-				this.$refs.formData.validate((valid) => {
-					if (valid) {
-						this.isEdit = 0
-						this.formData.goodsLibrarySpecList.unshift({
-							mainName: '',
-							smallName: '',
-							specValue: '',
-							price: '',
-							orgPrice: '',
-							shareAmount: '',
-							innerShareAmount: '',
-							costPrice: '',
-							imgUrl: []
-						})
-					}
-				});
-			},
-			edit(index){
-				this.$refs.formData.validate((valid) => {
-					if (valid) {
-						this.isEdit = index
-					}
-				});
-			},
-			del(index){
-				this.formData.goodsLibrarySpecList.splice(index,1)
-			},
-			// 监听勾选变化
-			selectionChange(data) {
-				this.recordSelected = data
-			},
-			openMore() {
-				if (this.recordSelected.length == 0) {
-					return this.$message.warning('请至少勾选一条数据!');
-				}
-				this.batch(this.recordSelected.map(item => { return item.goodsLibraryId }),true)
-			},
-			closeMore() {
-				if (this.recordSelected.length == 0) {
-					return this.$message.warning('请至少勾选一条数据!');
-				}
-				this.batch(this.recordSelected.map(item => { return item.goodsLibraryId }),false)
-			},
-			batch(goodsLibraryIds,statusEnum) {
-				console.log(goodsLibraryIds)
-				this.$confirm('请确认是否批量操作选中的数据, 是否继续?', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					batch({
-						goodsLibraryIds: goodsLibraryIds.join(','),
-						statusEnum
-					}).then(res => {
-						this.$message({ type: 'success', message: statusEnum?'批量开启成功!':'批量关闭成功!' })
-						this.$refs.pageRef.refreshList()
-					})
-				});
-			},
-			sync(){
-				const loading = this.$loading({
-				  lock: true,
-				  text: 'Loading',
-				  spinner: 'el-icon-loading',
-				  background: 'rgba(0, 0, 0, 0.7)'
-				});
-				sync().then(res => {
-					if(res.code == 200){
-						this.$message({ type: 'success', message: `同步成功!` })
-						this.$refs.pageRef.refreshList()
-					}else{
-						this.$message({ type: 'error', message: res.message })
-					}
-					loading.close();
-				})
-				
-			},
-			// 表格操作列
-			operation() {
-				return this.operationBtn({
-					edit: {
-						btnType: 'text',
-						click: ({ row, index, column }) => {
-							this.openForm('edit', row.goodsLibraryId)
-						}
-					},
-					del: {
-						btnType: 'text',
-						prompt: '确定删除吗?',
-						click: ({ row, index, column }) => {
-							del({
-								goodsLibraryId: row.goodsLibraryId
-							}).then(() => {
-								this.$message({
-									type: 'success',
-									message: '删除成功!'
-								})
-								this.$refs.pageRef.refreshList()
-							})
-						}
-					}
-				})
-			},
-			// 打开 新增编辑 网点表单
-			openForm(type, goodsLibraryId) {
-				this.$refs.tabPage.addTab({
-					// 对应显示的模块
-					activeKey: type,
-					// 唯一标识
-					key: type,
-					// 页签名称
-					label: ({
-						edit: "编辑",
-						add: "新增"
-					})[type],
-					// 打开时事件
-					triggerEvent: () => {
-						this.formCancel()
-						this.$nextTick(() => {
-							this.formType = type
-							this.formVisible = true
-							if (type == 'add') {
-								this.formDialogType = 0
-							} else if (type == 'edit') {
-								this.formDialogType = 1
-								getDetail({
-									goodsLibraryId
-								}).then(res => {
-									let imgs = []
-									let goodsLibrarySpecList = []
-									res.data.imgs.split(",").forEach(item=>{
-										imgs.push({
-											url: item
-										})
-									})
-									res.data.goodsLibrarySpecList.forEach(item=>{
-										goodsLibrarySpecList.push({
-											...item,
-											imgUrl: item.imgUrl?[{url: item.imgUrl}]:[]
-										})
-									})
-									Object.assign(this.formData, res.data,{
-										imgUrl: res.data.imgUrl?[{url: res.data.imgUrl}]:[],
-										imgs: res.data.imgs?imgs:[],
-										vedio: res.data.vedio?[{url: res.data.vedio}]:[],
-										goodsLibrarySpecList
-									})
-									console.log(this.formData,imgs)
-								})
-							}
-						})
-					},
-					// 关闭时事件
-					closeEvent: () => {
-
-					}
-				})
-			},
-			formCancel() {
-				this.formVisible = false
-				this.$refs?.formRef?.resetFields()
-				this.$data.formData = this.$options.data().formData
-			},
-			formConfirm(cancel) {
-				let imgs = this.formData.imgs.map(item => { return item.url })
-				let goodsLibrarySpecList = []
-				this.formData.goodsLibrarySpecList.forEach(item=>{
-					goodsLibrarySpecList.push({
-						...item,
-						imgUrl: item.imgUrl.length>0?item.imgUrl[0].url:''
-					})
-				})
-				this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-							if (valid) {
-								save({
-									...this.formData,
-									imgUrl: this.formData.imgUrl.length>0?this.formData.imgUrl[0].url:'',
-									imgs: this.formData.imgs.length>0?imgs.join(','):'',
-									vedio: this.formData.vedio.length>0?this.formData.vedio[0].url:'',
-									goodsLibrarySpecList
-								}).then(res => {
-									this.stepIndex = 0
-									this.$message({
-										type: 'success',
-										message: `${this.formDialogTitles[this.formDialogType]}成功!`
-									})
-									cancel('list')
-									this.$refs.pageRef.refreshList()
-								})
-							}else{
-								this.stepIndex = 1
-							}
-						})
-					}else{
-						if(this.formData.goodsLibrarySpecList.length == 0){
-							this.stepIndex = 1
-							this.$message({
-								type: 'warning',
-								message: '请添加规格类型!'
-							})
-						}else if(!this.formData.content){
-							this.stepIndex = 2
-							this.$message({
-								type: 'warning',
-								message: '请输入商品内容详情!'
-							})
-						}else{
-							this.stepIndex = 0
-						}
-					}
-				})
-			}
-		}
-	}
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
+import { listPageV2, pageExport, save, del, getDetail, batch, sync } from '@/api/goodsWarehouse'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import quillEditor from '@/components/v-quill-editor'
+export default {
+  components: {
+    TemplatePage,
+    ImageUpload,
+    quillEditor
+  },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑'],
+      formDialog: false,
+      formData: {
+        status: true,
+        brandName: '',
+        category1: '',
+        category2: '',
+        isVr: true,
+        goodsName: '',
+        describeText: '',
+        imgUrl: [],
+        vedio: [],
+        imgs: [],
+        content: '',
+        goodsLibrarySpecList: []
+      },
+      rules: {},
+      status: '',
+      formType: 'add',
+      formVisible: false,
+      stepIndex: 0,
+      isEdit: 0
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('openMore', {
+              click: () => {
+                this.openMore()
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('closeMore', {
+              click: () => {
+                this.closeMore()
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('synchronization', {
+              click: () => {
+                this.sync()
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push({ param: 'a.status', compare: '=', value: this.status })
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    changeType() {
+      this.$refs.pageRef.refreshList()
+    },
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'imgUrl') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:6px;cursor: pointer;">
+              {row.imgUrl
+                ? row.imgUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:60px;height:60px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      if (item.jname === 'goodsName') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <div style="padding:6px;">{row.goodsName}</div>
+        }
+        defaultData.columnAttributes.width = 300
+        console.log(defaultData, 11)
+      }
+      return defaultData
+    },
+    up() {
+      this.stepIndex -= 1
+    },
+    next() {
+      this.stepIndex += 1
+    },
+    add() {
+      this.$refs.formData.validate(valid => {
+        if (valid) {
+          this.isEdit = 0
+          this.formData.goodsLibrarySpecList.unshift({
+            mainName: '',
+            smallName: '',
+            specValue: '',
+            price: '',
+            orgPrice: '',
+            shareAmount: '',
+            innerShareAmount: '',
+            costPrice: '',
+            imgUrl: []
+          })
+        }
+      })
+    },
+    edit(index) {
+      this.$refs.formData.validate(valid => {
+        if (valid) {
+          this.isEdit = index
+        }
+      })
+    },
+    del(index) {
+      this.formData.goodsLibrarySpecList.splice(index, 1)
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    openMore() {
+      if (this.recordSelected.length == 0) {
+        return this.$message.warning('请至少勾选一条数据!')
+      }
+      this.batch(
+        this.recordSelected.map(item => {
+          return item.goodsLibraryId
+        }),
+        true
+      )
+    },
+    closeMore() {
+      if (this.recordSelected.length == 0) {
+        return this.$message.warning('请至少勾选一条数据!')
+      }
+      this.batch(
+        this.recordSelected.map(item => {
+          return item.goodsLibraryId
+        }),
+        false
+      )
+    },
+    batch(goodsLibraryIds, statusEnum) {
+      console.log(goodsLibraryIds)
+      this.$confirm('请确认是否批量操作选中的数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        batch({
+          goodsLibraryIds: goodsLibraryIds.join(','),
+          statusEnum
+        }).then(res => {
+          this.$message({ type: 'success', message: statusEnum ? '批量开启成功!' : '批量关闭成功!' })
+          this.$refs.pageRef.refreshList()
+        })
+      })
+    },
+    sync() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      sync().then(res => {
+        if (res.code == 200) {
+          this.$message({ type: 'success', message: `同步成功!` })
+          this.$refs.pageRef.refreshList()
+        } else {
+          this.$message({ type: 'error', message: res.message })
+        }
+        loading.close()
+      })
+    },
+    // 表格操作列
+    operation() {
+      return this.operationBtn({
+        edit: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.goodsLibraryId)
+          }
+        },
+        del: {
+          btnType: 'text',
+          prompt: '确定删除吗?',
+          click: ({ row, index, column }) => {
+            del({
+              goodsLibraryId: row.goodsLibraryId
+            }).then(() => {
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              })
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        }
+      })
+    },
+    // 打开 新增编辑 网点表单
+    openForm(type, goodsLibraryId) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: {
+          edit: '编辑',
+          add: '新增'
+        }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              getDetail({
+                goodsLibraryId
+              }).then(res => {
+                let imgs = []
+                let goodsLibrarySpecList = []
+                res.data.imgs.split(',').forEach(item => {
+                  imgs.push({
+                    url: item
+                  })
+                })
+                res.data.goodsLibrarySpecList.forEach(item => {
+                  goodsLibrarySpecList.push({
+                    ...item,
+                    imgUrl: item.imgUrl ? [{ url: item.imgUrl }] : []
+                  })
+                })
+                Object.assign(this.formData, res.data, {
+                  imgUrl: res.data.imgUrl ? [{ url: res.data.imgUrl }] : [],
+                  imgs: res.data.imgs ? imgs : [],
+                  vedio: res.data.vedio ? [{ url: res.data.vedio }] : [],
+                  goodsLibrarySpecList
+                })
+                console.log(this.formData, imgs)
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    formConfirm(cancel) {
+      let imgs = this.formData.imgs.map(item => {
+        return item.url
+      })
+      let goodsLibrarySpecList = []
+      this.formData.goodsLibrarySpecList.forEach(item => {
+        goodsLibrarySpecList.push({
+          ...item,
+          imgUrl: item.imgUrl.length > 0 ? item.imgUrl[0].url : ''
+        })
+      })
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+            if (valid) {
+              save({
+                ...this.formData,
+                imgUrl: this.formData.imgUrl.length > 0 ? this.formData.imgUrl[0].url : '',
+                imgs: this.formData.imgs.length > 0 ? imgs.join(',') : '',
+                vedio: this.formData.vedio.length > 0 ? this.formData.vedio[0].url : '',
+                goodsLibrarySpecList
+              }).then(res => {
+                this.stepIndex = 0
+                this.$message({
+                  type: 'success',
+                  message: `${this.formDialogTitles[this.formDialogType]}成功!`
+                })
+                cancel('list')
+                this.$refs.pageRef.refreshList()
+              })
+            } else {
+              this.stepIndex = 1
+            }
+          })
+        } else {
+          if (this.formData.goodsLibrarySpecList.length == 0) {
+            this.stepIndex = 1
+            this.$message({
+              type: 'warning',
+              message: '请添加规格类型!'
+            })
+          } else if (!this.formData.content) {
+            this.stepIndex = 2
+            this.$message({
+              type: 'warning',
+              message: '请输入商品内容详情!'
+            })
+          } else {
+            this.stepIndex = 0
+          }
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		padding: 20px;
-		padding-bottom: 60px;
-		box-sizing: border-box;
-	}
-	.flex_ac{
-		display: flex;
-		align-items: center;
-	}
-	.box-card{
-		margin-top: 30px;
-	}
-	.hui{
-		color: #888888;
-	}
-	.suggest{
-		display: inline-block;
-		padding: 0 10px;
-		margin-top: 10px;
-		background-color: #ffdee5;
-		color: #cd1e46;
-	}
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
-	
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
-	
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
-	
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+.page {
+  padding: 20px;
+  padding-bottom: 60px;
+  box-sizing: border-box;
+}
+.flex_ac {
+  display: flex;
+  align-items: center;
+}
+.box-card {
+  margin-top: 30px;
+}
+.hui {
+  color: #888888;
+}
+.suggest {
+  display: inline-block;
+  padding: 0 10px;
+  margin-top: 10px;
+  background-color: #ffdee5;
+  color: #cd1e46;
+}
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
+
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
+
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

Різницю між файлами не показано, бо вона завелика
+ 357 - 264
src/views/mallManagement/goods/goods_add/index.vue


+ 452 - 298
src/views/mallManagement/goods/goods_index/index.vue

@@ -2,23 +2,39 @@
   <div class="app-container">
     <div class="tab-container clearfix">
       <div class="tab-list fl">
-        <div class="item" :class="screenForm.type === '' ? 'current':''" @click="changeType('')">全部({{ goodsStateCount.total ? goodsStateCount.total : 0 }})</div>
-        <div class="item" :class="screenForm.type === 'S' ? 'current':''" @click="changeType('S')">出售中({{ goodsStateCount.csz ? goodsStateCount.csz : 0 }})</div>
-        <div class="item" :class="screenForm.type === 'O' ? 'current':''" @click="changeType('O')">已售罄({{ goodsStateCount.ysq ? goodsStateCount.ysq : 0 }})</div>
-        <div class="item" :class="screenForm.type === 'W' ? 'current':''" @click="changeType('W')">仓库中({{ goodsStateCount.ckz ? goodsStateCount.ckz : 0 }})</div>
-        <div class="item" :class="screenForm.type === 'A' ? 'current':''" @click="changeType('A')">活动中({{ goodsStateCount.hdz ? goodsStateCount.hdz : 0 }})</div>
+        <div class="item" :class="screenForm.type === '' ? 'current' : ''" @click="changeType('')">
+          全部({{ goodsStateCount.total ? goodsStateCount.total : 0 }})
+        </div>
+        <div class="item" :class="screenForm.type === 'S' ? 'current' : ''" @click="changeType('S')">
+          出售中({{ goodsStateCount.csz ? goodsStateCount.csz : 0 }})
+        </div>
+        <div class="item" :class="screenForm.type === 'O' ? 'current' : ''" @click="changeType('O')">
+          已售罄({{ goodsStateCount.ysq ? goodsStateCount.ysq : 0 }})
+        </div>
+        <div class="item" :class="screenForm.type === 'W' ? 'current' : ''" @click="changeType('W')">
+          仓库中({{ goodsStateCount.ckz ? goodsStateCount.ckz : 0 }})
+        </div>
+        <div class="item" :class="screenForm.type === 'A' ? 'current' : ''" @click="changeType('A')">
+          活动中({{ goodsStateCount.hdz ? goodsStateCount.hdz : 0 }})
+        </div>
       </div>
       <!-- <el-button type="primary" size="small" @click="addOrEdit('add')">添加商品</el-button> -->
     </div>
 
     <div class="screen2-container">
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0;">.</el-col>
+        <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0">.</el-col>
 
         <el-col :xs="24" :sm="20" :lg="18">
           <el-form ref="form" :model="screenForm" label-width="80px">
             <div class="search">
-              <el-input v-model="screenForm.keyword" placeholder="想快速搜索什么商品呢?输入商品名称,商品id,商品分类都可快速找到" class="input-with-select" clearable @change="getListByScreen">
+              <el-input
+                v-model="screenForm.keyword"
+                placeholder="想快速搜索什么商品呢?输入商品名称,商品id,商品分类都可快速找到"
+                class="input-with-select"
+                clearable
+                @change="getListByScreen"
+              >
                 <el-button slot="append" icon="el-icon-search" @click="getListByScreen"></el-button>
               </el-input>
             </div>
@@ -31,7 +47,8 @@
                       :options="classifyList"
                       :props="{ label: 'name', value: 'categoryId' }"
                       size="small"
-                      @change="getListByScreen">
+                      @change="getListByScreen"
+                    >
                     </el-cascader>
                     <!-- <el-select v-model="screenForm.classify" placeholder="全部" size="small" @change="getListByScreen">
                       <el-option label="商品分类" value=""></el-option>
@@ -41,14 +58,31 @@
                 </el-col>
                 <el-col :xs="8" :sm="8" :lg="4">
                   <el-form-item label-width="0">
-                    <el-select v-model="screenForm.status" placeholder="上下架状态" size="small" clearable @change="getListByScreen">
-                      <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
+                    <el-select
+                      v-model="screenForm.status"
+                      placeholder="上下架状态"
+                      size="small"
+                      clearable
+                      @change="getListByScreen"
+                    >
+                      <el-option
+                        :label="item.label"
+                        :value="item.value"
+                        v-for="(item, index) in select_status"
+                        :key="index"
+                      ></el-option>
                     </el-select>
                   </el-form-item>
                 </el-col>
                 <el-col :xs="8" :sm="8" :lg="4">
                   <el-form-item label-width="0">
-                    <el-select v-model="screenForm.isTrade" placeholder="是否支持以旧换新" size="small" clearable @change="getListByScreen">
+                    <el-select
+                      v-model="screenForm.isTrade"
+                      placeholder="是否支持以旧换新"
+                      size="small"
+                      clearable
+                      @change="getListByScreen"
+                    >
                       <el-option label="支持以旧换新" value="YES"></el-option>
                       <el-option label="不支持以旧换新" value="NO"></el-option>
                     </el-select>
@@ -56,16 +90,16 @@
                 </el-col>
                 <el-col :xs="12" :sm="12" :lg="6">
                   <el-form-item label="销售价格" label-width="80px">
-                    <el-input v-model="screenForm.price1" size="small" @change="getListByScreen" clearable ></el-input>
+                    <el-input v-model="screenForm.price1" size="small" @change="getListByScreen" clearable></el-input>
                     <span>至</span>
-                    <el-input v-model="screenForm.price2" size="small" @change="getListByScreen" clearable ></el-input>
+                    <el-input v-model="screenForm.price2" size="small" @change="getListByScreen" clearable></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :xs="12" :sm="12" :lg="6">
                   <el-form-item label="分销金额" label-width="80px">
-                    <el-input v-model="screenForm.amount1" size="small" @change="getListByScreen" clearable ></el-input>
+                    <el-input v-model="screenForm.amount1" size="small" @change="getListByScreen" clearable></el-input>
                     <span>至</span>
-                    <el-input v-model="screenForm.amount2" size="small" @change="getListByScreen" clearable ></el-input>
+                    <el-input v-model="screenForm.amount2" size="small" @change="getListByScreen" clearable></el-input>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -73,31 +107,59 @@
           </el-form>
         </el-col>
 
-        <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0;">.</el-col>
+        <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0">.</el-col>
       </el-row>
     </div>
 
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button v-if="$restrict('add')" type="primary" icon="el-icon-plus" size="small" @click="addOrEdit('add')">添加商品</el-button>
-          <el-button v-if="$restrict('batchSet')" size="small" @click="batchOperation('module')">批量设置模块</el-button>
-          <el-button v-if="$restrict('batchSetfreight')" size="small" @click="batchOperation('freight')">批量设置运费</el-button>
+          <el-button v-if="$restrict('add')" type="primary" icon="el-icon-plus" size="small" @click="addOrEdit('add')"
+            >添加商品</el-button
+          >
+          <el-button v-if="$restrict('batchSet')" size="small" @click="batchOperation('module')"
+            >批量设置模块</el-button
+          >
+          <el-button v-if="$restrict('batchSetfreight')" size="small" @click="batchOperation('freight')"
+            >批量设置运费</el-button
+          >
           <el-divider direction="vertical"></el-divider>
-          <el-button v-if="$restrict('batchLaunch')" size="small" @click="batchOperation('status', 'on')">批量上架</el-button>
-          <el-button v-if="$restrict('batchRemova')" size="small" @click="batchOperation('status', 'off')">批量下架</el-button>
+          <el-button v-if="$restrict('batchLaunch')" size="small" @click="batchOperation('status', 'on')"
+            >批量上架</el-button
+          >
+          <el-button v-if="$restrict('batchRemova')" size="small" @click="batchOperation('status', 'off')"
+            >批量下架</el-button
+          >
           <el-divider direction="vertical"></el-divider>
-          <el-button v-if="$restrict('batchTrade')" size="small" @click="batchOperation('isTrade', 'YES')">开启以旧换新</el-button>
-          <el-button v-if="$restrict('batchTrade')" size="small" @click="batchOperation('isTrade', 'NO')">关闭以旧换新</el-button>
+          <el-button v-if="$restrict('batchTrade')" size="small" @click="batchOperation('isTrade', 'YES')"
+            >开启以旧换新</el-button
+          >
+          <el-button v-if="$restrict('batchTrade')" size="small" @click="batchOperation('isTrade', 'NO')"
+            >关闭以旧换新</el-button
+          >
         </div>
       </div>
 
       <div class="table">
-        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleTableSelection">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          @selection-change="handleTableSelection"
+        >
           <el-table-column align="center" type="selection" width="55" fixed></el-table-column>
           <el-table-column align="center" label="商品图片" prop="imgUrl" width="85">
             <template slot-scope="scope">
-              <el-image style="width: 60px; height: 60px; display: block;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover"></el-image>
+              <el-image
+                style="width: 60px; height: 60px; display: block"
+                :src="$showImgUrl(scope.row.imgUrl)"
+                :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                fit="cover"
+              ></el-image>
             </template>
           </el-table-column>
           <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200">
@@ -109,9 +171,11 @@
           </el-table-column>
           <el-table-column align="center" label="状态" class-name="status-col">
             <template slot-scope="scope">
-              <div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center;">
-                <el-tag size="small" :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '上架':'下架' }}</el-tag>
-                <el-tag size="small" v-if="scope.row.promotionGroup" style="margin-top: 4px;">团购商品</el-tag>
+              <div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center">
+                <el-tag size="small" :type="scope.row.status ? 'success' : 'danger'">{{
+                  scope.row.status ? '上架' : '下架'
+                }}</el-tag>
+                <el-tag size="small" v-if="scope.row.promotionGroup" style="margin-top: 4px">团购商品</el-tag>
               </div>
             </template>
           </el-table-column>
@@ -157,16 +221,16 @@
               <i class="el-icon-edit pointer" @click="editData('stockNum', scope.row)"></i>
             </template>
           </el-table-column>
-		  <el-table-column align="center" label="仓库库存" prop="allStockNum" min-width="110" sortable>
-			  <template slot-scope="scope">
-			    <span style="margin-right: 10px">{{ scope.row.allStockNum || 0 }}</span>
-			    <i class="el-icon-s-data pointer" @click="editData('stockNum', scope.row)"></i>
-			  </template>
-		  </el-table-column>
+          <el-table-column align="center" label="仓库库存" prop="allStockNum" min-width="110" sortable>
+            <template slot-scope="scope">
+              <span style="margin-right: 10px">{{ scope.row.allStockNum || 0 }}</span>
+              <i class="el-icon-s-data pointer" @click="editData('stockNum', scope.row)"></i>
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="销量" prop="soldNum" min-width="110" sortable></el-table-column>
           <el-table-column align="center" label="是否支持以旧换新" prop="isTrade" min-width="130">
             <template slot-scope="scope">
-              {{ {YES: '支持', NO: '不支持'}[scope.row.isTrade] }}
+              {{ { YES: '支持', NO: '不支持' }[scope.row.isTrade] }}
             </template>
           </el-table-column>
           <el-table-column align="center" label="排序" prop="sortNum" min-width="110" sortable>
@@ -189,12 +253,36 @@
                 </el-popconfirm>
               </template> -->
 
-              <el-button v-if="$restrict('edit')" type="primary" size="mini" @click="addOrEdit('edit', scope.row.goodsId)">编辑</el-button>
-              <el-popconfirm v-if="$restrict('clone')" style="margin-left: 10px; margin-right: 10px" title="确定克隆吗?" @confirm="clone(scope.row.goodsId)" >
+              <el-button
+                v-if="$restrict('edit')"
+                type="primary"
+                size="mini"
+                @click="addOrEdit('edit', scope.row.goodsId)"
+                >编辑</el-button
+              >
+              <el-popconfirm
+                v-if="$restrict('clone')"
+                style="margin-left: 10px; margin-right: 10px"
+                title="确定克隆吗?"
+                @confirm="clone(scope.row.goodsId)"
+              >
                 <el-button slot="reference" type="primary" size="mini">克隆</el-button>
               </el-popconfirm>
-              <el-button v-if="$restrict('copyLink')" type="primary" size="mini" class="tag-read" @click="copy(scope.row.goodsId)" :data-clipboard-text="scope.row.goodsId">复制链接</el-button>
-              <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="delItem(scope.row.goodsId, scope.row.goodsSpecId)" >
+              <el-button
+                v-if="$restrict('copyLink')"
+                type="primary"
+                size="mini"
+                class="tag-read"
+                @click="copy(scope.row.goodsId)"
+                :data-clipboard-text="scope.row.goodsId"
+                >复制链接</el-button
+              >
+              <el-popconfirm
+                v-if="$restrict('del')"
+                style="margin-left: 10px"
+                title="确定删除吗?"
+                @confirm="delItem(scope.row.goodsId, scope.row.goodsSpecId)"
+              >
                 <el-button slot="reference" size="mini">删除</el-button>
               </el-popconfirm>
             </template>
@@ -211,20 +299,40 @@
             :page-sizes="[10, 20, 50, 100]"
             :page-size="10"
             layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal">
+            :total="listTotal"
+          >
           </el-pagination>
         </div>
       </div>
     </div>
 
     <!-- 编辑规格数据 -->
-    <el-dialog title="编辑" :visible.sync="editSpecVisible" :show-close="false" width="60%" :close-on-click-modal="false">
-      <el-table :data="editGoodsDetail.goodsSpecs" element-loading-text="Loading" border fit highlight-current-row stripe style="margin-bottom: 20px">
+    <el-dialog
+      title="编辑"
+      :visible.sync="editSpecVisible"
+      :show-close="false"
+      width="60%"
+      :close-on-click-modal="false"
+    >
+      <el-table
+        :data="editGoodsDetail.goodsSpecs"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+        style="margin-bottom: 20px"
+      >
         <el-table-column align="center" label="规格名称" prop="name"></el-table-column>
         <el-table-column align="center" label="规格值" prop="specValue"></el-table-column>
         <el-table-column align="center" label="规格图片" prop="imgUrl">
           <template slot-scope="scope">
-            <el-image style="width: 40px; height: 40px;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover"></el-image>
+            <el-image
+              style="width: 40px; height: 40px"
+              :src="$showImgUrl(scope.row.imgUrl)"
+              :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+              fit="cover"
+            ></el-image>
           </template>
         </el-table-column>
         <el-table-column align="center" label="成本价格" prop="costPrice"></el-table-column>
@@ -258,11 +366,11 @@
             <el-input v-model="scope.row.stockNum" :disabled="editType != 'stockNum'"></el-input>
           </template>
         </el-table-column>
-		<el-table-column align="center" label="仓库库存" prop="goodsMaterialStock">
-			<template slot-scope="scope">
-			  {{scope.row.goodsMaterialStock || 0}}
-			</template>
-		</el-table-column>
+        <el-table-column align="center" label="仓库库存" prop="goodsMaterialStock">
+          <template slot-scope="scope">
+            {{ scope.row.goodsMaterialStock || 0 }}
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="物料编号" prop="goodsCode" min-width="120">
           <template slot-scope="scope">
             <el-input v-model="scope.row.goodsCode"></el-input>
@@ -277,11 +385,28 @@
     </el-dialog>
 
     <!-- 批量设置模块 -->
-    <el-dialog :title="'设置模块 (已选择' + tableSelection.length + '件商品)'" :visible.sync="setModuleVisible" :show-close="false" width="30%" :close-on-click-modal="false">
-      <el-form ref="setModuleForm" :model="setModuleForm" :rules="setModuleFormRules" label-position="left" label-width="80px">
+    <el-dialog
+      :title="'设置模块 (已选择' + tableSelection.length + '件商品)'"
+      :visible.sync="setModuleVisible"
+      :show-close="false"
+      width="30%"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="setModuleForm"
+        :model="setModuleForm"
+        :rules="setModuleFormRules"
+        label-position="left"
+        label-width="80px"
+      >
         <el-form-item label="说明模块" prop="module">
-          <el-select v-model="setModuleForm.module" placeholder="请选择说明模块" style="width: 250px;">
-            <el-option v-for="item in moduleList" :key="item.commonTemplateId" :label="item.name" :value="item.commonTemplateId">
+          <el-select v-model="setModuleForm.module" placeholder="请选择说明模块" style="width: 250px">
+            <el-option
+              v-for="item in moduleList"
+              :key="item.commonTemplateId"
+              :label="item.name"
+              :value="item.commonTemplateId"
+            >
             </el-option>
           </el-select>
         </el-form-item>
@@ -294,11 +419,28 @@
     </el-dialog>
 
     <!-- 批量设置运费 -->
-    <el-dialog :title="'设置运费 (已选择' + tableSelection.length + '件商品)'" :visible.sync="setFreightVisible" :show-close="false" width="30%" :close-on-click-modal="false">
-      <el-form ref="setFreightForm" :model="setFreightForm" :rules="setFreightFormRules" label-position="left" label-width="80px">
+    <el-dialog
+      :title="'设置运费 (已选择' + tableSelection.length + '件商品)'"
+      :visible.sync="setFreightVisible"
+      :show-close="false"
+      width="30%"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="setFreightForm"
+        :model="setFreightForm"
+        :rules="setFreightFormRules"
+        label-position="left"
+        label-width="80px"
+      >
         <el-form-item label="运费模版" prop="freight">
-          <el-select v-model="setFreightForm.freight" placeholder="请选择运费模版" style="width: 250px;">
-            <el-option v-for="item in freightList" :key="item.freightTemplateId" :label="item.name" :value="item.freightTemplateId">
+          <el-select v-model="setFreightForm.freight" placeholder="请选择运费模版" style="width: 250px">
+            <el-option
+              v-for="item in freightList"
+              :key="item.freightTemplateId"
+              :label="item.name"
+              :value="item.freightTemplateId"
+            >
             </el-option>
           </el-select>
         </el-form-item>
@@ -309,12 +451,27 @@
         <el-button type="primary" @click="submitSetFreightForm">确 定</el-button>
       </div>
     </el-dialog>
-
   </div>
 </template>
 
 <script>
-import { getGoodsList, deleteGoods, getClassifyList, getGoodsStateCount, cloneGoods, editGoods, goodsPutOn, goodsPutOff, checkSeckill, getGoodsDetail, getModuleList, setCommomModule, setFreight, getFreightList, batchTrade } from '@/api/goods'
+import {
+  getGoodsList,
+  deleteGoods,
+  getClassifyList,
+  getGoodsStateCount,
+  cloneGoods,
+  editGoods,
+  goodsPutOn,
+  goodsPutOff,
+  checkSeckill,
+  getGoodsDetail,
+  getModuleList,
+  setCommomModule,
+  setFreight,
+  getFreightList,
+  batchTrade
+} from '@/api/goods'
 import Clipboard from 'clipboard'
 import { EventBus } from '@/utils/eventBus'
 export default {
@@ -335,9 +492,10 @@ export default {
         price1: '',
         price2: '',
         amount1: '',
-        amount2: '',
+        amount2: ''
       },
-      select_status: [ // 筛选字段 - 状态
+      select_status: [
+        // 筛选字段 - 状态
         { label: '上架', value: true },
         { label: '下架', value: false }
       ],
@@ -347,7 +505,7 @@ export default {
         csz: 0,
         ysq: 0,
         ckz: 0,
-        hdz: 0,
+        hdz: 0
       },
 
       tableSelection: [],
@@ -359,58 +517,52 @@ export default {
       setModuleVisible: false,
       moduleList: [],
       setModuleForm: {
-        module: '',
+        module: ''
       },
       setModuleFormRules: {
-        module: [
-          { required: true, message: '请选择说明模块', trigger: 'change' }
-        ],
+        module: [{ required: true, message: '请选择说明模块', trigger: 'change' }]
       },
 
       setFreightVisible: false,
       freightList: [],
       setFreightForm: {
-        freight: '',
+        freight: ''
       },
       setFreightFormRules: {
-        freight: [
-          { required: true, message: '请选择运费模块', trigger: 'change' }
-        ],
-      },
-
+        freight: [{ required: true, message: '请选择运费模块', trigger: 'change' }]
+      }
     }
   },
   created() {
-    this.getList();
-    
-    this.getClassifyList();
-    EventBus.$on("updateGoodsListPage",()=>{
-      this.getList();
+    this.getList()
+
+    this.getClassifyList()
+    EventBus.$on('updateGoodsListPage', () => {
+      this.getList()
     })
   },
   methods: {
-
     getClassifyList() {
       let params = {
         name: '',
         status: true
-      };
+      }
       getClassifyList(params).then(res => {
         res.data.unshift({
           name: '全部',
           categoryId: '',
-          children: null,
-        });
-        this.classifyList = res.data;
+          children: null
+        })
+        this.classifyList = res.data
       })
     },
 
     getList() {
-      this.listLoading = true;
+      this.listLoading = true
 
-      let categoryId = '';
-      if(this.screenForm.classify) {
-        categoryId = this.screenForm.classify[1];
+      let categoryId = ''
+      if (this.screenForm.classify) {
+        categoryId = this.screenForm.classify[1]
       }
 
       let params = {
@@ -425,43 +577,43 @@ export default {
         endShare: this.screenForm.amount2,
         pageNum: this.currentPage,
         pageSize: this.pageSize
-      };
+      }
 
       getGoodsList(params).then(res => {
-        console.log('-----------',res.data.records)
-        this.dataList = res.data.records;
-        this.listTotal = res.data.total;
-        this.listLoading = false;
+        console.log('-----------', res.data.records)
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
       })
 
       getGoodsStateCount({}).then(res => {
-        this.goodsStateCount = res.data;
+        this.goodsStateCount = res.data
       })
     },
 
     // 更改每页数量
     handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.getList();
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
     },
 
     // 更改当前页
     handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getList();
+      this.currentPage = val
+      this.getList()
     },
 
     // 筛选后重新获取列表
     getListByScreen() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
 
     // 切换类型
     changeType(type) {
-      this.screenForm.type = type;
-      this.getListByScreen();
+      this.screenForm.type = type
+      this.getListByScreen()
     },
 
     // 删除商品
@@ -470,23 +622,24 @@ export default {
         goodsId,
         goodsSpecId
       }).then(res => {
-        this.getList();
-        this.$successMsg();
+        this.getList()
+        this.$successMsg()
       })
     },
 
     // 添加商品
     addOrEdit(type, id) {
-      if(type == 'add') {
+      if (type == 'add') {
         this.$router.push({
           name: 'goods_add',
-          query: {type}
+          query: { type }
         })
-      }else {
+      } else {
         this.$router.push({
           name: 'goods_add',
           query: {
-            id,type
+            id,
+            type
           }
         })
       }
@@ -497,20 +650,20 @@ export default {
       cloneGoods({
         goodsId: id
       }).then(res => {
-        this.getList();
+        this.getList()
       })
     },
 
     copy() {
-      const clipboard = new Clipboard('.tag-read');
+      const clipboard = new Clipboard('.tag-read')
       // clipboard.on('success', e => {
       //   this.$successMsg('复制成功');
       // })
-      clipboard.on('error', e =>{
-        console.log('该浏览器不支持复制');
-        return false;
+      clipboard.on('error', e => {
+        console.log('该浏览器不支持复制')
+        return false
       })
-      this.$successMsg('复制成功');
+      this.$successMsg('复制成功')
     },
 
     // 编辑数据
@@ -525,191 +678,195 @@ export default {
         stockNum: '商品库存',
         sortNum: '排序'
       }
-      await getGoodsDetail({goodsId: item.goodsId}).then(res => {
-        this.editGoodsDetail = res.data;
+      await getGoodsDetail({ goodsId: item.goodsId }).then(res => {
+        this.editGoodsDetail = res.data
       })
-      if(['sortNum', 'goodsName'].includes(type)) {
-        let promptObj = {};
-        if(['sortNum'].includes(type)) {
+      if (['sortNum', 'goodsName'].includes(type)) {
+        let promptObj = {}
+        if (['sortNum'].includes(type)) {
           promptObj = {
             inputType: 'number',
-            inputValidator: function(value) {
-              if(!value && value !== 0) return '请输入'+typeMap[type]
-              if(value*1 < 0) return typeMap[type]+'不能小于0'
-            },
+            inputValidator: function (value) {
+              if (!value && value !== 0) return '请输入' + typeMap[type]
+              if (value * 1 < 0) return typeMap[type] + '不能小于0'
+            }
           }
-        }else {
+        } else {
           promptObj = {
-            inputValidator: function(value) {
-              if(!value) return '请输入'+typeMap[type]
-            },
+            inputValidator: function (value) {
+              if (!value) return '请输入' + typeMap[type]
+            }
           }
         }
-        this.$prompt('请输入'+typeMap[type], '编辑', {
+        this.$prompt('请输入' + typeMap[type], '编辑', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           inputValue: this.editGoodsDetail[type],
           ...promptObj
-        }).then(({ value }) => {
-          let params = this.editGoodsDetail;
-          params[type] = value;
-          editGoods(params).then(res => {
-            this.$successMsg('编辑成功');
-            this.getList();
+        })
+          .then(({ value }) => {
+            let params = this.editGoodsDetail
+            params[type] = value
+            editGoods(params).then(res => {
+              this.$successMsg('编辑成功')
+              this.getList()
+            })
           })
-        }).catch(() => {});
-      }
-      else {
-        if(type == 'shareAmount' && item.sharePercent != 0) {
-          return this.$errorMsg('佣金比例不为0的时候无法修改分销金额');
+          .catch(() => {})
+      } else {
+        if (type == 'shareAmount' && item.sharePercent != 0) {
+          return this.$errorMsg('佣金比例不为0的时候无法修改分销金额')
         }
-        if(type === 'innerShareAmount' && item.innerSharePercent !== 0) {
-          return this.$errorMsg('内部佣金比例不为0的时候无法修改内部分销金额');
+        if (type === 'innerShareAmount' && item.innerSharePercent !== 0) {
+          return this.$errorMsg('内部佣金比例不为0的时候无法修改内部分销金额')
         }
-        this.editType = type;
-        this.editSpecVisible = true;
+        this.editType = type
+        this.editSpecVisible = true
       }
-
     },
 
     // 取消 编辑规格数据
-    cancelEditSpecForm(){
-      this.editSpecVisible = false;
+    cancelEditSpecForm() {
+      this.editSpecVisible = false
     },
 
     // 提交 编辑规格数据
-    submitEditSpecForm(){
-      let specList = this.editGoodsDetail.goodsSpecs;
-      for(let i=0; i<specList.length; i++) {
-        if(specList[i].shareAmount / specList[i].price > 0.4) {
-            this.formLoading = false;
-            this.$errorMsg('单个规格的分销金额不能超过销售价的40%');
-            return;
-          }
-        if(Number(specList[i].sharePercent) < 0 || Number(specList[i].sharePercent) > 40) {
-          this.formLoading = false;
-          this.$errorMsg('单个规格的佣金比例范围在0-40');
-          return;
+    submitEditSpecForm() {
+      let specList = this.editGoodsDetail.goodsSpecs
+      for (let i = 0; i < specList.length; i++) {
+        if (specList[i].shareAmount / specList[i].price > 0.4) {
+          this.formLoading = false
+          this.$errorMsg('单个规格的分销金额不能超过销售价的40%')
+          return
+        }
+        if (Number(specList[i].sharePercent) < 0 || Number(specList[i].sharePercent) > 40) {
+          this.formLoading = false
+          this.$errorMsg('单个规格的佣金比例范围在0-40')
+          return
         }
-        if(specList[i].innerShareAmount / specList[i].price > 0.4) {
-          this.formLoading = false;
-          this.$errorMsg('单个规格的内部分销金额不能超过销售价的40%');
-          return;
+        if (specList[i].innerShareAmount / specList[i].price > 0.4) {
+          this.formLoading = false
+          this.$errorMsg('单个规格的内部分销金额不能超过销售价的40%')
+          return
         }
-        if(Number(specList[i].innerSharePercent) < 0 || Number(specList[i].innerSharePercent) > 40) {
-          this.formLoading = false;
-          this.$errorMsg('单个规格的内部佣金比例范围在0-40');
-          return;
+        if (Number(specList[i].innerSharePercent) < 0 || Number(specList[i].innerSharePercent) > 40) {
+          this.formLoading = false
+          this.$errorMsg('单个规格的内部佣金比例范围在0-40')
+          return
         }
       }
 
-      let allPrice = [];
+      let allPrice = []
       specList.forEach(item => {
-        allPrice.push(item.price);
+        allPrice.push(item.price)
       })
-      this.editGoodsDetail.goodsPrice = Math.min(...allPrice);
+      this.editGoodsDetail.goodsPrice = Math.min(...allPrice)
 
-      let params = this.editGoodsDetail;
+      let params = this.editGoodsDetail
       editGoods(params).then(res => {
-        this.editSpecVisible = false;
-        this.$successMsg('编辑成功');
-        this.getList();
+        this.editSpecVisible = false
+        this.$successMsg('编辑成功')
+        this.getList()
       })
     },
 
     // 表格选择列
     handleTableSelection(val) {
-      this.tableSelection = val;
+      this.tableSelection = val
     },
 
     // 批量操作
     batchOperation(type, status) {
-      if(this.tableSelection.length < 1) {
-        return this.$errorMsg('至少选择一个商品');
+      if (this.tableSelection.length < 1) {
+        return this.$errorMsg('至少选择一个商品')
       }
 
       // 批量上架/批量下架
-      if(type == 'status') {
-        this.$confirm(`您确定要批量${{on: '上架', off: '下架'}[status]}选中商品吗?`, '提示', {
+      if (type == 'status') {
+        this.$confirm(`您确定要批量${{ on: '上架', off: '下架' }[status]}选中商品吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then(() => {
-          let goodsIds = [];
-          this.tableSelection.forEach(item => {
-            goodsIds.push(item.goodsId);
-          });
-          // 批量上架
-          if(status == 'on') {
-            goodsPutOn(goodsIds).then(res => {
-              this.$successMsg();
-              this.getList();
+        })
+          .then(() => {
+            let goodsIds = []
+            this.tableSelection.forEach(item => {
+              goodsIds.push(item.goodsId)
             })
-          }
-          // 批量下架
-          else if(status == 'off') {
-            checkSeckill(goodsIds).then(res => {
-              if(res.data && res.data.length > 0) {
-                let goodsNames = [];
-                res.data.forEach(item => {
-                  let index = this.$findElem(this.tableSelection, 'goodsId', item);
-                  goodsNames.push('【' + this.tableSelection[index].goodsName + '】');
-                })
-                this.$confirm('你所选中的商品'+goodsNames.join('、')+'正在参与秒杀活动,是否确定下架?', '提示', {
-                  confirmButtonText: '确定',
-                  cancelButtonText: '取消',
-                  type: 'warning'
-                }).then(() => {
+            // 批量上架
+            if (status == 'on') {
+              goodsPutOn(goodsIds).then(res => {
+                this.$successMsg()
+                this.getList()
+              })
+            }
+            // 批量下架
+            else if (status == 'off') {
+              checkSeckill(goodsIds).then(res => {
+                if (res.data && res.data.length > 0) {
+                  let goodsNames = []
+                  res.data.forEach(item => {
+                    let index = this.$findElem(this.tableSelection, 'goodsId', item)
+                    goodsNames.push('【' + this.tableSelection[index].goodsName + '】')
+                  })
+                  this.$confirm('你所选中的商品' + goodsNames.join('、') + '正在参与秒杀活动,是否确定下架?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                  })
+                    .then(() => {
+                      goodsPutOff(goodsIds).then(res => {
+                        this.$successMsg()
+                        this.getList()
+                      })
+                    })
+                    .catch(() => {})
+                } else {
                   goodsPutOff(goodsIds).then(res => {
-                    this.$successMsg();
-                    this.getList();
+                    this.$successMsg()
+                    this.getList()
                   })
-                }).catch(() => {});
-              }else {
-                goodsPutOff(goodsIds).then(res => {
-                  this.$successMsg();
-                  this.getList();
-                })
-              }
-            })
-          }
-
-        }).catch(() => {});
+                }
+              })
+            }
+          })
+          .catch(() => {})
       }
 
       // 批量开启关闭以旧换新
-      else if(type == 'isTrade') {
-        this.$confirm(`您确定要批量${{YES: '开启', NO: '关闭'}[status]}以旧换新吗?`, '提示', {
+      else if (type == 'isTrade') {
+        this.$confirm(`您确定要批量${{ YES: '开启', NO: '关闭' }[status]}以旧换新吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then(() => {
-          let goodsIds = [];
-          this.tableSelection.forEach(item => {
-            goodsIds.push(item.goodsId);
-          });
-          batchTrade({
-            goodsIds: goodsIds.join(','),
-            isTrade: status
-          }).then(res => {
-            this.$successMsg();
-            this.getList();
+        })
+          .then(() => {
+            let goodsIds = []
+            this.tableSelection.forEach(item => {
+              goodsIds.push(item.goodsId)
+            })
+            batchTrade({
+              goodsIds: goodsIds.join(','),
+              isTrade: status
+            }).then(res => {
+              this.$successMsg()
+              this.getList()
+            })
           })
-        }).catch(() => {});
+          .catch(() => {})
       }
 
       // 批量设置模块
-      else if(type == 'module') {
-        this.getModuleList();
-        this.setModuleVisible = true;
+      else if (type == 'module') {
+        this.getModuleList()
+        this.setModuleVisible = true
       }
 
       // 批量设置运费
-      else if(type == 'freight') {
-        this.getFreightList();
-        this.setFreightVisible = true;
+      else if (type == 'freight') {
+        this.getFreightList()
+        this.setFreightVisible = true
       }
-
     },
 
     // 获取模块列表
@@ -718,29 +875,29 @@ export default {
         pageNum: 1,
         pageSize: 1000
       }).then(res => {
-        this.moduleList = res.data.records;
+        this.moduleList = res.data.records
       })
     },
 
     // 取消 设置模块
-    cancelSetModuleForm(){
-      this.setModuleVisible = false;
-      this.$refs.setModuleForm.resetFields();
+    cancelSetModuleForm() {
+      this.setModuleVisible = false
+      this.$refs.setModuleForm.resetFields()
     },
 
     // 提交 设置模块
     submitSetModuleForm() {
-      let goodsIds = [];
+      let goodsIds = []
       this.tableSelection.forEach(item => {
-        goodsIds.push(item.goodsId);
-      });
+        goodsIds.push(item.goodsId)
+      })
       setCommomModule({
         goodsIdList: goodsIds,
         templateId: this.setModuleForm.module
       }).then(res => {
-        this.cancelSetModuleForm();
-        this.$successMsg();
-        this.getList();
+        this.cancelSetModuleForm()
+        this.$successMsg()
+        this.getList()
       })
     },
 
@@ -750,90 +907,87 @@ export default {
         pageNum: 1,
         pageSize: 1000
       }).then(res => {
-        this.freightList = res.data.records;
+        this.freightList = res.data.records
       })
     },
 
     // 取消 设置运费
-    cancelSetFreightForm(){
-      this.setFreightVisible = false;
-      this.$refs.setFreightForm.resetFields();
+    cancelSetFreightForm() {
+      this.setFreightVisible = false
+      this.$refs.setFreightForm.resetFields()
     },
 
     // 提交 设置运费
     submitSetFreightForm() {
-      let goodsIds = [];
+      let goodsIds = []
       this.tableSelection.forEach(item => {
-        goodsIds.push(item.goodsId);
-      });
+        goodsIds.push(item.goodsId)
+      })
       setFreight({
         goodsIdList: goodsIds,
         freightTemplateId: this.setFreightForm.freight
       }).then(res => {
-        this.cancelSetFreightForm();
-        this.$successMsg();
-        this.getList();
+        this.cancelSetFreightForm()
+        this.$successMsg()
+        this.getList()
       })
     }
-
   }
-
 }
-
 </script>
 
 <style scoped lang="scss">
-  .tab-container {
-    .tab-list {
-      .item {
-        float: left;
-        font-size: 14px;
-        margin-right: 20px;
-        cursor: pointer;
-        line-height: 32px;
-        &.current {
-          color: #409EFF;
-        }
+.tab-container {
+  .tab-list {
+    .item {
+      float: left;
+      font-size: 14px;
+      margin-right: 20px;
+      cursor: pointer;
+      line-height: 32px;
+      &.current {
+        color: #409eff;
       }
     }
   }
+}
 
-  .screen2-container {
-    .search {
-      margin-top: 30px;
+.screen2-container {
+  .search {
+    margin-top: 30px;
+  }
+  .screen {
+    margin-top: 20px;
+    .el-input {
+      width: 40%;
     }
-    .screen {
-      margin-top: 20px;
-      .el-input {
-        width: 40%;
-      }
-      span {
-        width: 20%;
-        display: inline-block;
-        text-align: center;
-        color: #666666;
-      }
+    span {
+      width: 20%;
+      display: inline-block;
+      text-align: center;
+      color: #666666;
     }
   }
+}
 
-  .pointer {
-    cursor: pointer;
-    color: #409EFF;
-  }
+.pointer {
+  cursor: pointer;
+  color: #409eff;
+}
 </style>
 
 <style lang="scss">
-  .screen2-container {
-    .el-form-item__label {
-      line-height: 32px;
-    }
-    .el-form-item__content {
-      line-height: 32px;
-    }
+.screen2-container {
+  .el-form-item__label {
+    line-height: 32px;
   }
-
-  .el-image-viewer__wrapper .el-icon-circle-close {
-    color: #ffffff !important;
-    font-size: 60px;
+  .el-form-item__content {
+    line-height: 32px;
   }
+}
+
+.el-image-viewer__wrapper .el-icon-circle-close {
+  color: #ffffff !important;
+  font-size: 60px;
+}
 </style>

+ 205 - 136
src/views/mallManagement/goods/newclassify_set/index.vue

@@ -6,10 +6,10 @@
     <div class="form-container">
       <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px">
         <el-form-item :label="'主标题:'" prop="mainTitle">
-          <el-input style="width:250px" disabled v-model="mainForm.mainTitle"></el-input>
+          <el-input style="width: 250px" disabled v-model="mainForm.mainTitle"></el-input>
         </el-form-item>
         <el-form-item :label="'副标题:'" prop="subtitle">
-          <el-input style="width:250px" disabled v-model="mainForm.subtitle"></el-input>
+          <el-input style="width: 250px" disabled v-model="mainForm.subtitle"></el-input>
         </el-form-item>
         <el-form-item label="商品类别" prop="goodsType">
           <el-select v-model="mainForm.goodsType" placeholder="请选择商品类别" style="width: 250px" disabled>
@@ -43,7 +43,7 @@
       </div>
       <div class="goods-item" v-for="(item, index) in goodsList" :key="index">
         <div class="goods-info">
-          <img :src="item.imgUrl" alt="" />
+          <img :src="$showImgUrl(item.imgUrl)" alt="" />
           {{ item.goodsName }}
         </div>
         <div class="spec-list">
@@ -51,14 +51,18 @@
             <div class="col name">{{ it.name }}-{{ it.specValue }}</div>
             <div class="col input"><el-input disabled type="number" size="small" v-model="it.orgPrice"></el-input></div>
             <div class="col input"><el-input disabled type="number" size="small" v-model="it.price"></el-input></div>
-            <div class="col input"><el-input disabled type="number" size="small" v-model="it.shareAmount"></el-input>
+            <div class="col input">
+              <el-input disabled type="number" size="small" v-model="it.shareAmount"></el-input>
             </div>
-            <div class="col input"><el-input disabled type="number" size="small"
-                v-model="it.innerSharePercent"></el-input></div>
-            <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerShareAmount"></el-input>
+            <div class="col input">
+              <el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input>
+            </div>
+            <div class="col input">
+              <el-input disabled type="number" size="small" v-model="it.innerShareAmount"></el-input>
+            </div>
+            <div class="col input">
+              <el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input>
             </div>
-            <div class="col input"><el-input disabled type="number" size="small"
-                v-model="it.innerSharePercent"></el-input></div>
             <div class="col input"><el-input disabled type="number" size="small" v-model="it.stockNum"></el-input></div>
             <div class="col input"><el-input disabled type="number" size="small" v-model="it.soldNum"></el-input></div>
           </div>
@@ -74,21 +78,37 @@
       <el-table :data="goodsList" border fit highlight-current-row stripe>
         <el-table-column align="center" label="商品图片" prop="imgUrl" width="85">
           <template slot-scope="scope">
-            <el-image style="width: 60px; height: 60px; display: block;" :src="scope.row.imgUrl"
-              :preview-src-list="[scope.row.imgUrl]" fit="cover"></el-image>
+            <el-image
+              style="width: 60px; height: 60px; display: block"
+              :src="$showImgUrl(scope.row.imgUrl)"
+              :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+              fit="cover"
+            ></el-image>
           </template>
         </el-table-column>
         <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200"></el-table-column>
-        <el-table-column align="center" label="最低销售价" prop="packageMinAmount" min-width="120" sortable></el-table-column>
-        <el-table-column align="center" label="最低分佣金额" prop="packageMinShareAmount" min-width="130"
-          sortable></el-table-column>
+        <el-table-column
+          align="center"
+          label="最低销售价"
+          prop="packageMinAmount"
+          min-width="120"
+          sortable
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="最低分佣金额"
+          prop="packageMinShareAmount"
+          min-width="130"
+          sortable
+        ></el-table-column>
         <el-table-column align="center" label="库存" prop="stockNum" min-width="110"></el-table-column>
         <el-table-column align="center" label="销量" prop="soldNum" min-width="110"></el-table-column>
 
         <el-table-column align="center" label="操作" width="80" fixed="right">
           <template slot-scope="scope">
-            <el-button type="text" style="color: #f56c6c"
-              @click="deleteGoods(scope.row.goodsId, scope.$index)">删除</el-button>
+            <el-button type="text" style="color: #f56c6c" @click="deleteGoods(scope.row.goodsId, scope.$index)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -96,14 +116,21 @@
 
     <div class="page-footer">
       <div class="footer">
-        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? "提交中 ..." : "提 交"
+        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{
+          formLoading ? '提交中 ...' : '提 交'
         }}</el-button>
         <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
 
     <!-- 选择商品 -->
-    <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="50%" :close-on-click-modal="false">
+    <el-dialog
+      title="选择商品"
+      :visible.sync="addGoodsVisible"
+      :show-close="false"
+      width="50%"
+      :close-on-click-modal="false"
+    >
       <div class="dialog-container clearfix">
         <div class="left fl">
           <div class="item" @click="changeClassify('')">全部分类</div>
@@ -112,33 +139,68 @@
               <i :class="item.isOpen ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i> {{ item.name }}
             </div>
             <div class="child" v-if="item.isOpen">
-              <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex"
-                @click="changeClassify(childItem.categoryId)">{{ childItem.name }}</div>
+              <div
+                class="item"
+                v-for="(childItem, childIndex) in item.children"
+                :key="childIndex"
+                @click="changeClassify(childItem.categoryId)"
+              >
+                {{ childItem.name }}
+              </div>
             </div>
           </div>
         </div>
 
         <div class="right fl">
           <div class="search">
-            <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small"
-              style="width: 250px">
+            <el-input
+              placeholder="请输入商品名称进行搜索"
+              v-model="keyword"
+              class="input-with-select"
+              clearable
+              size="small"
+              style="width: 250px"
+            >
               <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
             </el-input>
           </div>
-          <div class="table" style="margin: 10px 0 20px;">
-            <el-table v-loading="table_listLoading" :data="table_dataList" element-loading-text="Loading"
-              tooltip-effect="dark" style="width: 100%" max-height="270" @selection-change="handleChooseGoods">
-              <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
-              <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200"
-                show-overflow-tooltip></el-table-column>
+          <div class="table" style="margin: 10px 0 20px">
+            <el-table
+              v-loading="table_listLoading"
+              :data="table_dataList"
+              element-loading-text="Loading"
+              tooltip-effect="dark"
+              style="width: 100%"
+              max-height="270"
+              @selection-change="handleChooseGoods"
+            >
+              <el-table-column
+                align="center"
+                type="selection"
+                :selectable="checkboxSelect"
+                width="45"
+              ></el-table-column>
+              <el-table-column
+                align="center"
+                prop="goodsName"
+                label="商品名称"
+                min-width="200"
+                show-overflow-tooltip
+              ></el-table-column>
               <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
               <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
             </el-table>
           </div>
           <div class="pagination clearfix">
             <div class="fr">
-              <el-pagination @current-change="handleTableCurrentChange" :current-page="table_currentPage"
-                :page-size="table_pageSize" background layout="prev, pager, next" :total="table_listTotal">
+              <el-pagination
+                @current-change="handleTableCurrentChange"
+                :current-page="table_currentPage"
+                :page-size="table_pageSize"
+                background
+                layout="prev, pager, next"
+                :total="table_listTotal"
+              >
               </el-pagination>
             </div>
           </div>
@@ -152,11 +214,23 @@
     </el-dialog>
 
     <!-- 选择分类 -->
-    <el-dialog title="选择分类" :visible.sync="addClassifyVisible" :show-close="false" width="40%"
-      :close-on-click-modal="false">
+    <el-dialog
+      title="选择分类"
+      :visible.sync="addClassifyVisible"
+      :show-close="false"
+      width="40%"
+      :close-on-click-modal="false"
+    >
       <div class="classify-list">
-        <el-tree :data="classifyList" show-checkbox default-expand-all node-key="categoryId" ref="tree" highlight-current
-          :props="defaultProps">
+        <el-tree
+          :data="classifyList"
+          show-checkbox
+          default-expand-all
+          node-key="categoryId"
+          ref="tree"
+          highlight-current
+          :props="defaultProps"
+        >
         </el-tree>
       </div>
 
@@ -169,30 +243,31 @@
 </template>
 
 <script>
-import { getactivityGoodsDetail, addActiveGoods, getEnterpriseTemplate, getClassifyList, getGoodsList, getMoreGoodsList } from "@/api/special";
+import {
+  getactivityGoodsDetail,
+  addActiveGoods,
+  getEnterpriseTemplate,
+  getClassifyList,
+  getGoodsList,
+  getMoreGoodsList
+} from '@/api/special'
 export default {
   data() {
     return {
-      objectId: "", // 小程序模板id
-      type: "", // 类型
-      companyWechatId: "",
-      useTemplate: "",
+      objectId: '', // 小程序模板id
+      type: '', // 类型
+      companyWechatId: '',
+      useTemplate: '',
       formLoading: false,
       mainForm: {
-        mainTitle: "", // 主标题
-        subtitle: "", // 副标题
-        goodsType: 1,
+        mainTitle: '', // 主标题
+        subtitle: '', // 副标题
+        goodsType: 1
       },
       mainFormRules: {
-        mainTitle: [
-          { required: true, message: "请输入主标题", trigger: "blur" },
-        ],
-        subtitle: [
-          { required: true, message: "请输入副标题", trigger: "blur" },
-        ],
-        goodsType: [
-          { required: true, message: "请选择商品类别", trigger: "change" },
-        ],
+        mainTitle: [{ required: true, message: '请输入主标题', trigger: 'blur' }],
+        subtitle: [{ required: true, message: '请输入副标题', trigger: 'blur' }],
+        goodsType: [{ required: true, message: '请选择商品类别', trigger: 'change' }]
       },
       goodsList: [], // 列表数据
 
@@ -212,20 +287,18 @@ export default {
       defaultProps: {
         children: 'children',
         label: 'name'
-      },
-    };
-  },
-  computed: {
-
+      }
+    }
   },
+  computed: {},
   created() {
-	if(this?.$route?.params?.pageCode){
-		const item = JSON.parse(this?.$route?.params?.pageCode)
-		this.mainForm.mainTitle = item.mainTitle;
-		this.mainForm.subtitle = item.subTitle;
-		this.mainForm.goodsType = item.type;
-		this.objectId = item.goodsNewsCategoryId
-	}
+    if (this?.$route?.params?.pageCode) {
+      const item = JSON.parse(this?.$route?.params?.pageCode)
+      this.mainForm.mainTitle = item.mainTitle
+      this.mainForm.subtitle = item.subTitle
+      this.mainForm.goodsType = item.type
+      this.objectId = item.goodsNewsCategoryId
+    }
 
     this.getEnterpriseTemplate()
     this.getactivityGoodsDetail()
@@ -243,12 +316,8 @@ export default {
 
     //获取企业下模板
     getEnterpriseTemplate() {
-      this.companyWechatId = JSON.parse(
-        localStorage.getItem("greemall_user")
-      ).companyWechatId;
-      this.useTemplate = JSON.parse(
-        localStorage.getItem("greemall_user")
-      ).useTemplate;
+      this.companyWechatId = JSON.parse(localStorage.getItem('greemall_user')).companyWechatId
+      this.useTemplate = JSON.parse(localStorage.getItem('greemall_user')).useTemplate
       const parmas = {
         companyId: this.companyWechatId
       }
@@ -261,21 +330,21 @@ export default {
     getactivityGoodsDetail() {
       const params = {
         objectId: this.objectId, // 小程序模板id
-        type: 1, // 类型: 1=新维度分类,2=首页弹窗,3=活动专区1,4=活动专区2左侧,5=活动专区2右侧,6=专场专区1,7=专场专区2,8=专场专区3,9=专场专区4
-      };
-      getactivityGoodsDetail(params).then((res) => {
+        type: 1 // 类型: 1=新维度分类,2=首页弹窗,3=活动专区1,4=活动专区2左侧,5=活动专区2右侧,6=专场专区1,7=专场专区2,8=专场专区3,9=专场专区4
+      }
+      getactivityGoodsDetail(params).then(res => {
         res.data.activeGoodsList.forEach(item => {
-          item.imgUrl = item?.goods?.imgUrl || ""
-        });
+          item.imgUrl = item?.goods?.imgUrl || ''
+        })
 
-        this.goodsList = res.data.activeGoodsList;
+        this.goodsList = res.data.activeGoodsList
 
         if (this.mainForm.goodsType === 2) {
           this.goodsList.forEach((item, index) => {
-            this.$set(this.goodsList, index, { ...item, ...(item?.goods || {}) });
+            this.$set(this.goodsList, index, { ...item, ...(item?.goods || {}) })
           })
         }
-      });
+      })
     },
 
     // 删除商品
@@ -285,45 +354,45 @@ export default {
 
     // 返回
     goBack() {
-      this.$router.go(-1);
+      this.$router.go(-1)
     },
 
     // 获取分类列表
     getClassifyList(state) {
       getClassifyList({ categoryLevel: 1, status: true }).then(res => {
         res.data.forEach(item => {
-          item.isOpen = false;
-        });
-        this.classifyList = res.data;
-        this.classifyCurrent = '';
+          item.isOpen = false
+        })
+        this.classifyList = res.data
+        this.classifyCurrent = ''
         if (!state) {
-          this.getGoodsList();
+          this.getGoodsList()
         }
       })
     },
 
     // 展开/收起 分类
     toggleOpen(index) {
-      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen
     },
 
     // 切换分类
     changeClassify(cid) {
       if (this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分类');
+        return this.$errorMsg('当前已选择商品,不可切换分类')
       }
-      this.classifyCurrent = cid;
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.classifyCurrent = cid
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 搜索
     getGoodsListByScreen() {
       if (this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可搜索');
+        return this.$errorMsg('当前已选择商品,不可搜索')
       }
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 获取商品列表
@@ -333,29 +402,29 @@ export default {
         pageSize: this.table_pageSize,
         keyword: this.keyword,
         categoryId: this.classifyCurrent,
-        goodsTypes: this.mainForm.goodsType === 1 ? 'COMMON' : 'PACKAGE',
+        goodsTypes: this.mainForm.goodsType === 1 ? 'COMMON' : 'PACKAGE'
       }).then(res => {
-        let oldGoodsList = this.goodsList;
-        let newGoodsList = res.data.records;
+        let oldGoodsList = this.goodsList
+        let newGoodsList = res.data.records
         for (let i = 0; i < oldGoodsList.length; i++) {
           let oldItem = oldGoodsList[i]
           for (let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
             if (newItem.goodsId === oldItem.goodsId) {
-              newGoodsList[j].selected = true;
-              break;
+              newGoodsList[j].selected = true
+              break
             }
           }
         }
         for (let j = 0; j < newGoodsList.length; j++) {
           let newItem = newGoodsList[j]
           if (newItem.promotionGroup === true) {
-            newGoodsList[j].selected = true;
+            newGoodsList[j].selected = true
           }
         }
-        this.table_dataList = newGoodsList;
-        this.table_listTotal = res.data.total;
-        this.table_listLoading = false;
+        this.table_dataList = newGoodsList
+        this.table_listTotal = res.data.total
+        this.table_listLoading = false
       })
     },
 
@@ -371,96 +440,96 @@ export default {
     // 更改列表当前页
     handleTableCurrentChange(val) {
       if (this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分页');
+        return this.$errorMsg('当前已选择商品,不可切换分页')
       }
-      this.table_currentPage = val;
-      this.getGoodsList();
+      this.table_currentPage = val
+      this.getGoodsList()
     },
 
     // table点击选择商品
     handleChooseGoods(val) {
-      this.table_chooseGoods = val;
+      this.table_chooseGoods = val
     },
 
     // 打开 选择商品
     addGoods() {
-      this.addGoodsVisible = true;
-      this.getClassifyList();
+      this.addGoodsVisible = true
+      this.getClassifyList()
     },
 
     // 取消 选择商品
     cancelAddGoods() {
-      this.addGoodsVisible = false;
+      this.addGoodsVisible = false
     },
 
     // 提交 选择商品
     submitAddGoods() {
-      let oldGoodsList = this.goodsList;
-      let newGoodsList = this.table_chooseGoods;
-      this.goodsList = oldGoodsList.concat(newGoodsList);
-      this.addGoodsVisible = false;
+      let oldGoodsList = this.goodsList
+      let newGoodsList = this.table_chooseGoods
+      this.goodsList = oldGoodsList.concat(newGoodsList)
+      this.addGoodsVisible = false
     },
 
     // 打开 选择分类
     addClassify() {
-      this.addClassifyVisible = true;
-      this.getClassifyList(true);
+      this.addClassifyVisible = true
+      this.getClassifyList(true)
     },
 
     // 取消 选择分类
     cancelAddClassify() {
-      this.addClassifyVisible = false;
+      this.addClassifyVisible = false
     },
 
     // 提交 选择分类
     submitAddClassify() {
       if (this.$refs.tree.getCheckedNodes().length <= 0) {
-        return this.$errorMsg('请选择分类');
+        return this.$errorMsg('请选择分类')
       }
-      let checkeds = this.$refs.tree.getCheckedNodes();
-      let ids = [];
+      let checkeds = this.$refs.tree.getCheckedNodes()
+      let ids = []
       checkeds.forEach(item => {
         if (item.level === 2) {
-          ids.push(item.categoryId);
+          ids.push(item.categoryId)
         }
       })
       getMoreGoodsList({ categoryIds: ids.join(',') }).then(res => {
-        let oldGoodsList = this.goodsList;
-        let newGoodsList = [];
+        let oldGoodsList = this.goodsList
+        let newGoodsList = []
         res.data.forEach(item => {
           if (item.promotionGroup === false) {
-            newGoodsList.push(item);
+            newGoodsList.push(item)
           }
         })
-        let allGoodsList = oldGoodsList.concat(newGoodsList);
-        let showGoodsList = [];
-        let obj = {};
+        let allGoodsList = oldGoodsList.concat(newGoodsList)
+        let showGoodsList = []
+        let obj = {}
         for (var i = 0; i < allGoodsList.length; i++) {
           if (!obj[allGoodsList[i].goodsId]) {
-            showGoodsList.push(allGoodsList[i]);
-            obj[allGoodsList[i].goodsId] = true;
+            showGoodsList.push(allGoodsList[i])
+            obj[allGoodsList[i].goodsId] = true
           }
         }
-        this.goodsList = showGoodsList;
-        this.addClassifyVisible = false;
+        this.goodsList = showGoodsList
+        this.addClassifyVisible = false
       })
     },
 
     // 提交
     submitMainForm() {
-      this.$refs.mainForm.validate((valid) => {
+      this.$refs.mainForm.validate(valid => {
         if (valid) {
           const params = {
             goodsList: this.goodsList,
             objectId: this.objectId,
             type: 1
           }
-          this.addActiveGoods(params);
+          this.addActiveGoods(params)
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -506,7 +575,6 @@ export default {
   }
 }
 
-
 .diy-table {
   overflow-x: scroll;
   border-left: 1px solid #f5f5f5;
@@ -702,4 +770,5 @@ export default {
 
 ::v-deep .el-form-item__label {
   margin-left: 0px !important;
-}</style>
+}
+</style>

+ 218 - 184
src/views/mallManagement/goods/watermark_add/index.vue

@@ -8,13 +8,14 @@
       <el-form-item label="水印图片" prop="logoUrl">
         <el-upload
           class="avatar-uploader"
-          style="height:122px"
+          style="height: 122px"
           :action="baseURL + 'common/upload'"
           :headers="myHeaders"
           :show-file-list="false"
           :on-success="uploadSuccess7"
-          :before-upload="beforeUpload7">
-          <img v-if="mainForm.logoUrl" :src="mainForm.logoUrl" class="avatar">
+          :before-upload="beforeUpload7"
+        >
+          <img v-if="mainForm.logoUrl" :src="$showImgUrl(mainForm.logoUrl)" class="avatar" />
           <i v-else class="el-icon-plus avatar-uploader-icon"></i>
         </el-upload>
       </el-form-item>
@@ -28,7 +29,8 @@
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
-          clearable>
+          clearable
+        >
         </el-date-picker>
       </el-form-item>
     </el-form>
@@ -43,23 +45,19 @@
         <el-table :data="goodsList" border fit stripe>
           <el-table-column align="center" label="商品名称" prop="goodsName" min-width="200"></el-table-column>
           <el-table-column align="center" label="销售价格" prop="goodsPrice" min-width="110">
-            <template slot-scope="scope">
-              ¥{{ scope.row.goodsPrice }}
-            </template>
+            <template slot-scope="scope"> ¥{{ scope.row.goodsPrice }} </template>
           </el-table-column>
           <el-table-column align="center" label="分销金额" prop="shareAmount" min-width="110">
-            <template slot-scope="scope">
-              ¥{{ scope.row.shareAmount }}
-            </template>
+            <template slot-scope="scope"> ¥{{ scope.row.shareAmount }} </template>
           </el-table-column>
           <el-table-column align="center" label="库存" prop="stockNum"></el-table-column>
           <el-table-column align="center" label="销量" prop="soldNum"></el-table-column>
           <el-table-column align="center" label="状态" class-name="status-col">
             <template slot-scope="scope">
-              <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '上架':'下架' }}</el-tag>
+              <el-tag :type="scope.row.status ? 'success' : 'danger'">{{ scope.row.status ? '上架' : '下架' }}</el-tag>
             </template>
           </el-table-column>
-          
+
           <el-table-column align="center" label="操作" width="100">
             <template slot-scope="scope">
               <el-button type="text" @click="deleteGoods(scope.$index)">删除</el-button>
@@ -71,49 +69,79 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="submitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
-        <el-popconfirm
-          title="确定关闭吗?"
-          @confirm="goBack"
-          style="margin-left: 10px;"
-        >
+        <el-button type="primary" @click="submitForm" :loading="formLoading">{{
+          formLoading ? '提交中 ...' : '提 交'
+        }}</el-button>
+        <el-popconfirm title="确定关闭吗?" @confirm="goBack" style="margin-left: 10px">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
       </div>
     </div>
 
     <!-- 选择商品 -->
-    <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="50%" :close-on-click-modal="false">
+    <el-dialog
+      title="选择商品"
+      :visible.sync="addGoodsVisible"
+      :show-close="false"
+      width="50%"
+      :close-on-click-modal="false"
+    >
       <div class="dialog-container clearfix">
         <div class="left fl">
           <div class="item" @click="changeClassify('')">全部分类</div>
           <div class="group" v-for="(item, index) in classifyList" :key="index">
             <div class="item" @click="toggleOpen(index)">
-              <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
+              <i :class="item.isOpen ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i> {{ item.name }}
             </div>
             <div class="child" v-if="item.isOpen">
-              <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
+              <div
+                class="item"
+                v-for="(childItem, childIndex) in item.children"
+                :key="childIndex"
+                @click="changeClassify(childItem.categoryId)"
+              >
+                {{ childItem.name }}
+              </div>
             </div>
           </div>
         </div>
 
         <div class="right fl">
           <div class="search">
-            <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
+            <el-input
+              placeholder="请输入商品名称进行搜索"
+              v-model="keyword"
+              class="input-with-select"
+              clearable
+              size="small"
+              style="width: 250px"
+            >
               <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
             </el-input>
           </div>
-          <div class="table" style="margin: 10px 0 20px;">
-            <el-table 
-              v-loading="table_listLoading" 
-              :data="table_dataList" 
-              element-loading-text="Loading" 
-              tooltip-effect="dark" 
-              style="width: 100%" 
+          <div class="table" style="margin: 10px 0 20px">
+            <el-table
+              v-loading="table_listLoading"
+              :data="table_dataList"
+              element-loading-text="Loading"
+              tooltip-effect="dark"
+              style="width: 100%"
               max-height="270"
-              @selection-change="handleChooseGoods">
-              <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
-              <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
+              @selection-change="handleChooseGoods"
+            >
+              <el-table-column
+                align="center"
+                type="selection"
+                :selectable="checkboxSelect"
+                width="45"
+              ></el-table-column>
+              <el-table-column
+                align="center"
+                prop="goodsName"
+                label="商品名称"
+                min-width="200"
+                show-overflow-tooltip
+              ></el-table-column>
               <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
               <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
             </el-table>
@@ -126,7 +154,8 @@
                 :page-size="table_pageSize"
                 background
                 layout="prev, pager, next"
-                :total="table_listTotal">
+                :total="table_listTotal"
+              >
               </el-pagination>
             </div>
           </div>
@@ -140,7 +169,13 @@
     </el-dialog>
 
     <!-- 选择分类 -->
-    <el-dialog title="选择分类" :visible.sync="addClassifyVisible" :show-close="false" width="40%" :close-on-click-modal="false">
+    <el-dialog
+      title="选择分类"
+      :visible.sync="addClassifyVisible"
+      :show-close="false"
+      width="40%"
+      :close-on-click-modal="false"
+    >
       <div class="classify-list">
         <el-tree
           :data="classifyList"
@@ -149,16 +184,16 @@
           node-key="categoryId"
           ref="tree"
           highlight-current
-          :props="defaultProps">
+          :props="defaultProps"
+        >
         </el-tree>
       </div>
-      
+
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitAddClassify">保 存</el-button>
         <el-button @click="cancelAddClassify">取 消</el-button>
       </div>
     </el-dialog>
-
   </div>
 </template>
 
@@ -170,25 +205,19 @@ export default {
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { 'x-token': getToken() },
       isEdit: false,
       editId: '',
 
       mainForm: {
         name: '',
         logoUrl: '',
-        showDate: [],
+        showDate: []
       },
       mainFormRules: {
-        name: [
-          { required: true, message: '请输入水印名称', trigger: 'blur' }
-        ],
-        logoUrl: [
-          { required: true, message: '请上传水印图片', trigger: 'blur' }
-        ],
-        showDate: [
-          { required: true, message: '请选择水印显示日期', trigger: 'blur' }
-        ],
+        name: [{ required: true, message: '请输入水印名称', trigger: 'blur' }],
+        logoUrl: [{ required: true, message: '请上传水印图片', trigger: 'blur' }],
+        showDate: [{ required: true, message: '请选择水印显示日期', trigger: 'blur' }]
       },
 
       formLoading: false,
@@ -222,28 +251,30 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    },
+    }
   },
 
   created() {
-    const { id } = this.$route.query;
-    this.isEdit = id ? true : false;
-    this.editId = id;
+    const { id } = this.$route.query
+    this.isEdit = id ? true : false
+    this.editId = id
 
-    if(this.isEdit) {
-      this.getModuleDetail(id);
+    if (this.isEdit) {
+      this.getModuleDetail(id)
     }
   },
 
   methods: {
     // 获取详情
     getModuleDetail(commonTemplateId) {
-      getModuleDetail({commonTemplateId}).then(res => {
+      getModuleDetail({ commonTemplateId }).then(res => {
         this.mainForm = {
           name: res.data.name,
           content: res.data.content,
           logoUrl: res.data.logo,
-          showDate: res.data.logoStartTime ? [res.data.logoStartTime.slice(0, 10), res.data.logoEndTime.slice(0, 10)] : [],
+          showDate: res.data.logoStartTime
+            ? [res.data.logoStartTime.slice(0, 10), res.data.logoEndTime.slice(0, 10)]
+            : []
         }
         this.goodsList = res.data.goodsList
       })
@@ -251,38 +282,38 @@ export default {
 
     // 获取分类列表
     getClassifyList() {
-      getClassifyList({categoryLevel: 1, status: true}).then(res => {
+      getClassifyList({ categoryLevel: 1, status: true }).then(res => {
         res.data.forEach(item => {
-          item.isOpen = false;
-        });
-        this.classifyList = res.data;
-        this.classifyCurrent = '';
-        this.getGoodsList();
+          item.isOpen = false
+        })
+        this.classifyList = res.data
+        this.classifyCurrent = ''
+        this.getGoodsList()
       })
     },
 
     // 展开/收起 分类
     toggleOpen(index) {
-      this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
+      this.classifyList[index].isOpen = !this.classifyList[index].isOpen
     },
 
     // 切换分类
     changeClassify(cid) {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分类');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分类')
       }
-      this.classifyCurrent = cid;
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.classifyCurrent = cid
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 搜索
     getGoodsListByScreen() {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可搜索');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可搜索')
       }
-      this.table_currentPage = 1;
-      this.getGoodsList();
+      this.table_currentPage = 1
+      this.getGoodsList()
     },
 
     // 获取商品列表
@@ -291,126 +322,126 @@ export default {
         pageNum: this.table_currentPage,
         pageSize: this.table_pageSize,
         keyword: this.keyword,
-        categoryId: this.classifyCurrent,
+        categoryId: this.classifyCurrent
       }).then(res => {
-        let oldGoodsList = this.goodsList;
-        let newGoodsList = res.data.records;
-        for(let i = 0; i < oldGoodsList.length; i++) {
+        let oldGoodsList = this.goodsList
+        let newGoodsList = res.data.records
+        for (let i = 0; i < oldGoodsList.length; i++) {
           let oldItem = oldGoodsList[i]
-          for(let j = 0; j < newGoodsList.length; j++) {
+          for (let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.goodsId === oldItem.goodsId){
-              newGoodsList[j].selected = true;
-              break;
+            if (newItem.goodsId === oldItem.goodsId) {
+              newGoodsList[j].selected = true
+              break
             }
           }
         }
-        this.table_dataList = newGoodsList;
-        this.table_listTotal = res.data.total;
-        this.table_listLoading = false;
+        this.table_dataList = newGoodsList
+        this.table_listTotal = res.data.total
+        this.table_listLoading = false
       })
     },
 
     // 查询重复值并禁选
-    checkboxSelect (row, rowIndex) {
+    checkboxSelect(row, rowIndex) {
       if (row.selected) {
         return false // 禁用
-      }else{
+      } else {
         return true // 不禁用
       }
     },
 
     // 更改列表当前页
     handleTableCurrentChange(val) {
-      if(this.table_chooseGoods.length > 0) {
-        return this.$errorMsg('当前已选择商品,不可切换分页');
+      if (this.table_chooseGoods.length > 0) {
+        return this.$errorMsg('当前已选择商品,不可切换分页')
       }
-      this.table_currentPage = val;
-      this.getGoodsList();
+      this.table_currentPage = val
+      this.getGoodsList()
     },
 
     // table点击选择商品
     handleChooseGoods(val) {
-      this.table_chooseGoods = val;
+      this.table_chooseGoods = val
     },
 
     // 打开 选择商品
     addGoods() {
-      this.addGoodsVisible = true;
-      this.getClassifyList();
+      this.addGoodsVisible = true
+      this.getClassifyList()
     },
 
     // 取消 选择商品
-    cancelAddGoods(){
-      this.addGoodsVisible = false;
+    cancelAddGoods() {
+      this.addGoodsVisible = false
     },
 
     // 提交 选择商品
     submitAddGoods() {
-      let oldGoodsList = this.goodsList;
-      let newGoodsList = this.table_chooseGoods;
-      this.goodsList = oldGoodsList.concat(newGoodsList);
-      this.addGoodsVisible = false;
+      let oldGoodsList = this.goodsList
+      let newGoodsList = this.table_chooseGoods
+      this.goodsList = oldGoodsList.concat(newGoodsList)
+      this.addGoodsVisible = false
     },
 
     // 删除商品
     deleteGoods(index) {
-      this.goodsList.splice(index, 1);
+      this.goodsList.splice(index, 1)
     },
 
     // 打开 选择分类
     addClassify() {
-      this.addClassifyVisible = true;
-      this.getClassifyList();
+      this.addClassifyVisible = true
+      this.getClassifyList()
     },
 
     // 取消 选择分类
-    cancelAddClassify(){
-      this.addClassifyVisible = false;
+    cancelAddClassify() {
+      this.addClassifyVisible = false
     },
 
     // 提交 选择分类
     submitAddClassify() {
-      if(this.$refs.tree.getCheckedNodes().length <= 0) {
-        return this.$errorMsg('请选择分类');
+      if (this.$refs.tree.getCheckedNodes().length <= 0) {
+        return this.$errorMsg('请选择分类')
       }
-      let checkeds = this.$refs.tree.getCheckedNodes();
-      let ids = [];
+      let checkeds = this.$refs.tree.getCheckedNodes()
+      let ids = []
       checkeds.forEach(item => {
-        if(item.level === 2) {
-          ids.push(item.categoryId);
+        if (item.level === 2) {
+          ids.push(item.categoryId)
         }
       })
-      getMoreGoodsList({ categoryIds: ids.join(',')}).then(res => {
-        let oldGoodsList = this.goodsList;
-        let newGoodsList = res.data;
-        let allGoodsList = oldGoodsList.concat(newGoodsList);
-        let showGoodsList = [];
-        let obj = {};
-        for(var i =0; i<allGoodsList.length; i++){
-            if(!obj[allGoodsList[i].goodsId]){
-              showGoodsList.push(allGoodsList[i]);
-              obj[allGoodsList[i].goodsId] = true;
-            }
+      getMoreGoodsList({ categoryIds: ids.join(',') }).then(res => {
+        let oldGoodsList = this.goodsList
+        let newGoodsList = res.data
+        let allGoodsList = oldGoodsList.concat(newGoodsList)
+        let showGoodsList = []
+        let obj = {}
+        for (var i = 0; i < allGoodsList.length; i++) {
+          if (!obj[allGoodsList[i].goodsId]) {
+            showGoodsList.push(allGoodsList[i])
+            obj[allGoodsList[i].goodsId] = true
+          }
         }
-        this.goodsList = showGoodsList;
-        this.addClassifyVisible = false;
+        this.goodsList = showGoodsList
+        this.addClassifyVisible = false
       })
     },
 
     submitForm() {
-      this.$refs.mainForm.validate((valid) => {
+      this.$refs.mainForm.validate(valid => {
         if (valid) {
-          if(this.goodsList.length <= 0) {
-            return this.$errorMsg('请选择商品');
+          if (this.goodsList.length <= 0) {
+            return this.$errorMsg('请选择商品')
           }
 
-          let goodsIds = [];
+          let goodsIds = []
           this.goodsList.forEach(item => {
-            goodsIds.push(item.goodsId);
+            goodsIds.push(item.goodsId)
           })
 
-          this.formLoading = true;
+          this.formLoading = true
 
           let params = {
             type: 2,
@@ -420,88 +451,91 @@ export default {
             logoEndTime: this.mainForm.showDate ? this.mainForm.showDate[1] + ' 23:59:59' : '',
             goodsIds: goodsIds
           }
-          params = this.$deleteEmptyObj(params);
-
-          if(this.isEdit) {
-            params.commonTemplateId = this.editId;
-            editModule(params).then(res => {
-              this.formLoading = false;
-              this.$successMsg('编辑成功');
-              setTimeout(()=>{
-                this.goBack();
-              }, 1000)
-            }).catch(err => {
-              this.formLoading = false;
-            })
+          params = this.$deleteEmptyObj(params)
+
+          if (this.isEdit) {
+            params.commonTemplateId = this.editId
+            editModule(params)
+              .then(res => {
+                this.formLoading = false
+                this.$successMsg('编辑成功')
+                setTimeout(() => {
+                  this.goBack()
+                }, 1000)
+              })
+              .catch(err => {
+                this.formLoading = false
+              })
           } else {
-            addModule(params).then(res => {
-              this.formLoading = false;
-              this.$successMsg('新增成功');
-              setTimeout(()=>{
-                this.goBack();
-              }, 1000)
-            }).catch(err => {
-              this.formLoading = false;
-            })
+            addModule(params)
+              .then(res => {
+                this.formLoading = false
+                this.$successMsg('新增成功')
+                setTimeout(() => {
+                  this.goBack()
+                }, 1000)
+              })
+              .catch(err => {
+                this.formLoading = false
+              })
           }
-
         }
       })
     },
 
     goBack() {
-      this.$router.go(-1);
+      this.$router.go(-1)
       // this.$store.dispatch("tagsView/delView", this.$route);
     },
 
     // 水印logo - 上传成功
     uploadSuccess7(res, file) {
-      this.mainForm.logoUrl = res.data.url;
+      this.mainForm.logoUrl = res.data.url
     },
 
     // 水印logo - 上传前
     beforeUpload7(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/png文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/png文件!')
+        return false
       }
-    },
+    }
   }
 }
 </script>
 
 <style lang="scss" scoped>
-  .dialog-container {
-    .left {
-      width: 140px;
-      height: 350px;
-      overflow-y: scroll;
-      .group {
-        margin-top: 10px;
-      }
-      .child {
-        margin-top: 5px;
-        .item {
-          padding-left: 18px;
-        }
-      }
+.dialog-container {
+  .left {
+    width: 140px;
+    height: 350px;
+    overflow-y: scroll;
+    .group {
+      margin-top: 10px;
+    }
+    .child {
+      margin-top: 5px;
       .item {
-        cursor: pointer;
-        line-height: 24px;
+        padding-left: 18px;
       }
     }
-    .right {
-      width: calc(100% - 140px);
-      height: 350px;
-      box-sizing: border-box;
-      padding-left: 20px;
+    .item {
+      cursor: pointer;
+      line-height: 24px;
     }
   }
-
-  .classify-list {
-    height: 50vh;
-    overflow-y: scroll;
+  .right {
+    width: calc(100% - 140px);
+    height: 350px;
+    box-sizing: border-box;
+    padding-left: 20px;
   }
-</style>
+}
+
+.classify-list {
+  height: 50vh;
+  overflow-y: scroll;
+}
+</style>

+ 156 - 111
src/views/mallManagement/invoice/index.vue

@@ -1,60 +1,66 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList">
-			</template-page>
-			<div v-if="~['detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
-				
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+      >
+      </template-page>
+      <div v-if="~['detail'].indexOf(activeKey)" style="box-sizing: border-box; padding: 16px">
         <el-descriptions border title="" :column="4" :colon="false" labelStyle="width: 8%" contentStyle="width: 17%">
           <el-descriptions-item label="所属商户">
-            {{detailData.companyWechatName}}
+            {{ detailData.companyWechatName }}
           </el-descriptions-item>
           <el-descriptions-item label="状态">
-            {{detailData.status | statusFilter}}
+            {{ detailData.status | statusFilter }}
           </el-descriptions-item>
           <el-descriptions-item label="订单编号">
-            {{detailData.orderId}}
+            {{ detailData.orderId }}
           </el-descriptions-item>
           <el-descriptions-item label="订单类型">
-            {{detailData.orderType | orderTypeFilter}}
+            {{ detailData.orderType | orderTypeFilter }}
           </el-descriptions-item>
           <el-descriptions-item label="发票类型">
-            {{detailData.taxType | taxTypeFilter}}
+            {{ detailData.taxType | taxTypeFilter }}
           </el-descriptions-item>
           <el-descriptions-item label="发票内容">
-            {{detailData.content}}
+            {{ detailData.content }}
           </el-descriptions-item>
           <el-descriptions-item label="抬头类型">
-            {{detailData.type | typeFilter}}
+            {{ detailData.type | typeFilter }}
           </el-descriptions-item>
           <el-descriptions-item label="抬头名称">
-            {{detailData.name}}
+            {{ detailData.name }}
           </el-descriptions-item>
           <el-descriptions-item label="单位税号">
-            {{detailData.taxNo}}
+            {{ detailData.taxNo }}
           </el-descriptions-item>
           <el-descriptions-item label="收票邮箱">
-            {{detailData.receiverEmail}}
+            {{ detailData.receiverEmail }}
           </el-descriptions-item>
           <el-descriptions-item label="开票金额">
-            {{detailData.amount}}
-          </el-descriptions-item>
-          <el-descriptions-item label="">
-            
+            {{ detailData.amount }}
           </el-descriptions-item>
+          <el-descriptions-item label=""> </el-descriptions-item>
           <el-descriptions-item label="创建人">
-            {{detailData.createBy}}
+            {{ detailData.createBy }}
           </el-descriptions-item>
           <el-descriptions-item label="创建时间">
-            {{detailData.createTime}}
+            {{ detailData.createTime }}
           </el-descriptions-item>
           <el-descriptions-item label="上传人">
-            {{detailData.upName}}
+            {{ detailData.upName }}
           </el-descriptions-item>
           <el-descriptions-item label="上传时间">
-            {{detailData.upTime}}
+            {{ detailData.upTime }}
           </el-descriptions-item>
         </el-descriptions>
 
@@ -69,30 +75,62 @@
                   v-model="formData.taxTime"
                   type="date"
                   value-format="yyyy-MM-dd"
-                  placeholder="选择发票时间">
+                  placeholder="选择发票时间"
+                >
                 </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="发票代码" prop="taxNumber">
-                <el-input v-model="formData.taxNumber" autocomplete="off" placeholder="请输入发票代码" :disabled="detailData.status"></el-input>
+                <el-input
+                  v-model="formData.taxNumber"
+                  autocomplete="off"
+                  placeholder="请输入发票代码"
+                  :disabled="detailData.status"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="发票号码" prop="taxCode">
-                <el-input v-model="formData.taxCode" autocomplete="off" placeholder="请输入发票号码" :disabled="detailData.status"></el-input>
+                <el-input
+                  v-model="formData.taxCode"
+                  autocomplete="off"
+                  placeholder="请输入发票号码"
+                  :disabled="detailData.status"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
               <el-form-item label="上传发票" prop="taxlink">
-                <el-upload class="avatar-uploader imageListUpload" style="height:0" :action="baseURL + 'common/upload'" :headers="myHeaders"
-                  :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload" :disabled="detailData.status">
+                <el-upload
+                  class="avatar-uploader imageListUpload"
+                  style="height: 0"
+                  :action="baseURL + 'common/upload'"
+                  :headers="myHeaders"
+                  :show-file-list="false"
+                  :on-success="uploadSuccess"
+                  :before-upload="beforeUpload"
+                  :disabled="detailData.status"
+                >
                 </el-upload>
                 <div class="images">
                   <div class="item" v-if="formData.taxlink">
                     <div class="img">
-                      <el-image :src="require('@/assets/common/pdf.png')" style="width: 120px; height: 120px; padding: 30px;" fit="cover" v-if="formData.taxlink.indexOf('pdf') >= 0"></el-image>
-                      <el-image class="mainimg" ref="img" :src="formData.taxlink" style="width: 120px; height: 120px" fit="cover" :preview-src-list="[formData.taxlink]" v-else></el-image>
+                      <el-image
+                        :src="require('@/assets/common/pdf.png')"
+                        style="width: 120px; height: 120px; padding: 30px"
+                        fit="cover"
+                        v-if="formData.taxlink.indexOf('pdf') >= 0"
+                      ></el-image>
+                      <el-image
+                        class="mainimg"
+                        ref="img"
+                        :src="$showImgUrl(formData.taxlink)"
+                        style="width: 120px; height: 120px"
+                        fit="cover"
+                        :preview-src-list="[$showImgUrl(formData.taxlink)]"
+                        v-else
+                      ></el-image>
                       <div class="mask" v-if="!detailData.status">
                         <div class="row">
                           <div class="it" @click="uploadImage()"><i class="el-icon-upload2"></i></div>
@@ -101,7 +139,9 @@
                       </div>
                     </div>
                     <div>
-                      <el-button @click="formData.taxlink.indexOf('pdf') >= 0 ? openFile() : openImage()" size="small">预览</el-button>
+                      <el-button @click="formData.taxlink.indexOf('pdf') >= 0 ? openFile() : openImage()" size="small"
+                        >预览</el-button
+                      >
                       <el-button @click="downloadFile" size="small">下载</el-button>
                     </div>
                   </div>
@@ -115,19 +155,27 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="备注" prop="remark">
-                <el-input type="textarea" v-model="formData.remark" autocomplete="off" placeholder="请输入备注" :disabled="detailData.status"></el-input>
+                <el-input
+                  type="textarea"
+                  v-model="formData.remark"
+                  autocomplete="off"
+                  placeholder="请输入备注"
+                  :disabled="detailData.status"
+                ></el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
 
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary" v-if="!detailData.status">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary" v-if="!detailData.status"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -135,37 +183,37 @@ import { getToken } from '@/utils/auth'
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { getList, pageExport, saveData, getDetail } from "@/api/invoice2";
+import { getList, pageExport, saveData, getDetail } from '@/api/invoice2'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin,operation_mixin],
+  mixins: [import_mixin, operation_mixin],
   filters: {
     statusFilter(val) {
       const MAP = {
         true: '已开票',
-        false: '待开票',
+        false: '待开票'
       }
       return MAP[val]
     },
     orderTypeFilter(val) {
       const MAP = {
         INCRE: '增值服务',
-        ORDER: '商城订单',
+        ORDER: '商城订单'
       }
       return MAP[val]
     },
     taxTypeFilter(val) {
       const MAP = {
         true: '专票',
-        false: '普票',
+        false: '普票'
       }
       return MAP[val]
     },
     typeFilter(val) {
       const MAP = {
         true: '公司',
-        false: '个人',
+        false: '个人'
       }
       return MAP[val]
     }
@@ -187,46 +235,46 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增", "编辑"],
+      formDialogTitles: ['新增', '编辑'],
       formDialog: false,
       formData: {
         taxTime: '',
         taxNumber: '',
         taxCode: '',
         taxlink: '',
-        remark: '',
+        remark: ''
       },
       formRules: {
         taxTime: [{ required: true, message: '请选择发票时间', trigger: 'change' }],
         taxNumber: [{ required: true, message: '请输入发票代码', trigger: 'blur' }],
         taxCode: [{ required: true, message: '请输入发票号码', trigger: 'blur' }],
-        taxlink: [{ required: true, message: '请上传发票文件', trigger: 'change' }],
+        taxlink: [{ required: true, message: '请上传发票文件', trigger: 'change' }]
       },
-			formType: 'add',
-			formVisible: false,
+      formType: 'add',
+      formVisible: false,
 
-      detailData: {},
+      detailData: {}
     }
   },
   computed: {
-	// 事件组合
-	optionsEvensGroup() {
-		return [
-			[
-				[
-					this.optionsEvensAuth("add", {
-						click: () => {
-							this.openForm('add')
-						}
-					})
-				],
-			]
-		]
-	},
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
-    },
+    }
   },
   methods: {
     // 列表请求函数
@@ -254,39 +302,37 @@ export default {
     },
     // 打开 新增编辑 网点表单
     openForm(type, id) {
-    	this.$refs.tabPage.addTab({
-    		// 对应显示的模块
-    		activeKey: type,
-    		// 唯一标识
-    		key: type,
-    		// 页签名称
-    		label: ({ detail: "详情" })[type],
-    		// 打开时事件
-    		triggerEvent: () => {
-    			this.formCancel()
-    			this.$nextTick(()=>{
-    				this.formType = type
-    				this.formVisible = true
-    				if (type == 'add') {
-    					this.formDialogType = 0
-    				} else if(type == 'detail'){
-    					this.formDialogType = 1
-    					getDetail({ orderTaxId: id }).then(res => {
-                this.detailData = res.data || {};
-    					  this.formData.taxTime = res.data.taxTime || '';
-    					  this.formData.taxNumber = res.data.taxNumber || '';
-    					  this.formData.taxCode = res.data.taxCode || '';
-    					  this.formData.taxlink = res.data.taxLink || '';
-    					  this.formData.remark = res.data.remark || '';
-    					})
-    				}
-    			})
-    		},
-    		// 关闭时事件
-    		closeEvent: () => {
-    		
-    		}
-    	})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { detail: '详情' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'detail') {
+              this.formDialogType = 1
+              getDetail({ orderTaxId: id }).then(res => {
+                this.detailData = res.data || {}
+                this.formData.taxTime = res.data.taxTime || ''
+                this.formData.taxNumber = res.data.taxNumber || ''
+                this.formData.taxCode = res.data.taxCode || ''
+                this.formData.taxlink = res.data.taxLink || ''
+                this.formData.remark = res.data.remark || ''
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
     },
 
     formCancel() {
@@ -298,7 +344,7 @@ export default {
     formConfirm(cancel) {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          saveData({...this.formData, orderTaxId: this.detailData.orderTaxId}).then(res => {
+          saveData({ ...this.formData, orderTaxId: this.detailData.orderTaxId }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             cancel('list')
             this.$refs.pageRef.refreshList()
@@ -308,21 +354,21 @@ export default {
     },
 
     uploadImage(id) {
-      document.querySelector('.imageListUpload input').click();
+      document.querySelector('.imageListUpload input').click()
     },
 
     // 附件 - 上传成功
     uploadSuccess(res, file) {
-      this.formData.taxlink = res.data.url;
+      this.formData.taxlink = res.data.url
     },
 
     // 附件 - 上传前
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png', 'pdf'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png', 'pdf']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传图片/pdf文件!');
-        return false;
+        this.$errorMsg('只支持上传图片/pdf文件!')
+        return false
       }
     },
 
@@ -344,7 +390,6 @@ export default {
 <style lang="scss" scoped></style>
 
 <style scoped lang="scss">
-
 .images {
   display: flex;
   flex-wrap: wrap;
@@ -424,4 +469,4 @@ export default {
     }
   }
 }
-</style>
+</style>

Різницю між файлами не показано, бо вона завелика
+ 343 - 258
src/views/mallManagement/old_machine/index.vue


Різницю між файлами не показано, бо вона завелика
+ 330 - 209
src/views/mallManagement/order/offline_order_list/index.vue


Різницю між файлами не показано, бо вона завелика
+ 554 - 285
src/views/mallManagement/order/order_detail/index.vue


Різницю між файлами не показано, бо вона завелика
+ 860 - 380
src/views/mallManagement/order/order_list/index.vue


Різницю між файлами не показано, бо вона завелика
+ 450 - 202
src/views/mallManagement/order/order_refund/index.vue


Різницю між файлами не показано, бо вона завелика
+ 659 - 448
src/views/mallManagement/order/order_refund_detail/index.vue


Різницю між файлами не показано, бо вона завелика
+ 372 - 244
src/views/mallManagement/order/sales_return_order_list/index.vue


+ 31 - 28
src/views/mallManagement/order/workOrder_detail/index.vue

@@ -7,13 +7,18 @@
       </div>
       <div class="el-page-header__content">
         <el-tabs v-model="activeName">
-          <el-tab-pane :label="'工单详情' + (index+1)" :name="'order_' + (index+1)" v-for="(item, index) in dataList" :key="index"></el-tab-pane>
+          <el-tab-pane
+            :label="'工单详情' + (index + 1)"
+            :name="'order_' + (index + 1)"
+            v-for="(item, index) in dataList"
+            :key="index"
+          ></el-tab-pane>
         </el-tabs>
       </div>
     </div>
 
     <div v-for="(item, index) in dataList" :key="index">
-      <div v-show="activeName === 'order_' + (index+1)">
+      <div v-show="activeName === 'order_' + (index + 1)">
         <div class="top-container">
           <span>订单编号:{{ item.orderId }}</span>
           <span>下单时间:{{ item.payTime }}</span>
@@ -25,7 +30,7 @@
             <el-table-column label="商品信息" min-width="200">
               <template slot-scope="scope">
                 <div class="goods-info">
-                  <el-image class="image" :src="scope.row.imgUrl"></el-image>
+                  <el-image class="image" :src="$showImgUrl(scope.row.imgUrl)"></el-image>
                   <div class="name">{{ scope.row.goodsName }}</div>
                 </div>
               </template>
@@ -97,7 +102,12 @@
           <el-table :data="item.fkxxs" style="width: 100%" border>
             <el-table-column prop="operatorType" label="操作类别" align="center" min-width="100"></el-table-column>
             <el-table-column prop="operatorContent" label="操作内容" align="center" min-width="160"></el-table-column>
-            <el-table-column prop="lastOperatorTime" label="最后操作时间" align="center" min-width="160"></el-table-column>
+            <el-table-column
+              prop="lastOperatorTime"
+              label="最后操作时间"
+              align="center"
+              min-width="160"
+            ></el-table-column>
             <el-table-column prop="operatorName" label="操作人" align="center" min-width="120"></el-table-column>
             <el-table-column prop="operatorWebsit" label="操作网点" align="center" min-width="120"></el-table-column>
             <el-table-column prop="result" label="反馈结果" align="center" min-width="100"></el-table-column>
@@ -135,59 +145,53 @@
       </el-table>
 
       <div slot="footer" class="dialog-footer">
-        <el-button @click="goodsDetailDialog = false;">关 闭</el-button>
+        <el-button @click="goodsDetailDialog = false">关 闭</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import {
-  getWorkOrder, getCompensateList
-} from "@/api/order";
-import * as Storage from "@/api/storage";
+import { getWorkOrder, getCompensateList } from '@/api/order'
+import * as Storage from '@/api/storage'
 import { mapGetters } from 'vuex'
 
 export default {
-  name: "detail",
+  name: 'detail',
   data() {
     return {
       activeName: 'order_1',
       orderId: '',
       dataList: {},
       goodsDetailDialog: false,
-      goodsDetailList: [],
+      goodsDetailList: []
     }
   },
 
   computed: {
-    ...mapGetters([
-      'userid', 
-      'name'
-    ]),
+    ...mapGetters(['userid', 'name'])
   },
 
   created() {
     this.orderId = this.$route.query.orderId
-    this.getDetail();
+    this.getDetail()
   },
   methods: {
     getDetail() {
-      getWorkOrder({ orderId: this.orderId }).then((res) => {
-        this.dataList = res.data;
+      getWorkOrder({ orderId: this.orderId }).then(res => {
+        this.dataList = res.data
       })
     },
     goBack() {
-      this.$router.go(-1);
+      this.$router.go(-1)
     },
-    
+
     // 理赔
     openDetail(list) {
-      this.goodsDetailList = list;
-      this.goodsDetailDialog = true;
-    },
-
-  },
+      this.goodsDetailList = list
+      this.goodsDetailDialog = true
+    }
+  }
 }
 </script>
 
@@ -241,7 +245,7 @@ export default {
   }
   .title {
     font-weight: 500;
-    color: #409EFF;
+    color: #409eff;
   }
   .order-info {
     padding: 10px 20px;
@@ -260,5 +264,4 @@ export default {
     }
   }
 }
-
-</style>
+</style>

+ 227 - 185
src/views/mallManagement/secondHandMall/classifiedManagement/index.vue

@@ -1,77 +1,127 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<div v-if="activeKey == 'list'" class="app-container">
-				<div class="btn-group clearfix">
-				  <div class="fl">
-				    <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add1')">添加分类</el-button>
-				  </div>
-				  <div class="fr">
-				    <el-input placeholder="请输入分类名称进行搜索" v-model="screenForm.keyword" size="small" style="width: 240px;" clearable>
-				      <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
-				    </el-input>
-				  </div>
-				</div>
-				
-				<div class="table">
-				  <el-table :data="dataList" row-key="categoryId" border default-expand-all :tree-props="{children: 'children'}">
-					  <el-table-column align="center" prop="companyName" label="所属商户" min-width="120"></el-table-column>
-				    <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
-				    <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
-				      <template slot-scope="scope">
-				        <el-image style="width: 40px; height: 40px; display: block; margin: 0 auto;" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]" fit="cover">
-				          <div slot="error" style="height: 100%;font-size: 40px;">
-				            <i class="el-icon-picture-outline"></i>
-				          </div>
-				        </el-image>
-				      </template>
-				    </el-table-column>
-					<el-table-column align="center" label="状态" class-name="status-col">
-					  <template slot-scope="scope">
-					    <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '启用':'禁用' }}</el-tag>
-					  </template>
-					</el-table-column>
-				    <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
-					<el-table-column align="center" prop="createBy" label="创建人"></el-table-column>
-					<el-table-column align="center" prop="createTime" label="创建时间"></el-table-column>
-					<el-table-column align="center" prop="updateBy" label="修改人"></el-table-column>
-					<el-table-column align="center" prop="updateTime" label="修改时间"></el-table-column>
-				    <el-table-column align="right" label="操作" width="150" fixed="right">
-				      <template slot-scope="scope">
-				        <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1 && $restrict('edit')" @click="addOrEditParent('edit1', scope.row.categoryId)"></el-button>
-				        <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
-				          <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
-				        </el-popconfirm>
-				      </template>
-				    </el-table-column>
-				  </el-table>
-				</div>
-			</div>
-			<!-- 新增编辑 一级分类 -->
-			<div v-if="addParentFormVisible" class="app-container">
-				<el-form ref="addParentForm" :model="addParentForm" :rules="addParentFormRules" label-position="left" label-width="100px">
-					<el-row :gutter="20">
-						<el-col :span="6">
-							<el-form-item label="分类名称" prop="oneClassify">
-							  <el-input type="text" placeholder="请输入分类名称" v-model="addParentForm.oneClassify" maxlength="10" show-word-limit style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="状态" prop="status" class="is-required">
-							  <el-radio-group v-model="addParentForm.status">
-							    <el-radio :label="true">启用</el-radio>
-							    <el-radio :label="false">禁用</el-radio>
-							  </el-radio-group>
-							</el-form-item>
-						</el-col>
-						<el-col :span="6">
-							<el-form-item label="排序" prop="sort">
-							  <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px;"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="分类图片" prop="imgUrl">
-<!-- 							  <el-upload
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <div v-if="activeKey == 'list'" class="app-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button
+              v-if="$restrict('add')"
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              @click="addOrEditParent('add1')"
+              >添加分类</el-button
+            >
+          </div>
+          <div class="fr">
+            <el-input
+              placeholder="请输入分类名称进行搜索"
+              v-model="screenForm.keyword"
+              size="small"
+              style="width: 240px"
+              clearable
+            >
+              <el-button slot="append" icon="el-icon-search" size="small" @click="getListByScreen"></el-button>
+            </el-input>
+          </div>
+        </div>
+
+        <div class="table">
+          <el-table
+            :data="dataList"
+            row-key="categoryId"
+            border
+            default-expand-all
+            :tree-props="{ children: 'children' }"
+          >
+            <el-table-column align="center" prop="companyName" label="所属商户" min-width="120"></el-table-column>
+            <el-table-column prop="name" label="分类名称" min-width="150"></el-table-column>
+            <el-table-column align="center" label="分类图片" prop="imgUrl" width="80">
+              <template slot-scope="scope">
+                <el-image
+                  style="width: 40px; height: 40px; display: block; margin: 0 auto"
+                  :src="$showImgUrl(scope.row.imgUrl)"
+                  :preview-src-list="[$showImgUrl(scope.row.imgUrl)]"
+                  fit="cover"
+                >
+                  <div slot="error" style="height: 100%; font-size: 40px">
+                    <i class="el-icon-picture-outline"></i>
+                  </div>
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="状态" class-name="status-col">
+              <template slot-scope="scope">
+                <el-tag :type="scope.row.status ? 'success' : 'danger'">{{
+                  scope.row.status ? '启用' : '禁用'
+                }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="sortNum" label="排序"></el-table-column>
+            <el-table-column align="center" prop="createBy" label="创建人"></el-table-column>
+            <el-table-column align="center" prop="createTime" label="创建时间"></el-table-column>
+            <el-table-column align="center" prop="updateBy" label="修改人"></el-table-column>
+            <el-table-column align="center" prop="updateTime" label="修改时间"></el-table-column>
+            <el-table-column align="right" label="操作" width="150" fixed="right">
+              <template slot-scope="scope">
+                <el-button
+                  type="primary"
+                  size="mini"
+                  icon="el-icon-edit"
+                  v-if="scope.row.level == 1 && $restrict('edit')"
+                  @click="addOrEditParent('edit1', scope.row.categoryId)"
+                ></el-button>
+                <el-popconfirm
+                  v-if="$restrict('del')"
+                  style="margin-left: 10px"
+                  title="确定删除吗?"
+                  @confirm="handleDelete(scope.row.categoryId)"
+                >
+                  <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <!-- 新增编辑 一级分类 -->
+      <div v-if="addParentFormVisible" class="app-container">
+        <el-form
+          ref="addParentForm"
+          :model="addParentForm"
+          :rules="addParentFormRules"
+          label-position="left"
+          label-width="100px"
+        >
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="分类名称" prop="oneClassify">
+                <el-input
+                  type="text"
+                  placeholder="请输入分类名称"
+                  v-model="addParentForm.oneClassify"
+                  maxlength="10"
+                  show-word-limit
+                  style="width: 250px"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="状态" prop="status" class="is-required">
+                <el-radio-group v-model="addParentForm.status">
+                  <el-radio :label="true">启用</el-radio>
+                  <el-radio :label="false">禁用</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="排序" prop="sort">
+                <el-input placeholder="请输入排序" v-model.number="addParentForm.sort" style="width: 250px"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="分类图片" prop="imgUrl">
+                <!-- 							  <el-upload
 							    class="avatar-uploader"
 							    style="height:122px"
 							    :action="baseURL + 'common/upload'"
@@ -82,43 +132,44 @@
 							    <img v-if="addParentForm.imgUrl" :src="addParentForm.imgUrl" class="avatar">
 							    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
 							  </el-upload> -->
-								<ImageUpload :fileList="addParentForm.imgUrl" :limit="1" :isEdit="true" />
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-				<div slot="footer" class="dialog-footer">
-				  <el-button @click="data.removeTab()">取 消</el-button>
-				  <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+                <ImageUpload :fileList="addParentForm.imgUrl" :limit="1" :isEdit="true" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="submitAddParentForm(data.removeTab)">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
 import { getToken } from '@/utils/auth'
 import { getClassifyList, addClassify, editClassify, deleteClassify, getClassifyDetail } from '@/api/goods'
-import { ORDER_MAIN_TYPE } from "@/utils/select_data";
-import { getMainList } from "@/api/workOrder/settlementStandardInstall";
-	import ImageUpload from '@/components/file-upload'
+import { ORDER_MAIN_TYPE } from '@/utils/select_data'
+import { getMainList } from '@/api/workOrder/settlementStandardInstall'
+import ImageUpload from '@/components/file-upload'
 
 export default {
-	components: {
-		ImageUpload
-	},
+  components: {
+    ImageUpload
+  },
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { 'x-token': getToken() },
 
       dataList: [], // 列表数据
       listLoading: true, // 列表加载loading
-      screenForm: { // 筛选表单数据
-        keyword: '', // 关键词
+      screenForm: {
+        // 筛选表单数据
+        keyword: '' // 关键词
       },
 
-      editParentId:  null,
+      editParentId: null,
       addParentFormType: 'add1',
       addParentFormVisible: false,
       addParentForm: {
@@ -126,114 +177,108 @@ export default {
         twoClassify: '',
         imgUrl: [],
         status: true,
-        sort: 0,
+        sort: 0
       },
       addParentFormRules: {
-        oneClassify: [
-          { required: true, message: '请填写分类名称', trigger: 'blur' },
-        ],
-        imgUrl: [
-          { required: true, message: '请上传分类图片', trigger: 'change' }
-        ]
+        oneClassify: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
+        imgUrl: [{ required: true, message: '请上传分类图片', trigger: 'change' }]
       },
 
       classifyList: [],
-		formType: 'add',
-		formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
-
     getList() {
-      this.listLoading = true;
+      this.listLoading = true
 
       let params = {
         name: this.screenForm.keyword,
-		type: 5
-      };
+        type: 5
+      }
 
       getClassifyList(params).then(res => {
-        this.dataList = res.data;
+        this.dataList = res.data
       })
     },
 
     // 筛选后重新获取列表
     getListByScreen() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
 
     // 打开 新增编辑 一级分类
     addOrEditParent(type, cid) {
-		this.$refs.tabPage.addTab({
-			// 对应显示的模块
-			activeKey: type,
-			// 唯一标识
-			key: type,
-			// 页签名称
-			label: ({ edit1: "编辑分类", add1: "添加分类" })[type],
-			// 打开时事件
-			triggerEvent: () => {
-				
-				this.$nextTick(()=>{
-					this.formType = type
-					this.formVisible = true
-					this.addParentFormType = type;
-					this.addParentFormVisible = true;
-					if(type == 'edit1'){
-						this.editParentId = cid;
-						getClassifyDetail({categoryId: cid}).then(res => {
-						  this.addParentForm = {
-						    oneClassify: res.data.name,
-						    status: res.data.status,
-						    imgUrl: [{url: res.data.imgUrl}],
-						    sort: res.data.sortNum
-						  }
-						})
-					}
-				})
-			},
-			// 关闭时事件
-			closeEvent: () => {
-				this.cancelAddParentForm()
-			}
-		})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit1: '编辑分类', add1: '添加分类' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            this.addParentFormType = type
+            this.addParentFormVisible = true
+            if (type == 'edit1') {
+              this.editParentId = cid
+              getClassifyDetail({ categoryId: cid }).then(res => {
+                this.addParentForm = {
+                  oneClassify: res.data.name,
+                  status: res.data.status,
+                  imgUrl: [{ url: res.data.imgUrl }],
+                  sort: res.data.sortNum
+                }
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.cancelAddParentForm()
+        }
+      })
     },
 
     // 取消 新增编辑 一级分类
-    cancelAddParentForm(){
-      this.addParentFormVisible = false;
-      this.$refs?.addParentForm?.resetFields();
+    cancelAddParentForm() {
+      this.addParentFormVisible = false
+      this.$refs?.addParentForm?.resetFields()
     },
 
     // 提交 一级分类
     submitAddParentForm(cancel) {
-      this.$refs.addParentForm.validate((valid) => {
+      this.$refs.addParentForm.validate(valid => {
         if (valid) {
           let params = {
-			type: 5,
+            type: 5,
             name: this.addParentForm.oneClassify,
             imgUrl: this.addParentForm.imgUrl[0].url,
             status: this.addParentForm.status,
-            sortNum: this.addParentForm.sort,
+            sortNum: this.addParentForm.sort
           }
-          if(this.addParentFormType == 'edit1') {
-            params.categoryId = this.editParentId;
+          if (this.addParentFormType == 'edit1') {
+            params.categoryId = this.editParentId
             editClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('编辑成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('编辑成功')
             })
-          }else {
+          } else {
             addClassify(params).then(res => {
-				cancel('list')
-              this.cancelAddParentForm();
-              this.getList();
-              this.$successMsg('添加成功');
+              cancel('list')
+              this.cancelAddParentForm()
+              this.getList()
+              this.$successMsg('添加成功')
             })
           }
         }
@@ -242,9 +287,9 @@ export default {
 
     // 操作 - 删除
     handleDelete(id) {
-      deleteClassify({categoryId: id}).then(res => {
-        this.getList();
-        this.$successMsg();
+      deleteClassify({ categoryId: id }).then(res => {
+        this.getList()
+        this.$successMsg()
       })
     },
 
@@ -257,33 +302,30 @@ export default {
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png', 'gif'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png', 'gif']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/jpeg/png/gif文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/jpeg/png/gif文件!')
+        return false
       }
-    },
-
+    }
   }
-
 }
-
 </script>
 
-<style scoped lang="scss">
-</style>
+<style scoped lang="scss"></style>
 
 <style lang="scss">
-  .el-image-viewer__wrapper .el-icon-circle-close {
-    color: #ffffff !important;
-    font-size: 60px;
-  }
-  .el-table__row.expanded {
-    background: #f5f5f5;
-  }
+.el-image-viewer__wrapper .el-icon-circle-close {
+  color: #ffffff !important;
+  font-size: 60px;
+}
+.el-table__row.expanded {
+  background: #f5f5f5;
+}
 
-  th:first-child, th:last-child {
-    text-align: center !important;
-  }
+th:first-child,
+th:last-child {
+  text-align: center !important;
+}
 </style>

+ 2 - 2
src/views/mallManagement/setActivity/formModule.vue

@@ -88,8 +88,8 @@ export default {
                       <div class="redbordererr">
                         {row[column.columnAttributes.prop] ? (
                           <el-image
-                            src={row[column.columnAttributes.prop]}
-                            preview-src-list={[row[column.columnAttributes.prop]]}
+                            src={this.$showImgUrl(row[column.columnAttributes.prop])}
+                            preview-src-list={[this.$showImgUrl(row[column.columnAttributes.prop])]}
                             fit="fit"
                             style="width:80px;height:80px;"
                           />

+ 10 - 5
src/views/mallManagement/setActivity/index.vue

@@ -555,8 +555,8 @@ export default {
                                           <div>
                                             {item.option_files.map(v => (
                                               <el-image
-                                                src={v.url}
-                                                preview-src-list={[v.url]}
+                                                src={this.$showImgUrl(v.url)}
+                                                preview-src-list={[this.$showImgUrl(v.url)]}
                                                 fit="fit"
                                                 style="width:80px;height:80px;"
                                               />
@@ -576,8 +576,8 @@ export default {
                                           <div>
                                             {item.option_files.map(v => (
                                               <el-image
-                                                src={v.url}
-                                                preview-src-list={[v.url]}
+                                                src={this.$showImgUrl(v.url)}
+                                                preview-src-list={[this.$showImgUrl(v.url)]}
                                                 fit="fit"
                                                 style="width:80px;height:80px;"
                                               />
@@ -675,7 +675,12 @@ export default {
                 ? row.qrcode
                     .split(',')
                     .map(url => (
-                      <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
                     ))
                 : null}
             </div>

+ 1246 - 1073
src/views/mallManagement/tenancyManagement/tenancyOrder/detail.vue

@@ -1,1093 +1,1266 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" :content="title"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="box-card" v-if="formType != 0">
-			<div class="order-main">
-				<el-row>
-					<el-col :span="24">
-						<div class="order-main-title">
-							<span>订单编号:{{ formData.id }}</span>
-							<span>下单时间:{{ formData.createTime }}</span>
-						</div>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="10">
-						<div style="display: flex;">
-							<div>
-								<div class="order-main-status">
-									<span>{{ filterStatus(formData.status) }}</span>
-								</div>
-								<div class="order-main-opt-btn">
-									<el-button v-if="formData.status === 'WAIT'" type="primary" @click="submitOrder()"
-										style="margin-right: 10px">确定租赁</el-button>
-									<el-button v-if="formData.status === 'LEASE' || formData.status === 'OVER'" @click="isRecover = true" type="primary" slot="reference" style="margin-right: 10px">确认回收</el-button>
-									<el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder()"
-										v-if="formData.status === 'WAIT'">
-										<el-button slot="reference" type="info" plain
-											style="margin-right: 10px">取消订单</el-button>
-									</el-popconfirm>
-									<el-button v-if="formData.status === 'LEASE'" @click="isRepair = true" type="primary" style="margin-right: 10px">报修</el-button>
-									<el-button v-if="formData.status === 'LEASE' || formData.status === 'OVER'" @click="isRelet = true" type="primary" style="margin-right: 10px">续租</el-button>
-								</div>
-							</div>
-						</div>
-
-					</el-col>
-					<el-col :span="14" style="padding-top: 10px;">
-						<el-steps :active="formData.status == 'WAIT'?1:formData.status == 'LEASE'?2:formData.status == 'OVER'?3:formData.status == 'RECOVER'?5:0" align-center>
-							<el-step title="买家下单" :description="formData.createTime"></el-step>
-							<el-step title="商家确认" :description="formData.confirmTime ? formData.confirmTime : ''"></el-step>
-							<el-step title="租赁中" :description="formData.deliverTime ? formData.deliverTime : ''"></el-step>
-							<el-step title="已到期-待回收" :description="formData.overTime ? formData.overTime : ''"></el-step>
-							<el-step title="已到期-已回收" :description="formData.overTime ? formData.overTime : ''"></el-step>
-						</el-steps>
-					</el-col>
-				</el-row>
-			</div>
-		</el-card>
-		<el-card class="box-card">
-			<div slot="header" class="clearfix">
-				<span>客户信息</span>
-			</div>
-			<div class="mymain-container">
-				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small"
-					label-position="left">
-					<el-row :gutter="20" justify="start">
-						<el-col :span="8">
-							<el-form-item label="客户姓名" prop="userName" :required="true">
-								<el-input type="text" :disabled="formType!=0 && formData.status != 'WAIT'"
-									v-model="formData.userName" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="8">
-							<el-form-item label="客户联系电话" prop="userMobile" :required="true">
-								<zj-select v-model="formData.userInfo" blurNoMatchInputBorderColor="" :blurNoMatchText="true" :filter-method="userMobileInput" :disabled="formType!=0 && formData.status != 'WAIT'" value-key="userId" filterable @change="changeUser" @blur="userBlur" placeholder="请选择" style="width: 100%;">
-								    <zj-option
-								      v-for="item in userList"
-								      :key="item.userId"
-								      :label="item.mobile+'('+item.nickName+')'"
-								      :value="item">
-								    </zj-option>
-								  </zj-select>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="客户地址" class="is-required">
-								<el-row>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-select v-model="formData.provinceObj" :disabled="formType!=0 && formData.status != 'WAIT'" filterable value-key="id" placeholder="请选择"
-											@change="(val) => {
-												formData.provinceId = val.id
-												formData.province = val.name
-												formData.cityObj = null
-												formData.cityId = ''
-												formData.city = ''
-												formData.areaObj = null
-												formData.areaId = ''
-												formData.area = ''
-												formData.streetObj = null
-												formData.streetId = ''
-												formData.street = ''
-												this.lbsAmapRegion('cityList',val.id)
-											}">
-											<el-option v-for="(item,index) in provinceList" :key="index" :label="item.name" :value="item"></el-option>
-										</el-select>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-select v-model="formData.cityObj" :disabled="formType!=0 && formData.status != 'WAIT'" filterable value-key="id" placeholder="请选择"
-											@change="(val) => {
-												formData.cityId = val.id
-												formData.city = val.name
-												formData.areaObj = null
-												formData.areaId = ''
-												formData.area = ''
-												formData.streetObj = null
-												formData.streetId = ''
-												formData.street = ''
-												this.lbsAmapRegion('areaList',val.id)
-											}">
-											<el-option v-for="(item,index) in cityList" :key="index" :label="item.name" :value="item"></el-option>
-										</el-select>
-									</el-col>
-									<el-col :span="5" style="margin-right: 12px;">
-										<el-select v-model="formData.areaObj" :disabled="formType!=0 && formData.status != 'WAIT'" filterable value-key="id" placeholder="请选择"
-											@change="(val) => {
-												formData.areaId = val.id
-												formData.area = val.name
-												formData.streetObj = null
-												formData.streetId = ''
-												formData.street = ''
-												this.lbsAmapRegion('streetList',val.id)
-											}">
-											<el-option v-for="(item,index) in areaList" :key="index" :label="item.name" :value="item"></el-option>
-										</el-select>
-									</el-col>
-									<el-col :span="8">
-										<el-select v-model="formData.streetObj" :disabled="formType!=0 && formData.status != 'WAIT'" filterable value-key="id" placeholder="请选择"
-											@change="(val) => {
-												formData.streetId = val.id
-												formData.street = val.name
-											}">
-											<el-option v-for="(item,index) in streetList" :key="index" :label="item.name" :value="item"></el-option>
-										</el-select>
-									</el-col>
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="" prop="address">
-								<el-row :gutter="20">
-									<el-col :span="22">
-										<el-input type="text" v-model="formData.address"
-											:disabled="formType!=0 && formData.status != 'WAIT'"
-											placeholder="详细地址"></el-input>
-									</el-col>
-									<el-col :span="2">
-										<!-- <geographicalPosi :disabled="formType!=0 && formData.status != 'WAIT'"
+  <div class="s-page">
+    <el-page-header @back="goBack" :content="title"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="box-card" v-if="formType != 0">
+      <div class="order-main">
+        <el-row>
+          <el-col :span="24">
+            <div class="order-main-title">
+              <span>订单编号:{{ formData.id }}</span>
+              <span>下单时间:{{ formData.createTime }}</span>
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="10">
+            <div style="display: flex">
+              <div>
+                <div class="order-main-status">
+                  <span>{{ filterStatus(formData.status) }}</span>
+                </div>
+                <div class="order-main-opt-btn">
+                  <el-button
+                    v-if="formData.status === 'WAIT'"
+                    type="primary"
+                    @click="submitOrder()"
+                    style="margin-right: 10px"
+                    >确定租赁</el-button
+                  >
+                  <el-button
+                    v-if="formData.status === 'LEASE' || formData.status === 'OVER'"
+                    @click="isRecover = true"
+                    type="primary"
+                    slot="reference"
+                    style="margin-right: 10px"
+                    >确认回收</el-button
+                  >
+                  <el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder()" v-if="formData.status === 'WAIT'">
+                    <el-button slot="reference" type="info" plain style="margin-right: 10px">取消订单</el-button>
+                  </el-popconfirm>
+                  <el-button
+                    v-if="formData.status === 'LEASE'"
+                    @click="isRepair = true"
+                    type="primary"
+                    style="margin-right: 10px"
+                    >报修</el-button
+                  >
+                  <el-button
+                    v-if="formData.status === 'LEASE' || formData.status === 'OVER'"
+                    @click="isRelet = true"
+                    type="primary"
+                    style="margin-right: 10px"
+                    >续租</el-button
+                  >
+                </div>
+              </div>
+            </div>
+          </el-col>
+          <el-col :span="14" style="padding-top: 10px">
+            <el-steps
+              :active="
+                formData.status == 'WAIT'
+                  ? 1
+                  : formData.status == 'LEASE'
+                  ? 2
+                  : formData.status == 'OVER'
+                  ? 3
+                  : formData.status == 'RECOVER'
+                  ? 5
+                  : 0
+              "
+              align-center
+            >
+              <el-step title="买家下单" :description="formData.createTime"></el-step>
+              <el-step title="商家确认" :description="formData.confirmTime ? formData.confirmTime : ''"></el-step>
+              <el-step title="租赁中" :description="formData.deliverTime ? formData.deliverTime : ''"></el-step>
+              <el-step title="已到期-待回收" :description="formData.overTime ? formData.overTime : ''"></el-step>
+              <el-step title="已到期-已回收" :description="formData.overTime ? formData.overTime : ''"></el-step>
+            </el-steps>
+          </el-col>
+        </el-row>
+      </div>
+    </el-card>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>客户信息</span>
+      </div>
+      <div class="mymain-container">
+        <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20" justify="start">
+            <el-col :span="8">
+              <el-form-item label="客户姓名" prop="userName" :required="true">
+                <el-input
+                  type="text"
+                  :disabled="formType != 0 && formData.status != 'WAIT'"
+                  v-model="formData.userName"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="客户联系电话" prop="userMobile" :required="true">
+                <zj-select
+                  v-model="formData.userInfo"
+                  blurNoMatchInputBorderColor=""
+                  :blurNoMatchText="true"
+                  :filter-method="userMobileInput"
+                  :disabled="formType != 0 && formData.status != 'WAIT'"
+                  value-key="userId"
+                  filterable
+                  @change="changeUser"
+                  @blur="userBlur"
+                  placeholder="请选择"
+                  style="width: 100%"
+                >
+                  <zj-option
+                    v-for="item in userList"
+                    :key="item.userId"
+                    :label="item.mobile + '(' + item.nickName + ')'"
+                    :value="item"
+                  >
+                  </zj-option>
+                </zj-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="客户地址" class="is-required">
+                <el-row>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-select
+                      v-model="formData.provinceObj"
+                      :disabled="formType != 0 && formData.status != 'WAIT'"
+                      filterable
+                      value-key="id"
+                      placeholder="请选择"
+                      @change="
+                        val => {
+                          formData.provinceId = val.id
+                          formData.province = val.name
+                          formData.cityObj = null
+                          formData.cityId = ''
+                          formData.city = ''
+                          formData.areaObj = null
+                          formData.areaId = ''
+                          formData.area = ''
+                          formData.streetObj = null
+                          formData.streetId = ''
+                          formData.street = ''
+                          this.lbsAmapRegion('cityList', val.id)
+                        }
+                      "
+                    >
+                      <el-option
+                        v-for="(item, index) in provinceList"
+                        :key="index"
+                        :label="item.name"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-select
+                      v-model="formData.cityObj"
+                      :disabled="formType != 0 && formData.status != 'WAIT'"
+                      filterable
+                      value-key="id"
+                      placeholder="请选择"
+                      @change="
+                        val => {
+                          formData.cityId = val.id
+                          formData.city = val.name
+                          formData.areaObj = null
+                          formData.areaId = ''
+                          formData.area = ''
+                          formData.streetObj = null
+                          formData.streetId = ''
+                          formData.street = ''
+                          this.lbsAmapRegion('areaList', val.id)
+                        }
+                      "
+                    >
+                      <el-option
+                        v-for="(item, index) in cityList"
+                        :key="index"
+                        :label="item.name"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-col>
+                  <el-col :span="5" style="margin-right: 12px">
+                    <el-select
+                      v-model="formData.areaObj"
+                      :disabled="formType != 0 && formData.status != 'WAIT'"
+                      filterable
+                      value-key="id"
+                      placeholder="请选择"
+                      @change="
+                        val => {
+                          formData.areaId = val.id
+                          formData.area = val.name
+                          formData.streetObj = null
+                          formData.streetId = ''
+                          formData.street = ''
+                          this.lbsAmapRegion('streetList', val.id)
+                        }
+                      "
+                    >
+                      <el-option
+                        v-for="(item, index) in areaList"
+                        :key="index"
+                        :label="item.name"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-col>
+                  <el-col :span="8">
+                    <el-select
+                      v-model="formData.streetObj"
+                      :disabled="formType != 0 && formData.status != 'WAIT'"
+                      filterable
+                      value-key="id"
+                      placeholder="请选择"
+                      @change="
+                        val => {
+                          formData.streetId = val.id
+                          formData.street = val.name
+                        }
+                      "
+                    >
+                      <el-option
+                        v-for="(item, index) in streetList"
+                        :key="index"
+                        :label="item.name"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-col>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="" prop="address">
+                <el-row :gutter="20">
+                  <el-col :span="22">
+                    <el-input
+                      type="text"
+                      v-model="formData.address"
+                      :disabled="formType != 0 && formData.status != 'WAIT'"
+                      placeholder="详细地址"
+                    ></el-input>
+                  </el-col>
+                  <el-col :span="2">
+                    <!-- <geographicalPosi :disabled="formType!=0 && formData.status != 'WAIT'"
 											:formData="this.formData" @selectPosi="selectAddress" /> -->
-									</el-col>
-								</el-row>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="备注">
-								<el-input type="textarea" :rows="4" v-model="formData.remark"
-									:disabled="formType!=0 && formData.status != 'WAIT'" placeholder="请输入"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :span="24">
-							<el-form-item label="租赁合同" prop="fileUrl" :rules="[{ required: true, message: `请上传租赁合同`, trigger: 'change' }]">
-								<ImageUpload :fileList="formData.fileUrl" :limit="1" :isEdit="formType==0 || formData.status == 'WAIT'" />
-							</el-form-item>
-						</el-col>
-						<template v-if="formData.status == 'RECOVER'">
-							<el-col :span="8">
-								<el-form-item label="回收操作人" prop="recoverBy">
-									<el-input type="text" disabled v-model="formData.recoverBy" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-							<el-col :span="8">
-								<el-form-item label="回收操作时间" prop="recoverTime">
-									<el-input type="text" disabled v-model="formData.recoverTime" placeholder="请输入"></el-input>
-								</el-form-item>
-							</el-col>
-						</template>
-					</el-row>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formType == 0">
-			<div slot="header" class="clearfix">
-				<span>商品信息</span>
-			</div>
-			<el-button size="small" v-if="formType==0" type="primary" @click="add()">添加</el-button>
-			<div class="table">
-				<el-form ref="formData1" :model="formData1" label-width="0" size="small" label-position="left">
-					<el-table :data="formData1.dataList" element-loading-text="Loading" border fit highlight-current-rowstripe>
-						<el-table-column prop="categoryName" align="center" label="*商品分类">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.categoryName'">
-									<el-input type="text" v-model="scope.row.categoryName" disabled
-										placeholder="请选择分类"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column label="*商品名称" align="center">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.goods'"
-									:rules="[{ required: true, message: `请选择商品`, trigger: 'change' }]">
-									<el-select v-model="scope.row.goods" @change="changeGoods($event,scope.row)"
-										value-key="id" :disabled="isEdit != scope.$index || formType == 2"
-										placeholder="请选择" style="width: 100%;">
-										<el-option v-for="item in goodsList" :key="item.id" :label="item.name"
-											:value="item">
-										</el-option>
-									</el-select>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="goodsUnit" align="center" label="单位"></el-table-column>
-						<el-table-column prop="" align="center" label="*数量">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.qty'"
-									:rules="[{ required: true, message: `请输入数量`, trigger: 'blur' }]">
-									<el-input type="number" v-model="scope.row.qty"
-										:disabled="isEdit != scope.$index || formType == 2"
-										placeholder="请输入"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="depositPrice" align="center" label="订金"></el-table-column>
-						<el-table-column prop="leasePrice" align="center" label="租价"></el-table-column>
-						<el-table-column prop="startDate" align="center" label="*起租日期">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.startDate'" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-									<el-date-picker
-									      v-model="scope.row.startDate"
-									      type="date"
-										  @change="(e)=>{
-											  getPrice(scope.row)
-										  }"
-										  value-format="yyyy-MM-dd HH:mm:ss"
-									      placeholder="选择日期">
-									</el-date-picker>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="endDate" align="center" label="*到期日期">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.endDate'" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-									<el-date-picker
-									      v-model="scope.row.endDate"
-									      type="date"
-										  @change="(e)=>{
-										  	getPrice(scope.row)
-										  }"
-										  value-format="yyyy-MM-dd HH:mm:ss"
-									      placeholder="选择日期">
-									</el-date-picker>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="depositAmount" align="center" label="*押金">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.depositAmount'"
-									:rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]">
-									<el-input type="number" v-model="scope.row.depositAmount"placeholder="请输入"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="renewalPrice" align="center" label="*续期单价">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.renewalPrice'"
-									:rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]">
-									<el-input type="number" v-model="scope.row.renewalPrice" @input="(e)=>{
-											  getPrice(scope.row)
-										  }" placeholder="请输入"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="leaseAmount" align="center" label="总租金"></el-table-column>
-						<el-table-column label="操作" align="right" width="140">
-							<template slot-scope="scope" v-if="formType != 2">
-								<el-button size="mini" type="primary" v-if="scope.$index != isEdit"
-									@click="isEdit = scope.$index">编辑</el-button>
-								<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
-							</template>
-						</el-table-column>
-					</el-table>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formType != 0">
-			<div class="table">
-				<el-form ref="formData3" :model="formData3" label-width="0" size="small" label-position="left">
-					<el-table :data="formData3.dataList" element-loading-text="Loading" border fit highlight-current-row
-						stripe>
-						<el-table-column align="center" label="*商品分类" width="300">
-							<template slot-scope="scope">
-								<div style="display: flex">
-									<div class="image">
-										<img :src="scope.row.categoryUrl" style="height:80px;width: 80px;">
-									</div>
-									<div class="main"
-										style="display: flex;justify-content: center;flex-direction: column;">
-										<span>{{ scope.row.goodsLeaseName }}</span>
-										<span>x{{ scope.row.qty }}</span>
-									</div>
-								</div>
-							</template>
-						</el-table-column>
-						<el-table-column prop="depositPrice" align="center" label="订金"></el-table-column>
-						<el-table-column prop="leasePrice" align="center" label="租价"></el-table-column>
-						<el-table-column prop="qty" align="center" label="数量"></el-table-column>
-						<el-table-column prop="startDate" align="center" label="*起租日期">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.startDate'" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-									<el-date-picker
-									      v-model="scope.row.startDate"
-									      type="date"
-										  @change="(e)=>{
-											  getPrice(scope.row)
-										  }"
-										  :disabled="formData.status != 'WAIT'"
-										  value-format="yyyy-MM-dd HH:mm:ss"
-									      placeholder="选择日期">
-									</el-date-picker>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="endDate" align="center" label="*到期日期">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.endDate'" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-									<el-date-picker
-									      v-model="scope.row.endDate"
-									      type="date"
-										  @change="(e)=>{
-										  	getPrice(scope.row)
-										  }"
-										  :disabled="formData.status != 'WAIT'"
-										  value-format="yyyy-MM-dd HH:mm:ss"
-									      placeholder="选择日期">
-									</el-date-picker>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="realEndDate" align="center" label="实际到期日期">
-							<template slot-scope="scope">
-								{{scope.row.realEndDate?scope.row.realEndDate.substring(0,10):''}}
-							</template>
-						</el-table-column>
-						<el-table-column prop="depositAmount" align="center" label="*押金">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.depositAmount'"
-									:rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]">
-									<el-input type="number" v-model="scope.row.depositAmount" :disabled="formData.status != 'WAIT'"
-										placeholder="请输入"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="" align="center" label="*续期单价">
-							<template slot-scope="scope">
-								<el-form-item :prop="'dataList.' + scope.$index + '.renewalPrice'"
-									:rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]">
-									<el-input type="number" v-model="scope.row.renewalPrice" @input="(e)=>{
-											  getPrice(scope.row)
-										  }"
-										:disabled="formData.status != 'WAIT'" placeholder="请输入"></el-input>
-								</el-form-item>
-							</template>
-						</el-table-column>
-						<el-table-column prop="leaseAmount" align="center" label="总租金"></el-table-column>
-						<el-table-column prop="renewalLeaseAmount" align="center" label="续期租金"></el-table-column>
-					</el-table>
-				</el-form>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formType != 0">
-			<div slot="header" class="clearfix">
-				<span>租赁记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="formData.records" element-loading-text="Loading" border fit highlight-current-row
-					stripe>
-					<el-table-column prop="status" label="租赁类型" align="center">
-						<template slot-scope="scope">
-							{{scope.row.orderType == 'FIRST'? '初次租赁':'续租'}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="payValue" label="订金" align="center"></el-table-column>
-					<el-table-column prop="" align="center" label="租赁开始时间">
-						<template slot-scope="scope">
-							{{scope.row.startDate?scope.row.startDate.substring(0,10):''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="" align="center" label="租赁结束时间">
-						<template slot-scope="scope">
-							{{scope.row.endDate?scope.row.endDate.substring(0,10):''}}
-						</template>
-					</el-table-column>
-					<el-table-column prop="createBy" align="center" label="操作人"></el-table-column>
-					<el-table-column prop="createTime" align="center" label="操作时间"></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<el-card class="box-card" v-if="formType != 0">
-			<div slot="header" class="clearfix">
-				<span>报修记录</span>
-			</div>
-			<div class="table">
-				<el-table :data="formData.orderBases" element-loading-text="Loading" border fit highlight-current-row
-					stripe>
-					<el-table-column prop="id" label="报修单号" align="center"></el-table-column>
-					<el-table-column prop="createDate" label="提交时间" align="center"></el-table-column>
-					<el-table-column prop="appointmentTime" label="上门时间" align="center"></el-table-column>
-					<el-table-column prop="overDate" label="完工时间" align="center"></el-table-column>
-					<el-table-column prop="updateBy" align="center" label="操作人"></el-table-column>
-					<el-table-column prop="updateTime" align="center" label="操作时间"></el-table-column>
-				</el-table>
-			</div>
-		</el-card>
-		<div class="page-footer">
-			<div class="footer">
-				<el-button v-if="formType == 0" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button size="small" type="info" @click="goBack">返回</el-button>
-			</div>
-		</div>
-		<el-dialog title="报修" :visible.sync="isRepair" width="30%" :close-on-click-modal="false">
-		  <el-form ref="repairForm" :model="repairForm" label-position="left">
-		    <el-form-item label="上门时间" prop="date" :rules="[{ required: true, message: `请选择上门时间`, trigger: 'blur' }]">
-		      <el-date-picker
-		              v-model="repairForm.date"
-		              type="date"
-						value-format="yyyy-MM-dd"
-		              placeholder="选择日期">
-		      </el-date-picker>
-		    </el-form-item>
-		  </el-form>
-		  <div slot="footer" class="dialog-footer">
-		    <el-button @click="isRepair = false">取 消</el-button>
-		    <el-button type="primary" @click="confirmRepair()">确 定</el-button>
-		  </div>
-		</el-dialog>
-		<el-dialog title="续租" :visible.sync="isRelet" width="30%" :close-on-click-modal="false">
-		  <el-form ref="reletForm" :model="reletForm" label-position="left">
-		    <el-form-item label="实际到期日期" prop="date" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-		      <el-date-picker
-		            v-model="reletForm.date"
-		            type="date"
-					value-format="yyyy-MM-dd"
-		            placeholder="选择日期">
-				</el-date-picker>
-		    </el-form-item>
-		  </el-form>
-		  <div slot="footer" class="dialog-footer">
-		    <el-button @click="isRelet = false">取 消</el-button>
-		    <el-button type="primary" @click="confirmRelet">确 定</el-button>
-		  </div>
-		</el-dialog>
-		<el-dialog title="确定回收" :visible.sync="isRecover" width="30%" :close-on-click-modal="false">
-		  <el-form ref="recoverForm" :model="recoverForm" label-position="left">
-		    <el-form-item label="实际到期日期" prop="date" :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]">
-		      <el-date-picker
-		            v-model="recoverForm.date"
-		            type="date"
-					value-format="yyyy-MM-dd"
-		            placeholder="选择日期">
-				</el-date-picker>
-		    </el-form-item>
-		  </el-form>
-		  <div slot="footer" class="dialog-footer">
-		    <el-button @click="isRecover = false">取 消</el-button>
-		    <el-button type="primary" @click="confirmRecover">确 定</el-button>
-		  </div>
-		</el-dialog>
-	</div>
+                  </el-col>
+                </el-row>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  v-model="formData.remark"
+                  :disabled="formType != 0 && formData.status != 'WAIT'"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                label="租赁合同"
+                prop="fileUrl"
+                :rules="[{ required: true, message: `请上传租赁合同`, trigger: 'change' }]"
+              >
+                <ImageUpload
+                  :fileList="formData.fileUrl"
+                  :limit="1"
+                  :isEdit="formType == 0 || formData.status == 'WAIT'"
+                />
+              </el-form-item>
+            </el-col>
+            <template v-if="formData.status == 'RECOVER'">
+              <el-col :span="8">
+                <el-form-item label="回收操作人" prop="recoverBy">
+                  <el-input type="text" disabled v-model="formData.recoverBy" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="回收操作时间" prop="recoverTime">
+                  <el-input type="text" disabled v-model="formData.recoverTime" placeholder="请输入"></el-input>
+                </el-form-item>
+              </el-col>
+            </template>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formType == 0">
+      <div slot="header" class="clearfix">
+        <span>商品信息</span>
+      </div>
+      <el-button size="small" v-if="formType == 0" type="primary" @click="add()">添加</el-button>
+      <div class="table">
+        <el-form ref="formData1" :model="formData1" label-width="0" size="small" label-position="left">
+          <el-table :data="formData1.dataList" element-loading-text="Loading" border fit highlight-current-rowstripe>
+            <el-table-column prop="categoryName" align="center" label="*商品分类">
+              <template slot-scope="scope">
+                <el-form-item :prop="'dataList.' + scope.$index + '.categoryName'">
+                  <el-input type="text" v-model="scope.row.categoryName" disabled placeholder="请选择分类"></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="*商品名称" align="center">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.goods'"
+                  :rules="[{ required: true, message: `请选择商品`, trigger: 'change' }]"
+                >
+                  <el-select
+                    v-model="scope.row.goods"
+                    @change="changeGoods($event, scope.row)"
+                    value-key="id"
+                    :disabled="isEdit != scope.$index || formType == 2"
+                    placeholder="请选择"
+                    style="width: 100%"
+                  >
+                    <el-option v-for="item in goodsList" :key="item.id" :label="item.name" :value="item"> </el-option>
+                  </el-select>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="goodsUnit" align="center" label="单位"></el-table-column>
+            <el-table-column prop="" align="center" label="*数量">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.qty'"
+                  :rules="[{ required: true, message: `请输入数量`, trigger: 'blur' }]"
+                >
+                  <el-input
+                    type="number"
+                    v-model="scope.row.qty"
+                    :disabled="isEdit != scope.$index || formType == 2"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="depositPrice" align="center" label="订金"></el-table-column>
+            <el-table-column prop="leasePrice" align="center" label="租价"></el-table-column>
+            <el-table-column prop="startDate" align="center" label="*起租日期">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.startDate'"
+                  :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+                >
+                  <el-date-picker
+                    v-model="scope.row.startDate"
+                    type="date"
+                    @change="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="endDate" align="center" label="*到期日期">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.endDate'"
+                  :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+                >
+                  <el-date-picker
+                    v-model="scope.row.endDate"
+                    type="date"
+                    @change="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="depositAmount" align="center" label="*押金">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.depositAmount'"
+                  :rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]"
+                >
+                  <el-input type="number" v-model="scope.row.depositAmount" placeholder="请输入"></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="renewalPrice" align="center" label="*续期单价">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.renewalPrice'"
+                  :rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]"
+                >
+                  <el-input
+                    type="number"
+                    v-model="scope.row.renewalPrice"
+                    @input="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="leaseAmount" align="center" label="总租金"></el-table-column>
+            <el-table-column label="操作" align="right" width="140">
+              <template slot-scope="scope" v-if="formType != 2">
+                <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index"
+                  >编辑</el-button
+                >
+                <el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formType != 0">
+      <div class="table">
+        <el-form ref="formData3" :model="formData3" label-width="0" size="small" label-position="left">
+          <el-table :data="formData3.dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+            <el-table-column align="center" label="*商品分类" width="300">
+              <template slot-scope="scope">
+                <div style="display: flex">
+                  <div class="image">
+                    <img :src="$showImgUrl(scope.row.categoryUrl)" style="height: 80px; width: 80px" />
+                  </div>
+                  <div class="main" style="display: flex; justify-content: center; flex-direction: column">
+                    <span>{{ scope.row.goodsLeaseName }}</span>
+                    <span>x{{ scope.row.qty }}</span>
+                  </div>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="depositPrice" align="center" label="订金"></el-table-column>
+            <el-table-column prop="leasePrice" align="center" label="租价"></el-table-column>
+            <el-table-column prop="qty" align="center" label="数量"></el-table-column>
+            <el-table-column prop="startDate" align="center" label="*起租日期">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.startDate'"
+                  :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+                >
+                  <el-date-picker
+                    v-model="scope.row.startDate"
+                    type="date"
+                    @change="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    :disabled="formData.status != 'WAIT'"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="endDate" align="center" label="*到期日期">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.endDate'"
+                  :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+                >
+                  <el-date-picker
+                    v-model="scope.row.endDate"
+                    type="date"
+                    @change="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    :disabled="formData.status != 'WAIT'"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="realEndDate" align="center" label="实际到期日期">
+              <template slot-scope="scope">
+                {{ scope.row.realEndDate ? scope.row.realEndDate.substring(0, 10) : '' }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="depositAmount" align="center" label="*押金">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.depositAmount'"
+                  :rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]"
+                >
+                  <el-input
+                    type="number"
+                    v-model="scope.row.depositAmount"
+                    :disabled="formData.status != 'WAIT'"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="" align="center" label="*续期单价">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'dataList.' + scope.$index + '.renewalPrice'"
+                  :rules="[{ required: true, message: `请输入押金`, trigger: 'blur' }]"
+                >
+                  <el-input
+                    type="number"
+                    v-model="scope.row.renewalPrice"
+                    @input="
+                      e => {
+                        getPrice(scope.row)
+                      }
+                    "
+                    :disabled="formData.status != 'WAIT'"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column prop="leaseAmount" align="center" label="总租金"></el-table-column>
+            <el-table-column prop="renewalLeaseAmount" align="center" label="续期租金"></el-table-column>
+          </el-table>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formType != 0">
+      <div slot="header" class="clearfix">
+        <span>租赁记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="formData.records" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="status" label="租赁类型" align="center">
+            <template slot-scope="scope">
+              {{ scope.row.orderType == 'FIRST' ? '初次租赁' : '续租' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="payValue" label="订金" align="center"></el-table-column>
+          <el-table-column prop="" align="center" label="租赁开始时间">
+            <template slot-scope="scope">
+              {{ scope.row.startDate ? scope.row.startDate.substring(0, 10) : '' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="" align="center" label="租赁结束时间">
+            <template slot-scope="scope">
+              {{ scope.row.endDate ? scope.row.endDate.substring(0, 10) : '' }}
+            </template>
+          </el-table-column>
+          <el-table-column prop="createBy" align="center" label="操作人"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="操作时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <el-card class="box-card" v-if="formType != 0">
+      <div slot="header" class="clearfix">
+        <span>报修记录</span>
+      </div>
+      <div class="table">
+        <el-table :data="formData.orderBases" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column prop="id" label="报修单号" align="center"></el-table-column>
+          <el-table-column prop="createDate" label="提交时间" align="center"></el-table-column>
+          <el-table-column prop="appointmentTime" label="上门时间" align="center"></el-table-column>
+          <el-table-column prop="overDate" label="完工时间" align="center"></el-table-column>
+          <el-table-column prop="updateBy" align="center" label="操作人"></el-table-column>
+          <el-table-column prop="updateTime" align="center" label="操作时间"></el-table-column>
+        </el-table>
+      </div>
+    </el-card>
+    <div class="page-footer">
+      <div class="footer">
+        <el-button v-if="formType == 0" size="small" type="primary" @click="submit()">提交</el-button>
+        <el-button size="small" type="info" @click="goBack">返回</el-button>
+      </div>
+    </div>
+    <el-dialog title="报修" :visible.sync="isRepair" width="30%" :close-on-click-modal="false">
+      <el-form ref="repairForm" :model="repairForm" label-position="left">
+        <el-form-item
+          label="上门时间"
+          prop="date"
+          :rules="[{ required: true, message: `请选择上门时间`, trigger: 'blur' }]"
+        >
+          <el-date-picker v-model="repairForm.date" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isRepair = false">取 消</el-button>
+        <el-button type="primary" @click="confirmRepair()">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="续租" :visible.sync="isRelet" width="30%" :close-on-click-modal="false">
+      <el-form ref="reletForm" :model="reletForm" label-position="left">
+        <el-form-item
+          label="实际到期日期"
+          prop="date"
+          :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+        >
+          <el-date-picker v-model="reletForm.date" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isRelet = false">取 消</el-button>
+        <el-button type="primary" @click="confirmRelet">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="确定回收" :visible.sync="isRecover" width="30%" :close-on-click-modal="false">
+      <el-form ref="recoverForm" :model="recoverForm" label-position="left">
+        <el-form-item
+          label="实际到期日期"
+          prop="date"
+          :rules="[{ required: true, message: `请选择日期`, trigger: 'blur' }]"
+        >
+          <el-date-picker v-model="recoverForm.date" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isRecover = false">取 消</el-button>
+        <el-button type="primary" @click="confirmRecover">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import {
-		lbsAmapRegion
-	} from '@/api/common.js'
-	import geographicalPosi from '@/components/geographicalPosi/index.vue'
-	import ImageUpload from '@/components/file-upload'
-	import {
-		getGoods,
-		getDetail,
-		add,confirmOrder,confirmRecover,confirmRelet,confirmRepair,getTypeList,getUserList,getPrice
-	} from "@/api/tenancyOrder";
-	export default {
-		components: {
-			geographicalPosi,
-			ImageUpload
-		},
-		props: ['id', 'title', 'formType'],
-		data() {
-			return {
-				formData1: {
-					dataList: [],
-				},
-				formData3: {
-					dataList: []
-				},
-				repairForm: {
-					date: ''
-				},
-				reletForm: {
-					date: ''
-				},
-				recoverForm: {
-					date: ''
-				},
-				goodsList: [],
-				userList: [],
-				is_submit: true,
-				isRelet: false,
-				isRepair: false,
-				isRecover: false,
-				formData: {
-					userInfo: null,
-					userName: '',
-					userId: '',
-					userMobile: '',
-					remark: '',
-					provinceObj: null,
-					province: '',
-					provinceId: '',
-					cityObj: null,
-					city: '',
-					cityId: '',
-					areaObj: null,
-					area: '',
-					areaId: '',
-					streetObj: null,
-					street: '',
-					streetId: '',
-					address: '',
-					lat: '',
-					lng: '',
-					records: [],
-					fileUrl: []
-				},
-				provinceList: [],
-				cityList: [],
-				areaList: [],
-				streetList: [],
-				isEdit: 0,
-				timer: '',
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				rules: {
-					address: [{
-						required: true,
-						message: '请选择客户地址',
-						trigger: 'change'
-					}],
-					userMobile: [{
-							required: true,
-							message: '请输入客户电话',
-							trigger: 'blur'
-						},
-						{
-							required: true,
-							message: '请输入客户电话',
-							trigger: 'change'
-						},
-						{
-							pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
-							message: '电话号码格式不正确',
-							trigger: 'blur'
-						},
-						,
-						{
-							pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
-							message: '电话号码格式不正确',
-							trigger: 'change'
-						}
-					],
-					userName: [{
-							required: true,
-							message: '请输入客户姓名',
-							trigger: 'blur'
-						},
-						{
-							required: true,
-							message: '请输入客户姓名',
-							trigger: 'change'
-						},
-					]
-				},
-				rules1: {
-					price: [{
-						pattern: /^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/,
-						message: '请输入大于0的数字',
-						trigger: 'blur'
-					}],
-				},
-				typeId: ''
-			};
-		},
-		computed: {
-			filterStatus() {
-				return function(type) {
-					let status = {
-						WAIT: '等待商家确认',
-						WAIT_START: '待开始',
-						LEASE: '租赁中',
-						OVER: '已过期-待回收',
-						RECOVER: '已过期-已回收',
-					}
-					return status[type]
-				}
-			}
-		},
-		created() {
-			if (this.id) {
-				this.getDetail()
-			}
-			this.lbsAmapRegion('provinceList',0)
-			this.getGoods()
-			this.getTypeList()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.$emit('back');
-			},
-			getDetail() {
-				getDetail({
-					id: this.id
-				}).then(res => {
-					this.formData = {
-						...res.data,
-						address: res.data.userAddress,
-						fileUrl: res.data.fileUrl?[{url: res.data.fileUrl}]:[],
-						provinceObj: {id: res.data.provinceId},
-						cityObj: {id: res.data.cityId},
-						areaObj: {id: res.data.areaId},
-						streetObj: {id: res.data.streetId},
-						userInfo: (res.data.userId && res.data.payType=="LINE")?{userId: res.data.userId,userMobile: res.data.userMobile,userName: res.data.userName}:res.data.userMobile
-					}
-					this.formData3.dataList = res.data.items
-					this.getinitlbslist()
-					this.getUserList()
-				})
-			},
-			getGoods() {
-				getGoods({
-					pageNum: 1,
-					pageSize: -1,
-					status: true
-				}).then(res => {
-					this.goodsList = res.data.records
-				})
-			},
-			getPrice(item){
-				if(!item.startDate || !item.endDate){
-					return false
-				}
-				getPrice({
-					startDate: item.startDate,
-					endDate: item.endDate,
-					isRenewal: (this.formData.status == 'WAIT' || !this.formData.status)?false:true,
-					price: (this.formData.status == 'WAIT' || !this.formData.status)?item.leasePrice:item.renewalPrice,
-					qty: item.qty,
-				}).then(res => {
-					if(this.formData.status == 'WAIT' || !this.formData.status){
-						item.leaseAmount = res.data
-					}else{
-						item.renewalLeaseAmount = (res.data*100 + this.formData.totalAmount*100)/100
-					}
-				})
-			},
-			getUserList(value){
-				getUserList({
-					pageNum: 1,
-					pageSize: -1,
-					params: [{param: "a.mobile", compare: "like", value}]
-				}).then(res => {
-					this.userList = res.data.records
-				})
-			},
-			userBlur(e){
-				this.formData.userMobile = e.target.value
-				this.formData.userInfo = e.target.value
-				this.$forceUpdate()
-			},
-			changeUser(e){
-				this.formData.userMobile = e.mobile
-				this.formData.userName = e.nickName
-				this.formData.userId = e.userId
-			},
-			changeGoods(e, item) {
-				item.categoryId = e.categoryId
-				item.categoryName = e.categoryName
-				item.categoryUrl = e.categoryUrl
-				item.goodsLeaseName = e.name
-				item.goodsLeaseId = e.id
-				item.goodsUnit = e.unit
-				item.depositPrice = e.depositPrice
-				item.leasePrice = e.leasePrice
-			},
-			userMobileInput(e){
-				if(e && e.length > 3){
-					this.getUserList(e)
-				}
-			},
-			add() {
-				this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						console.log(111)
-						if (this.formData1.dataList.length != 0) {
-							this.isEdit = 0
-						}
-						this.formData1.dataList.unshift({
-							goods: null,
-							categoryId: '',
-							categoryName: '',
-							categoryUrl: '',
-							qty: '',
-							goodsLeaseName: '',
-							goodsLeaseId: '',
-							goodsUnit: '',
-							depositPrice: null,
-							leasePrice: null,
-							startDate: '',
-							endDate: '',
-							realEndDate: '',
-							depositAmount: null,
-							renewalPrice: null,
-							leaseAmount: null,
-						})
-					}
-				})
-			},
-			del(index) {
-				if (index <= 1) {
-					this.isEdit == 0
-				} else {
-					this.isEdit -= 1
-				}
-				this.formData1.dataList.splice(index, 1)
-			},
-			submit() {
-				const that = this
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						if (this.formData1.dataList.length == 0) {
-							return this.$message.warning('请添加商品信息!')
-						} else {
-							this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
-								if (valid) {
-									add({
-										userId: this.formData.userId,
-										userName: this.formData.userName,
-										userMobile: this.formData.userMobile,
-										fileUrl: this.formData.fileUrl.length > 0 ? this.formData.fileUrl[0].url : '',
-										items: this.formData1.dataList,
-										remark: this.formData.remark,
-										province: this.formData.province,
-										provinceId: this.formData.provinceId,
-										city: this.formData.city,
-										cityId: this.formData.cityId,
-										area: this.formData.area,
-										areaId: this.formData.areaId,
-										street: this.formData.street,
-										streetId: this.formData.streetId,
-										userAddress: this.formData.address,
-										lat: this.formData.lat,
-										lng: this.formData.lng,
-									}).then(res => {
-										if (res.code == 200) {
-											this.$message.success('提交成功!')
-											this.goBack()
-										}
-									})
-								}
-							})
-						}
-					}
-				})
-			},
-			//确定租赁
-			submitOrder(){
-				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						this.$refs.formData3.validate((valid, invalidFields, errLabels) => {
-							if (valid) {
-								confirmOrder({
-									userName: this.formData.userName,
-									userMobile: this.formData.userMobile,
-									fileUrl: this.formData.fileUrl.length > 0 ? this.formData.fileUrl[0].url : '',
-									items: this.formData3.dataList,
-									remark: this.formData.remark,
-									province: this.formData.province,
-									provinceId: this.formData.provinceId,
-									city: this.formData.city,
-									cityId: this.formData.cityId,
-									area: this.formData.area,
-									areaId: this.formData.areaId,
-									street: this.formData.street,
-									streetId: this.formData.streetId,
-									userAddress: this.formData.address,
-									lat: this.formData.lat,
-									lng: this.formData.lng,
-									id: this.formData.id
-								}).then(res => {
-									if (res.code == 200) {
-										this.$message.success('提交成功!')
-										this.getDetail()
-									}
-								})
-							}
-						})
-					}
-				})
-			},
-			//取消订单
-			cancelOrder(){
-				cancelOrder({
-					id: this.id
-				}).then(res => {
-					if(res.code == 200){
-						this.$message.success('取消订单成功!')
-						this.getDetail();
-					}
-				})
-			},
-			getTypeList(){
-				getTypeList({
-					pageNum: 1,
-					pageSize: -1
-				}).then(res => {
-					if(res.code == 200){
-						res.data.records.forEach(item=>{
-							if(item.orderType == 'REPAIR'){
-								this.typeId = item.id
-							}
-						})
-					}
-				})
-			},
-			//报修
-			confirmRepair(){
-				let productList = [{
-					mainId: this.formData.items[0].categoryId,
-					mainName: this.formData.items[0].categoryName,
-					num: this.formData.items[0].qty,
-					imgUrl: this.formData.items[0].categoryUrl
-				}]
-				
-				this.$refs.repairForm.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						confirmRepair({
-							companyWechatId: this.formData.companyWechatId,
-							appointmentTime: this.repairForm.date + ' 00:00:00',
-							saleOrderId: this.id,
-							orderSmallType: this.typeId,
-							province: this.formData.province,
-							provinceId: this.formData.provinceId,
-							city: this.formData.city,
-							cityId: this.formData.cityId,
-							area: this.formData.area,
-							areaId: this.formData.areaId,
-							street: this.formData.street,
-							streetId: this.formData.streetId,
-							address: this.formData.address,
-							orderProducts: productList,
-							isZl: true
-						}).then(res => {
-							if (res.code == 200) {
-								this.isRepair = false
-								this.$message.success('报修成功!')
-								this.getDetail()
-							}
-						})
-					}
-				})
-			},
-			//确认续租
-			confirmRelet(){
-				this.$refs.reletForm.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						confirmRelet({
-							RealEndDate: this.reletForm.date + ' 00:00:00',
-							id: this.id,
-						}).then(res => {
-							if (res.code == 200) {
-								this.isRelet = false
-								this.$message.success('确认续租成功!')
-								this.getDetail()
-							}
-						})
-					}
-				})
-			},
-			//确认回收
-			confirmRecover(){
-				this.$refs.recoverForm.validate((valid, invalidFields, errLabels) => {
-					if (valid) {
-						confirmRecover({
-							RealEndDate: this.recoverForm.date + ' 00:00:00',
-							id: this.id,
-						}).then(res => {
-							if (res.code == 200) {
-								this.isRecover = false
-								this.$message.success('确认回收成功!')
-								this.getDetail()
-							}
-						})
-					}
-				})
-			},
-			lbsAmapRegion(name,pid){
-				lbsAmapRegion({ pid }).then(res => {
-				  this[name] = res.data
-				})
-			},
-			getinitlbslist() {
-				// 初始化请求省市区街道下拉选项数据
-				lbsAmapRegion({
-					pid: 0
-				}).then(res => {
-					this.provinceList = res.data
-					// 创建工单时获取ip地址定位赋值
-					if (!this.id && this.$IpAdd.province) {
-						var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
-						if (item) {
-							this.formData.provinceId = item.id
-							this.formData.province = item.name
-						}
-					}
-					if (this.formData.provinceId) {
-						lbsAmapRegion({
-							pid: this.formData.provinceId
-						}).then(res => {
-							this.cityList = res.data
-							// 创建工单时获取ip地址定位赋值
-							if (!this.id && this.$IpAdd.city) {
-								var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
-								if (item2) {
-									this.formData.cityId = item2.id
-									this.formData.city = item2.name
-								}
-							}
-							if (this.formData.cityId) {
-								lbsAmapRegion({
-									pid: this.formData.cityId
-								}).then(res => {
-									this.areaList = res.data
-								})
-							}
-							if (this.formData.areaId) {
-								lbsAmapRegion({
-									pid: this.formData.areaId
-								}).then(res => {
-									this.streetList = res.data
-								})
-							}
-						})
-					}
-				})
-			},
-			selectAddress(data) {
-				this.formData.lng = data.center[0]
-				this.formData.lat = data.center[1]
-				// 获取定位的省市区街道
-				var {
-					province,
-					city,
-					district,
-					township
-				} = data.data.addressComponent
-				// 获取选中省名称id
-				var {
-					id,
-					name
-				} = this.provinceList.find(item => item.name === province)
-				this.formData.provinceId = id
-				this.formData.province = name
-				// 请求市选项
-				lbsAmapRegion({
-					pid: this.formData.provinceId
-				}).then(res => {
-					// 赋值市选项
-					this.cityList = res.data
-					// 获取选中市名称id
-					var {
-						id,
-						name
-					} = res.data.find(item => item.name === city)
-					this.formData.cityId = id
-					this.formData.city = name
-					// 请求区选项
-					lbsAmapRegion({
-						pid: this.formData.cityId
-					}).then(res => {
-						// 赋值区选项
-						this.areaList = res.data
-						// 获取选中区名称id
-						var {
-							id,
-							name
-						} = res.data.find(item => item.name === district)
-						this.formData.areaId = id
-						this.formData.area = name
-						// 请求街道选项
-						lbsAmapRegion({
-							pid: this.formData.areaId
-						}).then(res => {
-							// 赋值街道选项
-							this.streetList = res.data
-							// 获取选中街道名称id
-							var {
-								id,
-								name
-							} = res.data.find(item => item.name === township)
-							this.formData.streetId = id
-							this.formData.street = name
-							// 赋值GPS详细地址
-							this.formData.address = data.name
-						})
-					})
-				})
-			},
-		}
-	};
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import ImageUpload from '@/components/file-upload'
+import {
+  getGoods,
+  getDetail,
+  add,
+  confirmOrder,
+  confirmRecover,
+  confirmRelet,
+  confirmRepair,
+  getTypeList,
+  getUserList,
+  getPrice
+} from '@/api/tenancyOrder'
+export default {
+  components: {
+    geographicalPosi,
+    ImageUpload
+  },
+  props: ['id', 'title', 'formType'],
+  data() {
+    return {
+      formData1: {
+        dataList: []
+      },
+      formData3: {
+        dataList: []
+      },
+      repairForm: {
+        date: ''
+      },
+      reletForm: {
+        date: ''
+      },
+      recoverForm: {
+        date: ''
+      },
+      goodsList: [],
+      userList: [],
+      is_submit: true,
+      isRelet: false,
+      isRepair: false,
+      isRecover: false,
+      formData: {
+        userInfo: null,
+        userName: '',
+        userId: '',
+        userMobile: '',
+        remark: '',
+        provinceObj: null,
+        province: '',
+        provinceId: '',
+        cityObj: null,
+        city: '',
+        cityId: '',
+        areaObj: null,
+        area: '',
+        areaId: '',
+        streetObj: null,
+        street: '',
+        streetId: '',
+        address: '',
+        lat: '',
+        lng: '',
+        records: [],
+        fileUrl: []
+      },
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+      isEdit: 0,
+      timer: '',
+      companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+      rules: {
+        address: [
+          {
+            required: true,
+            message: '请选择客户地址',
+            trigger: 'change'
+          }
+        ],
+        userMobile: [
+          {
+            required: true,
+            message: '请输入客户电话',
+            trigger: 'blur'
+          },
+          {
+            required: true,
+            message: '请输入客户电话',
+            trigger: 'change'
+          },
+          {
+            pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
+            message: '电话号码格式不正确',
+            trigger: 'blur'
+          },
+          ,
+          {
+            pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
+            message: '电话号码格式不正确',
+            trigger: 'change'
+          }
+        ],
+        userName: [
+          {
+            required: true,
+            message: '请输入客户姓名',
+            trigger: 'blur'
+          },
+          {
+            required: true,
+            message: '请输入客户姓名',
+            trigger: 'change'
+          }
+        ]
+      },
+      rules1: {
+        price: [
+          {
+            pattern: /^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/,
+            message: '请输入大于0的数字',
+            trigger: 'blur'
+          }
+        ]
+      },
+      typeId: ''
+    }
+  },
+  computed: {
+    filterStatus() {
+      return function (type) {
+        let status = {
+          WAIT: '等待商家确认',
+          WAIT_START: '待开始',
+          LEASE: '租赁中',
+          OVER: '已过期-待回收',
+          RECOVER: '已过期-已回收'
+        }
+        return status[type]
+      }
+    }
+  },
+  created() {
+    if (this.id) {
+      this.getDetail()
+    }
+    this.lbsAmapRegion('provinceList', 0)
+    this.getGoods()
+    this.getTypeList()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.$emit('back')
+    },
+    getDetail() {
+      getDetail({
+        id: this.id
+      }).then(res => {
+        this.formData = {
+          ...res.data,
+          address: res.data.userAddress,
+          fileUrl: res.data.fileUrl ? [{ url: res.data.fileUrl }] : [],
+          provinceObj: { id: res.data.provinceId },
+          cityObj: { id: res.data.cityId },
+          areaObj: { id: res.data.areaId },
+          streetObj: { id: res.data.streetId },
+          userInfo:
+            res.data.userId && res.data.payType == 'LINE'
+              ? { userId: res.data.userId, userMobile: res.data.userMobile, userName: res.data.userName }
+              : res.data.userMobile
+        }
+        this.formData3.dataList = res.data.items
+        this.getinitlbslist()
+        this.getUserList()
+      })
+    },
+    getGoods() {
+      getGoods({
+        pageNum: 1,
+        pageSize: -1,
+        status: true
+      }).then(res => {
+        this.goodsList = res.data.records
+      })
+    },
+    getPrice(item) {
+      if (!item.startDate || !item.endDate) {
+        return false
+      }
+      getPrice({
+        startDate: item.startDate,
+        endDate: item.endDate,
+        isRenewal: this.formData.status == 'WAIT' || !this.formData.status ? false : true,
+        price: this.formData.status == 'WAIT' || !this.formData.status ? item.leasePrice : item.renewalPrice,
+        qty: item.qty
+      }).then(res => {
+        if (this.formData.status == 'WAIT' || !this.formData.status) {
+          item.leaseAmount = res.data
+        } else {
+          item.renewalLeaseAmount = (res.data * 100 + this.formData.totalAmount * 100) / 100
+        }
+      })
+    },
+    getUserList(value) {
+      getUserList({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'a.mobile', compare: 'like', value }]
+      }).then(res => {
+        this.userList = res.data.records
+      })
+    },
+    userBlur(e) {
+      this.formData.userMobile = e.target.value
+      this.formData.userInfo = e.target.value
+      this.$forceUpdate()
+    },
+    changeUser(e) {
+      this.formData.userMobile = e.mobile
+      this.formData.userName = e.nickName
+      this.formData.userId = e.userId
+    },
+    changeGoods(e, item) {
+      item.categoryId = e.categoryId
+      item.categoryName = e.categoryName
+      item.categoryUrl = e.categoryUrl
+      item.goodsLeaseName = e.name
+      item.goodsLeaseId = e.id
+      item.goodsUnit = e.unit
+      item.depositPrice = e.depositPrice
+      item.leasePrice = e.leasePrice
+    },
+    userMobileInput(e) {
+      if (e && e.length > 3) {
+        this.getUserList(e)
+      }
+    },
+    add() {
+      this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          console.log(111)
+          if (this.formData1.dataList.length != 0) {
+            this.isEdit = 0
+          }
+          this.formData1.dataList.unshift({
+            goods: null,
+            categoryId: '',
+            categoryName: '',
+            categoryUrl: '',
+            qty: '',
+            goodsLeaseName: '',
+            goodsLeaseId: '',
+            goodsUnit: '',
+            depositPrice: null,
+            leasePrice: null,
+            startDate: '',
+            endDate: '',
+            realEndDate: '',
+            depositAmount: null,
+            renewalPrice: null,
+            leaseAmount: null
+          })
+        }
+      })
+    },
+    del(index) {
+      if (index <= 1) {
+        this.isEdit == 0
+      } else {
+        this.isEdit -= 1
+      }
+      this.formData1.dataList.splice(index, 1)
+    },
+    submit() {
+      const that = this
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          if (this.formData1.dataList.length == 0) {
+            return this.$message.warning('请添加商品信息!')
+          } else {
+            this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+              if (valid) {
+                add({
+                  userId: this.formData.userId,
+                  userName: this.formData.userName,
+                  userMobile: this.formData.userMobile,
+                  fileUrl: this.formData.fileUrl.length > 0 ? this.formData.fileUrl[0].url : '',
+                  items: this.formData1.dataList,
+                  remark: this.formData.remark,
+                  province: this.formData.province,
+                  provinceId: this.formData.provinceId,
+                  city: this.formData.city,
+                  cityId: this.formData.cityId,
+                  area: this.formData.area,
+                  areaId: this.formData.areaId,
+                  street: this.formData.street,
+                  streetId: this.formData.streetId,
+                  userAddress: this.formData.address,
+                  lat: this.formData.lat,
+                  lng: this.formData.lng
+                }).then(res => {
+                  if (res.code == 200) {
+                    this.$message.success('提交成功!')
+                    this.goBack()
+                  }
+                })
+              }
+            })
+          }
+        }
+      })
+    },
+    //确定租赁
+    submitOrder() {
+      this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          this.$refs.formData3.validate((valid, invalidFields, errLabels) => {
+            if (valid) {
+              confirmOrder({
+                userName: this.formData.userName,
+                userMobile: this.formData.userMobile,
+                fileUrl: this.formData.fileUrl.length > 0 ? this.formData.fileUrl[0].url : '',
+                items: this.formData3.dataList,
+                remark: this.formData.remark,
+                province: this.formData.province,
+                provinceId: this.formData.provinceId,
+                city: this.formData.city,
+                cityId: this.formData.cityId,
+                area: this.formData.area,
+                areaId: this.formData.areaId,
+                street: this.formData.street,
+                streetId: this.formData.streetId,
+                userAddress: this.formData.address,
+                lat: this.formData.lat,
+                lng: this.formData.lng,
+                id: this.formData.id
+              }).then(res => {
+                if (res.code == 200) {
+                  this.$message.success('提交成功!')
+                  this.getDetail()
+                }
+              })
+            }
+          })
+        }
+      })
+    },
+    //取消订单
+    cancelOrder() {
+      cancelOrder({
+        id: this.id
+      }).then(res => {
+        if (res.code == 200) {
+          this.$message.success('取消订单成功!')
+          this.getDetail()
+        }
+      })
+    },
+    getTypeList() {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1
+      }).then(res => {
+        if (res.code == 200) {
+          res.data.records.forEach(item => {
+            if (item.orderType == 'REPAIR') {
+              this.typeId = item.id
+            }
+          })
+        }
+      })
+    },
+    //报修
+    confirmRepair() {
+      let productList = [
+        {
+          mainId: this.formData.items[0].categoryId,
+          mainName: this.formData.items[0].categoryName,
+          num: this.formData.items[0].qty,
+          imgUrl: this.formData.items[0].categoryUrl
+        }
+      ]
+
+      this.$refs.repairForm.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          confirmRepair({
+            companyWechatId: this.formData.companyWechatId,
+            appointmentTime: this.repairForm.date + ' 00:00:00',
+            saleOrderId: this.id,
+            orderSmallType: this.typeId,
+            province: this.formData.province,
+            provinceId: this.formData.provinceId,
+            city: this.formData.city,
+            cityId: this.formData.cityId,
+            area: this.formData.area,
+            areaId: this.formData.areaId,
+            street: this.formData.street,
+            streetId: this.formData.streetId,
+            address: this.formData.address,
+            orderProducts: productList,
+            isZl: true
+          }).then(res => {
+            if (res.code == 200) {
+              this.isRepair = false
+              this.$message.success('报修成功!')
+              this.getDetail()
+            }
+          })
+        }
+      })
+    },
+    //确认续租
+    confirmRelet() {
+      this.$refs.reletForm.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          confirmRelet({
+            RealEndDate: this.reletForm.date + ' 00:00:00',
+            id: this.id
+          }).then(res => {
+            if (res.code == 200) {
+              this.isRelet = false
+              this.$message.success('确认续租成功!')
+              this.getDetail()
+            }
+          })
+        }
+      })
+    },
+    //确认回收
+    confirmRecover() {
+      this.$refs.recoverForm.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          confirmRecover({
+            RealEndDate: this.recoverForm.date + ' 00:00:00',
+            id: this.id
+          }).then(res => {
+            if (res.code == 200) {
+              this.isRecover = false
+              this.$message.success('确认回收成功!')
+              this.getDetail()
+            }
+          })
+        }
+      })
+    },
+    lbsAmapRegion(name, pid) {
+      lbsAmapRegion({ pid }).then(res => {
+        this[name] = res.data
+      })
+    },
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({
+        pid: 0
+      }).then(res => {
+        this.provinceList = res.data
+        // 创建工单时获取ip地址定位赋值
+        if (!this.id && this.$IpAdd.province) {
+          var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+          if (item) {
+            this.formData.provinceId = item.id
+            this.formData.province = item.name
+          }
+        }
+        if (this.formData.provinceId) {
+          lbsAmapRegion({
+            pid: this.formData.provinceId
+          }).then(res => {
+            this.cityList = res.data
+            // 创建工单时获取ip地址定位赋值
+            if (!this.id && this.$IpAdd.city) {
+              var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+              if (item2) {
+                this.formData.cityId = item2.id
+                this.formData.city = item2.name
+              }
+            }
+            if (this.formData.cityId) {
+              lbsAmapRegion({
+                pid: this.formData.cityId
+              }).then(res => {
+                this.areaList = res.data
+              })
+            }
+            if (this.formData.areaId) {
+              lbsAmapRegion({
+                pid: this.formData.areaId
+              }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          })
+        }
+      })
+    },
+    selectAddress(data) {
+      this.formData.lng = data.center[0]
+      this.formData.lat = data.center[1]
+      // 获取定位的省市区街道
+      var { province, city, district, township } = data.data.addressComponent
+      // 获取选中省名称id
+      var { id, name } = this.provinceList.find(item => item.name === province)
+      this.formData.provinceId = id
+      this.formData.province = name
+      // 请求市选项
+      lbsAmapRegion({
+        pid: this.formData.provinceId
+      }).then(res => {
+        // 赋值市选项
+        this.cityList = res.data
+        // 获取选中市名称id
+        var { id, name } = res.data.find(item => item.name === city)
+        this.formData.cityId = id
+        this.formData.city = name
+        // 请求区选项
+        lbsAmapRegion({
+          pid: this.formData.cityId
+        }).then(res => {
+          // 赋值区选项
+          this.areaList = res.data
+          // 获取选中区名称id
+          var { id, name } = res.data.find(item => item.name === district)
+          this.formData.areaId = id
+          this.formData.area = name
+          // 请求街道选项
+          lbsAmapRegion({
+            pid: this.formData.areaId
+          }).then(res => {
+            // 赋值街道选项
+            this.streetList = res.data
+            // 获取选中街道名称id
+            var { id, name } = res.data.find(item => item.name === township)
+            this.formData.streetId = id
+            this.formData.street = name
+            // 赋值GPS详细地址
+            this.formData.address = data.name
+          })
+        })
+      })
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
 
-	.page-footer {
-		height: 70px;
-	}
+.page-footer {
+  height: 70px;
+}
 
-	.order-main {
-		.order-main-title {
-			font-size: 14px;
-		}
+.order-main {
+  .order-main-title {
+    font-size: 14px;
+  }
 
-		.order-main-title span {
-			margin-right: 15px;
-		}
+  .order-main-title span {
+    margin-right: 15px;
+  }
 
-		.order-main-status {
-			padding: 15px 0;
-			font-size: 24px;
-			color: #409EFF;
-		}
+  .order-main-status {
+    padding: 15px 0;
+    font-size: 24px;
+    color: #409eff;
+  }
 
-		.order-main-opt-btn {
-			padding: 15px 0;
-		}
-	}
+  .order-main-opt-btn {
+    padding: 15px 0;
+  }
+}
 
-	.order-receive-info {
-		margin: 15px 0;
-		padding: 15px;
-		background: #f5f7fa;
+.order-receive-info {
+  margin: 15px 0;
+  padding: 15px;
+  background: #f5f7fa;
 
-		:first-child div span {
-			padding-right: 15px;
-		}
+  :first-child div span {
+    padding-right: 15px;
+  }
 
-		.el-row {
-			padding-top: 15px;
-		}
-	}
+  .el-row {
+    padding-top: 15px;
+  }
+}
 
-	.footer {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		z-index: 1;
-		width: 100%;
-		background: #fff;
-		padding: 15px 40px;
-		box-sizing: border-box;
-		transition: all 0.28s;
-		text-align: right;
-		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 1;
+  width: 100%;
+  background: #fff;
+  padding: 15px 40px;
+  box-sizing: border-box;
+  transition: all 0.28s;
+  text-align: right;
+  box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
 
-		&.hideSidebar {
-			margin-left: 54px;
-			width: calc(100vw - 54px);
-		}
+  &.hideSidebar {
+    margin-left: 54px;
+    width: calc(100vw - 54px);
+  }
 
-		&.openSidebar {
-			margin-left: 210px;
-			width: calc(100vw - 210px);
-		}
+  &.openSidebar {
+    margin-left: 210px;
+    width: calc(100vw - 210px);
+  }
 
-		.tips {
-			font-size: 12px;
-			color: red;
-			margin-top: 10px;
-		}
-	}
-</style>
+  .tips {
+    font-size: 12px;
+    color: red;
+    margin-top: 10px;
+  }
+}
+</style>

+ 421 - 397
src/views/mallManagement/tenancyManagement/tenancyOrder/index.vue

@@ -1,420 +1,444 @@
 <template>
-	<div>
-		<div v-if="!isShowDetail" class="app-container">
-			<div class="screen-container">
-				<el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
-					<el-row :gutter="20">
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="订单号" prop="id">
-								<el-input v-model="screenForm.id" placeholder="请输入订单号"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="商品名称" prop="goodsName">
-								<el-input v-model="screenForm.goodsName" placeholder="请输入商品名称"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="会员昵称" prop="userName">
-								<el-input v-model="screenForm.userName" placeholder="请输入会员昵称"></el-input>
-							</el-form-item>
-						</el-col>
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="手机号" prop="userMobile">
-								<el-input v-model="screenForm.userMobile" placeholder="请输入手机号"></el-input>
-							</el-form-item>
-						</el-col>
+  <div>
+    <div v-if="!isShowDetail" class="app-container">
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="订单号" prop="id">
+                <el-input v-model="screenForm.id" placeholder="请输入订单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="商品名称" prop="goodsName">
+                <el-input v-model="screenForm.goodsName" placeholder="请输入商品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="会员昵称" prop="userName">
+                <el-input v-model="screenForm.userName" placeholder="请输入会员昵称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="手机号" prop="userMobile">
+                <el-input v-model="screenForm.userMobile" placeholder="请输入手机号"></el-input>
+              </el-form-item>
+            </el-col>
 
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="创建时间" prop="createDate" style="height: 33px;">
-								<el-date-picker v-model="screenForm.createDate" type="datetimerange"
-									value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
-									end-placeholder="结束日期">
-								</el-date-picker>
-							</el-form-item>
-						</el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="创建时间" prop="createDate" style="height: 33px">
+                <el-date-picker
+                  v-model="screenForm.createDate"
+                  type="datetimerange"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
 
-						<el-col :xs="24" :sm="12" :lg="6">
-							<el-form-item label="支付时间" prop="payDate" style="height: 33px;">
-								<el-date-picker v-model="screenForm.payDate" type="datetimerange"
-									value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
-									end-placeholder="结束日期">
-								</el-date-picker>
-							</el-form-item>
-						</el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="支付时间" prop="payDate" style="height: 33px">
+                <el-date-picker
+                  v-model="screenForm.payDate"
+                  type="datetimerange"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
 
-						<el-col :xs="24" :sm="12" :lg="6" class="tr">
-							<el-form-item label="">
-								<el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
-								<el-button size="small" @click="resetScreenForm">清空</el-button>
-							</el-form-item>
-						</el-col>
-					</el-row>
-				</el-form>
-			</div>
-
-			<div class="tabs-container order-tabs-container clearfix">
-				<el-tabs v-model="screenForm.status" type="card" @tab-click="changeTabs" class="fl"
-					style="margin-right: 20px">
-					<el-tab-pane label="全部" name="ALL"></el-tab-pane>
-					<el-tab-pane label="待确认" name="WAIT"></el-tab-pane>
-					<el-tab-pane label="待开始" name="WAIT_START"></el-tab-pane>
-					<el-tab-pane label="租赁中" name="LEASE"></el-tab-pane>
-					<el-tab-pane label="已到期-待回收" name="OVER"></el-tab-pane>
-					<el-tab-pane label="已到期-已回收" name="RECOVER"></el-tab-pane>
-					<el-tab-pane label="已取消" name="CANCEL"></el-tab-pane>
-				</el-tabs>
-				<el-button type="primary" @click="isShowDetail = true;formType = 0">新增租赁单</el-button>
-			</div>
-			<div class="order-main-container">
-				<div class="table-top">
-					<el-row style="width:100%">
-						<el-col :span="3">
-							<span class="item product">商品</span>
-						</el-col>
-						<el-col :span="3" style="text-align: right"><span class="item">总租金(元)</span></el-col>
-						<el-col :span="3" style="text-align: center"><span class="item">订金(元)</span></el-col>
-						<el-col :span="7" style="text-align: center"><span class="item">收货信息</span></el-col>
-						<el-col :span="2" style="text-align: center"><span class="item">租金(元)/月</span></el-col>
-						<el-col :span="2" style="text-align: center"><span class="item">订单状态</span></el-col>
-						<el-col :span="4" style="text-align: center"><span class="item">操作</span></el-col>
-					</el-row>
-				</div>
-				<div class="order-item" v-for="order in dataList" :key="order.orderId">
-					<div class="order-top">
-						<span><b>订单号</b>:{{ order.id }}</span>
-						<span><b>下单时间</b>:{{ order.createTime }}</span>
-						<span v-if="order.startDate"><b>起租时间</b>:{{ order.startDate }}</span>
-						<span v-if="order.endDate"><b>结束时间</b>:{{ order.realEndDate || order.endDate }}</span>
-						<el-tag effect="dark" :type="order.payType=='LINE'?'':'success'">{{order.payType=="LINE"?'线下支付':'微信支付'}}</el-tag>
-						<div class="fr">
-							<el-link type="primary" v-if="$restrict('detail')" :underline="false"
-								 @click="confirmOrder(order.id)">查看详情</el-link>
-							<!-- <el-link type="primary" :underline="false" @click="queryWorkOrder(order.orderId)">订单工单</el-link> -->
-						</div>
-					</div>
-					<div class="order-content">
-						<el-row style="width:100%;">
-							<el-col :span="6" style="height: 100%;">
-								<div class="col-item-pro">
-									<div class="pro-item">
-										<div class="left">
-											<div class="image">
-												<img :src="order.categoryUrl" style="height:80px;width: 80px;">
-											</div>
-											<div class="main" style="justify-content: center;">
-												<span>{{ order.goodsLeaseName }}</span>
-												<span>x{{ order.qty }}</span>
-											</div>
-										</div>
-										<div class="right"
-											style="display: flex;flex-direction: column;justify-content: center;">
-											<span>{{order.totalAmount}}</span>
-											<span>总租金</span>
-										</div>
-									</div>
-								</div>
-							</el-col>
-							<el-col :span="3" style="height: 100%;">
-								<div class="col-item">
-									<div>{{ order.bookAmount }}</div>
-									<span>订金</span>
-								</div>
-							</el-col>
-							<el-col :span="7" style="height: 100%;">
-								<div class="col-item">
-									<div>{{ order.userName }}/{{ order.userMobile }}</div>
-									<div class="ellipsis-2">
-										{{ order.province + order.city + order.area + order.street + order.userAddress}}
-									</div>
-								</div>
-							</el-col>
-							<el-col :span="2" style="height: 100%;">
-								<div class="col-item">
-									<div class="totalprice">¥{{ order.leasePrice }}</div>
-								</div>
-							</el-col>
-							<el-col :span="2" style="height: 100%;">
-								<div class="col-item">
-									<div :style="{'color': filterStatus(order,'color')}">
-										{{ filterStatus(order,'name') }}</div>
-								</div>
-							</el-col>
-							<el-col :span="4" style="height: 100%;">
-								<div class="col-item">
-									<div class="operate">
-										<el-button v-if="order.status === 'WAIT'" @click="confirmOrder(order.id)" type="text" size="small">确定租赁</el-button>
-										<el-button v-if="order.status === 'LEASE' || order.status === 'OVER'" @click="confirmOrder(order.id)" type="text" size="small">确认回收</el-button>
-										<el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder(order.id)"
-											v-if="order.status === 'WAIT'">
-											<el-button slot="reference" type="text" size="small">取消订单</el-button>
-										</el-popconfirm>
-										<el-button v-if="order.status === 'LEASE'" @click="confirmOrder(order.id)" type="text" size="small">报修</el-button>
-									</div>
-								</div>
-							</el-col>
-						</el-row>
-					</div>
-				</div>
-				<div class="no-data" v-if="dataList.length <= 0">暂无订单</div>
-			</div>
-			<div class="pagination clearfix">
-				<div class="fr">
-					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-						:current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10"
-						layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
-					</el-pagination>
-				</div>
-			</div>
-		</div>
-		<detail v-else :id="id" @back="backList" :formType="formType" :title="'租赁订单' + formDialogTitles[formType]">
-		</detail>
-	</div>
+            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+              <el-form-item label="">
+                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+                <el-button size="small" @click="resetScreenForm">清空</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
 
+      <div class="tabs-container order-tabs-container clearfix">
+        <el-tabs v-model="screenForm.status" type="card" @tab-click="changeTabs" class="fl" style="margin-right: 20px">
+          <el-tab-pane label="全部" name="ALL"></el-tab-pane>
+          <el-tab-pane label="待确认" name="WAIT"></el-tab-pane>
+          <el-tab-pane label="待开始" name="WAIT_START"></el-tab-pane>
+          <el-tab-pane label="租赁中" name="LEASE"></el-tab-pane>
+          <el-tab-pane label="已到期-待回收" name="OVER"></el-tab-pane>
+          <el-tab-pane label="已到期-已回收" name="RECOVER"></el-tab-pane>
+          <el-tab-pane label="已取消" name="CANCEL"></el-tab-pane>
+        </el-tabs>
+        <el-button
+          type="primary"
+          @click="
+            isShowDetail = true
+            formType = 0
+          "
+          >新增租赁单</el-button
+        >
+      </div>
+      <div class="order-main-container">
+        <div class="table-top">
+          <el-row style="width: 100%">
+            <el-col :span="3">
+              <span class="item product">商品</span>
+            </el-col>
+            <el-col :span="3" style="text-align: right"><span class="item">总租金(元)</span></el-col>
+            <el-col :span="3" style="text-align: center"><span class="item">订金(元)</span></el-col>
+            <el-col :span="7" style="text-align: center"><span class="item">收货信息</span></el-col>
+            <el-col :span="2" style="text-align: center"><span class="item">租金(元)/月</span></el-col>
+            <el-col :span="2" style="text-align: center"><span class="item">订单状态</span></el-col>
+            <el-col :span="4" style="text-align: center"><span class="item">操作</span></el-col>
+          </el-row>
+        </div>
+        <div class="order-item" v-for="order in dataList" :key="order.orderId">
+          <div class="order-top">
+            <span><b>订单号</b>:{{ order.id }}</span>
+            <span><b>下单时间</b>:{{ order.createTime }}</span>
+            <span v-if="order.startDate"><b>起租时间</b>:{{ order.startDate }}</span>
+            <span v-if="order.endDate"><b>结束时间</b>:{{ order.realEndDate || order.endDate }}</span>
+            <el-tag effect="dark" :type="order.payType == 'LINE' ? '' : 'success'">{{
+              order.payType == 'LINE' ? '线下支付' : '微信支付'
+            }}</el-tag>
+            <div class="fr">
+              <el-link type="primary" v-if="$restrict('detail')" :underline="false" @click="confirmOrder(order.id)"
+                >查看详情</el-link
+              >
+              <!-- <el-link type="primary" :underline="false" @click="queryWorkOrder(order.orderId)">订单工单</el-link> -->
+            </div>
+          </div>
+          <div class="order-content">
+            <el-row style="width: 100%">
+              <el-col :span="6" style="height: 100%">
+                <div class="col-item-pro">
+                  <div class="pro-item">
+                    <div class="left">
+                      <div class="image">
+                        <img :src="$showImgUrl(order.categoryUrl)" style="height: 80px; width: 80px" />
+                      </div>
+                      <div class="main" style="justify-content: center">
+                        <span>{{ order.goodsLeaseName }}</span>
+                        <span>x{{ order.qty }}</span>
+                      </div>
+                    </div>
+                    <div class="right" style="display: flex; flex-direction: column; justify-content: center">
+                      <span>{{ order.totalAmount }}</span>
+                      <span>总租金</span>
+                    </div>
+                  </div>
+                </div>
+              </el-col>
+              <el-col :span="3" style="height: 100%">
+                <div class="col-item">
+                  <div>{{ order.bookAmount }}</div>
+                  <span>订金</span>
+                </div>
+              </el-col>
+              <el-col :span="7" style="height: 100%">
+                <div class="col-item">
+                  <div>{{ order.userName }}/{{ order.userMobile }}</div>
+                  <div class="ellipsis-2">
+                    {{ order.province + order.city + order.area + order.street + order.userAddress }}
+                  </div>
+                </div>
+              </el-col>
+              <el-col :span="2" style="height: 100%">
+                <div class="col-item">
+                  <div class="totalprice">¥{{ order.leasePrice }}</div>
+                </div>
+              </el-col>
+              <el-col :span="2" style="height: 100%">
+                <div class="col-item">
+                  <div :style="{ color: filterStatus(order, 'color') }">
+                    {{ filterStatus(order, 'name') }}
+                  </div>
+                </div>
+              </el-col>
+              <el-col :span="4" style="height: 100%">
+                <div class="col-item">
+                  <div class="operate">
+                    <el-button v-if="order.status === 'WAIT'" @click="confirmOrder(order.id)" type="text" size="small"
+                      >确定租赁</el-button
+                    >
+                    <el-button
+                      v-if="order.status === 'LEASE' || order.status === 'OVER'"
+                      @click="confirmOrder(order.id)"
+                      type="text"
+                      size="small"
+                      >确认回收</el-button
+                    >
+                    <el-popconfirm
+                      title="确定取消订单吗?"
+                      @confirm="cancelOrder(order.id)"
+                      v-if="order.status === 'WAIT'"
+                    >
+                      <el-button slot="reference" type="text" size="small">取消订单</el-button>
+                    </el-popconfirm>
+                    <el-button v-if="order.status === 'LEASE'" @click="confirmOrder(order.id)" type="text" size="small"
+                      >报修</el-button
+                    >
+                  </div>
+                </div>
+              </el-col>
+            </el-row>
+          </div>
+        </div>
+        <div class="no-data" v-if="dataList.length <= 0">暂无订单</div>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+    <detail v-else :id="id" @back="backList" :formType="formType" :title="'租赁订单' + formDialogTitles[formType]">
+    </detail>
+  </div>
 </template>
 
 <script>
-	import {
-		getList, cancelOrder
-	} from "@/api/tenancyOrder";
-	import detail from './detail.vue'
-	export default {
-		components: {
-			detail
-		},
-		data() {
-			return {
-				screenForm: { // 筛选表单数据
-					id: '', // 订单号
-					goodsName: '', // 商品名称
-					userName: '', // 会员昵称
-					userMobile: '', // 手机号
-					status: 'ALL', // 状态
-					createDate: '', // 创建时间
-					payDate: '', // 支付时间
-					evaluateStatus: '', // 评价状态
-					sendStatus: '', // 派单异常
-					workerOrderNo: '', // 信息编号
-				},
-				isShowDetail: false,
-				id: '',
-				currentPage: 1, // 当前页码
-				pageSize: 10, // 每页数量
-				listTotal: 0, // 列表总数
-				dataList: [],
-				formDialogTitles: ['新增', '详情'],
-				formType: 0,
-				formVisible: false,
-				typeIndex: '1',
-			}
-		},
-		computed: {
-			filterStatus() {
-				return function(item, type) {
-					if (item.status == 'WAIT') {
-						return {
-							name: '待确定订单',
-							color: '#ff5300'
-						} [type]
-					} else if (item.status == 'WAIT_START') {
-						return {
-							name: '待开始',
-							color: '#64c842'
-						} [type]
-					} else if (item.status == 'LEASE') {
-						return {
-							name: '租赁中',
-							color: '#1281ff'
-						} [type]
-					} else if (item.status == 'OVER') {
-						return {
-							name: '待回收',
-							color: '#9c84fe'
-						} [type]
-					} else if (item.status == 'RECOVER') {
-						return {
-							name: '已回收',
-							color: '#817f7f'
-						} [type]
-					} else if (item.status == 'CANCEL') {
-						return {
-							name: '已取消',
-							color: '#817f7f'
-						} [type]
-					}
-				}
-			}
-		},
-		created() {
-			this.getList();
-		},
-		methods: {
-			backList() {
-				this.id = ''
-				this.isShowDetail = false;
-				this.getList()
-			},
-			changeTabs(tab, event) {
-				this.getList();
-			},
-			// 获取数据列表
-			getList() {
-				// this.listLoading = true;
+import { getList, cancelOrder } from '@/api/tenancyOrder'
+import detail from './detail.vue'
+export default {
+  components: {
+    detail
+  },
+  data() {
+    return {
+      screenForm: {
+        // 筛选表单数据
+        id: '', // 订单号
+        goodsName: '', // 商品名称
+        userName: '', // 会员昵称
+        userMobile: '', // 手机号
+        status: 'ALL', // 状态
+        createDate: '', // 创建时间
+        payDate: '', // 支付时间
+        evaluateStatus: '', // 评价状态
+        sendStatus: '', // 派单异常
+        workerOrderNo: '' // 信息编号
+      },
+      isShowDetail: false,
+      id: '',
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: [],
+      formDialogTitles: ['新增', '详情'],
+      formType: 0,
+      formVisible: false,
+      typeIndex: '1'
+    }
+  },
+  computed: {
+    filterStatus() {
+      return function (item, type) {
+        if (item.status == 'WAIT') {
+          return {
+            name: '待确定订单',
+            color: '#ff5300'
+          }[type]
+        } else if (item.status == 'WAIT_START') {
+          return {
+            name: '待开始',
+            color: '#64c842'
+          }[type]
+        } else if (item.status == 'LEASE') {
+          return {
+            name: '租赁中',
+            color: '#1281ff'
+          }[type]
+        } else if (item.status == 'OVER') {
+          return {
+            name: '待回收',
+            color: '#9c84fe'
+          }[type]
+        } else if (item.status == 'RECOVER') {
+          return {
+            name: '已回收',
+            color: '#817f7f'
+          }[type]
+        } else if (item.status == 'CANCEL') {
+          return {
+            name: '已取消',
+            color: '#817f7f'
+          }[type]
+        }
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    backList() {
+      this.id = ''
+      this.isShowDetail = false
+      this.getList()
+    },
+    changeTabs(tab, event) {
+      this.getList()
+    },
+    // 获取数据列表
+    getList() {
+      // this.listLoading = true;
 
-				let params = {
-					orderId: this.screenForm.id, // 订单号
-					goodsName: this.screenForm.goodsName, // 商品名称
-					userName: this.screenForm.userName, // 会员昵称
-					userMobile: this.screenForm.userMobile, // 手机号
-					status: this.screenForm.status=='ALL'?'':this.screenForm.status, // 状态
-					startDate: this.screenForm.createDate[0] ? this.screenForm.createDate[0] : null, // 创建时间
-					endDate: this.screenForm.createDate[1] ? this.screenForm.createDate[1] : null, // 创建时间
-					startPayDate: this.screenForm.payDate[0] ? this.screenForm.payDate[0] : null, // 支付时间
-					endPayDate: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
-					pageNum: this.currentPage,
-					pageSize: this.pageSize
-				};
+      let params = {
+        orderId: this.screenForm.id, // 订单号
+        goodsName: this.screenForm.goodsName, // 商品名称
+        userName: this.screenForm.userName, // 会员昵称
+        userMobile: this.screenForm.userMobile, // 手机号
+        status: this.screenForm.status == 'ALL' ? '' : this.screenForm.status, // 状态
+        startDate: this.screenForm.createDate[0] ? this.screenForm.createDate[0] : null, // 创建时间
+        endDate: this.screenForm.createDate[1] ? this.screenForm.createDate[1] : null, // 创建时间
+        startPayDate: this.screenForm.payDate[0] ? this.screenForm.payDate[0] : null, // 支付时间
+        endPayDate: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
+        pageNum: this.currentPage,
+        pageSize: this.pageSize
+      }
 
-				getList(params).then(res => {
-					res.data.records.forEach(item => {
-						item.startDate = item.startDate?.substring(0,10)
-						item.endDate = item.endDate?.substring(0,10)
-						item.realEndDate = item.realEndDate?.substring(0,10)
-						// item.websitName = this.handleText(item.websitName);
-					});
-					this.dataList = res.data.records;
-					this.listTotal = res.data.total;
-					// this.listLoading = false;
-				})
-			},
-			
-			confirmOrder(id){
-				this.id = id
-				this.formType = 1
-				this.isShowDetail = true
-			},
-			
-			cancelOrder(id){
-				cancelOrder({
-					id
-				}).then(res => {
-					if(res.code == 200){
-						this.$message.success('取消订单成功!')
-						this.getList();
-					}
-				})
-			},
-			
-			// 提交筛选表单
-			submitScreenForm() {
-				this.currentPage = 1;
-				this.getList();
-			},
+      getList(params).then(res => {
+        res.data.records.forEach(item => {
+          item.startDate = item.startDate?.substring(0, 10)
+          item.endDate = item.endDate?.substring(0, 10)
+          item.realEndDate = item.realEndDate?.substring(0, 10)
+          // item.websitName = this.handleText(item.websitName);
+        })
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        // this.listLoading = false;
+      })
+    },
 
-			// 重置筛选表单
-			resetScreenForm() {
-				this.$refs.screenForm.resetFields();
-				this.currentPage = 1;
-				this.getList();
-			},
+    confirmOrder(id) {
+      this.id = id
+      this.formType = 1
+      this.isShowDetail = true
+    },
 
-			// 更改每页数量
-			handleSizeChange(val) {
-				this.pageSize = val;
-				this.currentPage = 1;
-				this.getList();
-			},
+    cancelOrder(id) {
+      cancelOrder({
+        id
+      }).then(res => {
+        if (res.code == 200) {
+          this.$message.success('取消订单成功!')
+          this.getList()
+        }
+      })
+    },
 
-			// 更改当前页
-			handleCurrentChange(val) {
-				this.currentPage = val;
-				this.getList();
-			},
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
+    },
 
-			// 获取省市区街道
-			getRegion(level = 0, id = 0) {
-				getRegion({
-					pid: id
-				}).then(res => {
-					if (level === 0) {
-						this.provinceList = res.data;
-					} else if (level === 1) {
-						this.cityList = res.data;
-					} else if (level === 2) {
-						this.areaList = res.data;
-					} else if (level === 3) {
-						this.streetList = res.data;
-					}
-				})
-			},
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
+    },
 
-			// 初始化省市区街道
-			initRegion(level, item, id = 0) {
-				let {
-					province,
-					city,
-					area,
-					street
-				} = item;
-				let nextId = null;
-				getRegion({
-					pid: id
-				}).then(res => {
-					if (level === 0) {
-						this.provinceList = res.data;
-						nextId = this.addressForm.province = this.provinceList[this.$findElem(this.provinceList,
-							'name', province)].id;
-					} else if (level === 1) {
-						this.cityList = res.data;
-						nextId = this.addressForm.city = this.cityList[this.$findElem(this.cityList, 'name', city)]
-							.id;
-					} else if (level === 2) {
-						this.areaList = res.data;
-						nextId = this.addressForm.area = this.areaList[this.$findElem(this.areaList, 'name', area)]
-							.id;
-					} else if (level === 3) {
-						this.streetList = res.data;
-						nextId = this.addressForm.street = this.streetList[this.$findElem(this.streetList, 'name',
-							street)].id;
-					}
-					if (level < 3) {
-						level = level + 1;
-						this.initRegion(level, item, nextId);
-					}
-				})
-			},
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
 
-			// 保存 修改收货地址 表单
-			save(cancel) {
-				this.$refs.addressForm.validate((valid) => {
-					if (valid) {
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    },
 
-					}
-				})
-			},
+    // 获取省市区街道
+    getRegion(level = 0, id = 0) {
+      getRegion({
+        pid: id
+      }).then(res => {
+        if (level === 0) {
+          this.provinceList = res.data
+        } else if (level === 1) {
+          this.cityList = res.data
+        } else if (level === 2) {
+          this.areaList = res.data
+        } else if (level === 3) {
+          this.streetList = res.data
+        }
+      })
+    },
 
-			// 查看工单
-			toWorkOrderDetail(orderId) {
-				this.$router.push({
-					name: "workOrder_detail",
-					query: {
-						orderId
-					}
-				})
+    // 初始化省市区街道
+    initRegion(level, item, id = 0) {
+      let { province, city, area, street } = item
+      let nextId = null
+      getRegion({
+        pid: id
+      }).then(res => {
+        if (level === 0) {
+          this.provinceList = res.data
+          nextId = this.addressForm.province = this.provinceList[this.$findElem(this.provinceList, 'name', province)].id
+        } else if (level === 1) {
+          this.cityList = res.data
+          nextId = this.addressForm.city = this.cityList[this.$findElem(this.cityList, 'name', city)].id
+        } else if (level === 2) {
+          this.areaList = res.data
+          nextId = this.addressForm.area = this.areaList[this.$findElem(this.areaList, 'name', area)].id
+        } else if (level === 3) {
+          this.streetList = res.data
+          nextId = this.addressForm.street = this.streetList[this.$findElem(this.streetList, 'name', street)].id
+        }
+        if (level < 3) {
+          level = level + 1
+          this.initRegion(level, item, nextId)
+        }
+      })
+    },
 
-			},
+    // 保存 修改收货地址 表单
+    save(cancel) {
+      this.$refs.addressForm.validate(valid => {
+        if (valid) {
+        }
+      })
+    },
 
-			handleRefreshList() {
-				this.getList();
-				// this.recordSelected = []
-				// this.$refs.pageRef.refreshList()
-			}
+    // 查看工单
+    toWorkOrderDetail(orderId) {
+      this.$router.push({
+        name: 'workOrder_detail',
+        query: {
+          orderId
+        }
+      })
+    },
 
-		}
-	}
+    handleRefreshList() {
+      this.getList()
+      // this.recordSelected = []
+      // this.$refs.pageRef.refreshList()
+    }
+  }
+}
 </script>
 <style scoped lang="scss">
-	.tabs-container {
-		margin-bottom: 10px;
-	}
-</style>
+.tabs-container {
+  margin-bottom: 10px;
+}
+</style>

+ 406 - 350
src/views/mallManagement/tenancyManagement/tenancyProduct/index.vue

@@ -1,379 +1,435 @@
 <template>
-	<div class="app-container">
-		<template v-if="!isShowDetail">
-			<div class="tab-container clearfix">
-				<div class="tab-list fl">
-					<div class="item" :class="screenForm.status === '' ? 'current':''" @click="changeType('')">
-						全部({{ (downCount + upCount) || 0 }})</div>
-					<div class="item" :class="screenForm.status ? 'current':''" @click="changeType(true)">
-						租赁中({{ upCount || 0 }})</div>
-					<div class="item" :class="screenForm.status === false ? 'current':''" @click="changeType(false)">
-						已下架({{ downCount || 0 }})</div>
-				</div>
-				<el-button type="primary" size="small" @click="addOrEdit('add')">添加商品</el-button>
-			</div>
-			
-			<div class="screen2-container">
-				<el-row :gutter="20">
-					<el-col :xs="24" :sm="2" :lg="3" style="opacity: 0;">.</el-col>
-			
-					<el-col :xs="24" :sm="20" :lg="18">
-						<el-form ref="form" :model="screenForm" label-width="80px">
-							<div class="search">
-								<el-input v-model="screenForm.keyword" placeholder="想快速搜索什么商品呢?输入商品名称,商品id,商品分类都可快速找到"
-									class="input-with-select" clearable @change="getListByScreen">
-									<el-button slot="append" icon="el-icon-search" @click="getListByScreen"></el-button>
-								</el-input>
-							</div>
-							<div class="screen clearfix">
-								<el-row :gutter="20">
-									<el-col :xs="12" :sm="12" :lg="4">
-										<el-form-item label="商品分类:" label-width="90px">
-											<el-cascader v-model="screenForm.classify" :options="classifyList"
-												:props="{ label: 'name', value: 'categoryId' }" size="small"
-												@change="getListByScreen">
-											</el-cascader>
-										</el-form-item>
-									</el-col>
-									<el-col :xs="12" :sm="12" :lg="8">
-										<el-form-item label="租赁订金:" label-width="90px">
-											<el-input v-model="screenForm.price1" size="small" @change="getListByScreen"
-												clearable></el-input>
-											<span>至</span>
-											<el-input v-model="screenForm.price2" size="small" @change="getListByScreen"
-												clearable></el-input>
-										</el-form-item>
-									</el-col>
-									<el-col :xs="12" :sm="12" :lg="8">
-										<el-form-item label="租赁价格:" label-width="90px">
-											<el-input v-model="screenForm.amount1" size="small" @change="getListByScreen"
-												clearable></el-input>
-											<span>至</span>
-											<el-input v-model="screenForm.amount2" size="small" @change="getListByScreen"
-												clearable></el-input>
-										</el-form-item>
-									</el-col>
-								</el-row>
-							</div>
-						</el-form>
-					</el-col>
-			
-					<el-col :xs="24" :sm="2" :lg="3" style="opacity: 0;">.</el-col>
-				</el-row>
-			</div>
-			
-			<div class="mymain-container">
-				<div class="table">
-					<el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit
-						highlight-current-row stripe @selection-change="handleTableSelection">
-						<el-table-column align="center" type="selection" width="55" fixed></el-table-column>
-						<el-table-column align="center" label="一级分类图片" prop="imgUrl" width="85">
-							<template slot-scope="scope">
-								<el-image style="width: 60px; height: 60px; display: block;" :src="scope.row.categoryUrl"
-									:preview-src-list="[scope.row.categoryUrl]" fit="cover"></el-image>
-							</template>
-						</el-table-column>
-						<el-table-column align="center" label="商品ID" prop="id" min-width="200"></el-table-column>
-						<el-table-column align="center" label="商品名称" prop="name" min-width="200"></el-table-column>
-						<el-table-column align="center" label="租赁价格(元/月)" prop="leasePrice" min-width="200"></el-table-column>
-						<el-table-column align="center" label="租赁订金(元/月)" prop="depositPrice" min-width="200"></el-table-column>
-						<el-table-column align="center" label="排序" prop="sort" min-width="110" sortable>
-							<template slot-scope="scope">
-								<!-- {{ scope.row.sortNum }} -->
-								<span style="margin-right: 10px">{{ scope.row.sort }}</span>
-								<i class="el-icon-edit pointer" @click="editData('sort', scope.row)"></i>
-							</template>
-						</el-table-column>
-						<el-table-column align="center" label="状态" class-name="status-col">
-							<template slot-scope="scope">
-								<div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center;">
-									<el-tag size="small"
-										:type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '上架':'下架' }}</el-tag>
-								</div>
-							</template>
-						</el-table-column>
-						<el-table-column align="center" label="操作" width="280" fixed="right">
-							<template slot-scope="scope">
-								<el-button v-if="$restrict('edit')" type="primary" size="mini"
-									@click="addOrEdit('edit', scope.row.id)">编辑</el-button>
-								<el-button v-if="$restrict('copyLink')" type="primary" size="mini" class="tag-read"
-									@click="copy(scope.row.id)"
-									:data-clipboard-text="scope.row.id">复制链接</el-button>
-								<el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?"
-									@confirm="delItem(scope.row.id)">
-									<el-button v-if="!scope.row.status" slot="reference" size="mini">删除</el-button>
-								</el-popconfirm>
-							</template>
-						</el-table-column>
-					</el-table>
-				</div>
-			
-				<div class="pagination clearfix">
-					<div class="fr">
-						<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-							:current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
-							layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
-						</el-pagination>
-					</div>
-				</div>
-			</div>
-		</template>
-		<template v-else>
-			<detail @back="backList" :title="'租赁产品' + formTypeItems[formType]" :id="id" :formType="formType"></detail>
-		</template>
-	</div>
+  <div class="app-container">
+    <template v-if="!isShowDetail">
+      <div class="tab-container clearfix">
+        <div class="tab-list fl">
+          <div class="item" :class="screenForm.status === '' ? 'current' : ''" @click="changeType('')">
+            全部({{ downCount + upCount || 0 }})
+          </div>
+          <div class="item" :class="screenForm.status ? 'current' : ''" @click="changeType(true)">
+            租赁中({{ upCount || 0 }})
+          </div>
+          <div class="item" :class="screenForm.status === false ? 'current' : ''" @click="changeType(false)">
+            已下架({{ downCount || 0 }})
+          </div>
+        </div>
+        <el-button type="primary" size="small" @click="addOrEdit('add')">添加商品</el-button>
+      </div>
+
+      <div class="screen2-container">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0">.</el-col>
+
+          <el-col :xs="24" :sm="20" :lg="18">
+            <el-form ref="form" :model="screenForm" label-width="80px">
+              <div class="search">
+                <el-input
+                  v-model="screenForm.keyword"
+                  placeholder="想快速搜索什么商品呢?输入商品名称,商品id,商品分类都可快速找到"
+                  class="input-with-select"
+                  clearable
+                  @change="getListByScreen"
+                >
+                  <el-button slot="append" icon="el-icon-search" @click="getListByScreen"></el-button>
+                </el-input>
+              </div>
+              <div class="screen clearfix">
+                <el-row :gutter="20">
+                  <el-col :xs="12" :sm="12" :lg="4">
+                    <el-form-item label="商品分类:" label-width="90px">
+                      <el-cascader
+                        v-model="screenForm.classify"
+                        :options="classifyList"
+                        :props="{ label: 'name', value: 'categoryId' }"
+                        size="small"
+                        @change="getListByScreen"
+                      >
+                      </el-cascader>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :xs="12" :sm="12" :lg="8">
+                    <el-form-item label="租赁订金:" label-width="90px">
+                      <el-input v-model="screenForm.price1" size="small" @change="getListByScreen" clearable></el-input>
+                      <span>至</span>
+                      <el-input v-model="screenForm.price2" size="small" @change="getListByScreen" clearable></el-input>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :xs="12" :sm="12" :lg="8">
+                    <el-form-item label="租赁价格:" label-width="90px">
+                      <el-input
+                        v-model="screenForm.amount1"
+                        size="small"
+                        @change="getListByScreen"
+                        clearable
+                      ></el-input>
+                      <span>至</span>
+                      <el-input
+                        v-model="screenForm.amount2"
+                        size="small"
+                        @change="getListByScreen"
+                        clearable
+                      ></el-input>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </div>
+            </el-form>
+          </el-col>
+
+          <el-col :xs="24" :sm="2" :lg="3" style="opacity: 0">.</el-col>
+        </el-row>
+      </div>
+
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            @selection-change="handleTableSelection"
+          >
+            <el-table-column align="center" type="selection" width="55" fixed></el-table-column>
+            <el-table-column align="center" label="一级分类图片" prop="imgUrl" width="85">
+              <template slot-scope="scope">
+                <el-image
+                  style="width: 60px; height: 60px; display: block"
+                  :src="$showImgUrl(scope.row.categoryUrl)"
+                  :preview-src-list="[$showImgUrl(scope.row.categoryUrl)]"
+                  fit="cover"
+                ></el-image>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="商品ID" prop="id" min-width="200"></el-table-column>
+            <el-table-column align="center" label="商品名称" prop="name" min-width="200"></el-table-column>
+            <el-table-column align="center" label="租赁价格(元/月)" prop="leasePrice" min-width="200"></el-table-column>
+            <el-table-column
+              align="center"
+              label="租赁订金(元/月)"
+              prop="depositPrice"
+              min-width="200"
+            ></el-table-column>
+            <el-table-column align="center" label="排序" prop="sort" min-width="110" sortable>
+              <template slot-scope="scope">
+                <!-- {{ scope.row.sortNum }} -->
+                <span style="margin-right: 10px">{{ scope.row.sort }}</span>
+                <i class="el-icon-edit pointer" @click="editData('sort', scope.row)"></i>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="状态" class-name="status-col">
+              <template slot-scope="scope">
+                <div style="display: flex; flex-wrap: wrap; align-items: center; justify-content: center">
+                  <el-tag size="small" :type="scope.row.status ? 'success' : 'danger'">{{
+                    scope.row.status ? '上架' : '下架'
+                  }}</el-tag>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="操作" width="280" fixed="right">
+              <template slot-scope="scope">
+                <el-button v-if="$restrict('edit')" type="primary" size="mini" @click="addOrEdit('edit', scope.row.id)"
+                  >编辑</el-button
+                >
+                <el-button
+                  v-if="$restrict('copyLink')"
+                  type="primary"
+                  size="mini"
+                  class="tag-read"
+                  @click="copy(scope.row.id)"
+                  :data-clipboard-text="scope.row.id"
+                  >复制链接</el-button
+                >
+                <el-popconfirm
+                  v-if="$restrict('del')"
+                  style="margin-left: 10px"
+                  title="确定删除吗?"
+                  @confirm="delItem(scope.row.id)"
+                >
+                  <el-button v-if="!scope.row.status" slot="reference" size="mini">删除</el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+
+        <div class="pagination clearfix">
+          <div class="fr">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10, 20, 50, 100]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            >
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+    </template>
+    <template v-else>
+      <detail @back="backList" :title="'租赁产品' + formTypeItems[formType]" :id="id" :formType="formType"></detail>
+    </template>
+  </div>
 </template>
 
 <script>
-	import { getList, del, getClassifyList, getGoodsStateCount, getDetail, save } from '@/api/tenancyProduct'
-	import Clipboard from 'clipboard'
-	import detail from './detail'
-	import { EventBus } from '@/utils/eventBus'
-	export default {
-		components: {detail},
-		data() {
-			return {
-				dataList: null, // 列表数据
-				isShowDetail: false,
-				listLoading: true, // 列表加载loading
-				currentPage: 1, // 当前页码
-				pageSize: 10, // 每页数量
-				listTotal: 0, // 列表总数
-				screenForm: {
-					status: '',
-					keyword: '',
-					classify: '',
-					status: '',
-					price1: '',
-					price2: '',
-					amount1: '',
-					amount2: '',
-				},
-				select_status: [ // 筛选字段 - 状态
-					{
-						label: '上架',
-						value: true
-					},
-					{
-						label: '下架',
-						value: false
-					}
-				],
-				classifyList: [],
-				upCount: 0,
-				downCount: 0,
-				id: '',
-				formType: 0,
-				formTypeItems: ['新增','编辑'],
-				tableSelection: [],
-			}
-		},
-		created() {
-			this.getClassifyList();
-			this.getList();
-			EventBus.$on("updateGoodsListPage", () => {
-				this.getList();
-			})
-		},
-		methods: {
-			getClassifyList() {
-				let params = {
-					name: '',
-					status: true
-				};
-				getClassifyList(params).then(res => {
-					res.data.unshift({
-						name: '全部',
-						categoryId: '',
-						children: null,
-					});
-					this.classifyList = res.data;
-				})
-			},
-			
-			backList() {
-				this.id = ''
-				this.isShowDetail = false;
-				this.getListByScreen()
-			},
-			
-			getList() {
-				this.listLoading = true;
+import { getList, del, getClassifyList, getGoodsStateCount, getDetail, save } from '@/api/tenancyProduct'
+import Clipboard from 'clipboard'
+import detail from './detail'
+import { EventBus } from '@/utils/eventBus'
+export default {
+  components: { detail },
+  data() {
+    return {
+      dataList: null, // 列表数据
+      isShowDetail: false,
+      listLoading: true, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      screenForm: {
+        status: '',
+        keyword: '',
+        classify: '',
+        status: '',
+        price1: '',
+        price2: '',
+        amount1: '',
+        amount2: ''
+      },
+      select_status: [
+        // 筛选字段 - 状态
+        {
+          label: '上架',
+          value: true
+        },
+        {
+          label: '下架',
+          value: false
+        }
+      ],
+      classifyList: [],
+      upCount: 0,
+      downCount: 0,
+      id: '',
+      formType: 0,
+      formTypeItems: ['新增', '编辑'],
+      tableSelection: []
+    }
+  },
+  created() {
+    this.getClassifyList()
+    this.getList()
+    EventBus.$on('updateGoodsListPage', () => {
+      this.getList()
+    })
+  },
+  methods: {
+    getClassifyList() {
+      let params = {
+        name: '',
+        status: true
+      }
+      getClassifyList(params).then(res => {
+        res.data.unshift({
+          name: '全部',
+          categoryId: '',
+          children: null
+        })
+        this.classifyList = res.data
+      })
+    },
 
-				let categoryId = '';
-				if (this.screenForm.classify) {
-					categoryId = this.screenForm.classify[1];
-				}
+    backList() {
+      this.id = ''
+      this.isShowDetail = false
+      this.getListByScreen()
+    },
 
-				let params = {
-					status: this.screenForm.status,
-					keyword: this.screenForm.keyword,
-					categoryId: categoryId,
-					status: this.screenForm.status,
-					startDeposit: this.screenForm.price1,
-					endDeposit: this.screenForm.price2,
-					startPrice: this.screenForm.amount1,
-					endPrice: this.screenForm.amount2,
-					pageNum: this.currentPage,
-					pageSize: this.pageSize
-				};
+    getList() {
+      this.listLoading = true
 
-				getList(params).then(res => {
-					this.dataList = res.data.records;
-					this.listTotal = res.data.total;
-					this.listLoading = false;
-				})
+      let categoryId = ''
+      if (this.screenForm.classify) {
+        categoryId = this.screenForm.classify[1]
+      }
 
-				getGoodsStateCount({}).then(res => {
-					this.downCount = res.data.downCount;
-					this.upCount = res.data.upCount;
-				})
-			},
-			
-			async editData(type, item){
-				let params = {}
-				await getDetail({id: item.id}).then(res => {
-				  params = res.data;
-				})
-				this.$prompt('请输入排序', '编辑', {
-				  confirmButtonText: '确定',
-				  cancelButtonText: '取消',
-				  inputValue: item.sort,
-				  promptObj: {
-					  inputType: 'number',
-					  inputValidator: function(value) {
-					    if(!value && value !== 0) return '请输入排序'
-					    if(value*1 < 0) return '排序不能小于0'
-					  }
-				  }
-				}).then(({ value }) => {
-				  params[type] = value;
-				  save(params).then(res => {
-				    this.$successMsg('编辑成功');
-				    this.getList();
-				  })
-				}).catch(() => {});
-			},
-			
-			// 更改每页数量
-			handleSizeChange(val) {
-				this.pageSize = val;
-				this.currentPage = 1;
-				this.getList();
-			},
+      let params = {
+        status: this.screenForm.status,
+        keyword: this.screenForm.keyword,
+        categoryId: categoryId,
+        status: this.screenForm.status,
+        startDeposit: this.screenForm.price1,
+        endDeposit: this.screenForm.price2,
+        startPrice: this.screenForm.amount1,
+        endPrice: this.screenForm.amount2,
+        pageNum: this.currentPage,
+        pageSize: this.pageSize
+      }
 
-			// 更改当前页
-			handleCurrentChange(val) {
-				this.currentPage = val;
-				this.getList();
-			},
+      getList(params).then(res => {
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
 
-			// 筛选后重新获取列表
-			getListByScreen() {
-				this.currentPage = 1;
-				this.getList();
-			},
+      getGoodsStateCount({}).then(res => {
+        this.downCount = res.data.downCount
+        this.upCount = res.data.upCount
+      })
+    },
 
-			// 切换类型
-			changeType(status) {
-				this.screenForm.status = status;
-				this.getListByScreen();
-			},
+    async editData(type, item) {
+      let params = {}
+      await getDetail({ id: item.id }).then(res => {
+        params = res.data
+      })
+      this.$prompt('请输入排序', '编辑', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputValue: item.sort,
+        promptObj: {
+          inputType: 'number',
+          inputValidator: function (value) {
+            if (!value && value !== 0) return '请输入排序'
+            if (value * 1 < 0) return '排序不能小于0'
+          }
+        }
+      })
+        .then(({ value }) => {
+          params[type] = value
+          save(params).then(res => {
+            this.$successMsg('编辑成功')
+            this.getList()
+          })
+        })
+        .catch(() => {})
+    },
 
-			// 删除商品
-			delItem(id) {
-				del([id]).then(res => {
-					this.getList();
-					this.$successMsg();
-				})
-			},
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
 
-			// 添加商品
-			addOrEdit(type, id) {
-				if(id){
-					this.id = id
-				}
-				this.formType = id?1:0
-				this.isShowDetail = true
-			},
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    },
 
-			copy() {
-				const clipboard = new Clipboard('.tag-read');
-				// clipboard.on('success', e => {
-				//   this.$successMsg('复制成功');
-				// })
-				clipboard.on('error', e => {
-					console.log('该浏览器不支持复制');
-					return false;
-				})
-				this.$successMsg('复制成功');
-			},
+    // 筛选后重新获取列表
+    getListByScreen() {
+      this.currentPage = 1
+      this.getList()
+    },
 
-			// 表格选择列
-			handleTableSelection(val) {
-				this.tableSelection = val;
-			},
-		}
-	}
+    // 切换类型
+    changeType(status) {
+      this.screenForm.status = status
+      this.getListByScreen()
+    },
+
+    // 删除商品
+    delItem(id) {
+      del([id]).then(res => {
+        this.getList()
+        this.$successMsg()
+      })
+    },
+
+    // 添加商品
+    addOrEdit(type, id) {
+      if (id) {
+        this.id = id
+      }
+      this.formType = id ? 1 : 0
+      this.isShowDetail = true
+    },
+
+    copy() {
+      const clipboard = new Clipboard('.tag-read')
+      // clipboard.on('success', e => {
+      //   this.$successMsg('复制成功');
+      // })
+      clipboard.on('error', e => {
+        console.log('该浏览器不支持复制')
+        return false
+      })
+      this.$successMsg('复制成功')
+    },
+
+    // 表格选择列
+    handleTableSelection(val) {
+      this.tableSelection = val
+    }
+  }
+}
 </script>
 
 <style scoped lang="scss">
-	.tab-container {
-		.tab-list {
-			.item {
-				float: left;
-				font-size: 14px;
-				margin-right: 20px;
-				cursor: pointer;
-				line-height: 32px;
+.tab-container {
+  .tab-list {
+    .item {
+      float: left;
+      font-size: 14px;
+      margin-right: 20px;
+      cursor: pointer;
+      line-height: 32px;
 
-				&.current {
-					color: #409EFF;
-				}
-			}
-		}
-	}
+      &.current {
+        color: #409eff;
+      }
+    }
+  }
+}
 
-	.screen2-container {
-		.search {
-			margin-top: 30px;
-		}
+.screen2-container {
+  .search {
+    margin-top: 30px;
+  }
 
-		.screen {
-			margin-top: 20px;
+  .screen {
+    margin-top: 20px;
 
-			.el-input {
-				width: 40%;
-			}
+    .el-input {
+      width: 40%;
+    }
 
-			span {
-				width: 20%;
-				display: inline-block;
-				text-align: center;
-				color: #666666;
-			}
-		}
-	}
+    span {
+      width: 20%;
+      display: inline-block;
+      text-align: center;
+      color: #666666;
+    }
+  }
+}
 
-	.pointer {
-		cursor: pointer;
-		color: #409EFF;
-	}
+.pointer {
+  cursor: pointer;
+  color: #409eff;
+}
 </style>
 
 <style lang="scss">
-	.screen2-container {
-		.el-form-item__label {
-			line-height: 32px;
-		}
+.screen2-container {
+  .el-form-item__label {
+    line-height: 32px;
+  }
 
-		.el-form-item__content {
-			line-height: 32px;
-		}
-	}
+  .el-form-item__content {
+    line-height: 32px;
+  }
+}
 
-	.el-image-viewer__wrapper .el-icon-circle-close {
-		color: #ffffff !important;
-		font-size: 60px;
-	}
-</style>
+.el-image-viewer__wrapper .el-icon-circle-close {
+  color: #ffffff !important;
+  font-size: 60px;
+}
+</style>

+ 119 - 72
src/views/secondHandMall/activistOrder/details.vue

@@ -1,7 +1,7 @@
 <template>
   <zj-page-container>
     <zj-page-fill>
-      <div style="box-sizing: border-box; padding:10px;">
+      <div style="box-sizing: border-box; padding: 10px">
         <div>
           <div class="order-main">
             <el-row style="padding: 15px 15px 10px">
@@ -18,7 +18,11 @@
                 <el-col :span="10">
                   <div v-if="~['WAIT'].indexOf(orderDetail.status)">
                     <el-form ref="formTHref" :model="formTH" label-width="80px" size="mini">
-                      <el-form-item label="处理结果" prop="refundType" :rules="[{ required: true, message: '请选择', trigger: 'blur' }]">
+                      <el-form-item
+                        label="处理结果"
+                        prop="refundType"
+                        :rules="[{ required: true, message: '请选择', trigger: 'blur' }]"
+                      >
                         <el-radio-group v-model="formTH.refundType">
                           <el-radio label="GOODS">仅退货</el-radio>
                           <el-radio label="REFUND">仅退款</el-radio>
@@ -26,12 +30,30 @@
                           <el-radio label="FAIL">驳回</el-radio>
                         </el-radio-group>
                       </el-form-item>
-                      <el-form-item v-if="~['GOODS','GOODS_REFUND'].indexOf(formTH.refundType)" label="退货数量" prop="refundNum" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
-                        {{(()=>{ if(formTH.refundType=="GOODS") formTH.refundPrice=""; })()}}
+                      <el-form-item
+                        v-if="~['GOODS', 'GOODS_REFUND'].indexOf(formTH.refundType)"
+                        label="退货数量"
+                        prop="refundNum"
+                        :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
+                      >
+                        {{
+                          (() => {
+                            if (formTH.refundType == 'GOODS') formTH.refundPrice = ''
+                          })()
+                        }}
                         <el-input v-model="formTH.refundNum"></el-input>
                       </el-form-item>
-                      <el-form-item v-if="~['REFUND','GOODS_REFUND'].indexOf(formTH.refundType)" label="退款金额" prop="refundPrice" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
-                        {{(()=>{ if(formTH.refundType=="REFUND") formTH.refundNum=""; })()}}
+                      <el-form-item
+                        v-if="~['REFUND', 'GOODS_REFUND'].indexOf(formTH.refundType)"
+                        label="退款金额"
+                        prop="refundPrice"
+                        :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
+                      >
+                        {{
+                          (() => {
+                            if (formTH.refundType == 'REFUND') formTH.refundNum = ''
+                          })()
+                        }}
                         <el-input type="number" v-model="formTH.refundPrice"></el-input>
                       </el-form-item>
                       <el-form-item label="备注">
@@ -39,19 +61,19 @@
                       </el-form-item>
                     </el-form>
                   </div>
-                  <div v-else style="display: flex;">
+                  <div v-else style="display: flex">
                     <div>
                       <div class="order-main-status">
-                        <span>{{ ({WAIT: "平台处理", OVER: "完成"})[orderDetail.status] }}</span>
+                        <span>{{ { WAIT: '平台处理', OVER: '完成' }[orderDetail.status] }}</span>
                       </div>
                     </div>
                   </div>
                 </el-col>
-                <el-col :span="14" style="padding-top: 10px;">
+                <el-col :span="14" style="padding-top: 10px">
                   <el-steps :active="zhuangtai" align-center>
-                    <el-step title="买家申请" ></el-step>
-                    <el-step title="平台处理" ></el-step>
-                    <el-step title="维权完成" ></el-step>
+                    <el-step title="买家申请"></el-step>
+                    <el-step title="平台处理"></el-step>
+                    <el-step title="维权完成"></el-step>
                   </el-steps>
                 </el-col>
               </el-row>
@@ -61,46 +83,73 @@
           <div class="order-receive-info">
             <el-row :gutter="10">
               <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                <div class='info'>
-                  <div class='info_title'>卖家信息</div>
-                  <div class='info_bottom'>
-                    <div v-if="orderDetail.sellUrl" class='info_bottom_lt'>
-                      <el-image style='width: 40px; height: 40px' :src="orderDetail.sellUrl"></el-image>
+                <div class="info">
+                  <div class="info_title">卖家信息</div>
+                  <div class="info_bottom">
+                    <div v-if="orderDetail.sellUrl" class="info_bottom_lt">
+                      <el-image style="width: 40px; height: 40px" :src="$showImgUrl(orderDetail.sellUrl)"></el-image>
                     </div>
-                    <div class='info_bottom_rt'>
-                      <div>昵称:{{orderDetail.sellName}}</div>
-                      <div>手机号:{{orderDetail.sellMobile}}</div>
-                      <div>发布时间:{{orderDetail.sellTime}}</div>
+                    <div class="info_bottom_rt">
+                      <div>昵称:{{ orderDetail.sellName }}</div>
+                      <div>手机号:{{ orderDetail.sellMobile }}</div>
+                      <div>发布时间:{{ orderDetail.sellTime }}</div>
                     </div>
                   </div>
                 </div>
               </el-col>
               <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                <div class='info'>
-                  <div class='info_title'>买家信息</div>
-                  <div class='info_bottom'>
-                    <div v-if="orderDetail.wechatUserUrl" class='info_bottom_lt'>
-                      <el-image style='width: 40px; height: 40px' :src="orderDetail.wechatUserUrl">
+                <div class="info">
+                  <div class="info_title">买家信息</div>
+                  <div class="info_bottom">
+                    <div v-if="orderDetail.wechatUserUrl" class="info_bottom_lt">
+                      <el-image style="width: 40px; height: 40px" :src="$showImgUrl(orderDetail.wechatUserUrl)">
                       </el-image>
                     </div>
-                    <div class='info_bottom_rt'>
-                      <div v-if="orderDetail.wechatUserName">昵称:{{orderDetail.wechatUserName}}</div>
-                      <div v-if="orderDetail.wechatUserMobile">手机号:{{orderDetail.wechatUserMobile}}</div>
-                      <div>收货人信息:({{orderDetail.userName}}){{orderDetail.userMobile}}</div>
-                      <div>收货人地址:{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress }}</div>
-                      <div>支付方式:{{({WECHAT:"微信支付", CASH:"到店支付", TRANSFER:"转账支付"})[orderDetail.payType]}}</div>
+                    <div class="info_bottom_rt">
+                      <div v-if="orderDetail.wechatUserName">昵称:{{ orderDetail.wechatUserName }}</div>
+                      <div v-if="orderDetail.wechatUserMobile">手机号:{{ orderDetail.wechatUserMobile }}</div>
+                      <div>收货人信息:({{ orderDetail.userName }}){{ orderDetail.userMobile }}</div>
+                      <div>
+                        收货人地址:{{
+                          orderDetail.province +
+                          orderDetail.city +
+                          orderDetail.area +
+                          orderDetail.street +
+                          orderDetail.receAddress
+                        }}
+                      </div>
+                      <div>
+                        支付方式:{{
+                          { WECHAT: '微信支付', CASH: '到店支付', TRANSFER: '转账支付' }[orderDetail.payType]
+                        }}
+                      </div>
                     </div>
                   </div>
                 </div>
               </el-col>
               <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                <div class='info'>
-                  <div class='info_title'>维权信息</div>
-                  <div class='info_bottom'>
-                    <div class='info_bottom_rt'>
-                      <div>退款方式:{{({REFUND: "退款", GOODS_REFUND: "退货退款", FAIL: "驳回", GOODS: "退货"})[orderDetail.refundType] || ""}}</div>
-                      <div>退款原因:{{orderDetail.refundNote || ""}}</div>
-                      <div>退款凭证:<el-image v-for="(item, index) in (orderDetail.esOrderRefundFiles || [])" :preview-src-list="(orderDetail.esOrderRefundFiles || []).map(item=>item.fileUrl)" :key="index" style="width: 60px; height: 60px" :src="item.fileUrl"></el-image>
+                <div class="info">
+                  <div class="info_title">维权信息</div>
+                  <div class="info_bottom">
+                    <div class="info_bottom_rt">
+                      <div>
+                        退款方式:{{
+                          { REFUND: '退款', GOODS_REFUND: '退货退款', FAIL: '驳回', GOODS: '退货' }[
+                            orderDetail.refundType
+                          ] || ''
+                        }}
+                      </div>
+                      <div>退款原因:{{ orderDetail.refundNote || '' }}</div>
+                      <div>
+                        退款凭证:<el-image
+                          v-for="(item, index) in orderDetail.esOrderRefundFiles || []"
+                          :preview-src-list="
+                            (orderDetail.esOrderRefundFiles || []).map(item => $showImgUrl(item.fileUrl))
+                          "
+                          :key="index"
+                          style="width: 60px; height: 60px"
+                          :src="$showImgUrl(item.fileUrl)"
+                        ></el-image>
                       </div>
                     </div>
                   </div>
@@ -110,14 +159,14 @@
           </div>
 
           <h3>商品信息</h3>
-          <div class="order-main" style="border:none;">
+          <div class="order-main" style="border: none">
             <!-- 订单表格 -->
             <el-table :data="[orderDetail]" style="width: 100%" border>
               <el-table-column label="商品信息" min-width="200">
                 <template slot-scope="scope">
                   <el-row>
                     <el-col v-if="scope.row.goodsUrl" :span="6">
-                      <el-image style="width: 40px; height: 40px" :src="scope.row.goodsUrl">
+                      <el-image style="width: 40px; height: 40px" :src="$showImgUrl(scope.row.goodsUrl)">
                         <div slot="error" class="image-slot">
                           <i class="el-icon-picture-outline"></i>
                         </div>
@@ -136,13 +185,13 @@
             </el-table>
           </div>
 
-          <h3 v-if="orderDetail.status=='OVER'">退款记录</h3>
-          <div v-if="orderDetail.status=='OVER'" class="order-main" style="border:none;">
+          <h3 v-if="orderDetail.status == 'OVER'">退款记录</h3>
+          <div v-if="orderDetail.status == 'OVER'" class="order-main" style="border: none">
             <!-- 订单表格 -->
             <el-table :data="[orderDetail]" style="width: 100%" border>
               <el-table-column label="处理结果" min-width="200">
                 <template slot-scope="scope">
-                  {{({REFUND: "退款", GOODS_REFUND: "退货退款", FAIL: "驳回", GOODS: "退货"})[scope.row.refundType]}}
+                  {{ { REFUND: '退款', GOODS_REFUND: '退货退款', FAIL: '驳回', GOODS: '退货' }[scope.row.refundType] }}
                 </template>
               </el-table-column>
               <el-table-column prop="refundNum" label="退货数量" align="center"></el-table-column>
@@ -152,47 +201,45 @@
               <el-table-column prop="refundTime" label="退款时间" align="center"></el-table-column>
             </el-table>
           </div>
-
         </div>
       </div>
     </zj-page-fill>
-    <div v-if="~['WAIT'].indexOf(orderDetail.status)" style="box-sizing: border-box; padding: 10px; text-align: right;">
+    <div v-if="~['WAIT'].indexOf(orderDetail.status)" style="box-sizing: border-box; padding: 10px; text-align: right">
       <el-button type="primary" size="small" @click="faqituikuan">确定</el-button>
     </div>
   </zj-page-container>
 </template>
 
 <script>
-import { esOrderDetailRefund, esOrderRefundPrice } from "@/api/orderManagement";
+import { esOrderDetailRefund, esOrderRefundPrice } from '@/api/orderManagement'
 export default {
-  props:{
+  props: {
     detailsId: {
       type: [String, Number],
-      default: ""
+      default: ''
     },
     detailsType: {
       type: [String, Number],
-      default: ""
-    },
+      default: ''
+    }
   },
   data() {
     return {
       detailsTypeCp: this.detailsType,
       // 退货退款表单
       formTH: {
-        refundType: "",
-        refundNum: "",
-        refundPrice: "",
-        refundRemark: "",
+        refundType: '',
+        refundNum: '',
+        refundPrice: '',
+        refundRemark: ''
       },
       // 订单详情
-      orderDetail: {
-      },
+      orderDetail: {}
     }
   },
-  computed:{
-    zhuangtai(){
-      return  !!~['WAIT'].indexOf(this.orderDetail.status)?2:!!~['OVER'].indexOf(this.orderDetail.status)?3:-1
+  computed: {
+    zhuangtai() {
+      return !!~['WAIT'].indexOf(this.orderDetail.status) ? 2 : !!~['OVER'].indexOf(this.orderDetail.status) ? 3 : -1
     }
   },
   watch: {
@@ -201,32 +248,32 @@ export default {
         this.getEsOrderDetail()
       },
       deep: true,
-      immediate: true,
-    },
+      immediate: true
+    }
   },
   methods: {
-    getEsOrderDetail(){
+    getEsOrderDetail() {
       esOrderDetailRefund({
         esOrderRefundId: this.detailsId
-      }).then(res=>{
+      }).then(res => {
         this.orderDetail = {
           ...res.data
         }
       })
     },
-    faqituikuan(){
-      this.$refs.formTHref.validate((valid) => {
+    faqituikuan() {
+      this.$refs.formTHref.validate(valid => {
         if (valid) {
           esOrderRefundPrice({
             ...this.formTH,
             esOrderRefundId: this.detailsId
-          }).then(res=>{
+          }).then(res => {
             this.$message({ type: 'success', message: `操作成功!` })
-            this.$emit("removeTab")
+            this.$emit('removeTab')
           })
         }
-      });
-    },
+      })
+    }
   }
 }
 </script>
@@ -274,7 +321,7 @@ export default {
   .order-main-status {
     padding: 15px 0;
     font-size: 24px;
-    color: #409EFF;
+    color: #409eff;
   }
 
   .order-main-opt-btn {
@@ -401,4 +448,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 110 - 74
src/views/secondHandMall/activistOrder/index.vue

@@ -1,10 +1,16 @@
 <template>
   <zj-page-container>
     <zj-page-fill>
-      <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
-        <template slot-scope="{activeKey, data}">
-          <div :style="{height:activeKey == 'list'?'100%':'0px'}" style="width:100%; height:100%; overflow: hidden;">
-            <div style="width:100%; height:100%;box-sizing: border-box; padding:10px;">
+      <zj-tab-page
+        ref="tabPage"
+        :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]"
+      >
+        <template slot-scope="{ activeKey, data }">
+          <div
+            :style="{ height: activeKey == 'list' ? '100%' : '0px' }"
+            style="width: 100%; height: 100%; overflow: hidden"
+          >
+            <div style="width: 100%; height: 100%; box-sizing: border-box; padding: 10px">
               <zj-page-container>
                 <div class="screen-container">
                   <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
@@ -35,23 +41,34 @@
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6">
-                        <el-form-item label="创建时间" prop="createDate" style="height: 33px;">
-                          <el-date-picker v-model="screenForm.createDate" type="datetimerange"
-                            value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
-                            end-placeholder="结束日期">
+                        <el-form-item label="创建时间" prop="createDate" style="height: 33px">
+                          <el-date-picker
+                            v-model="screenForm.createDate"
+                            type="datetimerange"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                          >
                           </el-date-picker>
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6">
-                        <el-form-item label="支付时间" prop="payDate" style="height: 33px;">
-                          <el-date-picker v-model="screenForm.payDate" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
-                            range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+                        <el-form-item label="支付时间" prop="payDate" style="height: 33px">
+                          <el-date-picker
+                            v-model="screenForm.payDate"
+                            type="datetimerange"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                          >
                           </el-date-picker>
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6" class="tr">
                         <el-form-item label="" label-width="0px">
-                          <div style="text-align: left;">
+                          <div style="text-align: left">
                             <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
                             <el-button size="small" @click="resetScreenForm">清空</el-button>
                           </div>
@@ -60,9 +77,16 @@
                     </el-row>
                   </el-form>
                 </div>
-                <div class="tabs-container order-tabs-container clearfix" style="margin: 10px 0!important;">
+                <div class="tabs-container order-tabs-container clearfix" style="margin: 10px 0 !important">
                   <div class="fl">
-                    <el-tabs v-model="tabCurrent" type="card" @tab-click="changeTabs" class="fl" size="small" style="margin-right: 10px">
+                    <el-tabs
+                      v-model="tabCurrent"
+                      type="card"
+                      @tab-click="changeTabs"
+                      class="fl"
+                      size="small"
+                      style="margin-right: 10px"
+                    >
                       <el-tab-pane label="全部" name="ALL"></el-tab-pane>
                       <el-tab-pane label="待商家处理" name="WAIT"></el-tab-pane>
                       <el-tab-pane label="已完成" name="OVER"></el-tab-pane>
@@ -75,7 +99,7 @@
                 <zj-page-fill>
                   <div class="order-main-container">
                     <div class="table-top">
-                      <el-row style="width:100%">
+                      <el-row style="width: 100%">
                         <el-col :span="3">
                           <span class="item product">商品信息</span>
                         </el-col>
@@ -97,13 +121,13 @@
                         <div class="fr"></div>
                       </div>
                       <div class="order-content">
-                        <el-row style="width:100%;">
-                          <el-col :span="6" style="height: 100%;">
+                        <el-row style="width: 100%">
+                          <el-col :span="6" style="height: 100%">
                             <div class="col-item-pro">
                               <div class="pro-item">
                                 <div class="left">
                                   <div class="image">
-                                    <img :src="order.goodsUrl" style="height:80px;width: 80px;">
+                                    <img :src="$showImgUrl(order.goodsUrl)" style="height: 80px; width: 80px" />
                                   </div>
                                   <div class="main">
                                     <span>{{ order.esGoodsName }}</span>
@@ -116,37 +140,41 @@
                               </div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
                               <div>{{ order.userName }}</div>
                               <div>{{ order.userMobile }}</div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
                               <div>{{ order.userName }}/{{ order.userMobile }}</div>
-                              <div class="ellipsis-2">{{ order.province + order.city + order.area + order.street + order.receAddress }}</div>
+                              <div class="ellipsis-2">
+                                {{ order.province + order.city + order.area + order.street + order.receAddress }}
+                              </div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
                               <div class="totalprice">¥{{ order.totalAmount }}</div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
                               <div class="totalprice">¥{{ order.refundPrice }}</div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
-                              <div style="display: flex; align-items: center;">
-                                <span style="margin-left: 4px">{{ ({WAIT: "平台处理", OVER: "完成"})[order.status] }}</span>
+                              <div style="display: flex; align-items: center">
+                                <span style="margin-left: 4px">{{
+                                  { WAIT: '平台处理', OVER: '完成' }[order.status]
+                                }}</span>
                               </div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
-                            <div class="col-item">  
+                          <el-col :span="3" style="height: 100%">
+                            <div class="col-item">
                               <div class="operate">
                                 <el-button @click="viewDetails(order)" type="text" size="small">查看详情</el-button>
                               </div>
@@ -158,11 +186,17 @@
                     <div class="no-data" v-if="dataList.length <= 0">暂无订单</div>
                   </div>
                 </zj-page-fill>
-                <div class="pagination clearfix" style="margin-top:10px;">
+                <div class="pagination clearfix" style="margin-top: 10px">
                   <div class="fr">
-                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                      :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10"
-                      layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
+                    <el-pagination
+                      @size-change="handleSizeChange"
+                      @current-change="handleCurrentChange"
+                      :current-page="currentPage"
+                      :page-sizes="[10, 20, 30, 50]"
+                      :page-size="10"
+                      layout="total, sizes, prev, pager, next, jumper"
+                      :total="listTotal"
+                    >
                     </el-pagination>
                   </div>
                 </div>
@@ -170,31 +204,36 @@
             </div>
           </div>
           <!-- 查看详情 -->
-          <div v-if="activeKey == 'details'" style="width:100%;height:100%;">
-            <detailsV :detailsId="detailsId" @removeTab="()=>{
-              getList()
-              data.removeTab()
-            }"/>
+          <div v-if="activeKey == 'details'" style="width: 100%; height: 100%">
+            <detailsV
+              :detailsId="detailsId"
+              @removeTab="
+                () => {
+                  getList()
+                  data.removeTab()
+                }
+              "
+            />
           </div>
         </template>
       </zj-tab-page>
     </zj-page-fill>
   </zj-page-container>
-
 </template>
 
 <script>
-import { esOrderListRefund } from "@/api/orderManagement";
-import detailsV from "./details.vue"
+import { esOrderListRefund } from '@/api/orderManagement'
+import detailsV from './details.vue'
 import '@/styles/order-list.scss'
 import { downloadFiles } from '@/utils/util'
 export default {
-  components: {detailsV},
+  components: { detailsV },
   data() {
     return {
-      screenForm: { // 筛选表单数据
+      screenForm: {
+        // 筛选表单数据
         orderId: '', // 订单号
-        esOrderRefundId: "",
+        esOrderRefundId: '',
         esGoodsName: '', // 商品名称
         userName: '', // 会员昵称
         userMobile: '', // 手机号
@@ -205,42 +244,40 @@ export default {
         exchangeCode: '', // 兑换码
         evaluateStatus: '', // 评价状态
         sendStatus: '', // 派单异常
-        workerOrderNo: '', // 信息编号
+        workerOrderNo: '' // 信息编号
       },
       tabCurrent: 'ALL',
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       dataList: [],
-      detailsId: "",
+      detailsId: ''
     }
   },
   created() {
-    this.getList();
+    this.getList()
   },
   methods: {
-    viewDetails(row, type){
+    viewDetails(row, type) {
       this.$refs.tabPage.addTab({
         // 对应显示的模块
-        activeKey: "details",
+        activeKey: 'details',
         // 唯一标识
-        key: "details",
+        key: 'details',
         // 页签名称
-        label: "订单详情",
+        label: '订单详情',
         // 打开时事件
         triggerEvent: () => {
           this.detailsId = row.esOrderRefundId
         },
         // 关闭时事件
-        closeEvent: () => {
-          
-        }
+        closeEvent: () => {}
       })
     },
     changeTabs(tab, event) {
       this.screenForm.status = this.tabCurrent === 'ALL' ? '' : tab.$options.propsData.name
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
     // 获取数据列表
     getList() {
@@ -257,36 +294,36 @@ export default {
         endPayTime: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
         pageNum: this.currentPage,
         pageSize: this.pageSize
-      };
+      }
       esOrderListRefund(params).then(res => {
         res.data.records.forEach(item => {
-          item.selected = false;
-        });
-        this.dataList = res.data.records;
-        this.listTotal = res.data.total;
+          item.selected = false
+        })
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
       })
     },
     // 更改每页数量
     handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.getList();
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
     },
     // 更改当前页
     handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getList();
+      this.currentPage = val
+      this.getList()
     },
     // 提交筛选表单
     submitScreenForm() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
     // 重置筛选表单
     resetScreenForm() {
-      this.$refs.screenForm.resetFields();
-      this.currentPage = 1;
-      this.getList();
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
     },
     // 导出
     handleExport() {
@@ -303,10 +340,9 @@ export default {
         endPayTime: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
         pageNum: this.currentPage,
         pageSize: this.pageSize
-      };
-      downloadFiles('esOrder/listExcelRefund', params);
-    },
+      }
+      downloadFiles('esOrder/listExcelRefund', params)
+    }
   }
 }
-
 </script>

+ 344 - 260
src/views/secondHandMall/commodityManagement/form.vue

@@ -4,24 +4,56 @@
       <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
         <zj-form-module title="商品详情" :form-data="formData" :form-items="formItems" label-width="80px">
         </zj-form-module>
-        <zj-form-module v-if="formData.id && ~['SALE'].indexOf(cpdata.status)" title="出售信息" class="my-module" :form-data="formData.order" :form-items="formItems2"
-          label-width="0px"/>
-        <zj-form-module title="查看留言" class="my-module" :form-data="formData.order" :form-items="formItems3"
-          label-width="0px"/>
-        <zj-form-module title="操作记录" class="my-module" :form-data="formData.order" :form-items="formItems4"
-          label-width="0px"/>
+        <zj-form-module
+          v-if="formData.id && ~['SALE'].indexOf(cpdata.status)"
+          title="出售信息"
+          class="my-module"
+          :form-data="formData.order"
+          :form-items="formItems2"
+          label-width="0px"
+        />
+        <zj-form-module
+          title="查看留言"
+          class="my-module"
+          :form-data="formData.order"
+          :form-items="formItems3"
+          label-width="0px"
+        />
+        <zj-form-module
+          title="操作记录"
+          class="my-module"
+          :form-data="formData.order"
+          :form-items="formItems4"
+          label-width="0px"
+        />
       </zj-form-container>
     </zj-page-fill>
-    <div style="box-sizing: border-box; padding: 10px; text-align: right;">
+    <div style="box-sizing: border-box; padding: 10px; text-align: right">
       <el-button v-if="!disabled" type="primary" size="small" @click="handleSubmit">保存</el-button>
-      <el-button v-if="formData.id && ~['SALE'].indexOf(formData.status)" type="primary" size="small"
-        @click="copyGoods">克隆商品</el-button>
-      <el-button v-if="formData.id && ~['ON'].indexOf(formData.status)" type="primary" size="small"
-        @click="setStatus('OFF')">下架</el-button>
-      <el-button v-if="formData.id && ~['ON'].indexOf(formData.status)" type="primary" size="small"
-        @click="zhuanxiaoshou">转销售</el-button>
-      <el-button v-if="formData.id && ~['OFF'].indexOf(formData.status)" type="primary" size="small"
-        @click="setStatus('ON')">重新上架</el-button>
+      <el-button v-if="formData.id && ~['SALE'].indexOf(formData.status)" type="primary" size="small" @click="copyGoods"
+        >克隆商品</el-button
+      >
+      <el-button
+        v-if="formData.id && ~['ON'].indexOf(formData.status)"
+        type="primary"
+        size="small"
+        @click="setStatus('OFF')"
+        >下架</el-button
+      >
+      <el-button
+        v-if="formData.id && ~['ON'].indexOf(formData.status)"
+        type="primary"
+        size="small"
+        @click="zhuanxiaoshou"
+        >转销售</el-button
+      >
+      <el-button
+        v-if="formData.id && ~['OFF'].indexOf(formData.status)"
+        type="primary"
+        size="small"
+        @click="setStatus('ON')"
+        >重新上架</el-button
+      >
       <el-button size="small" @click="handleClose">取消</el-button>
     </div>
   </zj-page-container>
@@ -29,7 +61,13 @@
 
 <script>
 import ImageUpload from '@/components/file-upload'
-import { esGoodsDetail, esGoodsCopy, esGoodsBatchUpdateStatus, esGoodsReply, esGoodsUpdate } from '@/api/commodityManagement'
+import {
+  esGoodsDetail,
+  esGoodsCopy,
+  esGoodsBatchUpdateStatus,
+  esGoodsReply,
+  esGoodsUpdate
+} from '@/api/commodityManagement'
 import { getClassifyList } from '@/api/goods'
 export default {
   components: { ImageUpload },
@@ -43,43 +81,43 @@ export default {
     return {
       classifyList: [],
       formData: {
-        "brand": "",
-        "categoryId": "",
-        "categoryName": "",
-        "companyWechatId": "",
-        "companyWechatName": "",
-        "del": true,
-        "goodsName": "",
-        "goodsNote": "",
-        "imgList": [],
-        "isTop": true,
-        "likeCount": 0,
-        "makeDate": "",
-        "mark": "",
-        "markId": "",
-        "messageList": [],
-        "operateRecordList": [],
-        "power": "",
-        "price": 0,
-        "qty": 0,
-        "queryCount": 0,
-        "remark": "",
-        "sort": 0,
-        "status": "",
-        "topTime": "",
-        "userId": ""
+        brand: '',
+        categoryId: '',
+        categoryName: '',
+        companyWechatId: '',
+        companyWechatName: '',
+        del: true,
+        goodsName: '',
+        goodsNote: '',
+        imgList: [],
+        isTop: true,
+        likeCount: 0,
+        makeDate: '',
+        mark: '',
+        markId: '',
+        messageList: [],
+        operateRecordList: [],
+        power: '',
+        price: 0,
+        qty: 0,
+        queryCount: 0,
+        remark: '',
+        sort: 0,
+        status: '',
+        topTime: '',
+        userId: ''
       },
       formRules: {},
       publishStatus: [
-        { label: '下架', value: "OFF" },
-        { label: '上架', value: "ON" },
-        { label: '已卖出', value: "SALE" },
+        { label: '下架', value: 'OFF' },
+        { label: '上架', value: 'ON' },
+        { label: '已卖出', value: 'SALE' }
       ],
-      cpdata:{},
+      cpdata: {}
     }
   },
   computed: {
-    disabled(){
+    disabled() {
       return ~['ON', 'OFF'].indexOf(this.cpdata?.status) ? false : true
     },
     formItems() {
@@ -87,12 +125,12 @@ export default {
         {
           name: 'el-select',
           md: 12,
-          options: this.classifyList.map(item=>({label: item.name,value: item.categoryId})),
+          options: this.classifyList.map(item => ({ label: item.name, value: item.categoryId })),
           attributes: { disabled: this.disabled },
           formItemAttributes: { label: '商品分类', prop: 'categoryId' },
           events: {
-            change: (val) => {
-              this.formData.categoryName = this.classifyList.find(item=>item.categoryId == val)?.name
+            change: val => {
+              this.formData.categoryName = this.classifyList.find(item => item.categoryId == val)?.name
             }
           }
         },
@@ -142,7 +180,7 @@ export default {
         {
           name: 'el-date-picker',
           md: 6,
-          attributes: { disabled: this.disabled, type:"date", style:{width:'100%'}, "value-format":"yyyy-MM-dd" },
+          attributes: { disabled: this.disabled, type: 'date', style: { width: '100%' }, 'value-format': 'yyyy-MM-dd' },
           formItemAttributes: { label: '制造日期', prop: 'makeDate' }
         },
         {
@@ -171,7 +209,7 @@ export default {
                 placeholder=""
               ></el-input>
             )
-          },
+          }
         },
         {
           name: 'el-input',
@@ -182,11 +220,11 @@ export default {
         {
           name: 'el-radio',
           options: [
-            { label: '一级能效', value: "一级能效" },
-            { label: '二级能效', value: "二级能效" },
-            { label: '三级能效', value: "三级能效" },
-            { label: '四级能效', value: "四级能效" },
-            { label: '五级能效', value: "五级能效" },
+            { label: '一级能效', value: '一级能效' },
+            { label: '二级能效', value: '二级能效' },
+            { label: '三级能效', value: '三级能效' },
+            { label: '四级能效', value: '四级能效' },
+            { label: '五级能效', value: '五级能效' }
           ],
           md: 18,
           attributes: { disabled: this.disabled },
@@ -201,202 +239,248 @@ export default {
             rules: []
           },
           render: (h, { props, onInput }) => {
-            return (
-              <ImageUpload fileList={this.formData.imgList} limit={100} isEdit={!this.disabled}/>
-            )
+            return <ImageUpload fileList={this.formData.imgList} limit={100} isEdit={!this.disabled} />
           }
         }
       ]
     },
     // esOrderInfo
-    formItems2 () {
-      return [{
-        name: 'slot-component',
-        md: 24,
-        attributes: { disabled: this.disabled },
-        formItemAttributes: { label: '', prop: '', 'label-width': '0px' },
-        render: (h, { props }) => {
-          return (<div>
-            <el-row gutter={10}>
-              <el-col xs={24} sm={24} md={8} lg={8} xl={8}>
-                <div class='info'>
-                  <div class='info_title'>卖家信息</div>
-                  <div class='info_bottom'>
-                    <div class='info_bottom_lt'>
-                      {this?.formData?.esOrderInfo?.sellUrl ? <el-image
-                        style='width: 40px; height: 40px'
-                        src={this?.formData?.esOrderInfo?.sellUrl}
-                      >
-                      </el-image>:null}
-                    </div>
-                    <div class='info_bottom_rt'>
-                      <div>微信昵称:{this?.formData?.esOrderInfo?.sellName}</div>
-                      <div>微信手机号:{this?.formData?.esOrderInfo?.sellMobile}</div>
-                      <div>发布时间:{this?.formData?.esOrderInfo?.sellTime}</div>
-                    </div>
-                  </div>
-                </div>
-              </el-col>
-              <el-col xs={24} sm={24} md={8} lg={8} xl={8}>
-                <div class='info'>
-                  <div class='info_title'>买家信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_lt'>
-                        {this?.formData?.esOrderInfo?.wechatUserUrl?<el-image
-                          style='width: 40px; height: 40px'
-                          src={this?.formData?.esOrderInfo?.wechatUserUrl}
-                        >
-                        </el-image>:null}
-                      </div>
-                      <div class='info_bottom_rt'>
-                        <div>微信昵称:{this?.formData?.esOrderInfo?.wechatUserName}</div>
-                        <div>微信手机号:{this?.formData?.esOrderInfo?.wechatUserMobile}</div>
-                        <div>收货人信息:{`(${this?.formData?.esOrderInfo?.userMobile||''}) ${this?.formData?.esOrderInfo?.userMobile||''}`}</div>
-                        <div>收货人地址:{this?.formData?.esOrderInfo?.sellName}</div>
-                        <div>支付方式:{({WECHAT:"微信支付", CASH:"到店支付", TRANSFER:"转账支付"})[this?.formData?.esOrderInfo?.payType]}</div>
+    formItems2() {
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '', prop: '', 'label-width': '0px' },
+          render: (h, { props }) => {
+            return (
+              <div>
+                <el-row gutter={10}>
+                  <el-col xs={24} sm={24} md={8} lg={8} xl={8}>
+                    <div class="info">
+                      <div class="info_title">卖家信息</div>
+                      <div class="info_bottom">
+                        <div class="info_bottom_lt">
+                          {this?.formData?.esOrderInfo?.sellUrl ? (
+                            <el-image
+                              style="width: 40px; height: 40px"
+                              src={this.$showImgUrl(this?.formData?.esOrderInfo?.sellUrl)}
+                            ></el-image>
+                          ) : null}
+                        </div>
+                        <div class="info_bottom_rt">
+                          <div>微信昵称:{this?.formData?.esOrderInfo?.sellName}</div>
+                          <div>微信手机号:{this?.formData?.esOrderInfo?.sellMobile}</div>
+                          <div>发布时间:{this?.formData?.esOrderInfo?.sellTime}</div>
+                        </div>
                       </div>
                     </div>
-                </div>
-              </el-col>
-              {~['SEND','OVER'].indexOf(this?.formData?.esOrderInfo?.status)?<el-col xs={24} sm={24} md={8} lg={8} xl={8}>
-                <div class='info'>
-                  <div class='info_title'>物流信息</div>
-                  <div class='info_bottom'>
-                    <div class='info_bottom_rt'>
-                      <div>
-                        <el-radio-group disabled={true} value={this?.formData?.esOrderInfo?.logisticsType}>
-                          <el-radio label='SELF'>自提</el-radio>
-                          <el-radio label='DELIVERY'>物流</el-radio>
-                        </el-radio-group>
+                  </el-col>
+                  <el-col xs={24} sm={24} md={8} lg={8} xl={8}>
+                    <div class="info">
+                      <div class="info_title">买家信息</div>
+                      <div class="info_bottom">
+                        <div class="info_bottom_lt">
+                          {this?.formData?.esOrderInfo?.wechatUserUrl ? (
+                            <el-image
+                              style="width: 40px; height: 40px"
+                              src={this.$showImgUrl(this?.formData?.esOrderInfo?.wechatUserUrl)}
+                            ></el-image>
+                          ) : null}
+                        </div>
+                        <div class="info_bottom_rt">
+                          <div>微信昵称:{this?.formData?.esOrderInfo?.wechatUserName}</div>
+                          <div>微信手机号:{this?.formData?.esOrderInfo?.wechatUserMobile}</div>
+                          <div>
+                            收货人信息:
+                            {`(${this?.formData?.esOrderInfo?.userMobile || ''}) ${
+                              this?.formData?.esOrderInfo?.userMobile || ''
+                            }`}
+                          </div>
+                          <div>收货人地址:{this?.formData?.esOrderInfo?.sellName}</div>
+                          <div>
+                            支付方式:
+                            {
+                              { WECHAT: '微信支付', CASH: '到店支付', TRANSFER: '转账支付' }[
+                                this?.formData?.esOrderInfo?.payType
+                              ]
+                            }
+                          </div>
+                        </div>
                       </div>
-                      {this?.formData?.esOrderInfo?.logisticsType=="DELIVERY"?<div>快递单号:{this?.formData?.esOrderInfo?.logisticsNo}</div>:null}
-                      {this?.formData?.esOrderInfo?.logisticsType=="DELIVERY"?<div>快递公司:{this?.formData?.esOrderInfo?.logisticsName}</div>:null}
-                      {this?.formData?.esOrderInfo?.logisticsType=="DELIVERY"?<el-button type='primary' size='small' onClick={() => { 
-                        this.$router.push({
-                          name: 'orderManagement',
-                          params: {
-                            pageName: this?.formData?.esOrderInfo?.esOrderId,
-                            pageType: 'materialFlow',
-                            pageCode: this?.formData?.esOrderInfo?.esOrderId,
-                          },
-                        })
-                      }}>查看物流
-                      </el-button>:null}
                     </div>
-                  </div>
-                </div>
-              </el-col>:null}
-            </el-row>
-          </div>)
+                  </el-col>
+                  {~['SEND', 'OVER'].indexOf(this?.formData?.esOrderInfo?.status) ? (
+                    <el-col xs={24} sm={24} md={8} lg={8} xl={8}>
+                      <div class="info">
+                        <div class="info_title">物流信息</div>
+                        <div class="info_bottom">
+                          <div class="info_bottom_rt">
+                            <div>
+                              <el-radio-group disabled={true} value={this?.formData?.esOrderInfo?.logisticsType}>
+                                <el-radio label="SELF">自提</el-radio>
+                                <el-radio label="DELIVERY">物流</el-radio>
+                              </el-radio-group>
+                            </div>
+                            {this?.formData?.esOrderInfo?.logisticsType == 'DELIVERY' ? (
+                              <div>快递单号:{this?.formData?.esOrderInfo?.logisticsNo}</div>
+                            ) : null}
+                            {this?.formData?.esOrderInfo?.logisticsType == 'DELIVERY' ? (
+                              <div>快递公司:{this?.formData?.esOrderInfo?.logisticsName}</div>
+                            ) : null}
+                            {this?.formData?.esOrderInfo?.logisticsType == 'DELIVERY' ? (
+                              <el-button
+                                type="primary"
+                                size="small"
+                                onClick={() => {
+                                  this.$router.push({
+                                    name: 'orderManagement',
+                                    params: {
+                                      pageName: this?.formData?.esOrderInfo?.esOrderId,
+                                      pageType: 'materialFlow',
+                                      pageCode: this?.formData?.esOrderInfo?.esOrderId
+                                    }
+                                  })
+                                }}
+                              >
+                                查看物流
+                              </el-button>
+                            ) : null}
+                          </div>
+                        </div>
+                      </div>
+                    </el-col>
+                  ) : null}
+                </el-row>
+              </div>
+            )
+          }
         }
-      }]
+      ]
     },
     formItems3() {
-      return [{
-        name: 'slot-component',
-        md: 24,
-        attributes: { disabled: this.disabled },
-        formItemAttributes: { label: '', prop: 'messageList', 'label-width': '0px' },
-        render: (h, { props }) => {
-          var { formData } = props
-          return <div>
-            <zj-table
-              columns={[
-                {
-                  columnAttributes: {
-                    label: '留言人名称',
-                    prop: 'createBy'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '留言内容',
-                    prop: 'content'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '留言时间',
-                    prop: 'createTime'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '回复人名称',
-                    prop: 'replyBy'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '回复内容',
-                    prop: 'replyContent'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '回复时间',
-                    prop: 'replyTime'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '操作',
-                  },
-                  render: (h, { row, column, index }) => {
-                    return <div style="padding-left:10px">
-                      <el-button type="text" onClick={() => {this.msgSend(row)}}>回复</el-button>
-                    </div>
-                  }
-                }
-              ]}
-              tableData={this.formData.messageList}>
-            </zj-table>
-          </div>
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '', prop: 'messageList', 'label-width': '0px' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <zj-table
+                  columns={[
+                    {
+                      columnAttributes: {
+                        label: '留言人名称',
+                        prop: 'createBy'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '留言内容',
+                        prop: 'content'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '留言时间',
+                        prop: 'createTime'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '回复人名称',
+                        prop: 'replyBy'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '回复内容',
+                        prop: 'replyContent'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '回复时间',
+                        prop: 'replyTime'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '操作'
+                      },
+                      render: (h, { row, column, index }) => {
+                        return (
+                          <div style="padding-left:10px">
+                            <el-button
+                              type="text"
+                              onClick={() => {
+                                this.msgSend(row)
+                              }}
+                            >
+                              回复
+                            </el-button>
+                          </div>
+                        )
+                      }
+                    }
+                  ]}
+                  tableData={this.formData.messageList}
+                ></zj-table>
+              </div>
+            )
+          }
         }
-      }]
+      ]
     },
     formItems4() {
-      return [{
-        name: 'slot-component',
-        md: 24,
-        attributes: { disabled: this.disabled },
-        formItemAttributes: { label: '', prop: 'operateRecordList', 'label-width': '0px' },
-        render: (h, { props }) => {
-          var { formData } = props
-          return <div>
-            <zj-table
-              columns={[
-                {
-                  columnAttributes: {
-                    label: '操作类型',
-                    prop: 'operateType'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '操作内容',
-                    prop: 'content'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '操作人',
-                    prop: 'createBy'
-                  }
-                },
-                {
-                  columnAttributes: {
-                    label: '操作时间',
-                    prop: 'createTime'
-                  }
-                }
-              ]}
-              tableData={this.formData.operateRecordList}>
-            </zj-table>
-          </div>
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '', prop: 'operateRecordList', 'label-width': '0px' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <zj-table
+                  columns={[
+                    {
+                      columnAttributes: {
+                        label: '操作类型',
+                        prop: 'operateType'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '操作内容',
+                        prop: 'content'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '操作人',
+                        prop: 'createBy'
+                      }
+                    },
+                    {
+                      columnAttributes: {
+                        label: '操作时间',
+                        prop: 'createTime'
+                      }
+                    }
+                  ]}
+                  tableData={this.formData.operateRecordList}
+                ></zj-table>
+              </div>
+            )
+          }
         }
-      }]
-    },
+      ]
+    }
   },
   watch: {
     detailId: {
@@ -411,7 +495,7 @@ export default {
             imgList: res.data.imgList.map(item => {
               return {
                 ...item,
-                url: item.imgUrl,
+                url: item.imgUrl
               }
             })
           }
@@ -419,29 +503,29 @@ export default {
         })
       },
       deep: true,
-      immediate: true,
+      immediate: true
     }
   },
-  created(){
+  created() {
     getClassifyList({
-      status:true,
-      type:5
-    }).then(res=>{
+      status: true,
+      type: 5
+    }).then(res => {
       this.classifyList = res.data
     })
   },
   methods: {
-    msgSend(row){
+    msgSend(row) {
       this.$prompt('留言回复', '回复', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        inputType: "textarea"
+        inputType: 'textarea'
       }).then(({ value }) => {
-        if(value){
+        if (value) {
           esGoodsReply({
-            id:this.detailId,
-            messageId:row.id,
-            content:value
+            id: this.detailId,
+            messageId: row.id,
+            content: value
           }).then(res => {
             this.$message({ type: 'success', message: `设置成功!` })
             esGoodsDetail({ id: this.detailId }).then(res2 => {
@@ -462,39 +546,39 @@ export default {
     copyGoods() {
       esGoodsCopy({ id: this.detailId }).then(res => {
         this.$message({ type: 'success', message: `克隆成功!` })
-        this.$emit('back',{detailId:res.data})
+        this.$emit('back', { detailId: res.data })
       })
     },
-    setStatus(status){
-      esGoodsBatchUpdateStatus({ ids: this.detailId, status:status }).then(res => {
+    setStatus(status) {
+      esGoodsBatchUpdateStatus({ ids: this.detailId, status: status }).then(res => {
         this.$message({ type: 'success', message: `设置成功!` })
         this.handleClose()
       })
     },
     handleSubmit() {
-      this.$refs.formRef.validate((valid) => {
+      this.$refs.formRef.validate(valid => {
         if (valid) {
           esGoodsUpdate({
             ...this.formData,
-            imgList: this.formData.imgList.map(item=>({...item, imgUrl:item.url}))
-          }).then(res=>{
+            imgList: this.formData.imgList.map(item => ({ ...item, imgUrl: item.url }))
+          }).then(res => {
             this.$message({ type: 'success', message: `成功!` })
             this.$emit('back')
           })
         }
-      });
+      })
     },
     handleClose() {
       this.$emit('back')
     },
-    zhuanxiaoshou(){
+    zhuanxiaoshou() {
       this.$router.push({
         name: 'orderManagement',
         params: {
           pageName: this.detailId,
           pageType: 'add',
-          pageCode: this.detailId,
-        },
+          pageCode: this.detailId
+        }
       })
     }
   }
@@ -534,11 +618,11 @@ export default {
   box-sizing: border-box;
   padding-left: 16px;
 
-  ::v-deep &>.zj-page-fill-scroll {
+  ::v-deep & > .zj-page-fill-scroll {
     box-sizing: border-box;
     padding-right: 16px;
 
-    &>div:nth-child(1) {
+    & > div:nth-child(1) {
       margin-top: 20px;
     }
   }

+ 42 - 19
src/views/secondHandMall/commodityManagement/index.vue

@@ -1,7 +1,17 @@
 <template>
-  <template-page ref="pageRef" :get-list="getList" :export-list="exportList" :column-parsing="columnParsing"
-    :more-parameters="moreParameters" :operation="operation()" :operation-column-width="240" :replace-or-not-map="false"
-    :optionsEvensGroup="optionsEvensGroup" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :column-parsing="columnParsing"
+    :more-parameters="moreParameters"
+    :operation="operation()"
+    :operation-column-width="240"
+    :replace-or-not-map="false"
+    :optionsEvensGroup="optionsEvensGroup"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
     <div class="cartographer_big">
       <el-dialog title="编辑" width="100%" :modal="false" :visible.sync="visible" :before-close="handleClose">
         <Form v-if="visible" :detail-id="detailId" @back="handleClose" />
@@ -15,7 +25,13 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import Form from './form.vue'
-import { esGoodsList, esGoodsListExport, esGoodsDel, esGoodsTop, esGoodsBatchUpdateStatus } from '@/api/commodityManagement'
+import {
+  esGoodsList,
+  esGoodsListExport,
+  esGoodsDel,
+  esGoodsTop,
+  esGoodsBatchUpdateStatus
+} from '@/api/commodityManagement'
 export default {
   components: { TemplatePage, Form },
   mixins: [import_mixin, operation_mixin],
@@ -33,8 +49,8 @@ export default {
                   return
                 }
                 esGoodsBatchUpdateStatus({
-                  ids:this.recordSelected.map(item=>item.id).join(","),
-                  status:"ON"
+                  ids: this.recordSelected.map(item => item.id).join(','),
+                  status: 'ON'
                 }).then(res => {
                   this.$message({ type: 'success', message: `设置成功!` })
                   this.$refs.pageRef.refreshList()
@@ -50,8 +66,8 @@ export default {
                   return
                 }
                 esGoodsBatchUpdateStatus({
-                  ids:this.recordSelected.map(item=>item.id).join(","),
-                  status:"OFF"
+                  ids: this.recordSelected.map(item => item.id).join(','),
+                  status: 'OFF'
                 }).then(res => {
                   this.$message({ type: 'success', message: `设置成功!` })
                   this.$refs.pageRef.refreshList()
@@ -107,7 +123,9 @@ export default {
   },
   methods: {
     selectable(row, index) {
-      return ["ON", "OFF"].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
+      return ['ON', 'OFF'].includes(
+        Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0]
+      )
     },
     // 监听勾选变化
     selectionChange(data) {
@@ -131,10 +149,15 @@ export default {
             <div style="padding:0 6px;cursor: pointer;">
               {row.imgUrl
                 ? row.imgUrl
-                  .split(',')
-                  .map(url => (
-                    <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />
-                  ))
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
                 : null}
             </div>
           )
@@ -151,9 +174,9 @@ export default {
           }
         },
         del: {
-          prompt: "是否确定删除?",
+          prompt: '是否确定删除?',
           conditions: ({ row, index, column }) => {
-            return row.status == "SALE"
+            return row.status == 'SALE'
           },
           click: ({ row, index, column }) => {
             esGoodsDel({ id: row.id }).then(res => {
@@ -163,7 +186,7 @@ export default {
           }
         },
         topFix: {
-          prompt: "是否确定置顶?",
+          prompt: '是否确定置顶?',
           conditions: ({ row, index, column }) => {
             return !row.isTop
           },
@@ -175,7 +198,7 @@ export default {
           }
         },
         unTopFix: {
-          prompt: "是否确定取消置顶?",
+          prompt: '是否确定取消置顶?',
           conditions: ({ row, index, column }) => {
             return row.isTop
           },
@@ -192,8 +215,8 @@ export default {
       this.detailId = ''
       this.visible = false
       this.$refs.pageRef.refreshList()
-      if(obj && obj.detailId){
-        this.$nextTick(()=>{
+      if (obj && obj.detailId) {
+        this.$nextTick(() => {
           this.detailId = obj.detailId
           this.visible = true
         })

+ 182 - 103
src/views/secondHandMall/orderManagement/details.vue

@@ -1,14 +1,14 @@
 <template>
   <zj-page-container>
-    <div style="box-sizing: border-box; padding:0 10px;">
+    <div style="box-sizing: border-box; padding: 0 10px">
       <el-tabs v-model="activeName">
         <el-tab-pane label="详情" name="first"></el-tab-pane>
         <el-tab-pane label="操作记录" name="second"></el-tab-pane>
       </el-tabs>
     </div>
     <zj-page-fill>
-      <template v-if="activeName=='first'">
-        <div style="box-sizing: border-box; padding:10px;">
+      <template v-if="activeName == 'first'">
+        <div style="box-sizing: border-box; padding: 10px">
           <div>
             <div class="order-main">
               <el-row style="padding: 15px 15px 10px">
@@ -23,35 +23,80 @@
                 <el-row>
                   <el-col :span="10">
                     <!--  -->
-                    <div v-if="~[0, 1].indexOf(detailsTypeCp)" style="display: flex;">
+                    <div v-if="~[0, 1].indexOf(detailsTypeCp)" style="display: flex">
                       <div>
                         <div class="order-main-status">
-                          <span>{{ ({SAVE: "待支付", WAIT: "待确认", PAID: "待发货", SEND: "卖家发货", OVER: "已完成", TIME_OUT: "超时", CANCEL: "已售后/取消", WAIT_REFUND: "售后中"})[orderDetail.status] }}</span>
+                          <span>{{
+                            {
+                              SAVE: '待支付',
+                              WAIT: '待确认',
+                              PAID: '待发货',
+                              SEND: '卖家发货',
+                              OVER: '已完成',
+                              TIME_OUT: '超时',
+                              CANCEL: '已售后/取消',
+                              WAIT_REFUND: '售后中'
+                            }[orderDetail.status]
+                          }}</span>
                         </div>
                         <div class="order-main-opt-btn">
                           <template>
-                            <el-button v-if="~['SEND','OVER'].indexOf(orderDetail.status)" size="small" type="primary" @click="lookkuaidi">查看物流</el-button>
-                            <el-button v-if="~['SEND','OVER'].indexOf(orderDetail.status)" size="small" type="primary" @click="detailsTypeCp = 2">退货退款</el-button>
+                            <el-button
+                              v-if="~['SEND', 'OVER'].indexOf(orderDetail.status)"
+                              size="small"
+                              type="primary"
+                              @click="lookkuaidi"
+                              >查看物流</el-button
+                            >
+                            <el-button
+                              v-if="~['SEND', 'OVER'].indexOf(orderDetail.status)"
+                              size="small"
+                              type="primary"
+                              @click="detailsTypeCp = 2"
+                              >退货退款</el-button
+                            >
                           </template>
                         </div>
                       </div>
                     </div>
                     <!--  -->
-                    <div  v-if="detailsTypeCp==2">
+                    <div v-if="detailsTypeCp == 2">
                       <el-form ref="formTHref" :model="formTH" label-width="80px" size="mini">
-                        <el-form-item label="处理结果" prop="refundType" :rules="[{ required: true, message: '请选择', trigger: 'blur' }]">
+                        <el-form-item
+                          label="处理结果"
+                          prop="refundType"
+                          :rules="[{ required: true, message: '请选择', trigger: 'blur' }]"
+                        >
                           <el-radio-group v-model="formTH.refundType">
                             <el-radio label="GOODS">仅退货</el-radio>
                             <el-radio label="REFUND">仅退款</el-radio>
                             <el-radio label="GOODS_REFUND">退货退款</el-radio>
                           </el-radio-group>
                         </el-form-item>
-                        <el-form-item v-if="~['GOODS','GOODS_REFUND'].indexOf(formTH.refundType)" label="退货数量" prop="refundNum" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
-                          {{(()=>{ if(formTH.refundType=="GOODS") formTH.refundPrice=""; })()}}
+                        <el-form-item
+                          v-if="~['GOODS', 'GOODS_REFUND'].indexOf(formTH.refundType)"
+                          label="退货数量"
+                          prop="refundNum"
+                          :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
+                        >
+                          {{
+                            (() => {
+                              if (formTH.refundType == 'GOODS') formTH.refundPrice = ''
+                            })()
+                          }}
                           <el-input v-model="formTH.refundNum"></el-input>
                         </el-form-item>
-                        <el-form-item v-if="~['REFUND','GOODS_REFUND'].indexOf(formTH.refundType)" label="退款金额" prop="refundPrice" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
-                          {{(()=>{ if(formTH.refundType=="REFUND") formTH.refundNum=""; })()}}
+                        <el-form-item
+                          v-if="~['REFUND', 'GOODS_REFUND'].indexOf(formTH.refundType)"
+                          label="退款金额"
+                          prop="refundPrice"
+                          :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
+                        >
+                          {{
+                            (() => {
+                              if (formTH.refundType == 'REFUND') formTH.refundNum = ''
+                            })()
+                          }}
                           <el-input type="number" v-model="formTH.refundPrice"></el-input>
                         </el-form-item>
                         <el-form-item label="备注">
@@ -60,82 +105,102 @@
                       </el-form>
                     </div>
                   </el-col>
-                  <el-col  v-if="detailsTypeCp==0" :span="14" style="padding-top: 10px;">
+                  <el-col v-if="detailsTypeCp == 0" :span="14" style="padding-top: 10px">
                     <el-steps :active="zhuangtai" align-center>
-                      <el-step title="买家下单" ></el-step>
-                      <el-step title="买家付款" ></el-step>
-                      <el-step title="卖家发货" ></el-step>
-                      <el-step title="交易成功" ></el-step>
+                      <el-step title="买家下单"></el-step>
+                      <el-step title="买家付款"></el-step>
+                      <el-step title="卖家发货"></el-step>
+                      <el-step title="交易成功"></el-step>
                     </el-steps>
                   </el-col>
                 </el-row>
               </div>
             </div>
-  
+
             <div class="order-receive-info">
               <el-row :gutter="10">
                 <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>卖家信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_lt'>
-                        <el-image v-if="orderDetail.sellUrl" style='width: 40px; height: 40px' :src="orderDetail.sellUrl"></el-image>
+                  <div class="info">
+                    <div class="info_title">卖家信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_lt">
+                        <el-image
+                          v-if="orderDetail.sellUrl"
+                          style="width: 40px; height: 40px"
+                          :src="$showImgUrl(orderDetail.sellUrl)"
+                        ></el-image>
                       </div>
-                      <div class='info_bottom_rt'>
-                        <div>昵称:{{orderDetail.sellName}}</div>
-                        <div>手机号:{{orderDetail.sellMobile}}</div>
-                        <div>发布时间:{{orderDetail.sellTime}}</div>
+                      <div class="info_bottom_rt">
+                        <div>昵称:{{ orderDetail.sellName }}</div>
+                        <div>手机号:{{ orderDetail.sellMobile }}</div>
+                        <div>发布时间:{{ orderDetail.sellTime }}</div>
                       </div>
                     </div>
                   </div>
                 </el-col>
                 <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>买家信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_lt'>
-                        <el-image v-if="orderDetail.wechatUserUrl" style='width: 40px; height: 40px' :src="orderDetail.wechatUserUrl">
+                  <div class="info">
+                    <div class="info_title">买家信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_lt">
+                        <el-image
+                          v-if="orderDetail.wechatUserUrl"
+                          style="width: 40px; height: 40px"
+                          :src="$showImgUrl(orderDetail.wechatUserUrl)"
+                        >
                         </el-image>
                       </div>
-                      <div class='info_bottom_rt'>
-                        <div v-if="orderDetail.wechatUserName">昵称:{{orderDetail.wechatUserName}}</div>
-                        <div v-if="orderDetail.wechatUserMobile">手机号:{{orderDetail.wechatUserMobile}}</div>
-                        <div>收货人信息:({{orderDetail.userName}}){{orderDetail.userMobile}}</div>
-                        <div>收货人地址:{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress }}</div>
-                        <div>支付方式:{{({WECHAT:"微信支付", CASH:"到店支付", TRANSFER:"转账支付"})[orderDetail.payType]}}</div>
+                      <div class="info_bottom_rt">
+                        <div v-if="orderDetail.wechatUserName">昵称:{{ orderDetail.wechatUserName }}</div>
+                        <div v-if="orderDetail.wechatUserMobile">手机号:{{ orderDetail.wechatUserMobile }}</div>
+                        <div>收货人信息:({{ orderDetail.userName }}){{ orderDetail.userMobile }}</div>
+                        <div>
+                          收货人地址:{{
+                            orderDetail.province +
+                            orderDetail.city +
+                            orderDetail.area +
+                            orderDetail.street +
+                            orderDetail.receAddress
+                          }}
+                        </div>
+                        <div>
+                          支付方式:{{
+                            { WECHAT: '微信支付', CASH: '到店支付', TRANSFER: '转账支付' }[orderDetail.payType]
+                          }}
+                        </div>
                       </div>
                     </div>
                   </div>
                 </el-col>
-                <el-col v-if="~['SEND','OVER'].indexOf(orderDetail.status)" :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>物流信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_rt'>
+                <el-col v-if="~['SEND', 'OVER'].indexOf(orderDetail.status)" :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
+                  <div class="info">
+                    <div class="info_title">物流信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_rt">
                         <div>
                           <el-radio-group disabled v-model="orderDetail.pickType">
-                            <el-radio label='YES'>自提</el-radio>
-                            <el-radio label='NO'>物流</el-radio>
+                            <el-radio label="YES">自提</el-radio>
+                            <el-radio label="NO">物流</el-radio>
                           </el-radio-group>
                         </div>
-                        <div v-if="orderDetail.pickType=='NO'">快递单号:{{orderDetail.logisticsNo}}</div>
-                        <div v-if="orderDetail.pickType=='NO'">快递公司:{{orderDetail.logisticsName}}</div>
+                        <div v-if="orderDetail.pickType == 'NO'">快递单号:{{ orderDetail.logisticsNo }}</div>
+                        <div v-if="orderDetail.pickType == 'NO'">快递公司:{{ orderDetail.logisticsName }}</div>
                       </div>
                     </div>
                   </div>
                 </el-col>
               </el-row>
             </div>
-  
+
             <h3>商品信息</h3>
-            <div class="order-main" style="border:none;">
+            <div class="order-main" style="border: none">
               <!-- 订单表格 -->
               <el-table :data="[orderDetail]" style="width: 100%" border>
                 <el-table-column label="商品信息" min-width="200">
                   <template slot-scope="scope">
                     <el-row>
                       <el-col v-if="scope.row.goodsUrl" :span="6">
-                        <el-image style="width: 40px; height: 40px" :src="scope.row.goodsUrl">
+                        <el-image style="width: 40px; height: 40px" :src="$showImgUrl(scope.row.goodsUrl)">
                           <div slot="error" class="image-slot">
                             <i class="el-icon-picture-outline"></i>
                           </div>
@@ -153,19 +218,23 @@
                 <el-table-column prop="refundPrice" label="退款金额" align="center"></el-table-column>
               </el-table>
             </div>
-  
-            <h3 v-if="detailsTypeCp==1">收款信息</h3>
-            <div v-if="detailsTypeCp==1" class="order-main">
+
+            <h3 v-if="detailsTypeCp == 1">收款信息</h3>
+            <div v-if="detailsTypeCp == 1" class="order-main">
               <div style="width: 100%; padding: 10px 15px 15px 15px">
                 <el-row>
                   <el-col :span="10">
                     <div>
                       <el-form ref="formSKref" :model="formSK" label-width="80px" size="mini">
-                        <el-form-item label="收款金额" prop="price" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
+                        <el-form-item
+                          label="收款金额"
+                          prop="price"
+                          :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
+                        >
                           <el-input type="number" v-model="formSK.price"></el-input>
                         </el-form-item>
                         <el-form-item label="收款金额" prop="fileUrl">
-                          <ImageUpload :fileList="formSK.fileUrl" :limit="1"/>
+                          <ImageUpload :fileList="formSK.fileUrl" :limit="1" />
                         </el-form-item>
                         <el-form-item label="备注" prop="remark">
                           <el-input type="textarea" v-model="formSK.remark"></el-input>
@@ -179,15 +248,19 @@
           </div>
         </div>
       </template>
-      <template v-if="activeName=='second'">
-        <div style="box-sizing: border-box; padding:10px;">
+      <template v-if="activeName == 'second'">
+        <div style="box-sizing: border-box; padding: 10px">
           <div>
-            <div class="order-main" style="border:none;">
+            <div class="order-main" style="border: none">
               <el-table :data="orderPayPriceList" style="width: 100%" border>
                 <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
                 <el-table-column prop="fileUrl" label="收款凭证" min-width="200">
                   <template slot-scope="scope">
-                    <el-image v-if="scope.row.fileUrl" style="width: 40px; height: 40px" :src="scope.row.fileUrl">
+                    <el-image
+                      v-if="scope.row.fileUrl"
+                      style="width: 40px; height: 40px"
+                      :src="$showImgUrl(scope.row.fileUrl)"
+                    >
                       <div slot="error" class="image-slot">
                         <i class="el-icon-picture-outline"></i>
                       </div>
@@ -202,59 +275,65 @@
         </div>
       </template>
     </zj-page-fill>
-    <div style="box-sizing: border-box; padding: 10px; text-align: right;">
+    <div style="box-sizing: border-box; padding: 10px; text-align: right">
       <!-- 确定退货退款 -->
-      <el-button v-if="detailsTypeCp==2" type="primary" size="small" @click="faqituikuan">确定</el-button>
+      <el-button v-if="detailsTypeCp == 2" type="primary" size="small" @click="faqituikuan">确定</el-button>
       <!-- 确认收款 -->
-      <el-button v-if="detailsTypeCp==1" type="primary" size="small" @click="quererndingda">确认收款</el-button>
+      <el-button v-if="detailsTypeCp == 1" type="primary" size="small" @click="quererndingda">确认收款</el-button>
     </div>
   </zj-page-container>
 </template>
 
 <script>
-import { esOrderDetail, esOrderRefund, esOrderPayPrice, esOrderPayPriceList } from "@/api/orderManagement";
+import { esOrderDetail, esOrderRefund, esOrderPayPrice, esOrderPayPriceList } from '@/api/orderManagement'
 import ImageUpload from '@/components/file-upload'
 export default {
-  components:{
+  components: {
     ImageUpload
   },
-  props:{
+  props: {
     detailsId: {
       type: [String, Number],
-      default: ""
+      default: ''
     },
     detailsType: {
       type: [String, Number],
-      default: ""
-    },
+      default: ''
+    }
   },
   data() {
     return {
-      activeName: "first",
+      activeName: 'first',
       detailsTypeCp: this.detailsType,
       // 退货退款表单
       formTH: {
-        refundType: "",
-        refundNum: "",
-        refundPrice: "",
-        refundRemark: "",
+        refundType: '',
+        refundNum: '',
+        refundPrice: '',
+        refundRemark: ''
       },
       // 收款表单
       formSK: {
-        fileUrl:[]
+        fileUrl: []
       },
       // 订单详情
-      orderDetail: {
-      },
+      orderDetail: {},
       // 物流详情
-      expressDetail: {
-      },
-      orderPayPriceList:[],
+      expressDetail: {},
+      orderPayPriceList: []
     }
   },
-  computed:{
-    zhuangtai(){
-      return  !!~['SAVE','WAIT'].indexOf(this.orderDetail.status)?1:!!~['PAID'].indexOf(this.orderDetail.status)?2:!!~['SEND'].indexOf(this.orderDetail.status)?3:!!~['OVER'].indexOf(this.orderDetail.status)?4:-1
+  computed: {
+    zhuangtai() {
+      return !!~['SAVE', 'WAIT'].indexOf(this.orderDetail.status)
+        ? 1
+        : !!~['PAID'].indexOf(this.orderDetail.status)
+        ? 2
+        : !!~['SEND'].indexOf(this.orderDetail.status)
+        ? 3
+        : !!~['OVER'].indexOf(this.orderDetail.status)
+        ? 4
+        : -1
     }
   },
   watch: {
@@ -263,53 +342,53 @@ export default {
         this.getEsOrderDetail()
       },
       deep: true,
-      immediate: true,
-    },
+      immediate: true
+    }
   },
   methods: {
-    getEsOrderDetail(){
+    getEsOrderDetail() {
       esOrderDetail({
         esOrderId: this.detailsId
-      }).then(res=>{
+      }).then(res => {
         this.orderDetail = {
           ...res.data
         }
       })
       esOrderPayPriceList({
         esOrderId: this.detailsId
-      }).then(res=>{
+      }).then(res => {
         this.orderPayPriceList = res.data
       })
     },
-    lookkuaidi(){
-      this.$emit("viewMaterialFlow", {...this.orderDetail})
+    lookkuaidi() {
+      this.$emit('viewMaterialFlow', { ...this.orderDetail })
     },
-    faqituikuan(){
-      this.$refs.formTHref.validate((valid) => {
+    faqituikuan() {
+      this.$refs.formTHref.validate(valid => {
         if (valid) {
           esOrderRefund({
             esOrderId: this.detailsId,
             ...this.formTH
-          }).then(res=>{
+          }).then(res => {
             this.$message({ type: 'success', message: `确定退货退款成功!` })
-            this.$emit("removeTab")
+            this.$emit('removeTab')
           })
         }
-      });
+      })
     },
-    quererndingda(){
-      this.$refs.formSKref.validate((valid) => {
+    quererndingda() {
+      this.$refs.formSKref.validate(valid => {
         if (valid) {
           esOrderPayPrice({
             esOrderId: this.detailsId,
             ...this.formSK,
-            fileUrl: this.formSK.fileUrl.map(item=>item.url).join(",")
-          }).then(res=>{
+            fileUrl: this.formSK.fileUrl.map(item => item.url).join(',')
+          }).then(res => {
             this.$message({ type: 'success', message: `确认收款成功!` })
-            this.$emit("removeTab")
+            this.$emit('removeTab')
           })
         }
-      });
+      })
     }
   }
 }
@@ -358,7 +437,7 @@ export default {
   .order-main-status {
     padding: 15px 0;
     font-size: 24px;
-    color: #409EFF;
+    color: #409eff;
   }
 
   .order-main-opt-btn {
@@ -485,4 +564,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 283 - 173
src/views/secondHandMall/orderManagement/index.vue

@@ -1,10 +1,16 @@
 <template>
   <zj-page-container>
     <zj-page-fill>
-      <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
-        <template slot-scope="{activeKey, data}">
-          <div :style="{height:activeKey == 'list'?'100%':'0px'}" style="width:100%; height:100%; overflow: hidden;">
-            <div style="width:100%; height:100%;box-sizing: border-box; padding:10px;">
+      <zj-tab-page
+        ref="tabPage"
+        :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]"
+      >
+        <template slot-scope="{ activeKey, data }">
+          <div
+            :style="{ height: activeKey == 'list' ? '100%' : '0px' }"
+            style="width: 100%; height: 100%; overflow: hidden"
+          >
+            <div style="width: 100%; height: 100%; box-sizing: border-box; padding: 10px">
               <zj-page-container>
                 <div class="screen-container">
                   <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
@@ -30,23 +36,34 @@
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6">
-                        <el-form-item label="创建时间" prop="createDate" style="height: 33px;">
-                          <el-date-picker v-model="screenForm.createDate" type="datetimerange"
-                            value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
-                            end-placeholder="结束日期">
+                        <el-form-item label="创建时间" prop="createDate" style="height: 33px">
+                          <el-date-picker
+                            v-model="screenForm.createDate"
+                            type="datetimerange"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                          >
                           </el-date-picker>
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6">
-                        <el-form-item label="支付时间" prop="payDate" style="height: 33px;">
-                          <el-date-picker v-model="screenForm.payDate" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
-                            range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+                        <el-form-item label="支付时间" prop="payDate" style="height: 33px">
+                          <el-date-picker
+                            v-model="screenForm.payDate"
+                            type="datetimerange"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            range-separator="至"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                          >
                           </el-date-picker>
                         </el-form-item>
                       </el-col>
                       <el-col :xs="24" :sm="12" :lg="6" class="tr">
                         <el-form-item label="" label-width="0px">
-                          <div style="text-align: left;">
+                          <div style="text-align: left">
                             <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
                             <el-button size="small" @click="resetScreenForm">清空</el-button>
                           </div>
@@ -55,9 +72,16 @@
                     </el-row>
                   </el-form>
                 </div>
-                <div class="tabs-container order-tabs-container clearfix" style="margin: 10px 0!important;">
+                <div class="tabs-container order-tabs-container clearfix" style="margin: 10px 0 !important">
                   <div class="fl">
-                    <el-tabs v-model="tabCurrent" type="card" @tab-click="changeTabs" class="fl" size="small" style="margin-right: 10px">
+                    <el-tabs
+                      v-model="tabCurrent"
+                      type="card"
+                      @tab-click="changeTabs"
+                      class="fl"
+                      size="small"
+                      style="margin-right: 10px"
+                    >
                       <el-tab-pane label="全部" name="ALL"></el-tab-pane>
                       <el-tab-pane label="待付款" name="SAVE"></el-tab-pane>
                       <el-tab-pane label="待确认" name="WAIT"></el-tab-pane>
@@ -76,7 +100,7 @@
                 <zj-page-fill>
                   <div class="order-main-container">
                     <div class="table-top">
-                      <el-row style="width:100%">
+                      <el-row style="width: 100%">
                         <el-col :span="3">
                           <span class="item product">商品信息</span>
                         </el-col>
@@ -92,21 +116,23 @@
                       <div class="order-top">
                         <span><b>订单号</b>:{{ order.esOrderId }}</span>
                         <span><b>下单时间</b>:{{ order.createTime }}</span>
-                        <el-tag v-if="~[2,'2'].indexOf(order.saleType)">线下销售</el-tag>
-                        <el-tag v-if="~[1,'1'].indexOf(order.saleType)">线上销售</el-tag>
-                        <el-tag v-if="order.saleType==1 && order.payType == 'WECHAT'">在线支付</el-tag>
-                        <el-tag v-if="(order.saleType==1 && order.payType != 'WECHAT') || order.saleType==2">到店支付</el-tag>
+                        <el-tag v-if="~[2, '2'].indexOf(order.saleType)">线下销售</el-tag>
+                        <el-tag v-if="~[1, '1'].indexOf(order.saleType)">线上销售</el-tag>
+                        <el-tag v-if="order.saleType == 1 && order.payType == 'WECHAT'">在线支付</el-tag>
+                        <el-tag v-if="(order.saleType == 1 && order.payType != 'WECHAT') || order.saleType == 2"
+                          >到店支付</el-tag
+                        >
                         <el-tag v-if="~[0].indexOf(order.totalAmount)">面议</el-tag>
                         <div class="fr"></div>
                       </div>
                       <div class="order-content">
-                        <el-row style="width:100%;">
-                          <el-col :span="6" style="height: 100%;">
+                        <el-row style="width: 100%">
+                          <el-col :span="6" style="height: 100%">
                             <div class="col-item-pro">
                               <div class="pro-item">
                                 <div class="left">
                                   <div class="image">
-                                    <img :src="order.goodsUrl" style="height:80px;width: 80px;">
+                                    <img :src="$showImgUrl(order.goodsUrl)" style="height: 80px; width: 80px" />
                                   </div>
                                   <div class="main">
                                     <span>{{ order.esGoodsName }}</span>
@@ -119,45 +145,107 @@
                               </div>
                             </div>
                           </el-col>
-                          <el-col :span="4" style="height: 100%;">
+                          <el-col :span="4" style="height: 100%">
                             <div class="col-item">
                               <div>{{ order.userName }}</div>
                               <div>{{ order.userMobile }}</div>
                             </div>
                           </el-col>
-                          <el-col :span="4" style="height: 100%;">
+                          <el-col :span="4" style="height: 100%">
                             <div class="col-item">
                               <div>{{ order.userName }}/{{ order.userMobile }}</div>
-                              <div class="ellipsis-2">{{ order.province + order.city + order.area + order.street + order.receAddress }}</div>
+                              <div class="ellipsis-2">
+                                {{ order.province + order.city + order.area + order.street + order.receAddress }}
+                              </div>
                             </div>
                           </el-col>
-                          <el-col :span="4" style="height: 100%;">
+                          <el-col :span="4" style="height: 100%">
                             <div class="col-item">
                               <div class="totalprice">¥{{ order.totalAmount }}</div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
+                          <el-col :span="3" style="height: 100%">
                             <div class="col-item">
-                              <div style="display: flex; align-items: center;">
-                                <span style="margin-left: 4px">{{ ({SAVE: "待支付", WAIT: "待确认", PAID: "待发货", SEND: "卖家发货", OVER: "已完成", TIME_OUT: "超时", CANCEL: "已售后/取消", WAIT_REFUND: "售后中", REFUND: "已退"})[order.status] }}</span>
+                              <div style="display: flex; align-items: center">
+                                <span style="margin-left: 4px">{{
+                                  {
+                                    SAVE: '待支付',
+                                    WAIT: '待确认',
+                                    PAID: '待发货',
+                                    SEND: '卖家发货',
+                                    OVER: '已完成',
+                                    TIME_OUT: '超时',
+                                    CANCEL: '已售后/取消',
+                                    WAIT_REFUND: '售后中',
+                                    REFUND: '已退'
+                                  }[order.status]
+                                }}</span>
                               </div>
                             </div>
                           </el-col>
-                          <el-col :span="3" style="height: 100%;">
-                            <div class="col-item">  
+                          <el-col :span="3" style="height: 100%">
+                            <div class="col-item">
                               <div class="operate">
-                                <el-popconfirm v-if="~['WAIT'].indexOf(order.status)" title="确认订单吗?" @confirm="quedingesOrderPayOk(order)">
+                                <el-popconfirm
+                                  v-if="~['WAIT'].indexOf(order.status)"
+                                  title="确认订单吗?"
+                                  @confirm="quedingesOrderPayOk(order)"
+                                >
                                   <el-button slot="reference" type="text" size="small">确认订单</el-button>
                                 </el-popconfirm>
-                                <el-popconfirm v-if="~['SAVE','WAIT'].indexOf(order.status)" title="确认取消订单吗?" @confirm="quedingesOrderCancel(order)">
+                                <el-popconfirm
+                                  v-if="~['SAVE', 'WAIT'].indexOf(order.status)"
+                                  title="确认取消订单吗?"
+                                  @confirm="quedingesOrderCancel(order)"
+                                >
                                   <el-button slot="reference" type="text" size="small">取消订单</el-button>
                                 </el-popconfirm>
-                                <el-button v-if="~['SEND','OVER'].indexOf(order.status)" @click="viewMaterialFlow(order)" type="text" size="small">查看物流</el-button>
-                                <el-button v-if="~['SAVE', 'WAIT', 'PAID', 'SEND', 'OVER', 'CANCEL', 'TIME_OUT'].indexOf(order.status)" @click="viewDetails(order, 0)" type="text" size="small">查看详情</el-button>
-                                <el-button v-if="~['CASH'].indexOf(order.payType) && ~['SAVE'].indexOf(order.status)" @click="viewDetails(order, 1)" type="text" size="small">确认收款</el-button>
-                                <el-button v-if="~['SEND','OVER','CANCEL'].indexOf(order.status) && order.payStatus=='PAID'" @click="viewDetails(order, 2)" type="text" size="small">发起退货</el-button>
-                                <el-button v-if="~['PAID'].indexOf(order.status)" type="text" @click="gofahuo(order)" size="small">发货</el-button>
-                                <el-button v-if="~['PAID','SEND'].indexOf(order.status)" type="text" size="small" @click="toPrint(order)">打印</el-button>
+                                <el-button
+                                  v-if="~['SEND', 'OVER'].indexOf(order.status)"
+                                  @click="viewMaterialFlow(order)"
+                                  type="text"
+                                  size="small"
+                                  >查看物流</el-button
+                                >
+                                <el-button
+                                  v-if="
+                                    ~['SAVE', 'WAIT', 'PAID', 'SEND', 'OVER', 'CANCEL', 'TIME_OUT'].indexOf(
+                                      order.status
+                                    )
+                                  "
+                                  @click="viewDetails(order, 0)"
+                                  type="text"
+                                  size="small"
+                                  >查看详情</el-button
+                                >
+                                <el-button
+                                  v-if="~['CASH'].indexOf(order.payType) && ~['SAVE'].indexOf(order.status)"
+                                  @click="viewDetails(order, 1)"
+                                  type="text"
+                                  size="small"
+                                  >确认收款</el-button
+                                >
+                                <el-button
+                                  v-if="~['SEND', 'OVER', 'CANCEL'].indexOf(order.status) && order.payStatus == 'PAID'"
+                                  @click="viewDetails(order, 2)"
+                                  type="text"
+                                  size="small"
+                                  >发起退货</el-button
+                                >
+                                <el-button
+                                  v-if="~['PAID'].indexOf(order.status)"
+                                  type="text"
+                                  @click="gofahuo(order)"
+                                  size="small"
+                                  >发货</el-button
+                                >
+                                <el-button
+                                  v-if="~['PAID', 'SEND'].indexOf(order.status)"
+                                  type="text"
+                                  size="small"
+                                  @click="toPrint(order)"
+                                  >打印</el-button
+                                >
                               </div>
                             </div>
                           </el-col>
@@ -167,11 +255,17 @@
                     <div class="no-data" v-if="dataList.length <= 0">暂无订单</div>
                   </div>
                 </zj-page-fill>
-                <div class="pagination clearfix" style="margin-top:10px;">
+                <div class="pagination clearfix" style="margin-top: 10px">
                   <div class="fr">
-                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                      :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10"
-                      layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
+                    <el-pagination
+                      @size-change="handleSizeChange"
+                      @current-change="handleCurrentChange"
+                      :current-page="currentPage"
+                      :page-sizes="[10, 20, 30, 50]"
+                      :page-size="10"
+                      layout="total, sizes, prev, pager, next, jumper"
+                      :total="listTotal"
+                    >
                     </el-pagination>
                   </div>
                 </div>
@@ -179,29 +273,47 @@
             </div>
           </div>
           <!-- 新增 -->
-          <div v-if="activeKey == 'add'" style="width:100%;height:100%;">
-            <add :detailsId="detailsId" :detailsType="detailsType" @removeTab="()=>{
-              getList()
-              data.removeTab()
-            }"/>
+          <div v-if="activeKey == 'add'" style="width: 100%; height: 100%">
+            <add
+              :detailsId="detailsId"
+              :detailsType="detailsType"
+              @removeTab="
+                () => {
+                  getList()
+                  data.removeTab()
+                }
+              "
+            />
           </div>
           <!-- 查看详情 / 确认收款 / 退货-->
-          <div v-if="~activeKey.indexOf('details_')" style="width:100%;height:100%;">
-            <detailsV :detailsId="detailsId" :detailsType="detailsType" @viewMaterialFlow="viewMaterialFlow" @removeTab="()=>{
-              getList()
-              data.removeTab()
-            }"/>
+          <div v-if="~activeKey.indexOf('details_')" style="width: 100%; height: 100%">
+            <detailsV
+              :detailsId="detailsId"
+              :detailsType="detailsType"
+              @viewMaterialFlow="viewMaterialFlow"
+              @removeTab="
+                () => {
+                  getList()
+                  data.removeTab()
+                }
+              "
+            />
           </div>
           <!-- 查看物流 -->
-          <div v-if="activeKey == 'materialFlow'" style="width:100%;height:100%;">
-            <materialFlow :detailsId="detailsId"/>
+          <div v-if="activeKey == 'materialFlow'" style="width: 100%; height: 100%">
+            <materialFlow :detailsId="detailsId" />
           </div>
           <!-- 发货 -->
-          <div v-if="activeKey == 'fahuo'" style="width:100%;height:100%;">
-            <deliverGoods :detailsId="detailsId" @removeTab="()=>{
-              getList()
-              data.removeTab()
-            }"/>
+          <div v-if="activeKey == 'fahuo'" style="width: 100%; height: 100%">
+            <deliverGoods
+              :detailsId="detailsId"
+              @removeTab="
+                () => {
+                  getList()
+                  data.removeTab()
+                }
+              "
+            />
           </div>
         </template>
       </zj-tab-page>
@@ -211,23 +323,24 @@
 </template>
 
 <script>
-import { esOrderList, esOrderListExcel, esOrderPayOk, esOrderCancel, esOrderDetail } from "@/api/orderManagement";
-import add from "./add.vue"
-import detailsV from "./details.vue"
-import materialFlow from "./materialFlow.vue"
-import deliverGoods from "./deliverGoods.vue"
+import { esOrderList, esOrderListExcel, esOrderPayOk, esOrderCancel, esOrderDetail } from '@/api/orderManagement'
+import add from './add.vue'
+import detailsV from './details.vue'
+import materialFlow from './materialFlow.vue'
+import deliverGoods from './deliverGoods.vue'
 import '@/styles/order-list.scss'
 import { downloadFiles } from '@/utils/util'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
 import printPreview from '../components/preview.vue'
 export default {
-  components: {add, detailsV, materialFlow, deliverGoods, printPreview},
+  components: { add, detailsV, materialFlow, deliverGoods, printPreview },
   data() {
     return {
-      pageType:this?.$route?.params?.pageType,
-      pageCode:this?.$route?.params?.pageCode,
-      pagePam:this?.$route?.params?.pagePam,
-      screenForm: { // 筛选表单数据
+      pageType: this?.$route?.params?.pageType,
+      pageCode: this?.$route?.params?.pageCode,
+      pagePam: this?.$route?.params?.pagePam,
+      screenForm: {
+        // 筛选表单数据
         orderId: '', // 订单号
         esGoodsName: '', // 商品名称
         userName: '', // 会员昵称
@@ -239,129 +352,121 @@ export default {
         exchangeCode: '', // 兑换码
         evaluateStatus: '', // 评价状态
         sendStatus: '', // 派单异常
-        workerOrderNo: '', // 信息编号
+        workerOrderNo: '' // 信息编号
       },
       tabCurrent: 'ALL',
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       dataList: [],
-      detailsId: "",
-      detailsType: "",
+      detailsId: '',
+      detailsType: ''
     }
   },
   created() {
-    this.getList();
-    if(this.pageType==="detail" && this.pageCode){
-      this.$nextTick(()=>{
-        this.viewDetails({esOrderId:this.pageCode},0)
+    this.getList()
+    if (this.pageType === 'detail' && this.pageCode) {
+      this.$nextTick(() => {
+        this.viewDetails({ esOrderId: this.pageCode }, 0)
       })
     }
-    if(this.pageType==="materialFlow" && this.pageCode){
-      this.$nextTick(()=>{
-        this.viewMaterialFlow({esOrderId:this.pageCode})
+    if (this.pageType === 'materialFlow' && this.pageCode) {
+      this.$nextTick(() => {
+        this.viewMaterialFlow({ esOrderId: this.pageCode })
       })
     }
-    if(this.pageType==="add" && this.pageCode){
-      this.$nextTick(()=>{
+    if (this.pageType === 'add' && this.pageCode) {
+      this.$nextTick(() => {
         this.add(0)
       })
     }
   },
   methods: {
-    quedingesOrderPayOk(row){
+    quedingesOrderPayOk(row) {
       esOrderPayOk({
-        esOrderId:row.esOrderId
-      }).then(res=>{
+        esOrderId: row.esOrderId
+      }).then(res => {
         this.$message({ type: 'success', message: `确定成功!` })
-        this.getList();
+        this.getList()
       })
     },
-    quedingesOrderCancel(row){
+    quedingesOrderCancel(row) {
       esOrderCancel({
-        esOrderId:row.esOrderId
-      }).then(res=>{
+        esOrderId: row.esOrderId
+      }).then(res => {
         this.$message({ type: 'success', message: `取消成功!` })
-        this.getList();
+        this.getList()
       })
     },
-    add(type){
+    add(type) {
       this.$refs.tabPage.addTab({
         // 对应显示的模块
-        activeKey: "add",
+        activeKey: 'add',
         // 唯一标识
-        key: "add",
+        key: 'add',
         // 页签名称
-        label: "新增订单",
+        label: '新增订单',
         // 打开时事件
         triggerEvent: () => {
           this.detailsType = type
         },
         // 关闭时事件
-        closeEvent: () => {
-          
-        }
+        closeEvent: () => {}
       })
     },
-    viewDetails(row, type){
+    viewDetails(row, type) {
       this.$refs.tabPage.addTab({
         // 对应显示的模块
-        activeKey: "details_"+type,
+        activeKey: 'details_' + type,
         // 唯一标识
-        key: "details_"+type,
+        key: 'details_' + type,
         // 页签名称
-        label: ["订单详情", "确认收款", "退货退款"][type],
+        label: ['订单详情', '确认收款', '退货退款'][type],
         // 打开时事件
         triggerEvent: () => {
           this.detailsId = row.esOrderId
           this.detailsType = type
         },
         // 关闭时事件
-        closeEvent: () => {
-          
-        }
+        closeEvent: () => {}
       })
     },
-    viewMaterialFlow(row){
+    viewMaterialFlow(row) {
       this.$refs.tabPage.addTab({
         // 对应显示的模块
-        activeKey: "materialFlow",
+        activeKey: 'materialFlow',
         // 唯一标识
-        key: "materialFlow",
+        key: 'materialFlow',
         // 页签名称
-        label: "查看物流",
+        label: '查看物流',
         // 打开时事件
         triggerEvent: () => {
           this.detailsId = row.esOrderId
         },
         // 关闭时事件
-        closeEvent: () => {
-          
-        }
+        closeEvent: () => {}
       })
     },
-    gofahuo (row) {
+    gofahuo(row) {
       this.$refs.tabPage.addTab({
         // 对应显示的模块
-        activeKey: "fahuo",
+        activeKey: 'fahuo',
         // 唯一标识
-        key: "fahuo",
+        key: 'fahuo',
         // 页签名称
-        label: "发货",
+        label: '发货',
         // 打开时事件
         triggerEvent: () => {
           this.detailsId = row.esOrderId
         },
         // 关闭时事件
-        closeEvent: () => {
-          
-        }
+        closeEvent: () => {}
       })
     },
     changeTabs(tab, event) {
       this.screenForm.status = this.tabCurrent === 'ALL' ? '' : tab.$options.propsData.name
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
     // 获取数据列表
     getList() {
@@ -377,36 +482,36 @@ export default {
         endPayTime: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
         pageNum: this.currentPage,
         pageSize: this.pageSize
-      };
+      }
       esOrderList(params).then(res => {
         res.data.records.forEach(item => {
-          item.selected = false;
-        });
-        this.dataList = res.data.records;
-        this.listTotal = res.data.total;
+          item.selected = false
+        })
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
       })
     },
     // 更改每页数量
     handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.getList();
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
     },
     // 更改当前页
     handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getList();
+      this.currentPage = val
+      this.getList()
     },
     // 提交筛选表单
     submitScreenForm() {
-      this.currentPage = 1;
-      this.getList();
+      this.currentPage = 1
+      this.getList()
     },
     // 重置筛选表单
     resetScreenForm() {
-      this.$refs.screenForm.resetFields();
-      this.currentPage = 1;
-      this.getList();
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
     },
     // 导出
     handleExport() {
@@ -422,26 +527,26 @@ export default {
         endPayTime: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
         pageNum: this.currentPage,
         pageSize: this.pageSize
-      };
-      downloadFiles('esOrder/listExcel', params);
+      }
+      downloadFiles('esOrder/listExcel', params)
     },
     // 点击打印
-		async toPrint(row) {
-			const { data } = await esOrderDetail({
+    async toPrint(row) {
+      const { data } = await esOrderDetail({
         esOrderId: row.esOrderId
       })
-			// 初始化模板,否则生成的模板叠加
-			hiprint.init()
-			this.hiprintTemplate = new hiprint.PrintTemplate()
-			// 使用 i-- 提升for效率
-			this.$startLoading()
+      // 初始化模板,否则生成的模板叠加
+      hiprint.init()
+      this.hiprintTemplate = new hiprint.PrintTemplate()
+      // 使用 i-- 提升for效率
+      this.$startLoading()
       try {
         let num = data.num
         let totalAmount = Number(data.num) * Number(data.goodsPrice)
         let html = `
           <tr align="center">
           <td>${data.esGoodsName || ''}</td>
-          <td>${data.unit||''}</td>
+          <td>${data.unit || ''}</td>
           <td>${data.num}</td>
           <td>${data.goodsPrice}</td>
           <td>${totalAmount}</td>
@@ -473,25 +578,29 @@ export default {
         this.$endLoading()
         return
       }
-			this.$endLoading()
-			// 预览打印内容
-			this.$refs.preView.show(this.hiprintTemplate, this.panel)
-		},
-		// 打印模板
-		setTableDom(data, html, totalAmount, num, length, page) {
-      let now = new Date();
-      let year = now.getFullYear();
-      let month = now.getMonth() + 1; // 月份是从 0 开始计数的,所以要加 1
-      let day = now.getDate();
-      let hours = now.getHours();
-      let minutes = now.getMinutes();
-      let seconds = now.getSeconds();
-      let nowTime = `${year}-${month < 10 ? '0'+month : month}-${day < 10 ? '0'+day : day} ${hours < 10 ? '0'+hours : hours}:${minutes < 10 ? '0'+minutes : minutes}:${seconds < 10 ? '0'+seconds : seconds}`
-      let showpPrintCount = `打印日期: ${nowTime}`;
-			return `
+      this.$endLoading()
+      // 预览打印内容
+      this.$refs.preView.show(this.hiprintTemplate, this.panel)
+    },
+    // 打印模板
+    setTableDom(data, html, totalAmount, num, length, page) {
+      let now = new Date()
+      let year = now.getFullYear()
+      let month = now.getMonth() + 1 // 月份是从 0 开始计数的,所以要加 1
+      let day = now.getDate()
+      let hours = now.getHours()
+      let minutes = now.getMinutes()
+      let seconds = now.getSeconds()
+      let nowTime = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day} ${
+        hours < 10 ? '0' + hours : hours
+      }:${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`
+      let showpPrintCount = `打印日期: ${nowTime}`
+      return `
 	    <div style="font-family:'黑体';font-size: 16px;">
         <div style="display: flex;justify-content: center;align-items: center;position: relative;">
-          <h1 style="text-align:center;margin: 10px 0;">${JSON.parse(localStorage.getItem('greemall_user'))?.billTitle || data.companyWechatName}销售单</h1>
+          <h1 style="text-align:center;margin: 10px 0;">${
+            JSON.parse(localStorage.getItem('greemall_user'))?.billTitle || data.companyWechatName
+          }销售单</h1>
           <div style="position: absolute;right:0;">共 ${length}页 第 ${page + 1} 页</div>
         </div>
         <div style="display: flex;justify-content: space-between;">
@@ -501,11 +610,13 @@ export default {
         </div>
         <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
           <div>客户: ${data.userName}</div>
-          <div>摘要: ${({TRANSFER:"在线支付",WECHAT:"在线支付",CASH:"到店支付"})[data.payType]}</div>
+          <div>摘要: ${{ TRANSFER: '在线支付', WECHAT: '在线支付', CASH: '到店支付' }[data.payType]}</div>
         </div>
         <div style="display: flex;font-size: 16px;margin-bottom: 10px;">
           <div style="flex-shrink: 0;">联系电话: ${data.userMobile}</div>
-          <div style="margin-left: 50px;">收货地址: ${data.province}${data.city}${data.area}${data.street}${data.receAddress}</div>
+          <div style="margin-left: 50px;">收货地址: ${data.province}${data.city}${data.area}${data.street}${
+        data.receAddress
+      }</div>
         </div>
         <div >
           <table border=".5" cellspacing="0" width="856" style="border-color: rgb(0,0,0);border-collapse: collapse;border-style: none;border: 1px solid rgb(0,0,0);font-weight: normal;text-decoration: none;vertical-align: middle;box-sizing: border-box;word-wrap: break-word;word-break: break-all;">
@@ -541,16 +652,15 @@ export default {
         </div>
 	   </div>
 	  `
-		},
+    },
     handleRefreshList() {
-      this.getList();
-		},
-		handleInitPrint() {
-			this.$nextTick(() => {
-				this?.initPrint()
-			})
-		},
+      this.getList()
+    },
+    handleInitPrint() {
+      this.$nextTick(() => {
+        this?.initPrint()
+      })
+    }
   }
 }
-
 </script>

+ 75 - 50
src/views/secondHandMall/orderManagement/materialFlow.vue

@@ -1,9 +1,8 @@
 <template>
   <zj-page-container>
     <zj-page-fill>
-      <div style="box-sizing: border-box; padding:10px;">
+      <div style="box-sizing: border-box; padding: 10px">
         <div>
-          
           <div class="order-main">
             <el-row style="padding: 15px 15px 10px">
               <el-col :span="24">
@@ -16,51 +15,75 @@
             <div style="width: 100%; padding: 10px 15px 15px 15px">
               <el-row :gutter="10">
                 <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>卖家信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_lt'>
-                        <el-image v-if="orderDetail.sellUrl" style='width: 40px; height: 40px' :src="orderDetail.sellUrl"></el-image>
+                  <div class="info">
+                    <div class="info_title">卖家信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_lt">
+                        <el-image
+                          v-if="orderDetail.sellUrl"
+                          style="width: 40px; height: 40px"
+                          :src="$showImgUrl(orderDetail.sellUrl)"
+                        ></el-image>
                       </div>
-                      <div class='info_bottom_rt'>
-                        <div>昵称:{{orderDetail.sellName}}</div>
-                        <div>手机号:{{orderDetail.sellMobile}}</div>
-                        <div>发布时间:{{orderDetail.sellTime}}</div>
+                      <div class="info_bottom_rt">
+                        <div>昵称:{{ orderDetail.sellName }}</div>
+                        <div>手机号:{{ orderDetail.sellMobile }}</div>
+                        <div>发布时间:{{ orderDetail.sellTime }}</div>
                       </div>
                     </div>
                   </div>
                 </el-col>
                 <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>买家信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_lt'>
-                        <el-image v-if="orderDetail.wechatUserUrl" style='width: 40px; height: 40px' :src="orderDetail.wechatUserUrl">
+                  <div class="info">
+                    <div class="info_title">买家信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_lt">
+                        <el-image
+                          v-if="orderDetail.wechatUserUrl"
+                          style="width: 40px; height: 40px"
+                          :src="$showImgUrl(orderDetail.wechatUserUrl)"
+                        >
                         </el-image>
                       </div>
-                      <div class='info_bottom_rt'>
-                        <div v-if="orderDetail.wechatUserName">昵称:{{orderDetail.wechatUserName}}</div>
-                        <div v-if="orderDetail.wechatUserMobile">手机号:{{orderDetail.wechatUserMobile}}</div>
-                        <div>收货人信息:({{orderDetail.userName}}){{orderDetail.userMobile}}</div>
-                        <div>收货人地址:{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress }}</div>
-                        <div>支付方式:{{({WECHAT:"微信支付", CASH:"到店支付", TRANSFER:"转账支付"})[orderDetail.payType]}}</div>
+                      <div class="info_bottom_rt">
+                        <div v-if="orderDetail.wechatUserName">昵称:{{ orderDetail.wechatUserName }}</div>
+                        <div v-if="orderDetail.wechatUserMobile">手机号:{{ orderDetail.wechatUserMobile }}</div>
+                        <div>收货人信息:({{ orderDetail.userName }}){{ orderDetail.userMobile }}</div>
+                        <div>
+                          收货人地址:{{
+                            orderDetail.province +
+                            orderDetail.city +
+                            orderDetail.area +
+                            orderDetail.street +
+                            orderDetail.receAddress
+                          }}
+                        </div>
+                        <div>
+                          支付方式:{{
+                            { WECHAT: '微信支付', CASH: '到店支付', TRANSFER: '转账支付' }[orderDetail.payType]
+                          }}
+                        </div>
                       </div>
                     </div>
                   </div>
                 </el-col>
                 <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
-                  <div class='info'>
-                    <div class='info_title'>物流信息</div>
-                    <div class='info_bottom'>
-                      <div class='info_bottom_rt'>
+                  <div class="info">
+                    <div class="info_title">物流信息</div>
+                    <div class="info_bottom">
+                      <div class="info_bottom_rt">
                         <div>
                           <el-radio-group disabled v-model="orderDetail.pickType">
-                            <el-radio label='YES'>自提</el-radio>
-                            <el-radio label='NO'>物流</el-radio>
+                            <el-radio label="YES">自提</el-radio>
+                            <el-radio label="NO">物流</el-radio>
                           </el-radio-group>
                         </div>
-                        <div v-if="orderDetail.logisticsCode && orderDetail.logisticsNo">快递单号:{{orderDetail.logisticsNo}}</div>
-                        <div v-if="orderDetail.logisticsCode && orderDetail.logisticsNo">快递公司:{{orderDetail.logisticsName}}</div>
+                        <div v-if="orderDetail.logisticsCode && orderDetail.logisticsNo">
+                          快递单号:{{ orderDetail.logisticsNo }}
+                        </div>
+                        <div v-if="orderDetail.logisticsCode && orderDetail.logisticsNo">
+                          快递公司:{{ orderDetail.logisticsName }}
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -77,13 +100,16 @@
               <el-table-column prop="time" label="物流时间" align="center" min-width="100"></el-table-column>
               <el-table-column prop="state" label="物流状态" align="center">
                 <template slot-scope="scope">
-                  <div>{{ ({0:'在途',1:'揽收',2:'疑难',3:'签收',4:'退签',5:'派件',6:'退回'})[scope.row.state] }}</div>
+                  <div>
+                    {{
+                      { 0: '在途', 1: '揽收', 2: '疑难', 3: '签收', 4: '退签', 5: '派件', 6: '退回' }[scope.row.state]
+                    }}
+                  </div>
                 </template>
               </el-table-column>
               <el-table-column prop="context" label="物流详情" align="center"></el-table-column>
             </el-table>
           </div>
-
         </div>
       </div>
     </zj-page-fill>
@@ -91,21 +117,20 @@
 </template>
 
 <script>
-import { esOrderDetail, esOrderExpress, esOrderRefund, esOrderPayPrice } from "@/api/orderManagement";
+import { esOrderDetail, esOrderExpress, esOrderRefund, esOrderPayPrice } from '@/api/orderManagement'
 export default {
-  props:{
+  props: {
     detailsId: {
       type: [String, Number],
-      default: ""
-    },
+      default: ''
+    }
   },
   data() {
     return {
       // 订单详情
-      orderDetail: {
-      },
+      orderDetail: {},
       // 物流详情
-      expressList: [],
+      expressList: []
     }
   },
   watch: {
@@ -114,27 +139,27 @@ export default {
         this.getEsOrderDetail()
       },
       deep: true,
-      immediate: true,
-    },
+      immediate: true
+    }
   },
   methods: {
-    getEsOrderDetail(){
+    getEsOrderDetail() {
       esOrderDetail({
         esOrderId: this.detailsId
-      }).then(res=>{
+      }).then(res => {
         this.orderDetail = {
           ...res.data
         }
-        if(this.orderDetail.logisticsCode && this.orderDetail.logisticsNo){
+        if (this.orderDetail.logisticsCode && this.orderDetail.logisticsNo) {
           esOrderExpress({
-            companyCode:this.orderDetail.logisticsCode,
-            logisticsNo:this.orderDetail.logisticsNo
-          }).then(res2=>{
+            companyCode: this.orderDetail.logisticsCode,
+            logisticsNo: this.orderDetail.logisticsNo
+          }).then(res2 => {
             this.expressList = res2.data
           })
         }
       })
-    },
+    }
   }
 }
 </script>
@@ -182,7 +207,7 @@ export default {
   .order-main-status {
     padding: 15px 0;
     font-size: 24px;
-    color: #409EFF;
+    color: #409eff;
   }
 
   .order-main-opt-btn {
@@ -309,4 +334,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 7 - 3
src/views/setting/loginSetting/index.vue

@@ -27,8 +27,12 @@
         ></el-table-column>
         <el-table-column align="center" label="轮播图" prop="imgCarouselUrl" min-width="120" show-overflow-tooltip>
           <template slot-scope="scope">
-            <a :href="scope.row.imgCarouselUrl">
-              <img :src="scope.row.imgCarouselUrl" alt="轮播图" class="el-image__inner el-image__preview" />
+            <a :href="$showImgUrl(scope.row.imgCarouselUrl)">
+              <img
+                :src="$showImgUrl(scope.row.imgCarouselUrl)"
+                alt="轮播图"
+                class="el-image__inner el-image__preview"
+              />
             </a>
           </template>
         </el-table-column>
@@ -486,7 +490,7 @@ export default {
           this.comPanyDialogForm.companyName = res.data[0].companyName
           this.comPanyDialogForm.sysName = res.data[0].sysName
           this.comPanyDialogForm.logo = res.data[0].logo
-          this.fileList2 = res.data[0].logo ?  [{ url: res.data[0].logo }] : []
+          this.fileList2 = res.data[0].logo ? [{ url: res.data[0].logo }] : []
         }
       })
       getImgCarouseList(params).then(res => {

+ 266 - 148
src/views/setting/organizationManagement/settledManagement/index.vue

@@ -6,15 +6,33 @@
       <div class="tips"></div>
       <el-card shadow="never" class="my-card">
         <div slot="header" class="clearfix">
-          <span>商户信息  <span style="font-size: 12px;margin-left: 10px;">说明:开通商户账号是指开通商城后台管理系统的总登录账号。</span></span>
+          <span
+            >商户信息
+            <span style="font-size: 12px; margin-left: 10px"
+              >说明:开通商户账号是指开通商城后台管理系统的总登录账号。</span
+            ></span
+          >
         </div>
-        <el-form class="my-form" ref="step1Form" :model="step1Form" :rules="step1FormRules" label-width="140px" size="mini">
+        <el-form
+          class="my-form"
+          ref="step1Form"
+          :model="step1Form"
+          :rules="step1FormRules"
+          label-width="140px"
+          size="mini"
+        >
           <el-row :gutter="20">
             <el-col :span="6">
               <el-form-item label="商户账号" prop="account">
                 <el-input v-model="step1Form.account" autocomplete="off" placeholder="请输入商户账号"></el-input>
-                <el-popover class="question" placement="right-start" title="账号设置" width="260" trigger="hover"
-                  content="账号设置需按数字、字母组合设置至少12位账号">
+                <el-popover
+                  class="question"
+                  placement="right-start"
+                  title="账号设置"
+                  width="260"
+                  trigger="hover"
+                  content="账号设置需按数字、字母组合设置至少12位账号"
+                >
                   <svg-icon icon-class="question" slot="reference" />
                 </el-popover>
               </el-form-item>
@@ -46,43 +64,75 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="地址" prop="address">
-                <div style="display:flex;">
-                  <el-input placeholder="请选择地址" autocomplete="off" readonly style="margin-right: 20px;"
-                    v-model="step1Form.address"></el-input>
+                <div style="display: flex">
+                  <el-input
+                    placeholder="请选择地址"
+                    autocomplete="off"
+                    readonly
+                    style="margin-right: 20px"
+                    v-model="step1Form.address"
+                  ></el-input>
                   <geographicalPosi :formData="step1Form" @selectPosi="selectAddress"></geographicalPosi>
                 </div>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="登录密码" prop="newPassword">
-                <el-input v-model="step1Form.newPassword" ref="password1" autocomplete="off" placeholder="请输入登录密码"
-                  :type="passwordType1"></el-input>
+                <el-input
+                  v-model="step1Form.newPassword"
+                  ref="password1"
+                  autocomplete="off"
+                  placeholder="请输入登录密码"
+                  :type="passwordType1"
+                ></el-input>
                 <span class="show-pwd" @click="showPwd(1)">
                   <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
                 </span>
-                <el-popover class="question" placement="right-start" title="密码设置" width="260" trigger="hover"
-                  content="密码设置需按数字、字母组合设置至少12位密码">
+                <el-popover
+                  class="question"
+                  placement="right-start"
+                  title="密码设置"
+                  width="260"
+                  trigger="hover"
+                  content="密码设置需按数字、字母组合设置至少12位密码"
+                >
                   <svg-icon icon-class="question" slot="reference" />
                 </el-popover>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="确认密码" prop="confirmPassword">
-                <el-input v-model="step1Form.confirmPassword" ref="password2" autocomplete="off" placeholder="请再次输入密码"
-                  :type="passwordType2"></el-input>
+                <el-input
+                  v-model="step1Form.confirmPassword"
+                  ref="password2"
+                  autocomplete="off"
+                  placeholder="请再次输入密码"
+                  :type="passwordType2"
+                ></el-input>
                 <span class="show-pwd" @click="showPwd(2)">
                   <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
                 </span>
-                <el-popover class="question" placement="right-start" title="密码设置" width="260" trigger="hover"
-                  content="确认密码需要和登录密码保持一致">
+                <el-popover
+                  class="question"
+                  placement="right-start"
+                  title="密码设置"
+                  width="260"
+                  trigger="hover"
+                  content="确认密码需要和登录密码保持一致"
+                >
                   <svg-icon icon-class="question" slot="reference" />
                 </el-popover>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="到期时间" prop="expireTime">
-                <el-date-picker style="width: 100%;" v-model="step1Form.expireTime" type="datetime"
-                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="step1Form.expireTime"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期时间"
+                >
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -160,19 +210,30 @@
       <div class="setting_title">商城配置</div>
       <el-divider></el-divider>
       <el-form label-width="100px" label-position="right">
-        <el-upload class="avatar-uploader" :action="baseURL + 'common/upload'" :headers="myHeaders"
-          :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
+        <el-upload
+          class="avatar-uploader"
+          :action="baseURL + 'common/upload'"
+          :headers="myHeaders"
+          :show-file-list="false"
+          :on-success="uploadSuccess"
+          :before-upload="beforeUpload"
+        >
         </el-upload>
         <el-form-item label="主logo:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
-                <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px"
-                  fit="contain"></el-image>
+              <div class="img" v-if="img1_url" @mouseover="img1_hover = true" @mouseout="img1_hover = false">
+                <el-image
+                  ref="img1"
+                  :src="$showImgUrl(img1_url)"
+                  :preview-src-list="[$showImgUrl(img1_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="img1_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
-                  <i class="el-icon-delete" @click="img1_url=''"></i>
+                  <i class="el-icon-delete" @click="img1_url = ''"></i>
                 </div>
               </div>
               <div class="add" v-else @click="uploadImage('img1')">
@@ -180,9 +241,12 @@
               </div>
             </div>
             <div class="tmp-img">
-              <el-image :src="require('@/assets/template/template_1.png')"
+              <el-image
+                :src="require('@/assets/template/template_1.png')"
                 :preview-src-list="[require('@/assets/template/template_1.png')]"
-                style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                style="width: 120px; height: 120px; display: block"
+                fit="contain"
+              ></el-image>
               <div class="tmp">示例图</div>
             </div>
           </div>
@@ -193,13 +257,18 @@
         <el-form-item label="通用logo:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
-                <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px"
-                  fit="contain"></el-image>
+              <div class="img" v-if="img2_url" @mouseover="img2_hover = true" @mouseout="img2_hover = false">
+                <el-image
+                  ref="img2"
+                  :src="$showImgUrl(img2_url)"
+                  :preview-src-list="[$showImgUrl(img2_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="img2_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
-                  <i class="el-icon-delete" @click="img2_url=''"></i>
+                  <i class="el-icon-delete" @click="img2_url = ''"></i>
                 </div>
               </div>
               <div class="add" v-else @click="uploadImage('img2')">
@@ -207,9 +276,12 @@
               </div>
             </div>
             <div class="tmp-img">
-              <el-image :src="require('@/assets/template/template_2.png')"
+              <el-image
+                :src="require('@/assets/template/template_2.png')"
                 :preview-src-list="[require('@/assets/template/template_2.png')]"
-                style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                style="width: 120px; height: 120px; display: block"
+                fit="contain"
+              ></el-image>
               <div class="tmp">示例图</div>
             </div>
           </div>
@@ -220,13 +292,18 @@
         <el-form-item label="头像logo:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
-                <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px"
-                  fit="contain"></el-image>
+              <div class="img" v-if="img3_url" @mouseover="img3_hover = true" @mouseout="img3_hover = false">
+                <el-image
+                  ref="img3"
+                  :src="$showImgUrl(img3_url)"
+                  :preview-src-list="[$showImgUrl(img3_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="img3_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
-                  <i class="el-icon-delete" @click="img3_url=''"></i>
+                  <i class="el-icon-delete" @click="img3_url = ''"></i>
                 </div>
               </div>
               <div class="add" v-else @click="uploadImage('img3')">
@@ -234,9 +311,12 @@
               </div>
             </div>
             <div class="tmp-img">
-              <el-image :src="require('@/assets/template/template_3.png')"
+              <el-image
+                :src="require('@/assets/template/template_3.png')"
                 :preview-src-list="[require('@/assets/template/template_3.png')]"
-                style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
+                style="width: 120px; height: 120px; display: block"
+                fit="contain"
+              ></el-image>
               <div class="tmp">示例图</div>
             </div>
           </div>
@@ -245,19 +325,22 @@
           </div>
         </el-form-item>
 
-
-
         <!-- --------------------------- -->
         <el-form-item label="小程序二维码:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="qrcode1_url" @mouseover="qrcode1_hover = true;" @mouseout="qrcode1_hover = false;">
-                <el-image ref="qrcode1" :src="qrcode1_url" :preview-src-list="[qrcode1_url]"
-                  style="width: 120px; height: 120px" fit="contain"></el-image>
+              <div class="img" v-if="qrcode1_url" @mouseover="qrcode1_hover = true" @mouseout="qrcode1_hover = false">
+                <el-image
+                  ref="qrcode1"
+                  :src="$showImgUrl(qrcode1_url)"
+                  :preview-src-list="[$showImgUrl(qrcode1_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="qrcode1_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('qrcode1')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('qrcode1')"></i>
-                  <i class="el-icon-delete" @click="qrcode1_url=''"></i>
+                  <i class="el-icon-delete" @click="qrcode1_url = ''"></i>
                 </div>
               </div>
               <div class="add" v-else @click="uploadImage('qrcode1')">
@@ -270,13 +353,18 @@
         <el-form-item label="公众号二维码:" prop="imgUrl">
           <div class="images">
             <div class="main-img">
-              <div class="img" v-if="qrcode2_url" @mouseover="qrcode2_hover = true;" @mouseout="qrcode2_hover = false;">
-                <el-image ref="qrcode2" :src="qrcode2_url" :preview-src-list="[qrcode2_url]"
-                  style="width: 120px; height: 120px" fit="contain"></el-image>
+              <div class="img" v-if="qrcode2_url" @mouseover="qrcode2_hover = true" @mouseout="qrcode2_hover = false">
+                <el-image
+                  ref="qrcode2"
+                  :src="$showImgUrl(qrcode2_url)"
+                  :preview-src-list="[$showImgUrl(qrcode2_url)]"
+                  style="width: 120px; height: 120px"
+                  fit="contain"
+                ></el-image>
                 <div class="mask" v-show="qrcode2_hover">
                   <i class="el-icon-zoom-in" @click="previewImage('qrcode2')"></i>
                   <i class="el-icon-upload2" @click="uploadImage('qrcode2')"></i>
-                  <i class="el-icon-delete" @click="qrcode2_url=''"></i>
+                  <i class="el-icon-delete" @click="qrcode2_url = ''"></i>
                 </div>
               </div>
               <div class="add" v-else @click="uploadImage('qrcode2')">
@@ -286,8 +374,6 @@
           </div>
         </el-form-item>
         <!-- --------------------------- -->
-
-
       </el-form>
     </div>
 
@@ -299,7 +385,14 @@
         <div slot="header" class="clearfix">
           <span>商户名称:{{ step1Form.nickName }}</span>
         </div>
-        <el-form class="my-form2" ref="step3Form" :model="step3Form" :rules="step3FormRules" label-width="130px" size="mini">
+        <el-form
+          class="my-form2"
+          ref="step3Form"
+          :model="step3Form"
+          :rules="step3FormRules"
+          label-width="130px"
+          size="mini"
+        >
           <el-row :gutter="20">
             <el-col :span="6">
               <el-form-item label="服务商appId" prop="appId">
@@ -313,7 +406,11 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="服务商商户密钥" prop="merchantKey">
-                <el-input v-model="step3Form.merchantKey" autocomplete="off" placeholder="请输入服务商商户密钥"></el-input>
+                <el-input
+                  v-model="step3Form.merchantKey"
+                  autocomplete="off"
+                  placeholder="请输入服务商商户密钥"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -328,7 +425,11 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="子商户号Id" prop="childMerchantId">
-                <el-input v-model="step3Form.childMerchantId" autocomplete="off" placeholder="请输入子商户号Id"></el-input>
+                <el-input
+                  v-model="step3Form.childMerchantId"
+                  autocomplete="off"
+                  placeholder="请输入子商户号Id"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -348,42 +449,74 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="改派通知" prop="pubTemplateId1">
-                <el-input v-model="step3Form.pubTemplateId1" autocomplete="off" placeholder="请输入工单派工,改派通知"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId1"
+                  autocomplete="off"
+                  placeholder="请输入工单派工,改派通知"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="发货通知" prop="pubTemplateId2">
-                <el-input v-model="step3Form.pubTemplateId2" autocomplete="off" placeholder="请输入商城订单支付成功提醒发货通知"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId2"
+                  autocomplete="off"
+                  placeholder="请输入商城订单支付成功提醒发货通知"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="维权订单提醒" prop="pubTemplateId3">
-                <el-input v-model="step3Form.pubTemplateId3" autocomplete="off" placeholder="请输入商城维权订单提醒"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId3"
+                  autocomplete="off"
+                  placeholder="请输入商城维权订单提醒"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="支付成功通知" prop="pubTemplateId4">
-                <el-input v-model="step3Form.pubTemplateId4" autocomplete="off" placeholder="请输入订单支付成功(含全部销售订单和延保)"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId4"
+                  autocomplete="off"
+                  placeholder="请输入订单支付成功(含全部销售订单和延保)"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="维保费用申请" prop="pubTemplateId5">
-                <el-input v-model="step3Form.pubTemplateId5" autocomplete="off" placeholder="请输入维保的费用申请"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId5"
+                  autocomplete="off"
+                  placeholder="请输入维保的费用申请"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="安维费用发放通知" prop="pubTemplateId6">
-                <el-input v-model="step3Form.pubTemplateId6" autocomplete="off" placeholder="请输入安维费用发放通知"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId6"
+                  autocomplete="off"
+                  placeholder="请输入安维费用发放通知"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="抢单新单通知" prop="pubTemplateId7">
-                <el-input v-model="step3Form.pubTemplateId7" autocomplete="off" placeholder="请输入抢单新单通知"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId7"
+                  autocomplete="off"
+                  placeholder="请输入抢单新单通知"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="配件到货通知" prop="pubTemplateId8">
-                <el-input v-model="step3Form.pubTemplateId8" autocomplete="off" placeholder="请输入配件到货通知"></el-input>
+                <el-input
+                  v-model="step3Form.pubTemplateId8"
+                  autocomplete="off"
+                  placeholder="请输入配件到货通知"
+                ></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -395,58 +528,58 @@
       <div class="footer" :class="classObj">
         <el-button @click="changeStep(0)" v-show="step > 1">上一步</el-button>
         <el-button @click="changeStep(1)" v-show="step < 3">下一步</el-button>
-        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交'
+        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{
+          formLoading ? '提交中 ...' : '提 交'
         }}</el-button>
-        <el-popconfirm title="确定关闭吗?" @confirm="goBack" style="margin-left: 10px;">
+        <el-popconfirm title="确定关闭吗?" @confirm="goBack" style="margin-left: 10px">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
       </div>
     </div>
-
   </div>
 </template>
 
 <script>
 import { getToken } from '@/utils/auth'
-import { addAccount } from "@/api/merchant";
+import { addAccount } from '@/api/merchant'
 import geographicalPosi from '@/components/geographicalPosi/index.vue'
 export default {
   components: { geographicalPosi },
   data() {
     var validateAccount = (rule, value, callback) => {
       if (value === '') {
-        callback(new Error('请输入商户账号'));
+        callback(new Error('请输入商户账号'))
       } else if (value.length < 12) {
-        callback(new Error('账号长度至少12位'));
+        callback(new Error('账号长度至少12位'))
       } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
-        callback(new Error('账号必须包含数字和字母'));
+        callback(new Error('账号必须包含数字和字母'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     var validatePass3 = (rule, value, callback) => {
       if (value === '') {
-        callback(new Error('请输入登录密码'));
+        callback(new Error('请输入登录密码'))
       } else if (value.length < 12) {
-        callback(new Error('密码长度至少12位'));
+        callback(new Error('密码长度至少12位'))
       } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
-        callback(new Error('密码必须包含数字和字母'));
+        callback(new Error('密码必须包含数字和字母'))
       } else {
         if (this.step1Form.confirmPassword !== '') {
-          this.$refs.step1Form.validateField('confirmPassword');
+          this.$refs.step1Form.validateField('confirmPassword')
         }
-        callback();
+        callback()
       }
-    };
+    }
     var validatePass4 = (rule, value, callback) => {
       if (value === '') {
-        callback(new Error('请再次输入密码'));
+        callback(new Error('请再次输入密码'))
       } else if (value !== this.step1Form.newPassword) {
-        callback(new Error('两次输入密码不一致'));
+        callback(new Error('两次输入密码不一致'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     return {
       baseURL: process.env.VUE_APP_BASE_API,
       myHeaders: { 'x-token': getToken() },
@@ -473,30 +606,14 @@ export default {
         yjhxDkFlag: 1
       },
       step1FormRules: {
-        account: [
-          { required: true, validator: validateAccount, trigger: 'blur' }
-        ],
-        nickName: [
-          { required: true, message: '请输入用户名', trigger: 'blur' }
-        ],
-        address: [
-          { required: true, message: '请选择GPS地址', trigger: 'blur' }
-        ],
-        appName: [
-          { required: true, message: '请输入用户名', trigger: 'blur' }
-        ],
-        chargePerson: [
-          { required: true, message: '请输入负责人', trigger: 'blur' }
-        ],
-        phone: [
-          { required: true, message: '请输入联系电话', trigger: 'blur' }
-        ],
-        newPassword: [
-          { required: true, validator: validatePass3, trigger: 'blur' }
-        ],
-        confirmPassword: [
-          { required: true, validator: validatePass4, trigger: 'blur' }
-        ],
+        account: [{ required: true, validator: validateAccount, trigger: 'blur' }],
+        nickName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
+        address: [{ required: true, message: '请选择GPS地址', trigger: 'blur' }],
+        appName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
+        chargePerson: [{ required: true, message: '请输入负责人', trigger: 'blur' }],
+        phone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
+        newPassword: [{ required: true, validator: validatePass3, trigger: 'blur' }],
+        confirmPassword: [{ required: true, validator: validatePass4, trigger: 'blur' }]
       },
       passwordType1: 'password',
       passwordType2: 'password',
@@ -528,18 +645,17 @@ export default {
         templateId: '',
         pubAppId: '',
         pubAppSecret: '',
-        pubTemplateId1:'',
-        pubTemplateId2:'',
-        pubTemplateId3:'',
-        pubTemplateId4:'',
-        pubTemplateId5:'',
-        pubTemplateId6:'',
-        pubTemplateId7:'',
-        pubTemplateId8:'',
-      },
-      step3FormRules: {
+        pubTemplateId1: '',
+        pubTemplateId2: '',
+        pubTemplateId3: '',
+        pubTemplateId4: '',
+        pubTemplateId5: '',
+        pubTemplateId6: '',
+        pubTemplateId7: '',
+        pubTemplateId8: ''
       },
-      formLoading: false,
+      step3FormRules: {},
+      formLoading: false
     }
   },
   computed: {
@@ -551,11 +667,11 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    },
+    }
   },
   methods: {
     goBack() {
-      this.$router.go(-1);
+      this.$router.go(-1)
     },
 
     selectAddress(res) {
@@ -590,76 +706,76 @@ export default {
 
     // 下一步
     nextStep() {
-      this.$refs.step1Form.validate((valid) => {
+      this.$refs.step1Form.validate(valid => {
         if (valid) {
-          this.step = 2;
+          this.step = 2
         }
       })
     },
 
     uploadImage(type) {
-      this.uploadImageType = type;
-      document.querySelector('.avatar-uploader input').click();
+      this.uploadImageType = type
+      document.querySelector('.avatar-uploader input').click()
     },
 
     // 上传图片
     uploadSuccess(res, file) {
-      this[this.uploadImageType + '_url'] = res.data.url;
+      this[this.uploadImageType + '_url'] = res.data.url
     },
 
     beforeUpload(file) {
-      const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const whiteList = ['jpg', 'jpeg', 'png'];
+      const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
+      const whiteList = ['jpg', 'jpeg', 'png']
       if (whiteList.indexOf(fileSuffix) === -1) {
-        this.$errorMsg('只支持上传jpg/jpeg/png文件!');
-        return false;
+        this.$errorMsg('只支持上传jpg/jpeg/png文件!')
+        return false
       }
     },
 
     // 预览图片
     previewImage(type) {
-      this.$refs[type].showViewer = true;
+      this.$refs[type].showViewer = true
     },
 
     // 切换步骤
     changeStep(type) {
       if (type == 1) {
-        this.step++;
+        this.step++
       } else {
-        this.step--;
+        this.step--
       }
     },
 
     // 点击 提交表单
     clickSubmitForm() {
       // 验证第一步
-      this.$refs.step1Form.validate((valid) => {
+      this.$refs.step1Form.validate(valid => {
         if (valid) {
           // 验证第二步
           if (this.img1_url && this.img2_url && this.img3_url && this.qrcode1_url && this.qrcode2_url) {
             // 验证第三步
-            this.$refs.step3Form.validate((valid) => {
+            this.$refs.step3Form.validate(valid => {
               if (valid) {
-                this.submitForm();
+                this.submitForm()
               } else {
-                this.step = 3;
+                this.step = 3
               }
             })
           } else {
-            this.$errorMsg('请完善商城配置');
-            this.step = 2;
+            this.$errorMsg('请完善商城配置')
+            this.step = 2
           }
         } else {
-          this.step = 1;
+          this.step = 1
         }
       })
     },
 
     // 提交表单
     submitForm() {
-      this.$refs.step3Form.validate((valid) => {
+      this.$refs.step3Form.validate(valid => {
         if (valid) {
-          this.formLoading = true;
+          this.formLoading = true
           let params = {
             type: 1,
             userName: this.step1Form.account,
@@ -678,7 +794,7 @@ export default {
             moduleWb: this.step1Form.moduleWb,
             storePay: this.step1Form.storePay,
             yjhxDkFlag: this.step1Form.yjhxDkFlag,
-            
+
             minLogo1: this.img1_url,
             minLogo2: this.img2_url,
             minLogo3: this.img3_url,
@@ -706,16 +822,18 @@ export default {
             pubTemplateId5: this.step3Form.pubTemplateId5,
             pubTemplateId6: this.step3Form.pubTemplateId6,
             pubTemplateId7: this.step3Form.pubTemplateId7,
-            pubTemplateId8: this.step3Form.pubTemplateId8,
+            pubTemplateId8: this.step3Form.pubTemplateId8
           }
-          addAccount(params).then(res => {
-            this.$successMsg('开通成功');
-            setTimeout(() => {
-              this.goBack();
-            }, 1500)
-          }).finally(res => {
-            this.formLoading = false;
-          })
+          addAccount(params)
+            .then(res => {
+              this.$successMsg('开通成功')
+              setTimeout(() => {
+                this.goBack()
+              }, 1500)
+            })
+            .finally(res => {
+              this.formLoading = false
+            })
         }
       })
     }
@@ -871,4 +989,4 @@ export default {
     }
   }
 }
-</style>
+</style>

Різницю між файлами не показано, бо вона завелика
+ 432 - 245
src/views/setting/organizationManagement/tenantDetails/index.vue


+ 198 - 172
src/views/setting/personal/index.vue

@@ -3,71 +3,105 @@
     <!-- <div class="setting_title">个人信息</div>
     <el-divider></el-divider> -->
     <div v-if="!isRenew">
-		<div class="userInfo">
-			<el-row>
-				<el-col :span="4">
-					<div class="avatar">
-						<fileUpload :multiple="true" :fileList="[{url: userInfo.minLogo3?userInfo.minLogo3:''}]" :download="false" :viewOnline="false" :limit="1" @getFiles="getFiles" />
-						<!-- <el-image style="width: 100px;height: 100px;border-radius: 50%;" :src="userInfo.minLogo3"></el-image> -->
-						<!-- <div class="img">
+      <div class="userInfo">
+        <el-row>
+          <el-col :span="4">
+            <div class="avatar">
+              <fileUpload
+                :multiple="true"
+                :fileList="[{ url: userInfo.minLogo3 ? userInfo.minLogo3 : '' }]"
+                :download="false"
+                :viewOnline="false"
+                :limit="1"
+                @getFiles="getFiles"
+              />
+              <!-- <el-image style="width: 100px;height: 100px;border-radius: 50%;" :src="userInfo.minLogo3"></el-image> -->
+              <!-- <div class="img">
 							<i class="el-icon-camera"></i>
 						</div> -->
-					</div>
-				</el-col>
-				<el-col :span="8">
-					<div style="height: 120px;display: flex;flex-direction: column;justify-content: space-around;">
-						<div>用户名: {{userInfo.nickName}}</div>
-						<div>负责人: {{userInfo.linkName}}</div>
-						<div>开通时间: {{userInfo.companyOpenTime?userInfo.companyOpenTime.substring(0,10):''}}</div>
-					</div>
-				</el-col>
-				<el-col :span="12">
-					<div style="height: 120px;display: flex;flex-direction: column;justify-content: space-around;">
-						<div>账号: {{userInfo.userName}}</div>
-						<div>手机号码: {{userInfo.linkPhone}}</div>
-						<div class="flex">
-							<span style="color: #169dff;margin-right: 10px;">到期时间: {{userInfo.companyExpireTime?userInfo.companyExpireTime.substring(0,10):''}}</span>
-							<el-tooltip effect="dark" content="账号到期后将自动停用系统功能,续费后功能恢复使用!" placement="top">
-							    <i class="el-icon-question icon-question"></i>
-							</el-tooltip>
-							<el-button style="margin: 0 20px;" size="small" type="primary" @click="renew">续费</el-button>
-							<!-- <el-button size="small" plain type="primary" @click="payRecords">购买记录</el-button> -->
-						</div>
-					</div>
-				</el-col>
-			</el-row>
-		</div>
-		
-		<div style="margin-top: 60px;">
-			<el-card class="goods">
-				<h3>修改密码</h3>
-				<el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="left" label-width="80px" style="width: 350px;margin-top: 40px;">
-				  <el-form-item label="原密码" prop="oldPassword">
-				    <el-input v-model="dialogForm.oldPassword" ref="password1" autocomplete="off" placeholder="请输入原密码" :type="passwordType1"></el-input>
-				    <span class="show-pwd" @click="showPwd(1)">
-				      <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
-				    </span>
-				  </el-form-item>
-				  <el-form-item label="新密码" prop="newPassword">
-				    <el-input v-model="dialogForm.newPassword" ref="password2" autocomplete="off" placeholder="请输入新密码" :type="passwordType2"></el-input>
-				    <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="confirmPassword">
-				    <el-input v-model="dialogForm.confirmPassword" ref="password3" autocomplete="off" placeholder="请再次输入新密码" :type="passwordType3"></el-input>
-				    <span class="show-pwd" @click="showPwd(3)">
-				      <svg-icon :icon-class="passwordType3 === 'password' ? 'eye' : 'eye-open'" />
-				    </span>
-				  </el-form-item>
-				</el-form>
-				<div style="padding-left: 100px;">
-				  <el-button type="primary" @click="submitDialogForm">保存</el-button>
-				</div>
-			</el-card>
-		</div>
-	</div>
-	<renew :userInfo="userInfo" @back="getUserInfo" v-if="isRenew"></renew>
+            </div>
+          </el-col>
+          <el-col :span="8">
+            <div style="height: 120px; display: flex; flex-direction: column; justify-content: space-around">
+              <div>用户名: {{ userInfo.nickName }}</div>
+              <div>负责人: {{ userInfo.linkName }}</div>
+              <div>开通时间: {{ userInfo.companyOpenTime ? userInfo.companyOpenTime.substring(0, 10) : '' }}</div>
+            </div>
+          </el-col>
+          <el-col :span="12">
+            <div style="height: 120px; display: flex; flex-direction: column; justify-content: space-around">
+              <div>账号: {{ userInfo.userName }}</div>
+              <div>手机号码: {{ userInfo.linkPhone }}</div>
+              <div class="flex">
+                <span style="color: #169dff; margin-right: 10px"
+                  >到期时间: {{ userInfo.companyExpireTime ? userInfo.companyExpireTime.substring(0, 10) : '' }}</span
+                >
+                <el-tooltip effect="dark" content="账号到期后将自动停用系统功能,续费后功能恢复使用!" placement="top">
+                  <i class="el-icon-question icon-question"></i>
+                </el-tooltip>
+                <el-button style="margin: 0 20px" size="small" type="primary" @click="renew">续费</el-button>
+                <!-- <el-button size="small" plain type="primary" @click="payRecords">购买记录</el-button> -->
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div style="margin-top: 60px">
+        <el-card class="goods">
+          <h3>修改密码</h3>
+          <el-form
+            ref="dialogForm"
+            :model="dialogForm"
+            :rules="dialogFormRules"
+            label-position="left"
+            label-width="80px"
+            style="width: 350px; margin-top: 40px"
+          >
+            <el-form-item label="原密码" prop="oldPassword">
+              <el-input
+                v-model="dialogForm.oldPassword"
+                ref="password1"
+                autocomplete="off"
+                placeholder="请输入原密码"
+                :type="passwordType1"
+              ></el-input>
+              <span class="show-pwd" @click="showPwd(1)">
+                <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
+              </span>
+            </el-form-item>
+            <el-form-item label="新密码" prop="newPassword">
+              <el-input
+                v-model="dialogForm.newPassword"
+                ref="password2"
+                autocomplete="off"
+                placeholder="请输入新密码"
+                :type="passwordType2"
+              ></el-input>
+              <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="confirmPassword">
+              <el-input
+                v-model="dialogForm.confirmPassword"
+                ref="password3"
+                autocomplete="off"
+                placeholder="请再次输入新密码"
+                :type="passwordType3"
+              ></el-input>
+              <span class="show-pwd" @click="showPwd(3)">
+                <svg-icon :icon-class="passwordType3 === 'password' ? 'eye' : 'eye-open'" />
+              </span>
+            </el-form-item>
+          </el-form>
+          <div style="padding-left: 100px">
+            <el-button type="primary" @click="submitDialogForm">保存</el-button>
+          </div>
+        </el-card>
+      </div>
+    </div>
+    <renew :userInfo="userInfo" @back="getUserInfo" v-if="isRenew"></renew>
   </div>
 </template>
 
@@ -80,88 +114,80 @@ import renew from './renew.vue'
 import request from '@/utils/request'
 
 export default {
-	components: { fileUpload, renew },
+  components: { fileUpload, renew },
   data() {
     var validatePass = (rule, value, callback) => {
       if (value === '') {
-        callback(new Error('请输入密码'));
+        callback(new Error('请输入密码'))
       } else if (value === this.dialogForm.oldPassword) {
-        callback(new Error('该密码与原密码一致'));
+        callback(new Error('该密码与原密码一致'))
       } else {
         if (this.dialogForm.confirmPassword !== '') {
-          this.$refs.dialogForm.validateField('confirmPassword');
+          this.$refs.dialogForm.validateField('confirmPassword')
         }
-        callback();
+        callback()
       }
-    };
+    }
     var validatePass2 = (rule, value, callback) => {
       if (value === '') {
-        callback(new Error('请再次输入密码'));
+        callback(new Error('请再次输入密码'))
       } else if (value !== this.dialogForm.newPassword) {
-        callback(new Error('两次输入密码不一致'));
+        callback(new Error('两次输入密码不一致'))
       } else {
-        callback();
+        callback()
       }
-    };
+    }
     return {
       userInfo: {},
       dialogFormVisible: false,
       dialogForm: {
         oldPassword: '', // 原密码
         newPassword: '', // 新密码
-        confirmPassword: '', // 确认密码
+        confirmPassword: '' // 确认密码
       },
       dialogFormRules: {
-        oldPassword: [
-          { required: true, message: '请输入原密码', trigger: 'blur' }
-        ],
-        newPassword: [
-          { required: true, validator: validatePass, trigger: 'blur' }
-        ],
-        confirmPassword: [
-          { required: true, validator: validatePass2, trigger: 'blur' }
-        ],
+        oldPassword: [{ required: true, message: '请输入原密码', trigger: 'blur' }],
+        newPassword: [{ required: true, validator: validatePass, trigger: 'blur' }],
+        confirmPassword: [{ required: true, validator: validatePass2, trigger: 'blur' }]
       },
 
       passwordType1: 'password',
       passwordType2: 'password',
       passwordType3: 'password',
-	  
-	  isRenew: false
+
+      isRenew: false
     }
   },
   computed: {
-    ...mapGetters([
-      'userid'
-    ])
+    ...mapGetters(['userid'])
   },
   created() {
-    this.getUserInfo();
-	if(this.$route.query.isRenew){
-		this.isRenew = true
-	}
+    this.getUserInfo()
+    if (this.$route.query.isRenew) {
+      this.isRenew = true
+    }
   },
   methods: {
     // 获取用户信息
     getUserInfo() {
-		this.isRenew = false
-      getUserInfo({adminUserId: this.userid}).then(res => {
-        this.userInfo = res.data;
+      this.isRenew = false
+      getUserInfo({ adminUserId: this.userid }).then(res => {
+        this.userInfo = res.data
       })
     },
 
     // 取消修改密码
-    cancelDialogForm(){
-      this.dialogFormVisible = false;
-      this.passwordType1 = 'password';
-      this.passwordType2 = 'password';
-      this.passwordType3 = 'password';
-      this.$refs.dialogForm.resetFields();
+    cancelDialogForm() {
+      this.dialogFormVisible = false
+      this.passwordType1 = 'password'
+      this.passwordType2 = 'password'
+      this.passwordType3 = 'password'
+      this.$refs.dialogForm.resetFields()
     },
 
     // 提交修改密码
     submitDialogForm() {
-      this.$refs.dialogForm.validate((valid) => {
+      this.$refs.dialogForm.validate(valid => {
         if (valid) {
           let params = {
             password: this.dialogForm.oldPassword,
@@ -169,9 +195,9 @@ export default {
             userName: this.userInfo.userName
           }
           changePassword(params).then(res => {
-            this.cancelDialogForm();
-            this.getUserInfo();
-            this.$successMsg();
+            this.cancelDialogForm()
+            this.getUserInfo()
+            this.$successMsg()
           })
         }
       })
@@ -179,7 +205,7 @@ export default {
 
     // 显示隐藏密码
     showPwd(num) {
-      if(num == 1) {
+      if (num == 1) {
         if (this.passwordType1 === 'password') {
           this.passwordType1 = ''
         } else {
@@ -189,7 +215,7 @@ export default {
           this.$refs.password1.focus()
         })
       }
-      if(num == 2) {
+      if (num == 2) {
         if (this.passwordType2 === 'password') {
           this.passwordType2 = ''
         } else {
@@ -199,7 +225,7 @@ export default {
           this.$refs.password2.focus()
         })
       }
-      if(num == 3) {
+      if (num == 3) {
         if (this.passwordType3 === 'password') {
           this.passwordType3 = ''
         } else {
@@ -210,74 +236,74 @@ export default {
         })
       }
     },
-	getFiles(e){
-		if(e[0].name){
-			request({
-				url: '/admin/user/user/updateCompanyWechat',
-				method: 'post',
-				data: {
-					minLogo3: e[0].url,
-					companyWechatId: this.userInfo.companyWechatId
-				}
-			}).then(res =>{
-				if(res.code == 200){
-					this.getUserInfo()
-					this.$message.success('上传成功!');
-				}
-			})
-		}
-	},
-	renew(){
-		this.isRenew = true
-	}
+    getFiles(e) {
+      if (e[0].name) {
+        request({
+          url: '/admin/user/user/updateCompanyWechat',
+          method: 'post',
+          data: {
+            minLogo3: e[0].url,
+            companyWechatId: this.userInfo.companyWechatId
+          }
+        }).then(res => {
+          if (res.code == 200) {
+            this.getUserInfo()
+            this.$message.success('上传成功!')
+          }
+        })
+      }
+    },
+    renew() {
+      this.isRenew = true
+    }
   }
 }
 </script>
 
 <style scoped lang="scss">
-  .el-form {
-    padding-left: 15px;
-  }
-  .userInfo .el-form-item {
-    margin-bottom: 10px;
-  }
-  .flex{
-	  display: flex;
-	  align-items: center;
-  }
-  .show-pwd {
+.el-form {
+  padding-left: 15px;
+}
+.userInfo .el-form-item {
+  margin-bottom: 10px;
+}
+.flex {
+  display: flex;
+  align-items: center;
+}
+.show-pwd {
+  position: absolute;
+  right: 15px;
+  top: 0;
+  font-size: 16px;
+  cursor: pointer;
+  user-select: none;
+}
+.userInfo {
+  padding-left: 30px;
+  padding-top: 30px;
+  color: #555555;
+}
+.avatar {
+  position: relative;
+  cursor: pointer;
+  .img {
+    width: 28px;
+    height: 28px;
+    border-radius: 14px;
     position: absolute;
-    right: 15px;
-    top: 0;
-    font-size: 16px;
-    cursor: pointer;
-    user-select: none;
-  }
-  .userInfo{
-	  padding-left: 30px;
-	  padding-top: 30px;
-	  color: #555555;
-  }
-  .avatar{
-	  position: relative;
-	  cursor: pointer;
-	  .img{
-		  width: 28px;
-		  height: 28px;
-		  border-radius: 14px;
-		  position: absolute;
-		  right: 0;
-		  bottom: 0;
-		  z-index: 9;
-		  text-align: center;
-		  line-height: 28px;
-		  background-color: #eeeeee;
-		  border: 2px solid #ffffff;
-		  color: #168dff;
-		  box-sizing: border-box;
-	  }
+    right: 0;
+    bottom: 0;
+    z-index: 9;
+    text-align: center;
+    line-height: 28px;
+    background-color: #eeeeee;
+    border: 2px solid #ffffff;
+    color: #168dff;
+    box-sizing: border-box;
   }
-  ::v-deep .images .item .img{
-	border-radius: 50% !important;
-  }
-</style>
+}
+::v-deep .images .item .img {
+  border-radius: 50% !important;
+}
+</style>

+ 294 - 264
src/views/setting/personal/renew.vue

@@ -1,271 +1,301 @@
 <template>
-	<div class="s-page">
-		<el-page-header @back="goBack" content="续费"></el-page-header>
-		<el-divider></el-divider>
-		<el-card class="goods">
-			<div class="tishi">请选择需要购买的套餐并用微信扫码支付!</div>
-			<div class="flex">
-				<div class="item" v-for="(item,index) in goodsList" :key="index" @click="goodsIndex = index;goodsId = item.id">
-					<div class="tj" v-if="item.isFirst == 1">推荐</div>
-					<div class="year">{{item.normName}}</div>
-					<div class="new"><span style="font-size: 20px;">¥</span>{{(item.normAmount*100 - item.discountAmount*100)/100}}</div>
-					<div class="old">¥{{item.normAmount}}</div>
-					<div :class="goodsIndex == index?'bottom active':'bottom'">立省¥{{item.discountAmount}}</div>
-				</div>
-			</div>
-			<div class="flex" style="justify-content: flex-start;">
-				<el-button style="margin-top: 30px;" type="success" @click="confirmPay()">微信支付</el-button>
-			</div>
-		</el-card>
-		<el-dialog title="确认支付" :visible.sync="is_pay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
-			<div class="pay" v-if="!isPaySuccess">
-				<div style="font-weight: bold;font-size: 22px;">扫码支付</div>
-				<div class="ewm" ref="payQRCode"/>
-				<div>
-					<div class="flex" style="align-items: center;">
-						<div>实付: <span style="font-size: 20px;color: #ff6804;">¥</span><span style="font-size: 36px;color: #ff6804;font-weight: bold;">{{(goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100)/100}}</span></div>
-						<div style="margin: 0 20px;">已优惠: <span style="font-size: 18px;color: #ff6804;">¥</span><span style="font-size: 20px;color: #ff6804;">{{goodsList[goodsIndex].discountAmount}}</span></div>
-						<el-tooltip effect="dark" placement="right-start">
-							<div slot="content">
-								购买年限越大越优惠,优惠价格按年份增加折扣,第1年<br/>
-								8.8折,第2年8折,第3年7折,第4年6折,第5年5折。<br/>
-								举例: 原价1000元/年,张三购买了3年限套餐,所需支付<br/>
-								价格为: 第1年880.00元+第2年800.00元+第三年700.00元,<br/>
-								需支付金额: 2380.00元
-							</div>
-						    <i class="el-icon-question icon-question"></i>
-						</el-tooltip>
-					</div>
-					<div style="display: flex;align-items: center;justify-content: center;margin-top: 20px;">
-						<img style="width: 30px;height: 30px;" src="@/assets/common/weixin.png" alt="">
-						<span>请使用微信扫码支付</span>
-					</div>
-				</div>
-			</div>
-			<div class="pay" v-else>
-				<img style="width: 60px;height: 60px;" src="@/assets/common/weixin.png" alt="">
-				<div style="font-weight: bold;font-size: 22px;margin: 20px 0;">支付成功</div>
-				<div class="flex" style="align-items: center;">
-					<div style="font-size: 16px;">支付金额: <span style="font-size: 20px;color: #ff6804;">¥</span><span style="font-size: 36px;color: #ff6804;font-weight: bold;">{{(goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100)/100}}</span></div>
-				</div>
-				<div style="margin: 50px 0;font-size: 18px;">您的账号已续费成功,最新到期时间为:<span style="color: #169dff;">{{userInfo.companyExpireTime}}</span></div>
-				<div style="display: flex;justify-content: center;">
-					<el-button size="small" type="primary" @click="goBack">知道了</el-button>
-				</div>
-			</div>
-		</el-dialog>
-	</div>
+  <div class="s-page">
+    <el-page-header @back="goBack" content="续费"></el-page-header>
+    <el-divider></el-divider>
+    <el-card class="goods">
+      <div class="tishi">请选择需要购买的套餐并用微信扫码支付!</div>
+      <div class="flex">
+        <div
+          class="item"
+          v-for="(item, index) in goodsList"
+          :key="index"
+          @click="
+            goodsIndex = index
+            goodsId = item.id
+          "
+        >
+          <div class="tj" v-if="item.isFirst == 1">推荐</div>
+          <div class="year">{{ item.normName }}</div>
+          <div class="new">
+            <span style="font-size: 20px">¥</span>{{ (item.normAmount * 100 - item.discountAmount * 100) / 100 }}
+          </div>
+          <div class="old">¥{{ item.normAmount }}</div>
+          <div :class="goodsIndex == index ? 'bottom active' : 'bottom'">立省¥{{ item.discountAmount }}</div>
+        </div>
+      </div>
+      <div class="flex" style="justify-content: flex-start">
+        <el-button style="margin-top: 30px" type="success" @click="confirmPay()">微信支付</el-button>
+      </div>
+    </el-card>
+    <el-dialog
+      title="确认支付"
+      :visible.sync="is_pay"
+      width="50%"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="close"
+    >
+      <div class="pay" v-if="!isPaySuccess">
+        <div style="font-weight: bold; font-size: 22px">扫码支付</div>
+        <div class="ewm" ref="payQRCode" />
+        <div>
+          <div class="flex" style="align-items: center">
+            <div>
+              实付: <span style="font-size: 20px; color: #ff6804">¥</span
+              ><span style="font-size: 36px; color: #ff6804; font-weight: bold">{{
+                (goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100) / 100
+              }}</span>
+            </div>
+            <div style="margin: 0 20px">
+              已优惠: <span style="font-size: 18px; color: #ff6804">¥</span
+              ><span style="font-size: 20px; color: #ff6804">{{ goodsList[goodsIndex].discountAmount }}</span>
+            </div>
+            <el-tooltip effect="dark" placement="right-start">
+              <div slot="content">
+                购买年限越大越优惠,优惠价格按年份增加折扣,第1年<br />
+                8.8折,第2年8折,第3年7折,第4年6折,第5年5折。<br />
+                举例: 原价1000元/年,张三购买了3年限套餐,所需支付<br />
+                价格为: 第1年880.00元+第2年800.00元+第三年700.00元,<br />
+                需支付金额: 2380.00元
+              </div>
+              <i class="el-icon-question icon-question"></i>
+            </el-tooltip>
+          </div>
+          <div style="display: flex; align-items: center; justify-content: center; margin-top: 20px">
+            <img style="width: 30px; height: 30px" src="@/assets/common/weixin.png" alt="" />
+            <span>请使用微信扫码支付</span>
+          </div>
+        </div>
+      </div>
+      <div class="pay" v-else>
+        <img style="width: 60px; height: 60px" src="@/assets/common/weixin.png" alt="" />
+        <div style="font-weight: bold; font-size: 22px; margin: 20px 0">支付成功</div>
+        <div class="flex" style="align-items: center">
+          <div style="font-size: 16px">
+            支付金额: <span style="font-size: 20px; color: #ff6804">¥</span
+            ><span style="font-size: 36px; color: #ff6804; font-weight: bold">{{
+              (goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100) / 100
+            }}</span>
+          </div>
+        </div>
+        <div style="margin: 50px 0; font-size: 18px">
+          您的账号已续费成功,最新到期时间为:<span style="color: #169dff">{{ userInfo.companyExpireTime }}</span>
+        </div>
+        <div style="display: flex; justify-content: center">
+          <el-button size="small" type="primary" @click="goBack">知道了</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import { mapGetters } from 'vuex'
-	import { getUserInfo } from '@/api/setting'
-	import QRCode from "qrcodejs2";
-	import request from '@/utils/request'
-	export default {
-		data() {
-			return {
-				userInfo: {},
-				goodsList: [],
-				goodsId: '',
-				goodsIndex: 0,
-				timer:'',
-				is_pay: false,
-				is_submit: true,
-				isPaySuccess: false,
-			};
-		},
-		computed: {
-		  ...mapGetters([
-		    'userid'
-		  ])
-		},
-		created() {
-			this.getUserInfo()
-			this.getBuyList()
-		},
-		destroyed() {
-			this.clear()
-		},
-		methods: {
-			// 返回
-			goBack() {
-				this.is_pay = false
-				this.clear()
-				this.$emit('back');
-			},
-			close(){
-				this.clear()
-			},
-			getUserInfo() {
-			  getUserInfo({adminUserId: this.userid}).then(res => {
-			    this.userInfo = res.data;
-			  })
-			},
-			getBuyList(){
-				request({
-				  url: `/buy/service/config/list`,
-				  method: 'post',
-				  data: {}
-				}).then(res => {
-					this.goodsList = res.data
-					this.goodsId = res.data[0].id
-				}).catch(erro => {
-					
-				})
-			},
-			confirmPay(){
-				if(!this.is_submit){
-					return false
-				}
-				this.is_submit = false
-				setTimeout(()=>{
-					this.is_submit = true
-				},3000)
-				this.getCode()
-				this.is_pay = true
-			},
-			checkPay(payId){
-				this.timer = setInterval(()=>{
-					request({
-					  url: `/buy/service/query/pay/code`,
-					  method: 'post',
-					  params: {
-						  companyName: this.userInfo.companyName,
-						  payId
-					  }
-					}).then(res => {
-						if(res.data == true){
-							this.getUserInfo()
-							this.$refs.payQRCode.innerHTML = '';
-							this.isPaySuccess = true
-							this.clear()
-						}
-					}).catch(erro => {
-						
-					})
-				},3000)
-			},
-			clear(){
-				clearInterval(this.timer)
-			},
-			getCode(){
-				request({
-				  url: `/buy/service/generate/pay/code`,
-				  method: 'post',
-				  params: {
-					  id: this.userInfo.buyCompanyInfo,
-					  normId: this.goodsId
-				  }
-				}).then(res => {
-					if(res.code == 200){
-						this.$refs.payQRCode.innerHTML = '';
-						this.$nextTick(() => {
-						  new QRCode(this.$refs.payQRCode, {
-						    text: res.data.codeUrl,
-						    width: 200,
-						    height: 200,
-						    colorDark: "#333333", // 二维码颜色
-						    colorLight: "#ffffff", // 二维码背景色
-						    correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
-						  });
-						  this.checkPay(res.data.id)
-						});
-					}
-				}).catch(erro => {
-					
-				})
-			}
-		}
-	};
+import { mapGetters } from 'vuex'
+import { getUserInfo } from '@/api/setting'
+import QRCode from 'qrcodejs2'
+import request from '@/utils/request'
+export default {
+  data() {
+    return {
+      userInfo: {},
+      goodsList: [],
+      goodsId: '',
+      goodsIndex: 0,
+      timer: '',
+      is_pay: false,
+      is_submit: true,
+      isPaySuccess: false
+    }
+  },
+  computed: {
+    ...mapGetters(['userid'])
+  },
+  created() {
+    this.getUserInfo()
+    this.getBuyList()
+  },
+  destroyed() {
+    this.clear()
+  },
+  methods: {
+    // 返回
+    goBack() {
+      this.is_pay = false
+      this.clear()
+      this.$emit('back')
+    },
+    close() {
+      this.clear()
+    },
+    getUserInfo() {
+      getUserInfo({ adminUserId: this.userid }).then(res => {
+        this.userInfo = res.data
+      })
+    },
+    getBuyList() {
+      request({
+        url: `/buy/service/config/list`,
+        method: 'post',
+        data: {}
+      })
+        .then(res => {
+          this.goodsList = res.data
+          this.goodsId = res.data[0].id
+        })
+        .catch(erro => {})
+    },
+    confirmPay() {
+      if (!this.is_submit) {
+        return false
+      }
+      this.is_submit = false
+      setTimeout(() => {
+        this.is_submit = true
+      }, 3000)
+      this.getCode()
+      this.is_pay = true
+    },
+    checkPay(payId) {
+      this.timer = setInterval(() => {
+        request({
+          url: `/buy/service/query/pay/code`,
+          method: 'post',
+          params: {
+            companyName: this.userInfo.companyName,
+            payId
+          }
+        })
+          .then(res => {
+            if (res.data == true) {
+              this.getUserInfo()
+              this.$refs.payQRCode.innerHTML = ''
+              this.isPaySuccess = true
+              this.clear()
+            }
+          })
+          .catch(erro => {})
+      }, 3000)
+    },
+    clear() {
+      clearInterval(this.timer)
+    },
+    getCode() {
+      request({
+        url: `/buy/service/generate/pay/code`,
+        method: 'post',
+        params: {
+          id: this.userInfo.buyCompanyInfo,
+          normId: this.goodsId
+        }
+      })
+        .then(res => {
+          if (res.code == 200) {
+            this.$refs.payQRCode.innerHTML = ''
+            this.$nextTick(() => {
+              new QRCode(this.$refs.payQRCode, {
+                text: res.data.codeUrl,
+                width: 200,
+                height: 200,
+                colorDark: '#333333', // 二维码颜色
+                colorLight: '#ffffff', // 二维码背景色
+                correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
+              })
+              this.checkPay(res.data.id)
+            })
+          }
+        })
+        .catch(erro => {})
+    }
+  }
+}
 </script>
 
 <style scoped="scoped" lang="scss">
-	.s-page {
-		padding: 20px;
-		background-color: #ffffff;
-	}
-	.tishi{
-		height: 40px;
-		padding-left: 40px;
-		background-color: #eeeeee;
-		text-align: left;
-		font-weight: bold;
-		line-height: 40px;
-		margin-bottom: 50px;
-	}
-	.flex{
-		display: flex;
-	}
-	.goods{
-		box-sizing: border-box;
-		text-align: center;
-		.item{
-			width: 200px;
-			height: 200px;
-			margin-right: 20px;
-			background-color: #eeeeee;
-			position: relative;
-			padding-top: 40px;
-			box-sizing: border-box;
-			font-weight: bold;
-			border-radius: 10px;
-			border: 1px solid #dddddd;
-			cursor: pointer;
-			.year{
-				font-size: 20px;
-				color: #999999;
-			}
-			.new{
-				font-size: 36px;
-				color: #ff6804;
-			}
-			.old{
-				font-size: 16px;
-				color: #999999;
-				text-decoration: line-through;
-			}
-			.bottom{
-				width: 100%;
-				padding: 10px 0;
-				color: #b4916d;
-				background-color: #e6e6e6;
-				position: absolute;
-				bottom: 0;
-				left: 0;
-			}
-			.tj{
-				padding: 6px 20px;
-				position: absolute;
-				top: 0;
-				left: 0;
-				font-size: 20px;
-				font-weight: 500;
-				color: #ffffff;
-				border-radius: 0 0 26px 0;
-				background-color: #ff554e;
-			}
-			.active{
-				color: #ffffff;
-				background-color: #ff953d;
-			}
-		}
-		.ewm{
-			width: 200px;
-			height: 200px;
-		}
-		.icon-question{
-			font-size: 20px;
-			// color: #189dff;
-		}
-	}
-	.pay{
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		text-align: center;
-		.ewm{
-			margin: 30px 0;
-		}
-	}
-</style>
+.s-page {
+  padding: 20px;
+  background-color: #ffffff;
+}
+.tishi {
+  height: 40px;
+  padding-left: 40px;
+  background-color: #eeeeee;
+  text-align: left;
+  font-weight: bold;
+  line-height: 40px;
+  margin-bottom: 50px;
+}
+.flex {
+  display: flex;
+}
+.goods {
+  box-sizing: border-box;
+  text-align: center;
+  .item {
+    width: 200px;
+    height: 200px;
+    margin-right: 20px;
+    background-color: #eeeeee;
+    position: relative;
+    padding-top: 40px;
+    box-sizing: border-box;
+    font-weight: bold;
+    border-radius: 10px;
+    border: 1px solid #dddddd;
+    cursor: pointer;
+    .year {
+      font-size: 20px;
+      color: #999999;
+    }
+    .new {
+      font-size: 36px;
+      color: #ff6804;
+    }
+    .old {
+      font-size: 16px;
+      color: #999999;
+      text-decoration: line-through;
+    }
+    .bottom {
+      width: 100%;
+      padding: 10px 0;
+      color: #b4916d;
+      background-color: #e6e6e6;
+      position: absolute;
+      bottom: 0;
+      left: 0;
+    }
+    .tj {
+      padding: 6px 20px;
+      position: absolute;
+      top: 0;
+      left: 0;
+      font-size: 20px;
+      font-weight: 500;
+      color: #ffffff;
+      border-radius: 0 0 26px 0;
+      background-color: #ff554e;
+    }
+    .active {
+      color: #ffffff;
+      background-color: #ff953d;
+    }
+  }
+  .ewm {
+    width: 200px;
+    height: 200px;
+  }
+  .icon-question {
+    font-size: 20px;
+    // color: #189dff;
+  }
+}
+.pay {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  text-align: center;
+  .ewm {
+    margin: 30px 0;
+  }
+}
+</style>

+ 481 - 412
src/views/userManagement/distributorManagement/index.vue

@@ -1,86 +1,110 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
-	  <template slot-scope="{activeKey, data}">
-			<div :style="{
-				width: '100%',
-				height: activeKey == 'list' ? '100%' : '0px',
-				overflow: 'hidden'
-			}">
-				<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="280"
-				  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-				  :operation="operation()" :exportList="exportList">
-					<div slot="moreSearch">
-					  <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
-					  	<el-radio-button label="">全部</el-radio-button>
-					  	<el-radio-button label="WAIT">待审核</el-radio-button>
-					  	<el-radio-button label="OK">审核通过</el-radio-button>
-					  	<el-radio-button label="FAIL">驳回</el-radio-button>
-					  </el-radio-group>
-					  <br><br>
-					</div>
-				</template-page>
-			</div>
-		  <div v-if="~['examine','detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
-		  	<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-		  	<zj-form-module title="" label-width="100px" :showPackUp="false"
-		  		:form-data="formData" :form-items="formItems">
-		  	</zj-form-module>
-		  	</zj-form-container>
-		  	<div slot="footer" class="dialog-footer">
-		  		<el-button v-if="formData.examineStatus == 'WAIT'" size="mini" type="primary" @click="audit('OK', data.removeTab)">审核通过</el-button>
-		  		<el-button v-if="formData.examineStatus == 'WAIT'" size="mini" type="danger" @click="audit('FAIL', data.removeTab)">审核驳回</el-button>
-		  		<el-button size="mini" @click="data.removeTab()">取 消</el-button>
-		  	</div>
-		  </div>
-		  <div v-if="~['worker'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
-		  	<el-form ref="workerForm" :model="workerForm" label-width="110px" size="small" label-position="left">
-		  		<el-row :gutter="20">
-		  			<el-col :span="6">
-		  				<el-form-item label="入驻网点" :required="true">
-		  					<el-select v-model="workerForm.websitId" placeholder="请选择" style="width: 100%;">
-		  					    <el-option
-		  					      v-for="item in websitList"
-		  					      :key="item.websitId"
-		  					      :label="item.name"
-		  					      :value="item.websitId">
-		  					    </el-option>
-		  					  </el-select>
-		  				</el-form-item>
-		  			</el-col>
-		  			<el-col :span="6">
-		  				<el-form-item label="姓名" :required="true">
-		  					<el-input v-model="workerForm.name" placeholder="请输入"></el-input>
-		  				</el-form-item>
-		  			</el-col>
-		  			<el-col :span="6">
-		  				<el-form-item label="身份证号码" :required="true">
-		  					<el-input v-model="workerForm.idCard" placeholder="请输入"></el-input>
-		  				</el-form-item>
-		  			</el-col>
-					<el-col :span="6">
-						<el-form-item label="银行卡号">
-							<el-input v-model="workerForm.bankAccount" placeholder="请输入"></el-input>
-						</el-form-item>
-					</el-col>
-		  			<el-col :span="24">
-		  				<el-form-item label="身份证正面照" :required="true">
-		  					<ImageUpload :fileList="fileList" :limit="1" :isEdit="true" />
-		  				</el-form-item>
-		  			</el-col>
-		  			<el-col :span="24" v-for="(item,index) in imgList" :key="index">
-		  				<el-form-item :label="item.dictValue" :required="true">
-		  					<ImageUpload :fileList="item.imgs" :limit="1" :isEdit="true" />
-		  				</el-form-item>
-		  			</el-col>
-		  		</el-row>
-		  	</el-form>
-		  	<div slot="footer" class="dialog-footer">
-		  		<el-button @click="data.removeTab()">取 消</el-button>
-		  		<el-button type="primary" @click="memberInner(data.removeTab)">确定</el-button>
-		  	</div>
-		  </div>
-	  </template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <div
+        :style="{
+          width: '100%',
+          height: activeKey == 'list' ? '100%' : '0px',
+          overflow: 'hidden'
+        }"
+      >
+        <template-page
+          ref="pageRef"
+          :get-list="getList"
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :operationColumnWidth="280"
+          :options-evens-group="optionsEvensGroup"
+          :moreParameters="moreParameters"
+          :column-parsing="columnParsing"
+          :operation="operation()"
+          :exportList="exportList"
+        >
+          <div slot="moreSearch">
+            <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
+              <el-radio-button label="">全部</el-radio-button>
+              <el-radio-button label="WAIT">待审核</el-radio-button>
+              <el-radio-button label="OK">审核通过</el-radio-button>
+              <el-radio-button label="FAIL">驳回</el-radio-button>
+            </el-radio-group>
+            <br /><br />
+          </div>
+        </template-page>
+      </div>
+      <div v-if="~['examine', 'detail'].indexOf(activeKey)" style="box-sizing: border-box; padding: 16px">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="100px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button
+            v-if="formData.examineStatus == 'WAIT'"
+            size="mini"
+            type="primary"
+            @click="audit('OK', data.removeTab)"
+            >审核通过</el-button
+          >
+          <el-button
+            v-if="formData.examineStatus == 'WAIT'"
+            size="mini"
+            type="danger"
+            @click="audit('FAIL', data.removeTab)"
+            >审核驳回</el-button
+          >
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+        </div>
+      </div>
+      <div v-if="~['worker'].indexOf(activeKey)" style="box-sizing: border-box; padding: 16px">
+        <el-form ref="workerForm" :model="workerForm" label-width="110px" size="small" label-position="left">
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="入驻网点" :required="true">
+                <el-select v-model="workerForm.websitId" placeholder="请选择" style="width: 100%">
+                  <el-option v-for="item in websitList" :key="item.websitId" :label="item.name" :value="item.websitId">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="姓名" :required="true">
+                <el-input v-model="workerForm.name" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="身份证号码" :required="true">
+                <el-input v-model="workerForm.idCard" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="银行卡号">
+                <el-input v-model="workerForm.bankAccount" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="身份证正面照" :required="true">
+                <ImageUpload :fileList="fileList" :limit="1" :isEdit="true" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-for="(item, index) in imgList" :key="index">
+              <el-form-item :label="item.dictValue" :required="true">
+                <ImageUpload :fileList="item.imgs" :limit="1" :isEdit="true" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="data.removeTab()">取 消</el-button>
+          <el-button type="primary" @click="memberInner(data.removeTab)">确定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -88,12 +112,20 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { memberListService2,memberPageExport, getMemberDetail, memberAudit, memberInner, memberInsideInner, getWebsit } from "@/api/distributorManagement";
+import {
+  memberListService2,
+  memberPageExport,
+  getMemberDetail,
+  memberAudit,
+  memberInner,
+  memberInsideInner,
+  getWebsit
+} from '@/api/distributorManagement'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import request from '@/utils/request'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin,operation_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
       // 事件组合
@@ -102,7 +134,7 @@ export default {
       tableAttributes: {
         // 启用勾选列
         selectColumn: false,
-		'row-class-name': this.tableRowClassName
+        'row-class-name': this.tableRowClassName
       },
       // 表格事件
       tableEvents: {
@@ -112,25 +144,25 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["审核", "详情"],
+      formDialogTitles: ['审核', '详情'],
       formDialog: false,
-			dialogVisible: false,
+      dialogVisible: false,
       formData: {
-				type: '工程师',
-				examineRemark: '',
-				examineStatus: ''
+        type: '工程师',
+        examineRemark: '',
+        examineStatus: ''
       },
-			examineStatus: '',
-			websitList: [],
-			workerForm: {
-				websitId: '',
-				userId: '',
-				idCard: '',
-				name: '',
-				bankAccount: ''
-			},
-			fileList: [],
-			imgList: []
+      examineStatus: '',
+      websitList: [],
+      workerForm: {
+        websitId: '',
+        userId: '',
+        idCard: '',
+        name: '',
+        bankAccount: ''
+      },
+      fileList: [],
+      imgList: []
     }
   },
   computed: {
@@ -139,343 +171,380 @@ export default {
       return []
     },
     formItems() {
-      return [{
-        md: 12,
-        isShow: true,
-        name: 'el-select',
-		options: [{label: '待审核', value: 'WAIT'},{label: '驳回', value: 'FAIL'},{label: '通过', value: 'OK'}],
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '审核状态',
-          prop: 'examineStatus',
-          rules: []
+      return [
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-select',
+          options: [
+            { label: '待审核', value: 'WAIT' },
+            { label: '驳回', value: 'FAIL' },
+            { label: '通过', value: 'OK' }
+          ],
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '审核状态',
+            prop: 'examineStatus',
+            rules: []
+          }
         },
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-select',
-		options: [{label: '业务员', value: 'SERVICE'},{label: '师傅', value: 'WORKER'},{label: '普通用户', value: 'GENERAL'}],
-        attributes: { disabled: true },
-        formItemAttributes: {
-          label: '用户类型',
-          prop: 'type',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '用户名称',
-          prop: 'nickName',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '联系电话',
-          prop: 'mobile',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '身份证号码',
-          prop: 'idCard',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '身份证',
-          prop: 'idCardImg',
-          rules: []
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-select',
+          options: [
+            { label: '业务员', value: 'SERVICE' },
+            { label: '师傅', value: 'WORKER' },
+            { label: '普通用户', value: 'GENERAL' }
+          ],
+          attributes: { disabled: true },
+          formItemAttributes: {
+            label: '用户类型',
+            prop: 'type',
+            rules: []
+          }
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          console.log(this.formData.idCardImg)
-          return (
-            this.formData.idCardImg ? <el-image src={this.formData.idCardImg} style='width: 120px;height:120px' preview-src-list={[this.formData.idCardImg]} fit="cover"></el-image> : ''
-          )
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: []
-        }
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入',type: "textarea", disabled: this.formData.examineStatus == 'WAIT' ? false:true },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'examineRemark',
-          rules: []
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '用户名称',
+            prop: 'nickName',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '联系电话',
+            prop: 'mobile',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '身份证号码',
+            prop: 'idCard',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '身份证',
+            prop: 'idCardImg',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            console.log(this.formData.idCardImg)
+            return this.formData.idCardImg ? (
+              <el-image
+                src={this.$showImgUrl(this.formData.idCardImg)}
+                style="width: 120px;height:120px"
+                preview-src-list={[this.$showImgUrl(this.formData.idCardImg)]}
+                fit="cover"
+              ></el-image>
+            ) : (
+              ''
+            )
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: []
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: {
+            placeholder: '请输入',
+            type: 'textarea',
+            disabled: this.formData.examineStatus == 'WAIT' ? false : true
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'examineRemark',
+            rules: []
+          }
         }
-      }]
+      ]
     }
   },
-	created(){
-		  this.getImgList()
-	},
+  created() {
+    this.getImgList()
+  },
   methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
-	},
-	exportList: memberPageExport,
-	// 列表请求函数
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "a.examine_status", "compare": "=", "value": this.examineStatus })
-	    }
-	    return memberListService2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-	getImgList(){
-		request({
-		  url: `/dictCompany/page`,
-		  method: 'post',
-		  data: { pageNum: 1, pageSize: -1, params: [{param: "a.dict_type", compare: "=", value: "WORKER_IMG"}] }
-		}).then(res=>{
-			this.imgList = res.data.records.filter(item=>{
-				return item.imgs = []
-			})
-		})
-	},
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+    exportList: memberPageExport,
+    // 列表请求函数
+    getList(p) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.examineStatus) {
+          pam.params.push({ param: 'a.examine_status', compare: '=', value: this.examineStatus })
+        }
+        return memberListService2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    getImgList() {
+      request({
+        url: `/dictCompany/page`,
+        method: 'post',
+        data: { pageNum: 1, pageSize: -1, params: [{ param: 'a.dict_type', compare: '=', value: 'WORKER_IMG' }] }
+      }).then(res => {
+        this.imgList = res.data.records.filter(item => {
+          return (item.imgs = [])
+        })
+      })
+    },
     // 列表导出函数
     exportList: memberPageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		    defaultData.render = (h, { row, index, column }) => {
-		      return (
-		        <div style="padding:0 6px;cursor: pointer;">
-		          {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		          </div>
-		      )
-		    }
-		}
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {' '}
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}{' '}
+            </div>
+          )
+        }
+      }
       return defaultData
     },
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
     },
-	guanbi() {
-	  this.$refs?.formRef?.$refs?.inlineForm?.clearValidate()
-	  this.$data.formData = this.$options.data().formData
-	},
-	tableRowClassName({row, rowIndex}){
-		if(row.examineStatus==="待审核"){
-			return 'redbackground'
-		}else{
-			return ''
-		}
-	},
-	// 表格操作列
-	operation() {
-		return this.operationBtn({
-			detail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.$refs.tabPage.addTab({
-					    activeKey: "detail",
-					    key: "detail",
-					    label: "详情",
-					    triggerEvent: () => {
-					        this.guanbi()
-					        this.$nextTick(() => {
-								getMemberDetail({ userId: row.userId }).then(res => {
-								  Object.assign(this.formData, res.data)
-								  this.formDialogType = 1
-								})
-							})
-						},
-					})
-					
-				}
-			},
-			examine: {
-				btnType: 'text',
-				conditions: ({ row, index, column }) => {
-					return row.examineStatus == 'WAIT'
-				},
-				click: ({ row, index, column }) => {
-					this.$refs.tabPage.addTab({
-					  activeKey: "examine",
-					  key: "examine",
-					  label: "审核",
-					  triggerEvent: () => {
-					    this.guanbi()
-					    this.$nextTick(() => {
-							this.workerForm.userId = row.userId
-							getMemberDetail({ userId: row.userId }).then(res => {
-								Object.assign(this.formData, res.data)
-							})
-					    })
-					  },
-					  closeEvent: () => {
-					  }
-					})
-				}
-			},
-			setWorker: {
-				btnType: 'text',
-				// prompt: '请确认是否设为工程师?',
-				conditions: ({ row, index, column }) => {
-					return row.examineStatus != 'WAIT'
-				},
-				click: ({ row, index, column }) => {
-					this.$refs.tabPage.addTab({
-					  activeKey: "worker",
-					  key: "worker",
-					  label: "设为工程师",
-					  triggerEvent: () => {
-					    this.guanbi()
-					    this.$nextTick(() => {
-							this.workerForm.userId = row.userId
-							getWebsit({type: 'C'}).then(res => {
-								this.websitList = res.data
-								this.dialogVisible = true
-							})
-					    })
-					  },
-					  closeEvent: () => {
-					  }
-					})
-				}
-			},
-			setCustomer: {
-				btnType: 'text',
-				prompt: '请确认是否设为客户?',
-				click: ({ row, index, column }) => {
-					memberInner({
-						type: 'GENERAL',
-						userId: row.userId
-					}).then(res => {
-						if (res.code == 200) {
-							this.$message({ type: 'success', message: '设为客户成功!' })
-							this.$refs.pageRef.refreshList()
-						} else {
-							this.$message.error(res.msg);
-						}
-					})
-				}
-			},
-			setService: {
-				name: ({ row, index, column }) => {
-					return `${row.innerr?'取消':'设为'}内部分销员`
-				},
-				btnType: 'text',
-				prompt: ({ row, index, column }) => {
-					return `请确认是否${row.innerr?'取消':'设为'}内部分销员?`
-				},
-				click: ({ row, index, column }) => {
-					memberInsideInner({
-						innerr: !row.innerr,
-						userIds: row.userId
-					}).then(res => {
-						if (res.code == 200) {
-							this.$message({ type: 'success', message: (row.innerr?'取消':'设为')+ '内部分销员成功!' })
-							this.$refs.pageRef.refreshList()
-						} else {
-							this.$message.error(res.msg);
-						}
-					})
-				}
-			},
-		})
-	},
+    guanbi() {
+      this.$refs?.formRef?.$refs?.inlineForm?.clearValidate()
+      this.$data.formData = this.$options.data().formData
+    },
+    tableRowClassName({ row, rowIndex }) {
+      if (row.examineStatus === '待审核') {
+        return 'redbackground'
+      } else {
+        return ''
+      }
+    },
+    // 表格操作列
+    operation() {
+      return this.operationBtn({
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.$refs.tabPage.addTab({
+              activeKey: 'detail',
+              key: 'detail',
+              label: '详情',
+              triggerEvent: () => {
+                this.guanbi()
+                this.$nextTick(() => {
+                  getMemberDetail({ userId: row.userId }).then(res => {
+                    Object.assign(this.formData, res.data)
+                    this.formDialogType = 1
+                  })
+                })
+              }
+            })
+          }
+        },
+        examine: {
+          btnType: 'text',
+          conditions: ({ row, index, column }) => {
+            return row.examineStatus == 'WAIT'
+          },
+          click: ({ row, index, column }) => {
+            this.$refs.tabPage.addTab({
+              activeKey: 'examine',
+              key: 'examine',
+              label: '审核',
+              triggerEvent: () => {
+                this.guanbi()
+                this.$nextTick(() => {
+                  this.workerForm.userId = row.userId
+                  getMemberDetail({ userId: row.userId }).then(res => {
+                    Object.assign(this.formData, res.data)
+                  })
+                })
+              },
+              closeEvent: () => {}
+            })
+          }
+        },
+        setWorker: {
+          btnType: 'text',
+          // prompt: '请确认是否设为工程师?',
+          conditions: ({ row, index, column }) => {
+            return row.examineStatus != 'WAIT'
+          },
+          click: ({ row, index, column }) => {
+            this.$refs.tabPage.addTab({
+              activeKey: 'worker',
+              key: 'worker',
+              label: '设为工程师',
+              triggerEvent: () => {
+                this.guanbi()
+                this.$nextTick(() => {
+                  this.workerForm.userId = row.userId
+                  getWebsit({ type: 'C' }).then(res => {
+                    this.websitList = res.data
+                    this.dialogVisible = true
+                  })
+                })
+              },
+              closeEvent: () => {}
+            })
+          }
+        },
+        setCustomer: {
+          btnType: 'text',
+          prompt: '请确认是否设为客户?',
+          click: ({ row, index, column }) => {
+            memberInner({
+              type: 'GENERAL',
+              userId: row.userId
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message({ type: 'success', message: '设为客户成功!' })
+                this.$refs.pageRef.refreshList()
+              } else {
+                this.$message.error(res.msg)
+              }
+            })
+          }
+        },
+        setService: {
+          name: ({ row, index, column }) => {
+            return `${row.innerr ? '取消' : '设为'}内部分销员`
+          },
+          btnType: 'text',
+          prompt: ({ row, index, column }) => {
+            return `请确认是否${row.innerr ? '取消' : '设为'}内部分销员?`
+          },
+          click: ({ row, index, column }) => {
+            memberInsideInner({
+              innerr: !row.innerr,
+              userIds: row.userId
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message({ type: 'success', message: (row.innerr ? '取消' : '设为') + '内部分销员成功!' })
+                this.$refs.pageRef.refreshList()
+              } else {
+                this.$message.error(res.msg)
+              }
+            })
+          }
+        }
+      })
+    },
     addData() {
       this.formDialogType = 0
       this.openForm()
     },
     openForm() {
-      this.formDialog = true;
+      this.formDialog = true
     },
     formCancel() {
       this.$refs.formRef.$refs.inlineForm.clearValidate()
       this.$data.formData = this.$options.data().formData
       this.formDialog = false
     },
-	audit(examineStatusEnum, removeTab){
-		memberAudit({ 
-			examineStatusEnum,
-			examineRemark: this.formData.examineRemark,
-			id: this.formData.id,
-			userId: this.workerForm.userId,
-		}).then(res => {
-			this.$message({ type: 'success', message: '审核成功!' })
-			this.formCancel()
-			removeTab('list')
-			this.$refs.pageRef.refreshList()
-		})
-	},
-	memberInner(removeTab){
-		let workerImgs = []
-		for(var i = 0;i < this.imgList.length;i++){
-			if(this.imgList[i].imgs.length == 0){
-				return this.$message({ type: 'error', message: '请上传' + this.imgList[i].dictValue +'!' })
-				break;
-			}else{
-				workerImgs.push({
-					imgName: this.imgList[i].dictValue,
-					imgUrl: this.imgList[i].imgs.length>0?this.imgList[i].imgs[0].url:''
-				})
-			}
-		}
-		if(!this.workerForm.websitId){
-			return this.$message({ type: 'error', message: '请选择入驻网点!' })
-		}else if(!this.workerForm.name){
-			return this.$message({ type: 'error', message: '请输入姓名!' })
-		}else if(!this.workerForm.idCard){
-			return this.$message({ type: 'error', message: '请输入身份证号码!' })
-		}else if(!/^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$/g.test(this.workerForm.idCard)){
-			return this.$message({ type: 'error', message: '请输入正确的身份证号码!' })
-		}else if(this.fileList.length == 0){
-			return this.$message({ type: 'error', message: '请上传身份证正面照!' })
-		}
-		memberInner({
-			type: 'WORKER',
-			userId: this.workerForm.userId,
-			websitId: this.workerForm.websitId,
-			name: this.workerForm.name,
-			idCard: this.workerForm.idCard,
-			bankAccount: this.workerForm.bankAccount,
-			idCardImg: this.fileList.map(item => item.url).join(","),
-			workerImgs
-		}).then(res => {
-			removeTab('list')
-			this.dialogVisible = false
-			this.$message({ type: 'success', message: '设置工程师成功!' })
-			this.$refs.pageRef.refreshList()
-		})
-	},
+    audit(examineStatusEnum, removeTab) {
+      memberAudit({
+        examineStatusEnum,
+        examineRemark: this.formData.examineRemark,
+        id: this.formData.id,
+        userId: this.workerForm.userId
+      }).then(res => {
+        this.$message({ type: 'success', message: '审核成功!' })
+        this.formCancel()
+        removeTab('list')
+        this.$refs.pageRef.refreshList()
+      })
+    },
+    memberInner(removeTab) {
+      let workerImgs = []
+      for (var i = 0; i < this.imgList.length; i++) {
+        if (this.imgList[i].imgs.length == 0) {
+          return this.$message({ type: 'error', message: '请上传' + this.imgList[i].dictValue + '!' })
+          break
+        } else {
+          workerImgs.push({
+            imgName: this.imgList[i].dictValue,
+            imgUrl: this.imgList[i].imgs.length > 0 ? this.imgList[i].imgs[0].url : ''
+          })
+        }
+      }
+      if (!this.workerForm.websitId) {
+        return this.$message({ type: 'error', message: '请选择入驻网点!' })
+      } else if (!this.workerForm.name) {
+        return this.$message({ type: 'error', message: '请输入姓名!' })
+      } else if (!this.workerForm.idCard) {
+        return this.$message({ type: 'error', message: '请输入身份证号码!' })
+      } else if (!/^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$/g.test(this.workerForm.idCard)) {
+        return this.$message({ type: 'error', message: '请输入正确的身份证号码!' })
+      } else if (this.fileList.length == 0) {
+        return this.$message({ type: 'error', message: '请上传身份证正面照!' })
+      }
+      memberInner({
+        type: 'WORKER',
+        userId: this.workerForm.userId,
+        websitId: this.workerForm.websitId,
+        name: this.workerForm.name,
+        idCard: this.workerForm.idCard,
+        bankAccount: this.workerForm.bankAccount,
+        idCardImg: this.fileList.map(item => item.url).join(','),
+        workerImgs
+      }).then(res => {
+        removeTab('list')
+        this.dialogVisible = false
+        this.$message({ type: 'success', message: '设置工程师成功!' })
+        this.$refs.pageRef.refreshList()
+      })
+    },
     formConfirm() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          ([memberAudit][this.formDialogType])(this.formData).then(res => {
+          ;[memberAudit][this.formDialogType](this.formData).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             this.formCancel()
             this.$refs.pageRef.refreshList()
@@ -488,11 +557,11 @@ export default {
 </script>
 
 <style lang="scss" scoped></style>
-<style lang="scss" >
+<style lang="scss">
 .redbackground {
-	background: rgb(248, 185, 185) !important;
+  background: rgb(248, 185, 185) !important;
 }
-.lcsebackground{
+.lcsebackground {
   background: rgb(212, 245, 212) !important;
 }
-</style>
+</style>

+ 356 - 256
src/views/userManagement/masterManagement/index.vue

@@ -1,14 +1,25 @@
 <template>
   <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
-    <template slot-scope="{activeKey, data}">
-      <div :style="{
-        width: '100%',
-        height: activeKey == 'list' ? '100%' : '0px',
-        overflow: 'hidden'
-      }">
-        <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-          :operationColumnWidth="260" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
-          :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    <template slot-scope="{ activeKey, data }">
+      <div
+        :style="{
+          width: '100%',
+          height: activeKey == 'list' ? '100%' : '0px',
+          overflow: 'hidden'
+        }"
+      >
+        <template-page
+          ref="pageRef"
+          :get-list="getList"
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :operationColumnWidth="260"
+          :options-evens-group="optionsEvensGroup"
+          :moreParameters="moreParameters"
+          :column-parsing="columnParsing"
+          :operation="operation()"
+          :exportList="exportList"
+        >
           <div slot="moreSearch">
             <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
               <el-radio-button label="">全部</el-radio-button>
@@ -16,15 +27,32 @@
               <el-radio-button label="OK">审核通过</el-radio-button>
               <el-radio-button label="FAIL">驳回</el-radio-button>
             </el-radio-group>
-            <br><br>
+            <br /><br />
           </div>
-          <el-dialog title="绑定辅助师傅" width="500px" :modal="true" :visible.sync="formDialogaddsf" :show-close="true"
-            :close-on-click-modal="false" :before-close="formCancelaa">
-            <zj-form-container ref="formRefaa" :form-data="formDataaa" :styleSwitch="false" :formAttributes="{
-              'label-position': 'top'
-            }">
-              <zj-form-module title="绑定辅助师傅" label-width="100px" :showHade="false" :form-data="formDataaa"
-                :form-items="formItemsaa">
+          <el-dialog
+            title="绑定辅助师傅"
+            width="500px"
+            :modal="true"
+            :visible.sync="formDialogaddsf"
+            :show-close="true"
+            :close-on-click-modal="false"
+            :before-close="formCancelaa"
+          >
+            <zj-form-container
+              ref="formRefaa"
+              :form-data="formDataaa"
+              :styleSwitch="false"
+              :formAttributes="{
+                'label-position': 'top'
+              }"
+            >
+              <zj-form-module
+                title="绑定辅助师傅"
+                label-width="100px"
+                :showHade="false"
+                :form-data="formDataaa"
+                :form-items="formItemsaa"
+              >
               </zj-form-module>
             </zj-form-container>
             <div slot="footer">
@@ -34,16 +62,35 @@
           </el-dialog>
         </template-page>
       </div>
-      <div v-if="~['examine', 'detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
+      <div v-if="~['examine', 'detail'].indexOf(activeKey)" style="box-sizing: border-box; padding: 16px">
         <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-          <zj-form-module :title="data.label" label-width="170px" :showPackUp="false" :form-data="formData"
-            :form-items="[...formItems,...imageList]">
+          <zj-form-module
+            :title="data.label"
+            label-width="170px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="[...formItems, ...imageList]"
+          >
           </zj-form-module>
         </zj-form-container>
         <div slot="footer" class="dialog-footer">
-          <el-button v-if="formData.examineStatus == 'WAIT' && activeKey == 'examine'" size="mini" type="primary" @click="audit('OK', data.removeTab)">审核通过</el-button>
-          <el-button v-if="formData.examineStatus == 'WAIT' && activeKey == 'examine'" size="mini" type="danger" @click="audit('FAIL', data.removeTab)">审核驳回</el-button>
-		  <el-button v-if="activeKey == 'detail'" size="mini" type="primary" @click="update(data.removeTab)">保存</el-button>
+          <el-button
+            v-if="formData.examineStatus == 'WAIT' && activeKey == 'examine'"
+            size="mini"
+            type="primary"
+            @click="audit('OK', data.removeTab)"
+            >审核通过</el-button
+          >
+          <el-button
+            v-if="formData.examineStatus == 'WAIT' && activeKey == 'examine'"
+            size="mini"
+            type="danger"
+            @click="audit('FAIL', data.removeTab)"
+            >审核驳回</el-button
+          >
+          <el-button v-if="activeKey == 'detail'" size="mini" type="primary" @click="update(data.removeTab)"
+            >保存</el-button
+          >
           <el-button size="mini" @click="data.removeTab()">取 消</el-button>
         </div>
       </div>
@@ -55,7 +102,15 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
-import { memberSlaveBind, memberListPageV2, memberPageExport, getMemberDetail, memberAudit, memberInner, update } from "@/api/masterManagement";
+import {
+  memberSlaveBind,
+  memberListPageV2,
+  memberPageExport,
+  getMemberDetail,
+  memberAudit,
+  memberInner,
+  update
+} from '@/api/masterManagement'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import ImageUpload from '@/components/file-upload'
 export default {
@@ -69,7 +124,7 @@ export default {
       tableAttributes: {
         // 启用勾选列
         selectColumn: false,
-		'row-class-name': this.tableRowClassName
+        'row-class-name': this.tableRowClassName
       },
       // 表格事件
       tableEvents: {
@@ -80,24 +135,24 @@ export default {
       /** 表单变量 */
       formData: {
         type: '工程师',
-		nickName: '',
-		mobile: '',
-		idCard: '',
-		bankAccount: '',
-		isEs: false,
+        nickName: '',
+        mobile: '',
+        idCard: '',
+        bankAccount: '',
+        isEs: false,
         examineRemark: '',
         examineStatus: '',
-		idCardImg: []
+        idCardImg: []
       },
       examineStatus: '',
       formDialogaddsf: false,
       formDataaa: {
-        slaveUserId: "",
-        userId: "",
-        websitId: ""
+        slaveUserId: '',
+        userId: '',
+        websitId: ''
       },
       suoyoushifu: [],
-			imageList: []
+      imageList: []
     }
   },
   computed: {
@@ -106,160 +161,180 @@ export default {
       return []
     },
     formItems() {
-      return [{
-        md: 12,
-        isShow: true,
-        name: 'el-select',
-        options: [{ label: '待审核', value: 'WAIT' }, { label: '驳回', value: 'FAIL' }, { label: '通过', value: 'OK' }],
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '审核状态',
-          prop: 'examineStatus',
-          rules: []
+      return [
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-select',
+          options: [
+            { label: '待审核', value: 'WAIT' },
+            { label: '驳回', value: 'FAIL' },
+            { label: '通过', value: 'OK' }
+          ],
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '审核状态',
+            prop: 'examineStatus',
+            rules: []
+          }
         },
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { disabled: true },
-        formItemAttributes: {
-          label: '用户类型',
-          prop: 'type',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '用户名称',
-          prop: 'nickName',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '联系电话',
-          prop: 'mobile',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '身份证号码',
-          prop: 'idCard',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '身份证',
-          prop: 'idCardImg',
-          rules: [...required]
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { disabled: true },
+          formItemAttributes: {
+            label: '用户类型',
+            prop: 'type',
+            rules: []
+          }
         },
-        render: (h, { props, onInput }) => {
-          var { value } = props
-          console.log(this.formData.idCardImg)
-          return (
-			<ImageUpload fileList={this.formData.idCardImg} limit={1} isEdit={true} />
-            // this.formData.idCardImg ? <el-image src={this.formData.idCardImg} style='width: 120px;height:120px' preview-src-list={[this.formData.idCardImg]} fit="cover"></el-image> : ''
-          )
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '入驻网点',
-          prop: 'websitName',
-          rules: []
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '银行卡',
-          prop: 'bankAccount',
-          rules: []
-        }
-      },
-	  {
-	  	md: 6,
-	  	isShow: true,
-	  	name: 'slot-component',
-	  	attributes: {},
-	  	formItemAttributes: {
-	  		label: '是否允许二手商城发布',
-	  		prop: 'isEs',
-	  		rules: [...required]
-	  	},
-	  	render: (h, { props, onInput }) => {
-	  		var { value } = props
-	  		return (
-	  			<el-radio-group v-model={this.formData.isEs}>
-	  				<el-radio label={true}>是</el-radio>
-	  				<el-radio label={false}>否</el-radio>
-	  			</el-radio-group>
-	  		)
-	  	}
-	  }, 
-	  {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', type: "textarea", disabled: this.formData.examineStatus == 'WAIT' ? false : true },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'examineRemark',
-          rules: []
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '用户名称',
+            prop: 'nickName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '联系电话',
+            prop: 'mobile',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '身份证号码',
+            prop: 'idCard',
+            rules: [...required]
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '身份证',
+            prop: 'idCardImg',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            console.log(this.formData.idCardImg)
+            return (
+              <ImageUpload fileList={this.formData.idCardImg} limit={1} isEdit={true} />
+              // this.formData.idCardImg ? <el-image src={this.formData.idCardImg} style='width: 120px;height:120px' preview-src-list={[this.formData.idCardImg]} fit="cover"></el-image> : ''
+            )
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '入驻网点',
+            prop: 'websitName',
+            rules: []
+          }
+        },
+        {
+          md: 12,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '银行卡',
+            prop: 'bankAccount',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '是否允许二手商城发布',
+            prop: 'isEs',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.isEs}>
+                <el-radio label={true}>是</el-radio>
+                <el-radio label={false}>否</el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: {
+            placeholder: '请输入',
+            type: 'textarea',
+            disabled: this.formData.examineStatus == 'WAIT' ? false : true
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'examineRemark',
+            rules: []
+          }
         }
-      }]
+      ]
     },
     formItemsaa() {
-      return [{
-        md: 24,
-        isShow: true,
-        name: 'el-select',
-        options: this.suoyoushifu,
-        attributes: { placeholder: '请输入' },
-        formItemAttributes: {
-          label: '选择师傅',
-          prop: 'slaveUserId',
-          rules: [...required]
-        },
-        events: {
-          change: (val) => {
-            if (val) {
-              this.formDataaa.websitId = this.suoyoushifu.find(item => item.value == val)?.websitId
-            } else {
-              this.formDataaa.websitId = ""
+      return [
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-select',
+          options: this.suoyoushifu,
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '选择师傅',
+            prop: 'slaveUserId',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              if (val) {
+                this.formDataaa.websitId = this.suoyoushifu.find(item => item.value == val)?.websitId
+              } else {
+                this.formDataaa.websitId = ''
+              }
             }
           }
         }
-      },]
+      ]
     }
   },
   methods: {
@@ -286,13 +361,13 @@ export default {
     changeType(val) {
       this.$refs.pageRef.refreshList()
     },
-	exportList: memberPageExport,
+    exportList: memberPageExport,
     // 列表请求函数
     getList(p) {
       try {
         var pam = JSON.parse(JSON.stringify(p))
         if (this.examineStatus) {
-          pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
+          pam.params.push({ param: 'b.examine_status', compare: '=', value: this.examineStatus })
         }
         return memberListPageV2(pam)
       } catch (error) {
@@ -307,7 +382,18 @@ export default {
         defaultData.render = (h, { row, index, column }) => {
           return (
             <div style="padding:0 6px;cursor: pointer;">
-              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+              {row.idCardImg
+                ? row.idCardImg
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
             </div>
           )
         }
@@ -325,41 +411,47 @@ export default {
           btnType: 'text',
           click: ({ row, index, column }) => {
             this.$refs.tabPage.addTab({
-              activeKey: "detail",
-              key: "detail",
-              label: "详情",
+              activeKey: 'detail',
+              key: 'detail',
+              label: '详情',
               triggerEvent: () => {
                 this.guanbi()
-				this.imageList = []
+                this.imageList = []
                 this.$nextTick(() => {
                   getMemberDetail({ id: row.id }).then(res => {
                     Object.assign(this.formData, res.data, {
-						idCardImg: [{ url: res.data.idCardImg }],
-					})
-					res.data.workerImgList.forEach(item=>{
-						this.imageList.push({
-							md: 12,
-							isShow: true,
-							name: 'slot-component',
-							attributes: {},
-							formItemAttributes: {
-							  label: item.imgName,
-							  prop: 'imgName',
-							  rules: []
-							},
-							render: (h, { props, onInput }) => {
-							  var { value } = props
-							  return (
-							    item.imgUrl ? <el-image src={item.imgUrl} style='width: 120px;height:120px' preview-src-list={[item.imgUrl]} fit="cover"></el-image> : ''
-							  )
-							}
-						})
-					})
+                      idCardImg: [{ url: res.data.idCardImg }]
+                    })
+                    res.data.workerImgList.forEach(item => {
+                      this.imageList.push({
+                        md: 12,
+                        isShow: true,
+                        name: 'slot-component',
+                        attributes: {},
+                        formItemAttributes: {
+                          label: item.imgName,
+                          prop: 'imgName',
+                          rules: []
+                        },
+                        render: (h, { props, onInput }) => {
+                          var { value } = props
+                          return item.imgUrl ? (
+                            <el-image
+                              src={this.$showImgUrl(item.imgUrl)}
+                              style="width: 120px;height:120px"
+                              preview-src-list={[this.$showImgUrl(item.imgUrl)]}
+                              fit="cover"
+                            ></el-image>
+                          ) : (
+                            ''
+                          )
+                        }
+                      })
+                    })
                   })
                 })
               },
-              closeEvent: () => {
-              }
+              closeEvent: () => {}
             })
           }
         },
@@ -370,21 +462,20 @@ export default {
           },
           click: ({ row, index, column }) => {
             this.$refs.tabPage.addTab({
-              activeKey: "examine",
-              key: "examine",
-              label: "审核",
+              activeKey: 'examine',
+              key: 'examine',
+              label: '审核',
               triggerEvent: () => {
                 this.guanbi()
                 this.$nextTick(() => {
                   getMemberDetail({ id: row.id }).then(res => {
                     Object.assign(this.formData, res.data, {
-						idCardImg: [{ url: res.data.idCardImg }],
-					})
+                      idCardImg: [{ url: res.data.idCardImg }]
+                    })
                   })
                 })
               },
-              closeEvent: () => {
-              }
+              closeEvent: () => {}
             })
           }
         },
@@ -400,7 +491,7 @@ export default {
                 this.$message({ type: 'success', message: '设为分销员成功!' })
                 this.$refs.pageRef.refreshList()
               } else {
-                this.$message.error(res.msg);
+                this.$message.error(res.msg)
               }
             })
           }
@@ -417,7 +508,7 @@ export default {
                 this.$message({ type: 'success', message: '设为客户成功!' })
                 this.$refs.pageRef.refreshList()
               } else {
-                this.$message.error(res.msg);
+                this.$message.error(res.msg)
               }
             })
           }
@@ -428,26 +519,35 @@ export default {
             return row.examineStatus == 'OK'
           },
           click: ({ row, index, column }) => {
-            memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [{"param":"b.examine_status","compare":"=","value":"OK"},{"param":"b.websit_id","compare":"=","value": row.websitId}] }).then(res => {
-              this.suoyoushifu = res.data.records.filter(item => item.id != row.id).map(item => ({
-                label: item.nickName,
-                value: item.userId,
-                websitId: item.websitId
-              }))
+            memberListPageV2({
+              pageNum: 1,
+              pageSize: -1,
+              params: [
+                { param: 'b.examine_status', compare: '=', value: 'OK' },
+                { param: 'b.websit_id', compare: '=', value: row.websitId }
+              ]
+            }).then(res => {
+              this.suoyoushifu = res.data.records
+                .filter(item => item.id != row.id)
+                .map(item => ({
+                  label: item.nickName,
+                  value: item.userId,
+                  websitId: item.websitId
+                }))
               this.formDataaa.userId = row.userId
               this.formDialogaddsf = true
             })
           }
-        },
+        }
       })
     },
-	tableRowClassName({row, rowIndex}){
-		if(row.examineStatus==="待审核"){
-			return 'redbackground'
-		}else{
-			return ''
-		}
-	},
+    tableRowClassName({ row, rowIndex }) {
+      if (row.examineStatus === '待审核') {
+        return 'redbackground'
+      } else {
+        return ''
+      }
+    },
     guanbi() {
       this.$refs?.formRef?.$refs?.inlineForm?.clearValidate()
       this.$data.formData = this.$options.data().formData
@@ -463,25 +563,25 @@ export default {
         this.$refs.pageRef.refreshList()
       })
     },
-	update(removeTab){
-		this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-			if (valid) {
-				update({
-				  userId: this.formData.userId,
-				  websitId: this.formData.websitId,
-				  bankAccount: this.formData.bankAccount,
-					isEs: this.formData.isEs,
-				  idCard: this.formData.idCard,
-				  idCardImg: this.formData.idCardImg[0].url,
-				  name: this.formData.nickName
-				}).then(res => {
-				  this.$message({ type: 'success', message: '保存成功!' })
-				  removeTab('list')
-				  this.$refs.pageRef.refreshList()
-				})
-			}
-		})
-	}
+    update(removeTab) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          update({
+            userId: this.formData.userId,
+            websitId: this.formData.websitId,
+            bankAccount: this.formData.bankAccount,
+            isEs: this.formData.isEs,
+            idCard: this.formData.idCard,
+            idCardImg: this.formData.idCardImg[0].url,
+            name: this.formData.nickName
+          }).then(res => {
+            this.$message({ type: 'success', message: '保存成功!' })
+            removeTab('list')
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    }
   }
 }
 </script>
@@ -491,11 +591,11 @@ export default {
   padding: 20px 20px 0 20px;
 }
 </style>
-<style lang="scss" >
+<style lang="scss">
 .redbackground {
-	background: rgb(248, 185, 185) !important;
+  background: rgb(248, 185, 185) !important;
 }
-.lcsebackground{
+.lcsebackground {
   background: rgb(212, 245, 212) !important;
 }
 </style>

+ 137 - 116
src/views/workOrder/appraise/index.vue

@@ -1,8 +1,15 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-		:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		:exportList="exportList">
-	</template-page>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :options-evens-group="optionsEvensGroup"
+    :moreParameters="moreParameters"
+    :column-parsing="columnParsing"
+    :exportList="exportList"
+  >
+  </template-page>
 </template>
 
 <script>
@@ -10,123 +17,137 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport } from "@/api/workOrder/appraise";
+import { listPageV2, pageExport } from '@/api/workOrder/appraise'
 export default {
-	components: { TemplatePage, ImageUpload },
-	mixins: [import_mixin],
-	data() {
-		return {
-			// 事件组合
-			optionsEvensGroup: [],
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: false
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			appraise_status: ''
-		}
-	},
-	computed: {
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() {
-			return []
-		}
-	},
-	created() {
-		if (this.$route.query.type == 1) {
-			this.appraise_status = 'C'
-			this.$nextTick(() => {
-				this.appraise_status = ''
-				this.$router.push({ name: "appraise", params: {}, query: {} })
-			})
-		}
-	},
-	methods: {
-		// 列表请求函数
-		getList(p, cb) {
-			try {
-				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ 'param': 'a.appraise_status', "compare": "=", "value": this.appraise_status })
-				cb && cb(pam)
-				return listPageV2(pam)
-			} catch (error) {
-				console.log(error)
-			}
-		},
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'id') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
-							<span style="color:#008dd4;" onClick={() => {
-								this.$router.push({
-									name: 'workOrderPool',
-									params: {
-										pageName: row.id,
-										pageType: 'detail',
-										pageCode: row.id,
-										pagePam: "Evaluation"
-									},
-								})
-							}}>{row.id}</span>
-							{column.isCopy ? (
-								<i
-									style="color:#008dd4;"
-									class={['el-icon-document-copy', column.columnCopyClass]}
-									data-clipboard-text={row[column.columnAttributes.prop]}
-								></i>
-							) : null}
-						</div>
-					)
-				}
-				defaultData.columnAttributes.width = 200
-			}
-			if (item.jname === 'appraiseImgUrl') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="cursor: pointer;display: flex;justify-content: center;">
-							{row.appraiseImgUrl ? row.appraiseImgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;cursor: pointer;" />) : null}
-						</div>
-					)
-				}
-				defaultData.columnAttributes.width = 200
-			}
-			if (item.jname === 'appraiseContent') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<span>{row.appraiseContent}</span>
-					)
-				}
-				defaultData.columnAttributes.width = 200
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
-	}
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin],
+  data() {
+    return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      appraise_status: ''
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return []
+    }
+  },
+  created() {
+    if (this.$route.query.type == 1) {
+      this.appraise_status = 'C'
+      this.$nextTick(() => {
+        this.appraise_status = ''
+        this.$router.push({ name: 'appraise', params: {}, query: {} })
+      })
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push({ param: 'a.appraise_status', compare: '=', value: this.appraise_status })
+        cb && cb(pam)
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'id') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
+              <span
+                style="color:#008dd4;"
+                onClick={() => {
+                  this.$router.push({
+                    name: 'workOrderPool',
+                    params: {
+                      pageName: row.id,
+                      pageType: 'detail',
+                      pageCode: row.id,
+                      pagePam: 'Evaluation'
+                    }
+                  })
+                }}
+              >
+                {row.id}
+              </span>
+              {column.isCopy ? (
+                <i
+                  style="color:#008dd4;"
+                  class={['el-icon-document-copy', column.columnCopyClass]}
+                  data-clipboard-text={row[column.columnAttributes.prop]}
+                ></i>
+              ) : null}
+            </div>
+          )
+        }
+        defaultData.columnAttributes.width = 200
+      }
+      if (item.jname === 'appraiseImgUrl') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="cursor: pointer;display: flex;justify-content: center;">
+              {row.appraiseImgUrl
+                ? row.appraiseImgUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;cursor: pointer;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+        defaultData.columnAttributes.width = 200
+      }
+      if (item.jname === 'appraiseContent') {
+        defaultData.render = (h, { row, index, column }) => {
+          return <span>{row.appraiseContent}</span>
+        }
+        defaultData.columnAttributes.width = 200
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 216 - 165
src/views/workOrder/basicConfiguration/orderType/index.vue

@@ -1,23 +1,41 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList" :operationColumnWidth="80">
-			</template-page>
-			<div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				  <zj-form-module title="" label-width="110px" :showPackUp="false"
-				    :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
-				  </zj-form-module>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="110px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+            :disabled="formDialogType == 2"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -25,7 +43,7 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, save, del } from "@/api/workOrder/orderType";
+import { listPageV2, pageExport, getDetail, save, del } from '@/api/workOrder/orderType'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
@@ -45,19 +63,19 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增", "编辑", "详情"],
+      formDialogTitles: ['新增', '编辑', '详情'],
       formDialog: false,
       formData: {
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				orderSmallTypeText: '',
-				orderType: '',
-				status: true,
-				sortNum: '',
-				imgUrl: [],
-				isRpProjectRepair: 'NO'
+        companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        orderSmallTypeText: '',
+        orderType: '',
+        status: true,
+        sortNum: '',
+        imgUrl: [],
+        isRpProjectRepair: 'NO'
       },
-			formType: 'add',
-			formVisible: false,
+      formType: 'add',
+      formVisible: false
     }
   },
   computed: {
@@ -66,10 +84,10 @@ export default {
       return [
         [
           [
-            this.optionsEvensAuth("add", {
-								click: () => {
-									this.openForm('add')
-								}
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
             })
           ]
         ]
@@ -80,104 +98,128 @@ export default {
       return []
     },
     formItems() {
-      return [{
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: [...required]
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: [...required]
+          }
         },
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-select',
-        options: [{ label: '安装', value: 'INSTALL' }, { label: '维修', value: 'REPAIR' }],
-        attributes: { placeholder: '请选择' },
-        formItemAttributes: {
-          label: '所属业务线',
-          prop: 'orderType',
-          rules: [...required]
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select',
+          options: [
+            { label: '安装', value: 'INSTALL' },
+            { label: '维修', value: 'REPAIR' }
+          ],
+          attributes: { placeholder: '请选择' },
+          formItemAttributes: {
+            label: '所属业务线',
+            prop: 'orderType',
+            rules: [...required]
+          }
         },
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入工单类型', },
-        formItemAttributes: {
-          label: '工单类型',
-          prop: 'orderSmallTypeText',
-          rules: [...required]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '状态',
-          prop: 'status',
-          rules: [...required]
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入工单类型' },
+          formItemAttributes: {
+            label: '工单类型',
+            prop: 'orderSmallTypeText',
+            rules: [...required]
+          }
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.status}>
-						<el-radio disabled={this.formDialogType==2} label={true}>启用</el-radio>
-						<el-radio disabled={this.formDialogType==2} label={false}>禁用</el-radio>
-				</el-radio-group>
-			)
-		}
-    }, {
-      md: 6,
-      isShow: true,
-      name: 'el-input',
-      attributes: { placeholder: '排序数字越小越靠前', type: 'number' },
-      formItemAttributes: {
-        label: '排序',
-        prop: 'sortNum',
-        rules: []
-      }
-    }, {
-      md: 6,
-      isShow: true,
-      name: 'slot-component',
-      attributes: {},
-      formItemAttributes: {
-        label: '是否工程维保',
-        prop: 'isRpProjectRepair',
-        rules: [...required]
-      },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.isRpProjectRepair}>
-						<el-radio disabled={this.formDialogType==2} label="YES">是</el-radio>
-						<el-radio disabled={this.formDialogType==2} label="NO">否</el-radio>
-				</el-radio-group>
-			)
-		}
-    }, {
-		md: 24,
-		isShow: true,
-		name: 'slot-component',
-		formItemAttributes: {
-			label: '上传图片',
-			prop: 'imgUrl',
-			rules: [...required]
-		},
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div>
-					<ImageUpload fileList={this.formData.imgUrl} fileType={['image']} limit={1} isEdit={this.formDialogType !== 2} />
-					<div style="color: #EA8000">上传后在小程序首页自助服务展示</div>
-				</div>
-			)
-		}
-	}]
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.status}>
+                <el-radio disabled={this.formDialogType == 2} label={true}>
+                  启用
+                </el-radio>
+                <el-radio disabled={this.formDialogType == 2} label={false}>
+                  禁用
+                </el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '排序数字越小越靠前', type: 'number' },
+          formItemAttributes: {
+            label: '排序',
+            prop: 'sortNum',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '是否工程维保',
+            prop: 'isRpProjectRepair',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.isRpProjectRepair}>
+                <el-radio disabled={this.formDialogType == 2} label="YES">
+                  是
+                </el-radio>
+                <el-radio disabled={this.formDialogType == 2} label="NO">
+                  否
+                </el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '上传图片',
+            prop: 'imgUrl',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <ImageUpload
+                  fileList={this.formData.imgUrl}
+                  fileType={['image']}
+                  limit={1}
+                  isEdit={this.formDialogType !== 2}
+                />
+                <div style="color: #EA8000">上传后在小程序首页自助服务展示</div>
+              </div>
+            )
+          }
+        }
+      ]
     }
   },
   methods: {
@@ -191,7 +233,18 @@ export default {
         defaultData.render = (h, { row, index, column }) => {
           return (
             <div style="padding:0 6px;cursor: pointer;">
-              {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
+              {row.imgUrl
+                ? row.imgUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="cover"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
             </div>
           )
         }
@@ -207,11 +260,11 @@ export default {
       return this.operationBtn({
         edit: {
           click: ({ row, index, column }) => {
-            this.openForm('edit',row.id)
+            this.openForm('edit', row.id)
           }
         },
         del: {
-          prompt: "请确认是否删除该数据, 是否继续?",
+          prompt: '请确认是否删除该数据, 是否继续?',
           click: ({ row, index, column }) => {
             del({
               id: row.id
@@ -220,7 +273,7 @@ export default {
                 this.$message({ type: 'success', message: '删除成功!' })
                 this.$refs.pageRef.refreshList()
               } else {
-                this.$message.error(res.msg);
+                this.$message.error(res.msg)
               }
             })
           }
@@ -236,43 +289,41 @@ export default {
     },
     // 打开 新增编辑 网点表单
     openForm(type, id) {
-    	this.$refs.tabPage.addTab({
-    		// 对应显示的模块
-    		activeKey: type,
-    		// 唯一标识
-    		key: type,
-    		// 页签名称
-    		label: ({ edit: "编辑", add: "新增", detail: "查看" })[type],
-    		// 打开时事件
-    		triggerEvent: () => {
-    			this.formCancel()
-    			this.$nextTick(()=>{
-    				this.formType = type
-    				this.formVisible = true
-    				if (type == 'add') {
-    					this.formDialogType = 0
-    				} else if(type == 'edit'){
-    					this.formDialogType = 1
-    					getDetail({ id }).then(res => {
-    					  Object.assign(this.formData, res.data, {
-    					    imgUrl: res.data?.imgUrl ? res.data?.imgUrl?.split(",").map(item => ({ url: item })) : []
-    					  })
-    					})
-    				}
-    			})
-    		},
-    		// 关闭时事件
-    		closeEvent: () => {
-    		
-    		}
-    	})
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增', detail: '查看' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              getDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data, {
+                  imgUrl: res.data?.imgUrl ? res.data?.imgUrl?.split(',').map(item => ({ url: item })) : []
+                })
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
     },
     formConfirm(cancel) {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          (save)({
+          save({
             ...this.formData,
-            imgUrl: this.formData.imgUrl.map(item => item.url).join(",")
+            imgUrl: this.formData.imgUrl.map(item => item.url).join(',')
           }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             cancel('list')

+ 305 - 302
src/views/workOrder/orderHome/index.vue

@@ -1,310 +1,313 @@
 <template>
-	<div class="dashboard_container">
-		<div class="refresh" @click="refreshData">
-			<span style="color: #1d82ff;">刷新数据</span>
-			<i class="el-icon-refresh-left" style="color: #1d82ff;"></i>
-		</div>
-		<div class="container_top">
-			<div class="tab" v-for="(item,index) in tabs" :key='index' @click="openOrder(item.type, item.title)">
-				<el-image class="img" :src="item.url" fit="fit"></el-image>
-				<div class="text">
-					<div class="title">{{item.title}}</div>
-					<div class="num">{{item.num}}</div>
-				</div>
-			</div>
-		</div>
-		<div class="container_center">
-			<div class="chart">
-				<div class="head">
-					<div class="title">近7天订单趋势</div>
-					<div class="more" @click="openOrder()">查看更多</div>
-				</div>
-				<div ref="chart1" style="width: 100%;height: 280px;"></div>
-			</div>
-			<div class="chart">
-				<div class="head">
-					<div class="title">未来7天需上门</div>
-				</div>
-				<div ref="chart2" style="width: 100%;height: 280px;"></div>
-			</div>
-		</div>
-		<div class="container_bottom">
-			<div class="chart">
-				<div class="head">
-					<div class="title">近30天完工类型分布</div>
-				</div>
-				<div ref="chart3" style="width: 100%;height: 330px;"></div>
-			</div>
-		</div>
-	</div>
+  <div class="dashboard_container">
+    <div class="refresh" @click="refreshData">
+      <span style="color: #1d82ff">刷新数据</span>
+      <i class="el-icon-refresh-left" style="color: #1d82ff"></i>
+    </div>
+    <div class="container_top">
+      <div class="tab" v-for="(item, index) in tabs" :key="index" @click="openOrder(item.type, item.title)">
+        <el-image class="img" :src="$showImgUrl(item.url)" fit="fit"></el-image>
+        <div class="text">
+          <div class="title">{{ item.title }}</div>
+          <div class="num">{{ item.num }}</div>
+        </div>
+      </div>
+    </div>
+    <div class="container_center">
+      <div class="chart">
+        <div class="head">
+          <div class="title">近7天订单趋势</div>
+          <div class="more" @click="openOrder()">查看更多</div>
+        </div>
+        <div ref="chart1" style="width: 100%; height: 280px"></div>
+      </div>
+      <div class="chart">
+        <div class="head">
+          <div class="title">未来7天需上门</div>
+        </div>
+        <div ref="chart2" style="width: 100%; height: 280px"></div>
+      </div>
+    </div>
+    <div class="container_bottom">
+      <div class="chart">
+        <div class="head">
+          <div class="title">近30天完工类型分布</div>
+        </div>
+        <div ref="chart3" style="width: 100%; height: 330px"></div>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	import { getCount } from "@/api/workOrder/orderHome";
-	export default{
-		data(){
-			return {
-				tabs: [
-          {title: '待派工',num: 0,url: require('@/assets/orderHome/dpg.png'),type: 'DWDPG'},
-          {title: '待抢单',num: 0,url: require('@/assets/orderHome/djs.png'),type: 'DQD'},
-          {title: '待接收',num: 0,url: require('@/assets/orderHome/djs.png'),type: 'DJD'},
-          {title: '服务中',num: 0,url: require('@/assets/orderHome/ffz.png'),type: 'FWZ'},
-          {title: '异常待处理',num: 0,url: require('@/assets/orderHome/yc.png'),type: 'YCD'},
-          {title: '差评统计',num: 0,url: require('@/assets/orderHome/pj.png'),type: 'appraise'}
-        ],
-				qtsm: [],
-				qtddqs: {},
-				wglxfb: {}
-			}
-		},
-		computed: {
-			getDate(){
-				return function(d,t){
-					var date = new Date();
-					var base = Date.parse(date); // 转换为时间戳
-					var year = date.getFullYear(); //获取当前年份
-					var mon = date.getMonth() + 1; //获取当前月份
-					var day = date.getDate(); //获取当前日
-					var oneDay = 24 * 3600 *1000
+import { getCount } from '@/api/workOrder/orderHome'
+export default {
+  data() {
+    return {
+      tabs: [
+        { title: '待派工', num: 0, url: require('@/assets/orderHome/dpg.png'), type: 'DWDPG' },
+        { title: '待抢单', num: 0, url: require('@/assets/orderHome/djs.png'), type: 'DQD' },
+        { title: '待接收', num: 0, url: require('@/assets/orderHome/djs.png'), type: 'DJD' },
+        { title: '服务中', num: 0, url: require('@/assets/orderHome/ffz.png'), type: 'FWZ' },
+        { title: '异常待处理', num: 0, url: require('@/assets/orderHome/yc.png'), type: 'YCD' },
+        { title: '差评统计', num: 0, url: require('@/assets/orderHome/pj.png'), type: 'appraise' }
+      ],
+      qtsm: [],
+      qtddqs: {},
+      wglxfb: {}
+    }
+  },
+  computed: {
+    getDate() {
+      return function (d, t) {
+        var date = new Date()
+        var base = Date.parse(date) // 转换为时间戳
+        var year = date.getFullYear() //获取当前年份
+        var mon = date.getMonth() + 1 //获取当前月份
+        var day = date.getDate() //获取当前日
+        var oneDay = 24 * 3600 * 1000
 
-					var daytimeArr = []
-					for (var i = 0; i < d ; i++) { //前七天的时间
-						var now = new Date(t=='before'?(base - oneDay*i):(base + oneDay*i));
-						var myear = now.getFullYear();
-						var month = now.getMonth() + 1;
-						var mday = now.getDate()
-						daytimeArr.push([month >=10 ?month :'0'+ month, mday>=10?mday:'0'+mday].join('-'))
-					}
-					return t=='before'?daytimeArr.reverse():daytimeArr
-				}
-			},
-			filterOrderType(){
-				return function(obj,type){
-					let names = []
-					let series = []
-					for(let key in this[obj]){
-						names.push(key)
-						series.push({
-							name: key,
-							data: this[obj][key],
-							type: 'line',
-							smooth: true
-						})
-					}
-					return type=='name'?names:series
-				}
-			}
-		},
-		created() {
-			this.getCount()
-		},
-		mounted() {
-			// this.drawChat1()
-		},
-		methods: {
-			refreshData(){
-				this.$echarts.init(this.$refs.chart1).dispose()
-				this.$echarts.init(this.$refs.chart2).dispose()
-				this.$echarts.init(this.$refs.chart3).dispose()
-				this.getCount()
-			},
-			openOrder(type, name){
-				if(!type){
-					this.$router.push({
-						name: "workOrderPool",
-						query: {}
-					})
-				}else if(type == 'appraise'){
-					this.$router.push({
-						name: "appraise",
-						query: {
-							type: 1
-						}
-					})
-				}else{
-					this.$router.push({
-						name: 'workOrderPool',
-						params: {
-							pageName: name||'-',
-							pageType: 'orderStatus',
-							pageCode: type,
-						},
-					})
-				}
-				
-			},
-			getCount(){
-				getCount().then(res => {
-					this.tabs[0].num = res.data.dpg
-					this.tabs[1].num = res.data.dqd
-					this.tabs[2].num = res.data.djs
-					this.tabs[3].num = res.data.fwz
-					this.tabs[4].num = res.data.ycdcl
-					this.tabs[5].num = res.data.cp
-					this.qtsm = res.data.qtsm
-					this.qtddqs = res.data.qtddqs
-					this.wglxfb = res.data.wglxfb
-					this.drawChat1()
-				})
-			},
-			drawChat1(){
-				let chart1 = this.$echarts.init(this.$refs.chart1)
-				let chart2 = this.$echarts.init(this.$refs.chart2)
-				let chart3 = this.$echarts.init(this.$refs.chart3)
-				let option1 = {
-					tooltip: {
-					    trigger: 'axis'
-					},
-					legend: {
-					    data: this.filterOrderType('qtddqs','name')
-					},
-					xAxis: {
-						type: 'category',
-						boundaryGap: false,
-						data: this.getDate(7,'before')
-					},
-					yAxis: {
-						type: 'value'
-					},
-					min: 0,
-					max: (value) => {  // 百位起最大值向上取整
-						return Math.ceil(value.max / 100) * 100;
-					},
-					series: this.filterOrderType('qtddqs','series')
-				};
-				let option2 = {
-					tooltip: {
-					    trigger: 'axis'
-					},
-					xAxis: {
-						type: 'category',
-						boundaryGap: false,
-						data: this.getDate(7,'after')
-					},
-					yAxis: {
-						type: 'value'
-					},
-					min: 0,
-					max: (value) => {  // 百位起最大值向上取整
-						return Math.ceil(value.max / 100) * 100;
-					},
-					series: [
-						{
-							name: '工单数',
-							data: this.qtsm,
-							type: 'line',
-							smooth: true
-						}
-					]
-				};
-				let option3 = {
-					tooltip: {
-					    trigger: 'axis'
-					},
-					legend: {
-					    data: this.filterOrderType('wglxfb','name')
-					},
-					xAxis: {
-						type: 'category',
-						boundaryGap: false,
-						data: this.getDate(30,'before')
-					},
-					min: 0,
-					max: (value) => {  // 百位起最大值向上取整
-						return Math.ceil(value.max / 100) * 100;
-					},
-					yAxis: {
-						type: 'value'
-					},
-					series: this.filterOrderType('wglxfb','series')
-				};
-				chart1.setOption(option1)
-				chart2.setOption(option2)
-				chart3.setOption(option3)
-			}
-		}
-	}
+        var daytimeArr = []
+        for (var i = 0; i < d; i++) {
+          //前七天的时间
+          var now = new Date(t == 'before' ? base - oneDay * i : base + oneDay * i)
+          var myear = now.getFullYear()
+          var month = now.getMonth() + 1
+          var mday = now.getDate()
+          daytimeArr.push([month >= 10 ? month : '0' + month, mday >= 10 ? mday : '0' + mday].join('-'))
+        }
+        return t == 'before' ? daytimeArr.reverse() : daytimeArr
+      }
+    },
+    filterOrderType() {
+      return function (obj, type) {
+        let names = []
+        let series = []
+        for (let key in this[obj]) {
+          names.push(key)
+          series.push({
+            name: key,
+            data: this[obj][key],
+            type: 'line',
+            smooth: true
+          })
+        }
+        return type == 'name' ? names : series
+      }
+    }
+  },
+  created() {
+    this.getCount()
+  },
+  mounted() {
+    // this.drawChat1()
+  },
+  methods: {
+    refreshData() {
+      this.$echarts.init(this.$refs.chart1).dispose()
+      this.$echarts.init(this.$refs.chart2).dispose()
+      this.$echarts.init(this.$refs.chart3).dispose()
+      this.getCount()
+    },
+    openOrder(type, name) {
+      if (!type) {
+        this.$router.push({
+          name: 'workOrderPool',
+          query: {}
+        })
+      } else if (type == 'appraise') {
+        this.$router.push({
+          name: 'appraise',
+          query: {
+            type: 1
+          }
+        })
+      } else {
+        this.$router.push({
+          name: 'workOrderPool',
+          params: {
+            pageName: name || '-',
+            pageType: 'orderStatus',
+            pageCode: type
+          }
+        })
+      }
+    },
+    getCount() {
+      getCount().then(res => {
+        this.tabs[0].num = res.data.dpg
+        this.tabs[1].num = res.data.dqd
+        this.tabs[2].num = res.data.djs
+        this.tabs[3].num = res.data.fwz
+        this.tabs[4].num = res.data.ycdcl
+        this.tabs[5].num = res.data.cp
+        this.qtsm = res.data.qtsm
+        this.qtddqs = res.data.qtddqs
+        this.wglxfb = res.data.wglxfb
+        this.drawChat1()
+      })
+    },
+    drawChat1() {
+      let chart1 = this.$echarts.init(this.$refs.chart1)
+      let chart2 = this.$echarts.init(this.$refs.chart2)
+      let chart3 = this.$echarts.init(this.$refs.chart3)
+      let option1 = {
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: this.filterOrderType('qtddqs', 'name')
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: false,
+          data: this.getDate(7, 'before')
+        },
+        yAxis: {
+          type: 'value'
+        },
+        min: 0,
+        max: value => {
+          // 百位起最大值向上取整
+          return Math.ceil(value.max / 100) * 100
+        },
+        series: this.filterOrderType('qtddqs', 'series')
+      }
+      let option2 = {
+        tooltip: {
+          trigger: 'axis'
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: false,
+          data: this.getDate(7, 'after')
+        },
+        yAxis: {
+          type: 'value'
+        },
+        min: 0,
+        max: value => {
+          // 百位起最大值向上取整
+          return Math.ceil(value.max / 100) * 100
+        },
+        series: [
+          {
+            name: '工单数',
+            data: this.qtsm,
+            type: 'line',
+            smooth: true
+          }
+        ]
+      }
+      let option3 = {
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data: this.filterOrderType('wglxfb', 'name')
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: false,
+          data: this.getDate(30, 'before')
+        },
+        min: 0,
+        max: value => {
+          // 百位起最大值向上取整
+          return Math.ceil(value.max / 100) * 100
+        },
+        yAxis: {
+          type: 'value'
+        },
+        series: this.filterOrderType('wglxfb', 'series')
+      }
+      chart1.setOption(option1)
+      chart2.setOption(option2)
+      chart3.setOption(option3)
+    }
+  }
+}
 </script>
 
 <style scoped lang="scss">
-	.dashboard_container{
-		background: #f5f5f5;
-		padding: 20px;
-		min-height: calc(100vh - 86px);
-		box-sizing: border-box;
-		.refresh{
-			text-align: right;
-			margin-bottom: 10px;
-			span{
-				cursor: pointer;
-			}
-			i{
-				font-weight: bold;
-				margin-left: 4px;
-				cursor: pointer;
-			}
-		}
-		.container_top{
-			display: flex;
-			.tab{
-				display: flex;
-				align-items: center;
-				flex: 1;
-				padding: 20px;
-				margin-right: 20px;
-				background-color: #ffffff;
-				border-radius: 10px;
-				cursor: pointer;
-				.text{
-					margin-left: 30px;
-					.title{
-						color: #666666;
-						font-size: 16px;
-						margin-bottom: 8px;
-					}
-					.num{
-						font-size: 26px;
-						font-weight: bold;
-					}
-				}
-				.img{
-					width: 36px;
-					height: 36px;
-				}
-			}
-			.tab:last-child{
-				margin-right: 0;
-			}
-		}
-		.container_center{
-			display: flex;
-			margin: 10px 0;
-			margin-top: 20px;
-			.chart{
-				flex: 1;
-				height: 300px;
-				background-color: #ffffff;
-				margin-right: 20px;
-			}
-			.chart:last-child{
-				margin-right: 0;
-			}
-		}
-		.container_bottom{
-			width: 100%;
-			height: 350px;
-			background-color: #ffffff;
-		}
-		.head{
-			width: 100%;
-			display: flex;
-			justify-content: space-between;
-			padding: 16px 20px;
-			font-weight: bold;
-			.more{
-				color: #1d82ff;
-				cursor: pointer;
-			}
-		}
-	}
-</style>
+.dashboard_container {
+  background: #f5f5f5;
+  padding: 20px;
+  min-height: calc(100vh - 86px);
+  box-sizing: border-box;
+  .refresh {
+    text-align: right;
+    margin-bottom: 10px;
+    span {
+      cursor: pointer;
+    }
+    i {
+      font-weight: bold;
+      margin-left: 4px;
+      cursor: pointer;
+    }
+  }
+  .container_top {
+    display: flex;
+    .tab {
+      display: flex;
+      align-items: center;
+      flex: 1;
+      padding: 20px;
+      margin-right: 20px;
+      background-color: #ffffff;
+      border-radius: 10px;
+      cursor: pointer;
+      .text {
+        margin-left: 30px;
+        .title {
+          color: #666666;
+          font-size: 16px;
+          margin-bottom: 8px;
+        }
+        .num {
+          font-size: 26px;
+          font-weight: bold;
+        }
+      }
+      .img {
+        width: 36px;
+        height: 36px;
+      }
+    }
+    .tab:last-child {
+      margin-right: 0;
+    }
+  }
+  .container_center {
+    display: flex;
+    margin: 10px 0;
+    margin-top: 20px;
+    .chart {
+      flex: 1;
+      height: 300px;
+      background-color: #ffffff;
+      margin-right: 20px;
+    }
+    .chart:last-child {
+      margin-right: 0;
+    }
+  }
+  .container_bottom {
+    width: 100%;
+    height: 350px;
+    background-color: #ffffff;
+  }
+  .head {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    padding: 16px 20px;
+    font-weight: bold;
+    .more {
+      color: #1d82ff;
+      cursor: pointer;
+    }
+  }
+}
+</style>

+ 480 - 405
src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue

@@ -1,23 +1,41 @@
 <template>
-	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
-		<template slot-scope="{activeKey, data}">
-			<template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-			  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-			  :operation="operation()" :exportList="exportList" :operationColumnWidth="80">
-			</template-page>
-			<div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
-				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				  <zj-form-module title="" label-width="110px" :showPackUp="false"
-				    :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
-				  </zj-form-module>
-				</zj-form-container>
-				<div slot="footer" class="dialog-footer">
-				  <el-button size="mini" @click="data.removeTab()">取 消</el-button>
-				  <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
-				</div>
-			</div>
-		</template>
-	</zj-tab-page>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="110px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+            :disabled="formDialogType == 2"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button v-if="formDialogType !== 2" size="mini" @click="formConfirm(data.removeTab)" type="primary"
+            >确 定</el-button
+          >
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
 </template>
 
 <script>
@@ -25,399 +43,456 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, del, getExamine } from "@/api/workOrder/rewardsPunishmentsOrder";
-import { getWebsit } from "@/api/customerManagement";
-import { getWorker } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, del, getExamine } from '@/api/workOrder/rewardsPunishmentsOrder'
+import { getWebsit } from '@/api/customerManagement'
+import { getWorker } from '@/api/auxiliaryFittings/auxiliarySalesOrder'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-	components: { TemplatePage, ImageUpload },
-	mixins: [import_mixin, operation_mixin],
-	data() {
-		return {
-			// 表格属性
-			tableAttributes: {
-				// 启用勾选列
-				selectColumn: false
-			},
-			// 表格事件
-			tableEvents: {
-				'selection-change': this.selectionChange
-			},
-			// 勾选选中行
-			recordSelected: [],
-			/** 表单变量 */
-			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
-			formData: {
-				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-				websit: {},
-				websitName: '',
-				websitId: '',
-				worker: {},
-				workerId: '',
-				workerName: '',
-				mobile: '',
-				idcard: '',
-				examineProjectName: '',
-				examineProjectId: '',
-				examineProjectType: '',
-				examineProjectAmount: '',
-				examineProject: {},
-				orderBaseId: '',
-				fileUrl: [],
-				remark: ''
-			},
-			websitList: [],
-			workerList: [],
-			examineList: [],
-			formType: 'add',
-			formVisible: false,
-		}
-	},
-	computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
-				[
-					[
-						this.optionsEvensAuth("add", {
-							click: () => {
-								this.openForm('add')
-							}
-						})
-					]
-				]
-			]
-		},
-		// 更多参数
-		moreParameters() {
-			return []
-		},
-		formItems() {
-			return [{
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', disabled: true },
-				formItemAttributes: {
-					label: '所属商户',
-					prop: 'companyName',
-					rules: [...required]
-				},
-			}, {
-				md: 6,
-				isShow: this.type == 1,
-				name: 'slot-component',
-				attributes: { placeholder: '请输入网点名称', },
-				formItemAttributes: {
-					label: '网点名称',
-					prop: 'websitId',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-select v-model={this.formData.websit} disabled={this.formDialogType != 0} value-key="websitId" onChange={(e) => {
-							this.formData.websitId = e.websitId
-							this.formData.websitName = e.name
-							this.formData.worker = {}
-							this.formData.workerId = ''
-							this.formData.workerName = ''
-							this.formData.idcard = ''
-							this.formData.mobile = ''
-							this.getWorker()
-						}} placeholder="请选择" style="width: 100%;">
-							{
-								this.websitList.map((item, index) => {
-									return <el-option key={item.websitId} label={item.name} value={item}></el-option>
-								})
-							}
-						</el-select>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: this.type == 0,
-				name: 'el-input',
-				attributes: { placeholder: '请输入网点名称', disabled: true },
-				formItemAttributes: {
-					label: '网点名称',
-					prop: 'websitName',
-					rules: [...required]
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'slot-component',
-				attributes: { placeholder: '请选择工程师', },
-				formItemAttributes: {
-					label: '选择工程师',
-					prop: 'workerId',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-select v-model={this.formData.worker} disabled={this.formDialogType != 0} value-key="nickName" onChange={(e) => {
-							this.formData.workerId = e.userId
-							this.formData.workerName = e.nickName
-							this.formData.idcard = e.idCard
-							this.formData.mobile = e.mobile
-						}} placeholder="请选择" style="width: 100%;">
-							{
-								this.workerList.map((item, index) => {
-									return <el-option key={item.userId} label={item.nickName} value={item}></el-option>
-								})
-							}
-						</el-select>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', },
-				formItemAttributes: {
-					label: '身份证',
-					prop: 'idcard',
-					rules: this.formData.idcard ? [
-						{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-					] : []
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', },
-				formItemAttributes: {
-					label: '联系电话',
-					prop: 'mobile',
-					rules: this.formData.mobile ? [
-						{ pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-					] : []
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'slot-component',
-				attributes: { placeholder: '请选择考核项目', },
-				formItemAttributes: {
-					label: '选择考核项目',
-					prop: 'examineProjectName',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-select v-model={this.formData.examineProject} disabled={this.formDialogType != 0} value-key="name" onChange={(e) => {
-							this.formData.examineProjectId = e.id
-							this.formData.examineProjectName = e.name
-							this.formData.examineProjectType = e.type
-							this.formData.examineProjectAmount = e.amount
-						}} placeholder="请选择" style="width: 100%;">
-							{
-								this.examineList.map((item, index) => {
-									return <el-option key={item.id} label={item.name} value={item}></el-option>
-								})
-							}
-						</el-select>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'slot-component',
-				attributes: {},
-				formItemAttributes: {
-					label: '考核类型',
-					prop: 'examineProjectType',
-					rules: [...required]
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<el-radio-group v-model={this.formData.examineProjectType}>
-							<el-radio disabled={true} label="REWARD">奖励</el-radio>
-							<el-radio disabled={true} label="PUNISH">惩罚</el-radio>
-						</el-radio-group>
-					)
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', type: 'number', disabled: true },
-				formItemAttributes: {
-					label: '考核金额',
-					prop: 'examineProjectAmount',
-					rules: [...required]
-				}
-			}, {
-				md: 6,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入' },
-				formItemAttributes: {
-					label: '关联工单号',
-					prop: 'orderBaseId',
-					rules: []
-				}
-			}, {
-				md: 24,
-				isShow: true,
-				name: 'slot-component',
-				formItemAttributes: {
-					label: '附件',
-					prop: 'fileUrl',
-					rules: []
-				},
-				render: (h, { props, onInput }) => {
-					var { value } = props
-					return (
-						<ImageUpload fileList={this.formData.fileUrl} limit={1} isEdit={this.formDialogType !== 2} />
-					)
-				}
-			}, {
-				md: 24,
-				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
-				formItemAttributes: {
-					label: '备注',
-					prop: 'remark',
-					rules: []
-				}
-			}]
-		}
-	},
-	created() {
-		if (this.$route.query.id) {
-			this.openForm('detail',this.$route.query.id)
-		}
-	},
-	methods: {
-		// 列表请求函数
-		getList: listPageV2,
-		// 列表导出函数
-		exportList: pageExport,
-		// 表格列解析渲染数据更改
-		columnParsing(item, defaultData) {
-			if (item.jname === 'fileUrl') {
-				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.fileUrl ? row.fileUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
-				}
-			}
-			return defaultData
-		},
-		// 监听勾选变化
-		selectionChange(data) {
-			this.recordSelected = data
-		},
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑', '详情'],
+      formDialog: false,
+      type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
+      formData: {
+        companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        websit: {},
+        websitName: '',
+        websitId: '',
+        worker: {},
+        workerId: '',
+        workerName: '',
+        mobile: '',
+        idcard: '',
+        examineProjectName: '',
+        examineProjectId: '',
+        examineProjectType: '',
+        examineProjectAmount: '',
+        examineProject: {},
+        orderBaseId: '',
+        fileUrl: [],
+        remark: ''
+      },
+      websitList: [],
+      workerList: [],
+      examineList: [],
+      formType: 'add',
+      formVisible: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: this.type == 1,
+          name: 'slot-component',
+          attributes: { placeholder: '请输入网点名称' },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitId',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-select
+                v-model={this.formData.websit}
+                disabled={this.formDialogType != 0}
+                value-key="websitId"
+                onChange={e => {
+                  this.formData.websitId = e.websitId
+                  this.formData.websitName = e.name
+                  this.formData.worker = {}
+                  this.formData.workerId = ''
+                  this.formData.workerName = ''
+                  this.formData.idcard = ''
+                  this.formData.mobile = ''
+                  this.getWorker()
+                }}
+                placeholder="请选择"
+                style="width: 100%;"
+              >
+                {this.websitList.map((item, index) => {
+                  return <el-option key={item.websitId} label={item.name} value={item}></el-option>
+                })}
+              </el-select>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: this.type == 0,
+          name: 'el-input',
+          attributes: { placeholder: '请输入网点名称', disabled: true },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: { placeholder: '请选择工程师' },
+          formItemAttributes: {
+            label: '选择工程师',
+            prop: 'workerId',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-select
+                v-model={this.formData.worker}
+                disabled={this.formDialogType != 0}
+                value-key="nickName"
+                onChange={e => {
+                  this.formData.workerId = e.userId
+                  this.formData.workerName = e.nickName
+                  this.formData.idcard = e.idCard
+                  this.formData.mobile = e.mobile
+                }}
+                placeholder="请选择"
+                style="width: 100%;"
+              >
+                {this.workerList.map((item, index) => {
+                  return <el-option key={item.userId} label={item.nickName} value={item}></el-option>
+                })}
+              </el-select>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '身份证',
+            prop: 'idcard',
+            rules: this.formData.idcard
+              ? [
+                  {
+                    pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
+                    message: '身份证号格式不正确',
+                    trigger: 'blur'
+                  }
+                ]
+              : []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '联系电话',
+            prop: 'mobile',
+            rules: this.formData.mobile
+              ? [
+                  {
+                    pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
+                    message: '电话号码格式不正确',
+                    trigger: 'blur'
+                  }
+                ]
+              : []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: { placeholder: '请选择考核项目' },
+          formItemAttributes: {
+            label: '选择考核项目',
+            prop: 'examineProjectName',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-select
+                v-model={this.formData.examineProject}
+                disabled={this.formDialogType != 0}
+                value-key="name"
+                onChange={e => {
+                  this.formData.examineProjectId = e.id
+                  this.formData.examineProjectName = e.name
+                  this.formData.examineProjectType = e.type
+                  this.formData.examineProjectAmount = e.amount
+                }}
+                placeholder="请选择"
+                style="width: 100%;"
+              >
+                {this.examineList.map((item, index) => {
+                  return <el-option key={item.id} label={item.name} value={item}></el-option>
+                })}
+              </el-select>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'slot-component',
+          attributes: {},
+          formItemAttributes: {
+            label: '考核类型',
+            prop: 'examineProjectType',
+            rules: [...required]
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <el-radio-group v-model={this.formData.examineProjectType}>
+                <el-radio disabled={true} label="REWARD">
+                  奖励
+                </el-radio>
+                <el-radio disabled={true} label="PUNISH">
+                  惩罚
+                </el-radio>
+              </el-radio-group>
+            )
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'number', disabled: true },
+          formItemAttributes: {
+            label: '考核金额',
+            prop: 'examineProjectAmount',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '关联工单号',
+            prop: 'orderBaseId',
+            rules: []
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '附件',
+            prop: 'fileUrl',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return <ImageUpload fileList={this.formData.fileUrl} limit={1} isEdit={this.formDialogType !== 2} />
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入备注内容', type: 'textarea', rows: 5 },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    if (this.$route.query.id) {
+      this.openForm('detail', this.$route.query.id)
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: listPageV2,
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'fileUrl') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.fileUrl
+                ? row.fileUrl
+                    .split(',')
+                    .map(url => (
+                      <el-image
+                        src={this.$showImgUrl(url)}
+                        preview-src-list={[this.$showImgUrl(url)]}
+                        fit="fit"
+                        style="width:80px;height:80px;"
+                      />
+                    ))
+                : null}
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
 
-		operation() {
-			return this.operationBtn({
-				detail: {
-					click: ({ row, index, column }) => {
-						this.openForm('detail',row.id)
-					}
-				}
-			})
-		},
-		
-		openDetail(id) {
-			getDetail({ id }).then(res => {
-				Object.assign(this.formData, res.data, {
-					fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item => ({ url: item })) : [],
-					worker: { workerId: res.data.workerId, nickName: res.data.workerName },
-					websit: { websitId: res.data.websitId, websitName: res.data.websitName },
-					examineProject: { name: res.data.examineProjectName }
-				})
-				this.getExamine()
-				this.getWebsit()
-				this.getWorker()
-			})
-		},
-		getExamine() {
-			getExamine({ pageNum: 1, pageSize: -1, params: [] }).then(res => {
-				this.examineList = res.data.records
-			})
-		},
-		getWebsit() {
-			if (this.type == 0) {
-				this.formData.websitId = JSON.parse(localStorage.getItem('greemall_user')).adminWebsitId
-				this.formData.websitName = JSON.parse(localStorage.getItem('greemall_user')).nickName
-			} else {
-				getWebsit({ type: 'C' }).then(res => {
-					this.websitList = res.data
-				})
-			}
-		},
-		getWorker() {
-			getWorker({ pageNum: 1, pageSize: -1, params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }] }).then(res => {
-				this.workerList = res.data.records
-			})
-		},
-		openForm(type,id) {
-			this.$refs.tabPage.addTab({
-				// 对应显示的模块
-				activeKey: type,
-				// 唯一标识
-				key: type,
-				// 页签名称
-				label: ({ edit: "编辑", add: "新增", detail: "详情" })[type],
-				// 打开时事件
-				triggerEvent: () => {
-					this.formCancel()
-					this.$nextTick(()=>{
-						this.formType = type
-						this.formVisible = true
-						if (type == 'add') {
-							this.getExamine()
-							this.getWebsit()
-							this.formDialogType = 0
-						}else{
-							this.formDialogType = 2
-							this.openDetail(id)
-						}
-					})
-				},
-				// 关闭时事件
-				closeEvent: () => {
-				
-				}
-			})
-		},
-		formCancel() {
-			this.formVisible = false
-			this.$refs?.formRef?.resetFields()
-			this.$data.formData = this.$options.data().formData
-		},
-		formConfirm(cancel) {
-			this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-				if (valid) {
-					([add, edit][this.formDialogType])({
-						...this.formData,
-						fileUrl: this.formData.fileUrl.map(item => item.url).join(",")
-					}).then(res => {
-						this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-						cancel('list')
-						this.$refs.pageRef.refreshList()
-					})
-				}
-			})
-		}
-	}
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            this.openForm('detail', row.id)
+          }
+        }
+      })
+    },
+
+    openDetail(id) {
+      getDetail({ id }).then(res => {
+        Object.assign(this.formData, res.data, {
+          fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(',').map(item => ({ url: item })) : [],
+          worker: { workerId: res.data.workerId, nickName: res.data.workerName },
+          websit: { websitId: res.data.websitId, websitName: res.data.websitName },
+          examineProject: { name: res.data.examineProjectName }
+        })
+        this.getExamine()
+        this.getWebsit()
+        this.getWorker()
+      })
+    },
+    getExamine() {
+      getExamine({ pageNum: 1, pageSize: -1, params: [] }).then(res => {
+        this.examineList = res.data.records
+      })
+    },
+    getWebsit() {
+      if (this.type == 0) {
+        this.formData.websitId = JSON.parse(localStorage.getItem('greemall_user')).adminWebsitId
+        this.formData.websitName = JSON.parse(localStorage.getItem('greemall_user')).nickName
+      } else {
+        getWebsit({ type: 'C' }).then(res => {
+          this.websitList = res.data
+        })
+      }
+    },
+    getWorker() {
+      getWorker({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }]
+      }).then(res => {
+        this.workerList = res.data.records
+      })
+    },
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增', detail: '详情' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            if (type == 'add') {
+              this.getExamine()
+              this.getWebsit()
+              this.formDialogType = 0
+            } else {
+              this.formDialogType = 2
+              this.openDetail(id)
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {}
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    formConfirm(cancel) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ;[add, edit]
+            [this.formDialogType]({
+              ...this.formData,
+              fileUrl: this.formData.fileUrl.map(item => item.url).join(',')
+            })
+            .then(res => {
+              this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+              cancel('list')
+              this.$refs.pageRef.refreshList()
+            })
+        }
+      })
+    }
+  }
 }
 </script>
 
 <style lang="scss" scoped>
 .tab {
-	padding: 20px 20px 0 20px;
+  padding: 20px 20px 0 20px;
 }
 </style>

+ 50 - 31
src/views/workOrder/workOrderPool/detailModule/Evaluation/index.vue

@@ -3,9 +3,13 @@
     <zj-page-fill class="neibuview">
       <zj-form-container>
         <zj-form-module title="评价信息">
-          <zj-table :columns="evaluationColumns" :table-data="evaluationData" :table-attributes="{
-            border: true
-          }" />
+          <zj-table
+            :columns="evaluationColumns"
+            :table-data="evaluationData"
+            :table-attributes="{
+              border: true
+            }"
+          />
         </zj-form-module>
       </zj-form-container>
     </zj-page-fill>
@@ -13,13 +17,13 @@
 </template>
 
 <script>
-import { listPageV2 } from "@/api/workOrder/appraise";
-import { tableDataParsing } from "@/utils/common.js"
+import { listPageV2 } from '@/api/workOrder/appraise'
+import { tableDataParsing } from '@/utils/common.js'
 export default {
   props: {
     id: {
       type: [String, Number],
-      default: null,
+      default: null
     }
   },
   data() {
@@ -31,34 +35,49 @@ export default {
   watch: {
     id: {
       handler(newVal, oldVal) {
-        listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.id", "compare": "=", "value": this.id }] }).then(res => {
-          this.evaluationColumns = tableDataParsing(res.fieldBeans.filter(item => !~["orderFlags", "orderType"].indexOf(item.jname))).map(item => {
-            if (item.columnAttributes.prop == "appraiseImgUrl") {
-              item.render = (h, { row, index, column }) => {
-                return (
-                  <div style="padding:0 6px;cursor: pointer;">
-                    {row.appraiseImgUrl ? row.appraiseImgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-                  </div>
-                )
+        listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.id', compare: '=', value: this.id }] }).then(
+          res => {
+            this.evaluationColumns = tableDataParsing(
+              res.fieldBeans.filter(item => !~['orderFlags', 'orderType'].indexOf(item.jname))
+            ).map(item => {
+              if (item.columnAttributes.prop == 'appraiseImgUrl') {
+                item.render = (h, { row, index, column }) => {
+                  return (
+                    <div style="padding:0 6px;cursor: pointer;">
+                      {row.appraiseImgUrl
+                        ? row.appraiseImgUrl
+                            .split(',')
+                            .map(url => (
+                              <el-image
+                                src={this.$showImgUrl(url)}
+                                preview-src-list={[this.$showImgUrl(url)]}
+                                fit="fit"
+                                style="width:80px;height:80px;"
+                              />
+                            ))
+                        : null}
+                    </div>
+                  )
+                }
               }
-            }
-            return item
-          })
-          this.$nextTick(() => {
-            this.evaluationData = res.data.records.map(item => {
-              Object.keys(item).map(key => {
-                var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || "{}")[item[key]];
-                if (val) item[key] = val;
-              })
               return item
             })
-          })
-        })
+            this.$nextTick(() => {
+              this.evaluationData = res.data.records.map(item => {
+                Object.keys(item).map(key => {
+                  var val = JSON.parse(res?.fieldBeans?.find(val => val.jname == key)?.enumMap || '{}')[item[key]]
+                  if (val) item[key] = val
+                })
+                return item
+              })
+            })
+          }
+        )
       },
       deep: true,
-      immediate: true,
-    },
-  },
+      immediate: true
+    }
+  }
 }
 </script>
 
@@ -67,11 +86,11 @@ export default {
   box-sizing: border-box;
   padding-left: 16px;
 
-  ::v-deep &>.zj-page-fill-scroll {
+  ::v-deep & > .zj-page-fill-scroll {
     box-sizing: border-box;
     padding-right: 16px;
 
-    &>div:nth-child(1) {
+    & > div:nth-child(1) {
       margin-top: 20px;
     }
   }

Деякі файли не було показано, через те що забагато файлів було змінено