Pārlūkot izejas kodu

Merge branch 'sit'

xiaodai2022 2 gadi atpakaļ
vecāks
revīzija
62e71a1591

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.html


+ 1 - 0
dist/static/css/chunk-4d92ea46.b73a3b00.css

@@ -0,0 +1 @@
+.dashboard-container[data-v-0e9df9b2]{padding:0 0 0 0;position:relative;width:100%;min-height:calc(100vh - 53px);display:block;overflow:hidden}.dashboard-container .bg-img[data-v-0e9df9b2]{width:100%;position:absolute;display:block;min-height:100%;height:100%}.emptyGif[data-v-0e9df9b2]{display:block;width:100%;margin:0 auto}.dashboard-editor-container[data-v-0e9df9b2]{position:relative;min-height:100%;width:100%;text-align:center}.dashboard-editor-container .info-container[data-v-0e9df9b2]{display:block;width:60%;text-align:center;margin:0 auto;padding:10vh 0 0 0}.dashboard-editor-container .info-container .welcome-title[data-v-0e9df9b2]{vertical-align:top;padding:0;margin:0 0 0 18px;color:#97a8be;display:inline-block;height:130px;line-height:130px;font-size:45px}.dashboard-editor-container img[data-v-0e9df9b2]{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1}

+ 0 - 1
dist/static/css/chunk-5ce8d4ba.41b5526a.css

@@ -1 +0,0 @@
-.dashboard-container[data-v-6bdd809c]{padding:0 0 0 0;position:relative;width:100%;min-height:calc(100vh - 50px);display:inline-block;background-color:#e3e3e3}.emptyGif[data-v-6bdd809c]{display:block;width:100%;margin:0 auto}.dashboard-editor-container[data-v-6bdd809c]{position:relative;min-height:100%;width:100%;padding:0 6% 0 0;text-align:center}.dashboard-editor-container .info-container[data-v-6bdd809c]{display:block;width:60%;text-align:center;margin:0 auto;padding:10vh 0 0 0}.dashboard-editor-container .info-container .welcome-title[data-v-6bdd809c]{vertical-align:top;padding:0;margin:0 0 0 18px;color:#97a8be;display:inline-block;height:130px;line-height:130px;font-size:45px}.dashboard-editor-container img[data-v-6bdd809c]{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/chunk-76ebff08.755dd1b0.css


BIN
dist/static/css/chunk-76ebff08.755dd1b0.css.gz


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/chunk-a699ed6c.e33d9ee4.css


BIN
dist/static/css/chunk-a699ed6c.e33d9ee4.css.gz


BIN
dist/static/img/welcome.748a4df4.gif


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.3b89f2c2.js


BIN
dist/static/js/app.3b89f2c2.js.gz


BIN
dist/static/js/app.7d970a99.js.gz


+ 1 - 0
dist/static/js/chunk-4d92ea46.e64e8399.js

@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4d92ea46"],{4895:function(t,n,a){"use strict";a("f9fb")},9406:function(t,n,a){"use strict";a.r(n);var e={name:"dashboard",data:function(){return{emptyGif:a("ff1f")}}},f=(a("4895"),a("2877"));f=Object(f.a)(e,(function(){var t=this,n=t.$createElement;n=t._self._c||n;return n("div",{staticClass:"dashboard-container"},[n("img",{staticClass:"bg-img",attrs:{src:t.emptyGif}})])}),[],!1,null,"0e9df9b2",null);n.default=f.exports},f9fb:function(t,n,a){},ff1f:function(t,n,a){t.exports=a.p+"static/img/welcome.748a4df4.gif"}}]);

+ 0 - 1
dist/static/js/chunk-5ce8d4ba.b627d305.js

@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-5ce8d4ba"],{9406:function(t,a,i){"use strict";i.r(a);var c=i("5530"),e=i("2f62");c={name:"dashboard",data:function(){return{emptyGif:i("ff1f")}},computed:Object(c.a)({},Object(e.b)(["avatar"])),mounted:function(){}},i("9d69"),e=i("2877"),e=Object(e.a)(c,(function(){var t=this,a=t.$createElement;a=t._self._c||a;return a("div",{staticClass:"dashboard-container"},[a("div",{staticClass:"dashboard-editor-container"},[a("div",{staticClass:"info-container clearfix"},[a("pan-thumb",{attrs:{image:t.avatar,width:"130px",height:"130px"}}),a("span",{staticClass:"welcome-title"},[t._v("欢迎登录采销平台")])],1),a("img",{staticStyle:{width:"60%",margin:"-30px auto 0 auto"},attrs:{src:t.emptyGif}})])])}),[],!1,null,"6bdd809c",null);a.default=e.exports},"9cf7":function(t,a,i){},"9d69":function(t,a,i){"use strict";i("9cf7")},ff1f:function(t,a,i){t.exports=i.p+"static/img/welcome.6cf0f25b.gif"}}]);

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-76ebff08.4de24ec1.js


BIN
dist/static/js/chunk-76ebff08.4de24ec1.js.gz


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/chunk-a699ed6c.b6715872.js


BIN
dist/static/js/chunk-a699ed6c.b6715872.js.gz


BIN
src/assets/img/welcome.gif


+ 0 - 0
dist/static/img/welcome.6cf0f25b.gif → src/assets/img/welcome1.gif


+ 25 - 16
src/views/dashboard/index.vue

@@ -1,19 +1,20 @@
 <template>
   <div class="dashboard-container">
-    <div class="dashboard-editor-container">
-      <div class="info-container clearfix">
+    <!-- <div class="dashboard-editor-container"> -->
+      <!-- <div class="info-container clearfix">
         <pan-thumb :image="avatar" :width="'130px'" :height="'130px'">
         </pan-thumb>
         
         <span class="welcome-title">欢迎登录采销平台</span>
-      </div>
-      <img :src="emptyGif" style="width: 60%; margin: -30px auto 0 auto" />
-    </div>
+      </div> -->
+      <!-- style="width: 60%; margin: -30px auto 0 auto" -->
+      <img :src="emptyGif" class="bg-img" />
+    <!-- </div> -->
   </div>
 </template>
 
 <script>
-import { mapGetters } from "vuex";
+// import { mapGetters } from "vuex";
 
 export default {
   name: "dashboard",
@@ -22,14 +23,14 @@ export default {
       emptyGif: require("@/assets/img/welcome.gif"),
     };
   },
-  computed: {
-    ...mapGetters([
+  // computed: {
+    // ...mapGetters([
       // 'name',
-      "avatar",
+      // "avatar",
       // 'roles'
-    ]),
-  },
-  mounted() {},
+    // ]),
+  // },
+  // mounted() {},
 };
 </script>
 <style lang="scss" scoped>
@@ -38,9 +39,17 @@ export default {
   padding: 0 0 0 0;
   position: relative;
   width: 100%;
-  min-height: calc( 100vh - 50px);
-  display: inline-block;
-  background-color: #e3e3e3;
+  min-height: calc( 100vh - 53px);
+  display:block;
+  overflow: hidden;
+  .bg-img{
+    width: 100%;
+    position: absolute;
+      display:block;
+    min-height: 100%;
+    height: 100%;
+  }
+  // background-color: #e3e3e3;
 }
 .emptyGif {
   display: block;
@@ -53,7 +62,7 @@ export default {
   min-height:100%;
   width: 100%;
   // display: flex;
-  padding: 0 6% 0 0;
+  // padding: 0 6% 0 0;
   text-align: center;
   // align-items: flex-start ;
   .info-container {

+ 12 - 11
src/views/orderEntry/orderImport/columns.js

@@ -68,11 +68,7 @@ const columns = [
     label: "收费模式",
     width: "90px",
   },
-  {
-    prop: "order_remark",
-    label: "订单备注",
-    width: "140px",
-  },
+ 
   {
     prop: "contactor",
     label: "收货人",
@@ -89,13 +85,18 @@ const columns = [
     width: "140px",
   },
   {
-    prop: "",
-    label: "操作",
-    fixed: "right",
-    _noset_: true,
-    width: "50px",
-    _slot_: "operation",
+    prop: "order_remark",
+    label: "订单备注",
+    width: "140px",
   },
+  // {
+  //   prop: "",
+  //   label: "操作",
+  //   fixed: "right",
+  //   _noset_: true,
+  //   width: "50px",
+  //   _slot_: "operation",
+  // },
 ]
 export {
   columns

+ 94 - 248
src/views/orderEntry/orderImport/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="orderImport pagePadding">
+  <div class="orderImport pagePadding" v-loading="loading">
     <div
       v-if="tableData && tableData.length > 0"
       class="tr"
@@ -17,11 +17,6 @@
       :data="tableData"
       style="margin: 15px 0 0 0"
     >
-      <template #operation="{ scope }">
-        <el-tooltip effect="dark" content="删除" placement="top">
-          <i class="el-icon-delete tb-icon" @click="del(scope)"></i>
-        </el-tooltip>
-      </template>
     </ex-table>
   </div>
 </template>
@@ -43,17 +38,17 @@ export default {
       table: {
         stripe: true,
         border: true,
-        "max-height":'800px'
+        "max-height": "800px",
         // _defaultHeader_: ["setcol"],
       },
       tableData: [],
-      tableHeader: [],
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
         total: 0,
       },
+      loading: false,
       // 表格 - 列参数
       columns: columns,
 
@@ -61,9 +56,7 @@ export default {
       btnFlag: false,
 
       //编辑全局锁
-      editBtnFlag:false,
-
-      
+      editBtnFlag: false,
     };
   },
   mounted() {},
@@ -80,258 +73,111 @@ export default {
       return false;
     },
     handleSuccess({ results, header }) {
-      console.log("表格导入数据", results, "表格表头", header);
-      if (results.length === 0) {
-        this.$message.error("表格无有效数据!");
-        return;
-      }
-
-      let head = [
-        "平台订单号",
-        "其他单号(不必填)",
-        "平台下单时间",
-        "销售渠道",
-        "平台商品编号",
-        "单价(元)",
-        "数量",
-        // "优惠前总金额",
-        "订单总金额",
-        // "商品优惠后金额",
-        "优惠活动名称",
-        "收费模式",
-        "收货人",
-        "联系电话",
-        "联系地址",
-        "订单备注",
-      ];
-      if (head.length !== header.length) {
-        // console.log("自定义head长度",head.length)
-        // console.log("表格内数据长度:",header.length)
-        this.$message.error("表头与导入模板不匹配!");
-        return;
-      }
-      let hederOk = true;
-      head.forEach((v1, i1) => {
-        if (v1 !== header[i1].replace(/\s*/g, "")) {
-          console.log(v1);
-          console.log(header[i1]);
-          hederOk = false;
+      if (!this.loading) {
+        this.loading = true;
+        if (results.length === 0) {
+          this.$message.error("表格无有效数据!");
+          this.loading = false;
+          return;
         }
-      });
-
-      if (!hederOk) {
-        console.log(hederOk);
-        this.$message.error("表头与导入模板不匹配!");
-        return;
-      }
-      this.tableHeader = header;
-      this.tableData = [];
-      let list = results;
-      // let r = /^\+?[1-9][0-9]*$/;
-      // let tableOk = true;
-      this.ruleForm.order_addr = [];
-
-      try {
-        list.forEach((v1, index) => {
-          let b = Object.values(v1);
-          // let numFlag = false;
-          
-          
-          // let item = this.get_code(b[3], b[4], b[5]);
-          let model = {
-            platform_code: b[0] + "",
-            po_code: b[1] + "",
-            platform_time: this.formatDate(b[2]) + "",
-            sale_source: b[3] + "",
-            plat_code: b[4] + "",
-            price: b[5] + "",
-            num: b[6] + "",
-            // before_discount_all_price: b[7] + "",
-            before_discount_all_price: b[7] + "",
-            // after_price: b[9] + "",
-            activity_name: b[8] + "",
-            mode: b[9] + "",
-            contactor: b[10] + "",
-            mobile: b[11] + "",
-            addr: b[12] + "",
-            order_remark: b[13] + "",
-            //编辑锁
-            // editFlag:false,
-          };
 
-          this.tableData.push(model);
+        let head = [
+          "平台订单号",
+          "其他单号(不必填)",
+          "平台下单时间",
+          "销售渠道",
+          "平台商品编号",
+          "单价(元)",
+          "数量",
+          // "优惠前总金额",
+          "订单总金额",
+          // "商品优惠后金额",
+          "优惠活动名称",
+          "收费模式",
+          "收货人",
+          "联系电话",
+          "联系地址",
+          "订单备注",
+        ];
+        if (head.length !== header.length) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        let hederOk = true;
+        head.forEach((v1, i1) => {
+          if (v1 !== header[i1].replace(/\s*/g, "")) {
+            console.log(v1 + "----" + header[i1]);
+            hederOk = false;
+          }
         });
-      } catch (e) {}
 
-      console.log(this.tableData);
+        if (!hederOk) {
+          this.$message.error("表头与导入模板不匹配!");
+          this.loading = false;
+          return;
+        }
+        this.tableData = [];
+        let list = results;
+
+        try {
+          list.forEach((v1, index) => {
+            let b = Object.values(v1);
+            let model = {
+              platform_code: b[0] + "",
+              po_code: b[1] + "",
+              platform_time: b[2],
+              sale_source: b[3] + "",
+              plat_code: b[4] + "",
+              price: b[5] + "",
+              num: b[6] + "",
+              before_discount_all_price: b[7] + "",
+              activity_name: b[8] + "",
+              mode: b[9] + "",
+              contactor: b[10] + "",
+              mobile: b[11] + "",
+              addr: b[12] + "",
+              order_remark: b[13] + "",
+            };
+
+            this.tableData.push(model);
+          });
+        } catch (e) {}
+        this.loading = false;
+      }
+      // console.log(this.tableData);
     },
     //取消
     cancel() {
       this.tableData = [];
     },
-    //编辑
-    edit(scope){
-      if(this.editBtnFlag){
-        this.$message.warning("当前已有数据在编辑,请保存后再试!");
-        return;
-      }
-      //只能同时编辑一条数据,将编辑上锁
-      this.editBtnFlag = true;
-      //将本条编辑功能替换为保存
-      this.tableData[scope.$index].editFlag = true;
-      console.log(scope)
-    },
-    //保存
-    check(scope){
-      //将编辑锁解开
-      this.editBtnFlag = false;
-      //将本条保存功能替换为编辑
-      this.tableData[scope.$index].editFlag = false;
 
-      //本条数据是否更改
-      console.log("本条数据",this.tableData[scope.$index])
-    },
-    //删除
-    del(scope) {
-      console.log(scope.$index);
-      this.$confirm("是否删除本条导入数据?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.tableData.splice(scope.$index, 1);
-          this.$message({
-            type: "success",
-            message: "删除成功!",
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "已取消删除",
-          });
-        });
-    },
-    //日期转换
-    formatDate(numb) {
-      const date = new Date(numb);
-      var Y = date.getFullYear() + "-";
-      var M =
-        (date.getMonth() + 1 < 10
-          ? "0" + (date.getMonth() + 1)
-          : date.getMonth() + 1) + "-";
-      var D = date.getDate() + " ";
-      // var h = date.getHours() + ':';
-      // var m = date.getMinutes() + ':';
-      // var s = date.getSeconds();
-      return Y + M + D;
-    },
     //提交
     async submit() {
-      if (this.btnFlag) {
-        console.log("拦截点击");
-        return;
-      }
-
-      const model = {
-        list: this.tableData,
-      };
-      if (model.list.length <= 0) {
-        this.$message.warning("导入数据不能为空");
-        return;
-      }
-      let obj = [
-        { name: "平台订单号", str: "platform_code" },
-        { name: "销售渠道", str: "sale_source" },
-        { name: "平台商品编号", str: "plat_code" },
-        { name: "单价(元)", str: "price" },
-        { name: "数量", str: "num" },
-        { name: "收费模式", str: "mode" },
-        { name: "订单备注", str: "order_remark" },
-        { name: "收货人", str: "contactor" },
-        { name: "联系电话", str: "mobile" },
-        { name: "联系地址", str: "addr" },
-      ];
-      let flag = true;
-      let platform_code_arr = [];
-      try{
-        model.list.forEach((item, index) => {
-        platform_code_arr.push(item.platform_code);
-        //必填判断
-        if (flag) {
+      if (!this.loading) {
+        this.loading = true;
+        if (this.tableData.length === 0) {
+          this.$message.warning("导入数据不能为空");
+          this.loading = false;
+          return;
+        }
+        let model = {
+          list: this.tableData,
+        };
+        const { code, data, message } = await asyncRequest.orderimport(model);
+        this.loading = false;
+        if (code === 0) {
+          this.$notify.success({
+            title: "导入成功!",
+            message: "",
+          });
+          this.tableData = [];
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
         } else {
-          throw Error();
+          this.$message.warning(message);
         }
-        
-
-        if (item.price == 0 || item.num == 0) {
-            this.$message.warning(
-              `表格第${index + 1}行,单价,数量的值不能为0`
-            );
-            flag = false;
-            throw Error();
-          }
-
-          if (!isNaN(item.price) && !isNaN(item.num) && !isNaN(item.before_discount_all_price)) {
-          } else {
-            this.$message.warning(
-              `表格第${index + 1}行,单价,数量,总金额必须是数字`
-            );
-            flag = false;
-            throw Error();
-          }
-
-          if (!Number.isInteger(Number(item.num))) {
-            this.$message.warning(`表格第${index + 1}行,数量必须是整数`);
-            flag = false;
-            throw Error();
-          }
-
-        for (let i = 0; i < obj.length; i++) {
-          let txt = item[obj[i].str].trim();
-          if (txt == "") {
-            this.$message.warning(`第${index + 1}行的${obj[i].name}不能为空`);
-            flag = false;
-            throw Error();
-          } else {
-            flag = true;
-          }
-        }   
-      });
-      }catch{
-
-      }
-
-      //去重锁
-      if (
-        platform_code_arr.length !=
-        Array.from(new Set(platform_code_arr)).length
-      ) {
-        this.$message.warning(`平台订单号不能重复`);
-        return;
-      }
-      if (flag) {
-        //按钮锁开启
-        this.btnFlag = true;
-        this.submitHttp(model);
-      }
-    },
-    async submitHttp(model) {
-      const res = await asyncRequest.orderimport(model);
-      if (res && res.code === 0) {
-        this.$notify.success({
-          title: "成功!",
-          message: "",
-        });
-        this.tableData = [];
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(res.message);
       }
-      //关闭按钮锁
-      this.btnFlag = false;
     },
   },
 };

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels