lilei 1 год назад
Родитель
Сommit
800a2be011

+ 5 - 1
src/components/UploadFile/index.vue

@@ -7,6 +7,7 @@
       :disabled="disabled"
       @preview="handlePreview"
       @change="handleChange"
+      :headers="headers"
       :remove="handleRemove"
       :beforeUpload="beforeUpload"
       :data="params"
@@ -94,7 +95,10 @@ export default {
       previewImage: '',
       fileList: [],
       comVal: this.value,
-      params: this.uploadParams
+      params: this.uploadParams,
+      headers: {
+        'access-token': this.$store.state.user.token
+      }
     }
   },
   methods: {

+ 4 - 2
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -198,7 +198,9 @@ export default {
     loadWarehouse (sn) {
       this.defaultWarehouseSn = sn
       this.queryParam.warehouseSn = sn
-      this.resetSearchForm()
+      if(this.buyerSn){
+        this.resetSearchForm()
+      }
     },
     // 切换tab
     changeTab(e){
@@ -215,7 +217,7 @@ export default {
               _this.$message.info('该产品暂时不能添加')
             } else {
               event.stopPropagation()
-              _this.$emit('add', record, this.promoProductClz)
+              _this.$emit('add', record, 0, this.promoProductClz)
             }
           }
         }

+ 8 - 8
src/views/salesManagement/salesQueryNew/comps/chooseImportModal.vue

@@ -90,22 +90,22 @@ export default {
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qtyText', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'qty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '库存', dataIndex: 'stockQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '单位', dataIndex: 'productUnit', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qtyText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'importQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '库存', dataIndex: 'stockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'importErrorMsgSet', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'errorDescSet', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       unLoadData: [],
       loading: false
@@ -114,6 +114,7 @@ export default {
   methods: {
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
+      console.log(paramsData)
       this.loadData = paramsData.rightList || []
       this.unLoadData = paramsData.errorList || []
       this.loadData.map((item, index) => {
@@ -121,7 +122,6 @@ export default {
       })
       this.unLoadData.map((item, index) => {
         item.no = index + 1
-        item.importErrorMsgSet = item.remarks.split(',')
       })
     },
     // 确认导入

+ 5 - 3
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -63,6 +63,7 @@ export default {
       isShow: this.openModal, //  是否打开弹框
     }
   },
+  
   methods: {
     onClose () {
       this.$emit('close')
@@ -80,14 +81,15 @@ export default {
     openModal (newValue, oldValue) {
       this.isShow = newValue
     },
+    buyerSn (newStr, oldStr){
+      this.$refs.partQuery.pageInit(newStr)
+    },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
       } else {
-        this.$nextTick(() => {
-          this.$refs.partQuery.pageInit(this.buyerSn || '')
-        })
+        this.$refs.partQuery.resetSearchForm()
       }
     }
   }

+ 11 - 6
src/views/salesManagement/salesQueryNew/comps/importGuideModal.vue

@@ -25,7 +25,6 @@
               </a>
             </li>
           </ul>
-          <!-- <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button> -->
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -38,7 +37,7 @@
               ref="importUpload"
               :maxNums="1"
               fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
-              uploadType="import"
+              uploadType="attach"
               :action="attachAction"
               :uploadParams="uploadParams"
               upText="添加文件"
@@ -84,6 +83,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    promoProductClz:{
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -95,7 +98,7 @@ export default {
       uploadParams: {
         salesBillSn: this.params.salesBillSn,
         salesPromoSn: this.params.salesPromoSn||'', 
-        promoProductClz: this.params.promoProductClz||''
+        promoProductClz: this.promoProductClz||''
       },
       exportLoading: false,
       filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx'
@@ -112,9 +115,9 @@ export default {
     },
     // 上传文件  change
     changeImport (file) {
-      console.log(file)
-      if (file) {
-        this.paramsData = Object.assign({}, file || null, this.params)
+      // console.log(file, JSON.parse(file))
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
       } else {
         this.paramsData = null
       }
@@ -143,6 +146,8 @@ export default {
         this.$emit('close')
         this.paramsData = null
         this.$refs.importUpload.setFileList('')
+      }else{
+        this.uploadParams.promoProductClz = this.promoProductClz
       }
     }
   }

+ 3 - 1
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -231,7 +231,8 @@
       <!-- 导入产品 -->
       <importGuideModal 
       :openModal="openGuideModal" 
-      :params="{salesBillSn: $route.params.sn, salesPromoSn: promo.salesPromoSn, promoProductClz:promoProductClz}" 
+      :params="{salesBillSn: $route.params.sn, salesPromoSn: promo.salesPromoSn}" 
+      :promoProductClz="promoProductClz"
       @close="closeGuideModel" 
       @ok="hanldeImportOk" />
       <!-- 仓库设置 -->
@@ -626,6 +627,7 @@
       },
       closeGuideModel () {
         this.openGuideModal = false
+        this.promoProductClz = ''
       },
       // 批量导入产品
       hanldeImportOk (data, salesPromoSn) {

+ 8 - 8
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -164,10 +164,10 @@
       </template>
     </s-table>
 
-      <!-- 导入产品 -->
-      <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: salesBillSn}" @close="closeGuideModel" @ok="hanldeOk" />
-      <!-- 仓库设置 -->
-      <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: salesBillSn}" @close="closeGuideModel" @ok="hanldeOk" />
+    <!-- 仓库设置 -->
+    <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
   </div>
 </template>
 
@@ -179,7 +179,7 @@
   import chooseWarehouse from '@/views/common/chooseWarehouse'
   import ProductBrand from '@/views/common/productBrand.js'
   import productTypeAll from '@/views/common/productTypeAll.js'
-  import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, addPromoGoods, salesBatchInsert } from '@/api/salesDetailNew'
+  import { salesDetailAllList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, addPromoGoods, salesBatchInsert } from '@/api/salesDetailNew'
   export default {
     name: 'ProductList',
     mixins: [commonMixin],
@@ -216,9 +216,9 @@
         spinning: false,
         // 加载数据方法 必须为 Promise 对象
         loadData: parameter => {
-          this.disabled = true
+          // this.disabled = true
           this.queryParam.salesBillSn = this.salesBillSn || ''
-          return salesDetailList(Object.assign(parameter, this.queryParam, {showStock: true})).then(res => {
+          return salesDetailAllList(Object.assign(parameter, this.queryParam, {showStock: true})).then(res => {
             let data
             if (res.status == 200) {
               data = res.data
@@ -227,9 +227,9 @@
                 data.list[i].no = no + i + 1
                 data.list[i].qtyBackups = data.list[i].qty
               }
-              this.disabled = false
               this.dataSource = data.list
             }
+            // this.disabled = false
             return data
           })
         },

+ 4 - 2
src/views/salesManagement/salesQueryNew/comps/queryPart.vue

@@ -190,7 +190,9 @@ export default {
     loadWarehouse (sn) {
       this.defaultWarehouseSn = sn
       this.queryParam.warehouseSn = sn
-      this.resetSearchForm()
+      if(this.buyerSn){
+        this.resetSearchForm()
+      }
     },
     // 双击列表
     handleClickRow (record) {
@@ -242,7 +244,7 @@ export default {
     },
     // 选择配件
     handleAdd (row) {
-      this.$emit('add', row, 0)
+      this.$emit('add', row, 0, 0)
     },
     //  产品分类  change
     changeProductType (val, opt) {