snow пре 2 година
родитељ
комит
2244085ad6

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/0.js


+ 27 - 17
src/views/netOrderEntry/prestoreRecordingOrders/importTemplateModal.vue

@@ -26,7 +26,7 @@
 
 <script>
 import asyncRequest from '@/apis/service/netOrderEntry/netOrderEnter'
-import { isMobile, isPhone, isnumber } from '@/utils/validate'
+import { isMobile, isPhone, isnumber, isnumber2, isnumber3 } from '@/utils/validate'
 import companyHelper from '@/mixins/companyHelper'
 import { MessageBox } from 'element-ui'
 
@@ -106,20 +106,27 @@ export default {
       })
       return verification
     },
-    formatDate2(numb, format = '-', mao = ':') {
-      const time = new Date((numb - 1) * 24 * 3600000 + 1)
-      time.setYear(time.getFullYear() - 70)
-      const year = time.getFullYear() + ''
-      const month = time.getMonth() + 1 + ''
-      const date = time.getDate() - 1 + ''
+    formatDate2(serialNumber, format = '-', mao = ':') {
+      var timestamp = (serialNumber - 25569 - 8 / 24) * 86400 * 1000 // 转换为时间戳
+      var newDate = new Date(timestamp) // 转换为日期时间对象
+      const year = newDate.getFullYear() // 获取年份,例如 2023
+      const month = newDate.getMonth() + 1 // 获取月份,注意需要加上 1,例如 4
+      const day = newDate.getDate() // 获取日期,例如 9
+      let hours = newDate.getHours() // 获取小时,例如 0
+      let minutes = newDate.getMinutes() // 获取分钟,例如 0
+      let seconds = newDate.getSeconds() // 获取秒数,例如 0
 
-      const houer = time.getHours() - 8 + ''
-      const minutes = time.getMinutes() + ''
-      const seconds = time.getSeconds() + ''
-      if (format && format.length === 1) {
-        return year + format + month + format + date + ' ' + (houer < 10 ? (houer === 0 ? '00' : '0' + houer) : houer) + mao + (minutes < 10 ? (minutes === 0 ? '00' : '0' + minutes) : minutes) + mao + (seconds < 10 ? (seconds === 0 ? '00' : '0' + seconds) : seconds)
+      // 判断小时、分钟和秒是否小于 10,如果是,则在前面补一个零
+      if (hours < 10) {
+        hours = '0' + hours
       }
-      return year + (month < 10 ? '0' + month : month) + (date < 10 ? '0' + date : date) + ' ' + (houer < 10 ? '0' + date : date)
+      if (minutes < 10) {
+        minutes = '0' + minutes
+      }
+      if (seconds < 10) {
+        seconds = '0' + seconds
+      }
+      return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
     },
     /* 校验导入的联系电话是否合法 **/
     validateMobile(mobiles = []) {
@@ -150,7 +157,7 @@ export default {
       numberFields[fields[0]].forEach((_, index) => {
         const values = helper.values(numberFields, fields, index)
         const valuesIsNumber = values.every(value => {
-          return isnumber(value)
+          return isnumber(value) || isnumber2(value) || isnumber3(value)
         })
         if (!valuesIsNumber) {
           verification.isValid = false
@@ -161,9 +168,9 @@ export default {
     },
     /* 校验导入的税率、数量、采购单价、销售单价是否为数字 **/
     validateDateField(dateFields) {
-      const verification = createFieldVerification("发货日期不能为空,且单元格格式必须为日期类型:'2001/3/7 0:00'")
+      const verification = createFieldVerification('发货日期不能为空,且必须为日期格式')
       dateFields.forEach((date, index) => {
-        if (!date || !(/\d{4}\/\d{1,2}\/\d{1,2}\s\d{1,2}:\d{2}/.test(date))) {
+        if (!date || !(/^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(date))) {
           verification.isValid = false
           verification.notValidRows.push(index + 1)
         }
@@ -255,6 +262,9 @@ export default {
       }
       templateItems.forEach(templateItem => {
         const tableItem = this.mapTemplateItemToTableItem(templateItem)
+        if (tableItem[PROPERTYS.SEND_TIME]) {
+          tableItem[PROPERTYS.SEND_TIME] = this.formatDate2(tableItem[PROPERTYS.SEND_TIME])
+        }
         this.tableData.push(tableItem)
       })
       this.validateFields(this.tableData).message()
@@ -265,7 +275,7 @@ export default {
 
       const list = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
         ...prev,
-        [currentKey]: currentKey === PROPERTYS.SEND_TIME ? (tableItem[currentKey]).split('/').join('-') + ':00' : tableItem[currentKey]
+        [currentKey]: tableItem[currentKey]
       }), {}))
 
       this.loading = true

+ 1 - 3
src/views/netOrderEntry/prestoreRecordingOrders/index.vue

@@ -36,9 +36,7 @@
             </el-col>
             <el-col :span="4" style="width: 380px; padding: 0 0 0 10px">
               <el-select v-model="parmValue.status" size="mini" clearable
-                  @change="pageInfo.curr = 1;
-                                  parmValue.page = 1;
-                                  searchList();"
+                  @change="pageInfo.curr = 1;  parmValue.page = 1; searchList();"
                 >
                 <el-option label="未转单" value="1"></el-option>
                 <el-option label="已转单" value="2"></el-option>

+ 1 - 2
src/views/netOrderEntry/prestoreRecordingOrders/template.js

@@ -203,9 +203,8 @@ export const columns = [
 
 export function createErrorMessage(messages) {
   const rows = Object.keys(messages)
-  return rows.reduce((prev, row, index) => {
+  return [rows[0]].reduce((prev, row, index) => {
     const suffix = index === rows.length - 1 ? '</ul>' : ''
-
     const content = prev + `
       <li>
         <strong style="font-weight:700">第${row}行</strong>,${messages[row]}

+ 107 - 109
src/views/sellOut/project/components/search-good-online-table-modal/index.vue

@@ -1,18 +1,18 @@
 <template>
   <el-dialog
+    v-loading="loading"
     :title="'选择已上线的商品'"
     :center="true"
     align="left"
     top="8vh"
     width="1040px"
-    @close="showModelThis = false"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
-    v-loading="loading"
     element-loading-text="拼命加载中"
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
     append-to-body
+    @close="showModelThis = false"
   >
     <el-card style="margin-top: -20px" class="modal-form-style">
       <ex-table
@@ -41,18 +41,17 @@
               <el-col :span="24">
                 <el-col :span="4" style="width: 220px">
                   <el-input
-                    :size="'mini'"
                     v-model="parmValue.buy_num"
+                    :size="'mini'"
                     :maxlength="40"
                     disabled
                     placeholder="起订量"
-                    ><template slot="prepend">起订量:</template></el-input
-                  >
+                  ><template slot="prepend">起订量:</template></el-input>
                 </el-col>
                 <el-col :span="4" style="width: 460px; padding: 0 0 0 10px">
                   <el-input
-                    :size="'mini'"
                     v-model="company"
+                    :size="'mini'"
                     :maxlength="40"
                     clearable
                     disabled
@@ -79,18 +78,17 @@
               <el-col :span="24" style="padding: 10px 0 0 0">
                 <el-col :span="4" style="width: 220px">
                   <el-input
-                    :size="'mini'"
                     v-model="parmValue.price"
+                    :size="'mini'"
                     :maxlength="40"
                     disabled
                     placeholder="预算单价"
-                    ><template slot="prepend">售 价 ≤</template></el-input
-                  >
+                  ><template slot="prepend">售 价 ≤</template></el-input>
                 </el-col>
                 <el-col :span="4" style="width: 250px; padding: 0 0 0 10px">
                   <el-input
-                    :size="'mini'"
                     v-model="platform_name"
+                    :size="'mini'"
                     :maxlength="40"
                     clearable
                     disabled
@@ -100,11 +98,11 @@
                 <el-col :span="4" style="width: 280px; padding: 0 0 0 10px">
                   <good-class
                     :value="parmValue.cat_id"
-                    @handleChange="goods_class_change"
                     :disabled="sitem.good_type + '' === '1'"
                     :size="'mini'"
-                    :isDetail="sitem.good_type + '' === '1'"
+                    :is-detail="sitem.good_type + '' === '1'"
                     :placeholder="'分类'"
+                    @handleChange="goods_class_change"
                   />
                 </el-col>
                 <el-col :span="3" style="width: 66px; float: right">
@@ -127,19 +125,19 @@
 </template>
 
 <script>
-import asyncRequest from "@/apis/service/sellOut/project";
+import asyncRequest from '@/apis/service/sellOut/project'
 
-import resToken from "@/mixins/resToken";
-import mixinPage from "@/mixins/elPaginationHandle";
-import { mapGetters } from "vuex";
-import columns from "./columns";
+import resToken from '@/mixins/resToken'
+import mixinPage from '@/mixins/elPaginationHandle'
+import { mapGetters } from 'vuex'
+import columns from './columns'
 export default {
-  name: "searchGoodOnlineTableModal",
+  name: 'SearchGoodOnlineTableModal',
   mixins: [resToken, mixinPage],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
   },
-  props: ["showModel", "sitem"],
+  props: ['showModel', 'sitem'],
 
   /**
    * 属性集合
@@ -153,23 +151,23 @@ export default {
   data() {
     return {
       options: [
-        { id: "0", name: "非库存品" },
-        { id: "1", name: "库存品" },
+        { id: '0', name: '非库存品' },
+        { id: '1', name: '库存品' }
       ],
-      company: "",
-      platform_name: "",
+      company: '',
+      platform_name: '',
       selectLoading: false,
-      searchName: "",
+      searchName: '',
       loading: true,
       showModelThis: false,
       parmValue: {
-        buy_num: "", // 商品购买数量
-        price: "", // 单价
+        buy_num: '', // 商品购买数量
+        price: '', // 单价
         cat_id: [], // 分类id
-        companyNo: "", // 业务公司id
-        platform_code: "", //平台编号id
+        companyNo: '', // 业务公司id
+        platform_code: '', // 平台编号id
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       },
       tableData: [],
       passwordModel: false,
@@ -180,36 +178,36 @@ export default {
       // 表格 - 参数
       table: {
         stripe: true,
-        border: true,
+        border: true
         // _defaultHeader_: ["setcol"],
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
-      columns: columns,
-    };
+      columns: columns
+    }
   },
   watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
+    showModel: function(val) {
+      this.showModelThis = val
       if (val) {
-        this.restSearch();
+        this.restSearch()
       }
     },
     showModelThis(val) {
       if (!val) {
-        this.$emit("cancel");
+        this.$emit('cancel')
       }
-    },
+    }
   },
 
   methods: {
     restSearch() {
-      console.log(this.sitem);
+      console.log(this.sitem)
       const {
         platform_id,
         companyNo,
@@ -218,126 +216,126 @@ export default {
         budget_price,
         company,
         platform_name,
-        cat_info,
-      } = this.sitem;
-      console.log(this.sitem);
-      this.company = company;
-      this.platform_name = platform_name;
-      let list = [];
+        cat_info
+      } = this.sitem
+      console.log(this.sitem)
+      this.company = company
+      this.platform_name = platform_name
+      const list = []
       if (cat_info && cat_info.length > 0) {
         cat_info.forEach((s) => {
-          list.push(s.id);
-        });
+          list.push(s.id)
+        })
       }
       this.parmValue = {
         buy_num: num, // 商品购买数量
         price: budget_price, // 单价
         cat_id: list, // 分类id
         companyNo: companyNo, // 业务公司id
-        platform_code: platform_id, //平台编号id
+        platform_code: platform_id, // 平台编号id
         page: 1, // 页码
-        size: 15, // 每页显示条数
-      };
+        size: 15 // 每页显示条数
+      }
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
-      };
-      this.searchList();
+        total: 0
+      }
+      this.searchList()
     },
     async searchList() {
-      this.loading = true;
-      let model = JSON.parse(JSON.stringify(this.parmValue));
-      const { cat_id } = model;
-      model.cat_id = cat_id && cat_id.length > 0 ? cat_id[cat_id.length - 1] : "";
-      const res = await asyncRequest.get_good_online_list(model);
+      this.loading = true
+      const model = JSON.parse(JSON.stringify(this.parmValue))
+      const { cat_id } = model
+      model.cat_id = cat_id && cat_id.length > 0 ? cat_id[cat_id.length - 1] : ''
+      const res = await asyncRequest.get_good_online_list(model)
       if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
+        this.tableData = res.data.list
         this.tableData.map((v) => {
-          v.cat_name = "";
+          v.cat_name = ''
           if (v.cat_info && v.cat_info.length > 0) {
             v.cat_info.forEach((x, xi) => {
-              v.cat_name += `${xi !== 0 ? "_" : ""}${x.name}`;
-            });
-            return v;
+              v.cat_name += `${xi !== 0 ? '_' : ''}${x.name}`
+            })
+            return v
           }
-          this.setNum(v.sale_price);
+          this.setNum(v.sale_price)
 
-          return v;
-        });
+          return v
+        })
         //
-        this.pageInfo.total = Number(res.data.count);
+        this.pageInfo.total = Number(res.data.count)
       } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
-        this.tableData = [];
-        this.pageInfo.total = 0;
+        this.tableData = []
+        this.pageInfo.total = 0
       }
-      this.loading = false;
+      this.loading = false
     },
     async goods_class_change(e) {
-      this.parmValue.cat_id = e;
-      this.pageInfo.curr = 1;
-      this.parmValue.page = 1;
-      await this.searchList();
+      this.parmValue.cat_id = e
+      this.pageInfo.curr = 1
+      this.parmValue.page = 1
+      await this.searchList()
     },
     async remoteMethod(query) {
-      this.selectLoading = true;
-      if (query !== "") {
-        this.options = [];
-        let formValue = {
+      this.selectLoading = true
+      if (query !== '') {
+        this.options = []
+        const formValue = {
           page: 1,
           size: 100,
           name: query,
-          code: "",
-        };
+          code: ''
+        }
 
-        let res = await asyncRequest.supplierList(formValue);
+        const res = await asyncRequest.supplierList(formValue)
         if (res && res.code === 0 && res.data) {
-          const { list } = res.data;
-          this.options = list;
+          const { list } = res.data
+          this.options = list
         } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
+          await this.logout()
         } else {
-          this.$message.warning(res.message);
+          this.$message.warning(res.message)
         }
       } else {
-        this.options = [];
+        this.options = []
       }
-      this.selectLoading = false;
+      this.selectLoading = false
     },
     async resultList(selection) {
       if (selection && selection.length > 1 && this.once) {
-        this.$message.warning("只能选择一条商品信息!");
-        return;
+        this.$message.warning('只能选择一条商品信息!')
+        return
       }
-      this.loading = true;
-      let model = {
+      this.loading = true
+      const model = {
         pgNo: this.sitem.pgNo,
         spuCode: [],
-        source: "1",
-      };
+        source: '1'
+      }
       selection.forEach((a) => {
-        model.spuCode.push(a.skuCode);
-      });
-      let { code, data, message } = await asyncRequest.project_online_good_add(model);
-      this.loading = false;
+        model.spuCode.push(a.skuCode)
+      })
+      const { code, data, message } = await asyncRequest.project_online_good_add(model)
+      this.loading = false
       if (code === 0) {
         this.$notify.success({
-          title: "添加成功!",
-          message: "",
-        });
-        this.showModelThis = false;
-        this.$emit("submitRes", this.sitem.pgNo_index);
+          title: '添加成功!',
+          message: ''
+        })
+        this.showModelThis = false
+        this.$emit('submitRes', this.sitem.pgNo_index)
       } else if (code >= 100 && code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
-        this.$message.warning(message);
+        this.$message.warning(message)
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
 
 <style></style>

Неке датотеке нису приказане због велике количине промена