caojunjie %!s(int64=2) %!d(string=hai) anos
pai
achega
bd093821bd

+ 94 - 4
src/views/client/index.vue

@@ -75,6 +75,10 @@
             <template slot="menuLeft">
               <el-button type="primary" size="mini" @click.stop="newAdd()">新建客户
               </el-button>
+              <el-button type="primary" size="mini" icon="el-icon-bottom" @click="excelBox = true">导入
+              </el-button>
+              <el-button type="primary" size="mini" icon="el-icon-bottom" @click="outExport">导出
+              </el-button>
             </template>
             <template slot-scope="{ row, index }" slot="cname">
               <span style="color: #409EFF;cursor: pointer" @click.stop="viewInfo(row)">{{ row.cname }}
@@ -131,22 +135,65 @@
         <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="导入客户" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+               v-dialog-drag>
+      <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
+                 :upload-before="uploadBefore" :upload-after="uploadAfter">
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="derivation">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+      <p style="text-align: center;color: #DC0505">
+        温馨提示 第一次导入时请先下载模板
+      </p>
+    </el-dialog>
   </div>
 </template>
-  
+
 <script>
 import detailsInfo from "./detailsInfo";
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
 import { getList, getCorpType, pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/client";
 import corpType from '@/components/corpType/index'
+import {getToken} from "@/util/auth";
 export default {
   name: "index",
   data() {
     return {
       corpTypeVisible: false,
+      excelForm:{},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24
+          },
+          {
+            label: "导入客户",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "客户上传中,请稍等",
+            accept:'.xls,.xlsx',
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-client/partsCorps/import-desc"
+          }
+        ]
+      },
       src: '',
       show: true,
+      excelBox: false,
       showInfo: true,
       loading: false,
       search: {},
@@ -277,7 +324,8 @@ export default {
           }
         ]
       },
-      hostUrl: ''
+      hostUrl: '',
+      option:{}
     };
   },
   components: {
@@ -294,6 +342,49 @@ export default {
     this.$refs.crud.refreshTable();
   },
   methods: {
+    derivation() {
+      window.open(
+          `/api/blade-client/partsCorps/export-template?${this.website.tokenHeader
+          }=${getToken()}`
+      );
+    },
+    //导出
+    outExport() {
+      let config = {params: {...this.search}}
+      if (config.params) {
+        for (const propName of Object.keys(config.params)) {
+          const value = config.params[propName];
+          if (value !== null && typeof (value) !== "undefined") {
+            if (value instanceof Array) {
+              for (const key of Object.keys(value)) {
+                let params = propName + '[' + key + ']';
+                config.params[params] = value[key]
+              }
+              delete config.params[propName]
+            }
+          }
+        }
+      }
+      const routeData = this.$router.resolve({
+        path: '/api/blade-client/partsCorps/export-desc',      //跳转目标窗口的地址
+        query: {
+          ...config.params,    //括号内是要传递给新窗口的参数
+          identification:this.url
+        }
+      })
+      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+    },
+    uploadBefore(file, done, loading) {
+      done();
+      loading = true;
+    },
+    uploadAfter(res, done, loading, column) {
+      this.excelBox = false;
+      this.$message.success("导入成功!");
+      this.refreshChange();
+      loading = false;
+      done();
+    },
     filterNode(value, data) {
       console.log(value, data)
       if (!value) return true;
@@ -461,7 +552,7 @@ export default {
   }
 }
 </script>
-  
+
 <style  lang="scss"  scoped>
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
@@ -510,4 +601,3 @@ export default {
   }
 }
 </style>
-  

+ 7 - 0
src/views/product/detailsPage.vue

@@ -145,6 +145,7 @@ export default {
             label: "零售价",
             prop: "standardPrice",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -152,6 +153,7 @@ export default {
             label: "售价1",
             prop: "wholesalePrice",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -159,6 +161,7 @@ export default {
             label: "售价2",
             prop: "repairDepotPrice",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -166,6 +169,7 @@ export default {
             label: "售价3",
             prop: "storePrice",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -173,6 +177,7 @@ export default {
             label: "售价4",
             prop: "price",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -180,6 +185,7 @@ export default {
             label: "进货价",
             prop: "purchasePrice",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },
@@ -187,6 +193,7 @@ export default {
             label: "特价",
             prop: "specialOffer",
             type: 'number',
+            minRows:0,
             controls: false,
             span: 8,
           },

+ 30 - 4
src/views/productLaunch/index.vue

@@ -21,9 +21,18 @@
         <template slot-scope="{type,size,row,$index}" slot="menu">
           <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">编辑
           </el-button>
-          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">
-            {{ row.upperFrame == 0 ? '上架' : '下架' }}
-          </el-button>
+<!--          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">-->
+<!--            {{ row.upperFrame == 0 ? '上架' : '下架' }}-->
+<!--          </el-button>-->
+          <el-tooltip :content="`${row.upperFrame == 0?'上架':'下架'}`" placement="top">
+            <el-switch
+                style="margin-left: 10px"
+                v-model="row.upperFrame"
+                @change="check(row)"
+                active-value="1"
+                inactive-value="0">
+            </el-switch>
+          </el-tooltip>
         </template>
         <template slot-scope="{type,size,row,$index}" slot="menuLeft">
           <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary" size="small"
@@ -171,6 +180,23 @@ export default {
             label: "dictValue",
             value: "dictKey"
           }
+        }, {
+          label: '产品状态',
+          prop: 'upperFrame',
+          filterable: true,
+          display:false,
+          search: true,
+          hide:true,
+          showColumn:false,
+          type: 'select',
+          span: 17,
+          dicData:[{
+            label: "上架",
+            value: 1
+          },{
+            label: "下架",
+            value: 0
+          }]
         }]
       }
     }
@@ -231,7 +257,7 @@ export default {
         ...row,
         label: row.label.join(","),
         ids: row.goodsId,
-        upperFrame: row.upperFrame == 0 ? 1 : 0,
+        upperFrame: row.upperFrame,
         specialOffer: row.salesPrice,
       }).then(res => {
         this.onLoad(this.page, this.search)

+ 6 - 5
src/views/salesOrder/index.vue

@@ -16,7 +16,7 @@
           </div>
         </template>
         <template slot="expand" slot-scope="{row}">
-          <avue-crud ref="expandCrud" :option="optionList" :data="row.orderItemsList"></avue-crud>
+          <avue-crud ref="expandCrud" :option="optionList" :table-loading="row.loading" :data="row.orderItemsList"></avue-crud>
         </template>
         <template slot="corpIdSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
@@ -384,7 +384,7 @@ export default {
         this.findObject(this.option.column, "createUser").dicData = res.data.data;
       })
       getCorpType({corpType: 'KH'}).then(res => {
-        this.findObject(this.option.column, "corpType").dicData = res.data.data
+        this.findObject(this.option.column, "corpType").dicData = res.data.data;
       });
       this.$refs.crud.init();
     },
@@ -397,8 +397,10 @@ export default {
         this.findObject(this.optionList.column, "storageId").dicData = res.data;
       })
       if (row){
+        row.loading = true
         getDetails({ id: row.id }).then(res=>{
           row.orderItemsList = res.data.data.orderItemsList
+          row.loading = false
         })
       }
     },
@@ -432,7 +434,7 @@ export default {
           this.$refs.crud.toggleRowExpansion(item, false);
         });
       }
-      statusStatisticsApi().then(res => {
+      statusStatisticsApi({type:'1'}).then(res => {
         this.badgeList = [];
         this.badgeList.push({
           count:0,
@@ -459,8 +461,7 @@ export default {
       ).then(res => {
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
-        })
-        .finally(() => {
+        }).finally(() => {
           this.loading = false;
         });
     },