snow 2 jaren geleden
bovenliggende
commit
ce01064b3a

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.js


+ 0 - 2
src/App.vue

@@ -5,8 +5,6 @@
 </template>
 
 <script>
-// import { JudgeEnvironment } from '@/utils/validate'
-// import { getCode } from '@/utils/dingding'
 import { mapGetters } from 'vuex'
 
 export default {

+ 9 - 9
src/apis/url-config.js

@@ -4,20 +4,20 @@ import {
   webUrl,
   loginTitle,
   loginBeian,
-  loginBeianUrl,
-} from "@/config";
-const { baseApi } = api;
-const { CorpId, AgentId } = ding;
+  loginBeianUrl
+} from '@/config'
+const { baseApi } = api
+const { CorpId, AgentId } = ding
 export default {
-  //后端接口url
+  // 后端接口url
   baseURL: baseApi,
-  //企业id
+  // 企业id
   corpId: CorpId,
-  //应用凭证
+  // 应用凭证
   agentId: AgentId,
   // tableURL: tableApi,
   webUrl: webUrl,
   loginTitle,
   loginBeian,
-  loginBeianUrl,
-};
+  loginBeianUrl
+}

+ 0 - 1
src/apis/userAxios.js

@@ -21,7 +21,6 @@ export default async(
   onUploadProgress
 ) => {
   type = type.toLowerCase()
-  console.log(headers)
   const obj = {
     method: type,
     baseURL: '',

+ 1 - 1
src/config/env.development.js

@@ -6,7 +6,7 @@ module.exports = {
     baseApi: 'http://stocknew.test241.wanyuhengtong.com/'
     // baseApi: 'http://stockwm.test241.wanyuhengtong.com/'
   },
-  webUrl: 'http://project.web.caixiao365.com/#/test-good-share?id=',
+  webUrl: 'http://project.web.caixiao365.com/#/test-good-company-share?id=',
   fileURL: `https://api2.edu.futurelab.tv`,
   shareWebUrl: 'http://post.web.caixiao365.com/?prod=1&outCode=',
   // 分仓

+ 0 - 1
src/views/goodStore/goodsOnline/columns.js

@@ -188,7 +188,6 @@ const rules = {
       trigger: 'blur'
     }
   ]
-
 }
 
 export { options1, options2, options3, options4, options5, options6, options7, options8, listCol, rules }

+ 0 - 2
src/views/goodStore/goodsOnline/components/fixed-price-form.vue

@@ -802,8 +802,6 @@ export default {
     },
     //保存某一行
     async checkRow(rowIndex) {
-       // new_sale_price  sale_price
-       // new_cost_fee cost_fee
       const { sale_price ,new_sale_price , cost_fee , new_cost_fee } = this.addrForm.good_ladder[rowIndex] || {}
       const _salePrice = Number(sale_price)
       const _systemSalePrice = Number(new_sale_price)

+ 0 - 1
src/views/goodStore/goodsOnline/detail.vue

@@ -409,7 +409,6 @@ export default {
         this.spuCode = spuCode;
         this.ladderlist = JSON.parse(JSON.stringify(ladderlist));
         this.nakelist = JSON.parse(JSON.stringify(nakelist));
-        console.log(this.ladderlist);
         let cat = "";
         if (cat_info && cat_info.length > 0) {
           cat_info.forEach((e, i) => {

+ 1 - 1
src/views/login/index.vue

@@ -180,7 +180,7 @@ export default {
       loginBeianUrl: urlConfig.loginBeianUrl,
       loginForm: {
         username: '',
-        password: '',
+        password: 'dingding123',
         code: ''
       },
       loginRules: {

+ 2 - 2
src/views/netOrderEntry/netOrderEnter/addEdit.vue

@@ -313,8 +313,8 @@
               </el-col>
 
               <el-col :span="6">
-                <el-form-item label="款总额" prop="good_total">
-                  <el-input v-model="ruleForm.good_total" placeholder="款总额" disabled>
+                <el-form-item label="款总额" prop="good_total">
+                  <el-input v-model="ruleForm.good_total" placeholder="款总额" disabled>
                     <template #append>元</template>
                   </el-input>
                 </el-form-item>

+ 123 - 0
src/views/netOrderEntry/netOrderEnter/importTemplateModal.vue

@@ -0,0 +1,123 @@
+<template>
+  <el-dialog
+    center
+    width="1024px"
+    title="导入采销订单补录"
+    :visible="innerVisible"
+    :close-on-click-modal="false"
+    @close="() => innerVisible = false"
+  >
+    <div v-if="tableData && tableData.length > 0" class="tr" style="padding: 10px 0 0 0">
+      <el-button :size="'mini'" @click="cancel">取消</el-button>
+      <el-button type="primary" :size="'mini'" @click="submit">提交</el-button>
+    </div>
+    <div v-else>
+      <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
+    </div>
+
+    <ex-table
+      :columns="columns"
+      :table="table"
+      :data="tableData"
+      style="margin: 15px 0 0 0"
+    />
+  </el-dialog>
+</template>
+
+<script>
+import { columns, getTableProperty } from './template'
+import companyHelper from '@/mixins/companyHelper'
+export default {
+  mixins: [companyHelper],
+  props: ['visible'],
+  data() {
+    return {
+      columns,
+      loading: false,
+      tableData: [],
+      table: {
+        stripe: true,
+        border: true,
+        'max-height': '800px'
+      }
+    }
+  },
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newVal) {
+        this.$emit('update:visible', newVal)
+      }
+    }
+  },
+  methods: {
+    validateTableHeader(header, importHeader) {
+      let isHeaderOk = true
+      if (header.length !== importHeader.length) return false
+      for (const index in header) {
+        const field = header[index]
+        const importField = importHeader[index]
+        if (field !== importField) {
+          console.log(field, importField)
+          isHeaderOk = false
+          break
+        }
+      }
+
+      return isHeaderOk
+    },
+    /* 校验导入的销售方列表编码(与选择的公司必须一致) **/
+    validateCompanyNo() {
+      const current = this.currentCompany
+    },
+    /* 校验导入的数据 **/
+    validateFields(tableData = []) {
+      for (const index in tableData) {
+        const tableItem = tableData[index]
+        const propertys = Object.keys(tableItem)
+
+        propertys.forEach(property => {
+          switch (property) {
+            case 'companyNo':
+              break
+          }
+        })
+      }
+    },
+    mapTemplateItemToTableItem(templateItem) {
+      const tableItem = {}
+      const templatePropertys = Object.keys(templateItem)
+      templatePropertys.forEach(templateProperty => {
+        const tableproperty = getTableProperty(templateProperty)
+        tableItem[tableproperty] = templateItem[templateProperty]
+      })
+      return tableItem
+    },
+    handleSuccess({ results: templateItems, header: templateHeader }) {
+      const isHeaderValid = this.validateTableHeader(
+        this.columns.map(({ label }) => label).slice(1),
+        templateHeader
+      )
+
+      if (!isHeaderValid) {
+        this.$message.warning('表格与导入的表头不一致!')
+        return
+      }
+
+      if (templateItems.length === 0) {
+        this.$message.warning('导入的表格没有数据!')
+        return
+      }
+
+      templateItems.forEach(templateItem => {
+        const tableItem = this.mapTemplateItemToTableItem(templateItem)
+        this.tableData.push(tableItem)
+      })
+
+      const isValid = this.validateFields(this.tableData)
+    }
+  }
+}
+</script>

+ 29 - 14
src/views/netOrderEntry/netOrderEnter/index.vue

@@ -74,7 +74,8 @@
                 >重置</el-button
               >
             </el-col>
-            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px" v-if="powers.includes('003') && !isSupertube">
+            <!-- v-if="powers.includes('003') && !isSupertube" -->
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
               <el-button type="primary" :size="searchSize" @click="openModal({}, '003')"
                 >添加</el-button
               >
@@ -116,6 +117,17 @@
                 "
               />
             </el-col>
+
+            <!-- <el-col :span="3" class="fr" style="width: 116px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click="downloadTemplate">
+                下载导入模板
+              </el-button>
+            </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click="() => templateModalVisible = true">
+                导入
+              </el-button>
+            </el-col> -->
           </el-row>
         </div>
       </template>
@@ -173,6 +185,8 @@
       </template>
     </ex-table>
     <no-auth v-else></no-auth>
+
+    <import-template-modal :visible.sync="templateModalVisible" />
     <!-- 弹窗 新增/修改 -->
     <add-edit
       :id="modelId"
@@ -185,20 +199,24 @@
 </template>
 <script>
 import asyncRequest from "@/apis/service/netOrderEntry/netOrderEnter";
+import { xs_order_type_options, xs_order_source_options } from "@/assets/js/statusList";
 import { statusList } from "@/assets/js/statusList";
 import mixinPage from "@/mixins/elPaginationHandle";
 import roleLevel from "@/assets/js/roleLevel";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
 import addEdit from "./addEdit";
-import { xs_order_type_options, xs_order_source_options } from "@/assets/js/statusList";
 import companyHelper from "@/mixins/companyHelper";
+import { utils, writeFile } from "xlsx"
+import { template } from "./template"
+import importTemplateModal from "./importTemplateModal.vue";
 
 export default {
   name: "netOrderEnter",
   mixins: [mixinPage, resToken, companyHelper],
   components: {
     addEdit,
+    importTemplateModal
   },
   computed: {
     //组件SIZE设置
@@ -219,6 +237,7 @@ export default {
     };
 
     return {
+      templateModalVisible:false,
       xs_order_type_options,
       xs_order_source_options,
       statusList: statusList,
@@ -278,13 +297,6 @@ export default {
           label: "商品名称",
           width: "150",
         },
-        // {
-        //   prop: 'good_class',
-        //   label: '商品分类',
-        //   width: '120'
-
-        // },
-
         {
           prop: "good_num",
           label: "商品数量",
@@ -316,11 +328,6 @@ export default {
           _slot_: "order_type",
           width: "90px",
         },
-        // {
-        //   prop: 'useage',
-        //   label: '订单用途',
-        //   width: '100px'
-        // },
         {
           prop: "customer_code",
           label: "客户公司编码",
@@ -376,6 +383,14 @@ export default {
     this.searchList();
   },
   methods: {
+    downloadTemplate(){
+      const workBook = new utils.book_new()
+      const workSheet = new utils.json_to_sheet(template)
+      utils.book_append_sheet(workBook,workSheet,"sheet")
+      writeFile(workBook, "采销订单补录.xlsx",{
+        bookType:'xlsx'
+      })
+    },
     restSearch() {
       // 表格 - 分页
       this.pageInfo = {

+ 185 - 0
src/views/netOrderEntry/netOrderEnter/template.js

@@ -0,0 +1,185 @@
+export const template = [
+  {
+    '销售方公司编码': '',
+    '销售方公司名称': '',
+    '购买方公司编码': '',
+    '购买方公司名称': '',
+    '供应商公司编码': '',
+    '供应商公司名称': '',
+    '所属平台': '',
+    '商品分类': '',
+    '商品名称': '',
+    '单位': '',
+    '税率': '',
+    '数量': '',
+    '单价': '',
+    '采购毛利率': '',
+    '货款总额': '',
+    '收货人': '',
+    '联系电话': '',
+    '收货地址': '',
+    '发货时间': '',
+    'PO编号': '',
+    '单据号': ''
+  }
+]
+
+const mapTemplateToTable = {
+  '销售方公司编码': 'companyNo',
+  '销售方公司名称': 'value0',
+  '购买方公司编码': 'khNo',
+  '购买方公司名称': 'value1',
+  '供应商公司编码': 'supplierNo',
+  '供应商公司名称': 'value2',
+  '所属平台': 'platform_id',
+  '商品分类': 'cat_id',
+  '商品名称': 'goodName',
+  '单位': 'goodUnit',
+  '税率': 'tax',
+  '数量': 'goodNum',
+  '单价': 'goodPrice',
+  '采购毛利率': 'cgd_tax',
+  '货款总额': 'good_total',
+  '收货人': 'contactor',
+  '联系电话': 'mobile',
+  '收货地址': 'addr',
+  '发货时间': 'sendtime',
+  'PO编号': 'poCode',
+  '单据号': 'workCode'
+}
+
+export const getTableProperty = (key) => mapTemplateToTable[key]
+
+export const columns = [
+  {
+    type: 'index',
+    label: '序号',
+    width: '70px'
+  },
+  {
+    prop: getTableProperty('销售方公司编码'),
+    label: '销售方公司编码',
+    width: '156px'
+  },
+
+  {
+    prop: getTableProperty('销售方公司名称'),
+    label: '销售方公司名称',
+    width: '156px'
+  },
+  {
+    prop: getTableProperty('购买方公司编码'),
+    label: '购买方公司编码',
+    width: '180px'
+  },
+  {
+    prop: getTableProperty('购买方公司名称'),
+    label: '购买方公司名称',
+    width: '180px'
+  },
+  {
+    prop: getTableProperty('供应商公司编码'),
+    label: '供应商公司编码',
+    width: '120px'
+  },
+
+  {
+    prop: getTableProperty('供应商公司名称'),
+    label: '供应商公司名称',
+    width: '120px'
+  },
+  {
+    prop: getTableProperty('所属平台'),
+    label: '所属平台',
+    width: '110px'
+  },
+  {
+    prop: getTableProperty('商品分类'),
+    label: '商品分类',
+    width: '150px'
+  },
+  {
+    prop: getTableProperty('商品名称'),
+    label: '商品名称',
+    width: '150px'
+  },
+  {
+    prop: getTableProperty('单位'),
+    label: '单位',
+    width: '150px'
+  },
+  {
+    prop: getTableProperty('税率'),
+    label: '税率',
+    width: '150px'
+  },
+  {
+    prop: getTableProperty('数量'),
+    label: '数量',
+    width: '140px'
+  },
+  {
+    prop: getTableProperty('单价'),
+    label: '单价',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('采购毛利率'),
+    label: '采购毛利率',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('货款总额'),
+    label: '货款总额',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('收货人'),
+    label: '收货人',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('联系电话'),
+    label: '联系电话',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('收货地址'),
+    label: '收货地址',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('发货时间'),
+    label: '发货时间',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('PO编号'),
+    label: 'PO编号',
+    'width': '150px'
+  },
+  {
+    prop: getTableProperty('单据号'),
+    label: '单据号',
+    'width': '150px'
+  }
+]
+
+export const requiredFields = [
+  '销售方公司编号',
+  '购买方公司编码',
+  '供应商公司编码',
+  '所属平台',
+  '商品分类',
+  '商品名称',
+  '单位',
+  '税率',
+  '数量',
+  '单价',
+  '采购毛利率',
+  '收货人',
+  '联系电话',
+  '收货地址',
+  '发货时间',
+  'PO编号'
+]

Some files were not shown because too many files changed in this diff