lilei пре 1 година
родитељ
комит
1bb8a9a2fd

BIN
public/templ/货位编号管理导入模板.xlsx


+ 9 - 7
src/views/productManagement/shelfNoManage/chooseImportModal.vue

@@ -87,18 +87,20 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '产品编码', dataIndex: 'code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorMsg', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       unLoadData: [],

+ 43 - 8
src/views/productManagement/shelfNoManage/editHwModal.vue

@@ -4,7 +4,7 @@
     class="shelfSet-newHw-modal"
     :footer="null"
     :maskClosable="false"
-    title="编辑"
+    :title="title"
     v-model="isShow"
     @cancel="isShow=false"
     :width="600">
@@ -16,8 +16,26 @@
         :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="产品编码">{{ nowData&&nowData.productVO.code || '--' }}</a-form-model-item>
-        <a-form-model-item label="产品名称">{{ nowData&&nowData.productVO.name || '--' }}</a-form-model-item>
+        <div v-if="type=='edit'">
+          <a-form-model-item label="产品编码">{{ nowData&&nowData.productVO.code || '--' }}</a-form-model-item>
+          <a-form-model-item label="产品名称">{{ nowData&&nowData.productVO.name || '--' }}</a-form-model-item>
+          <a-form-model-item label="仓库">{{ nowData&&nowData.warehouseName || '--' }}</a-form-model-item>
+        </div>
+        <div v-if="type=='add'">
+          <a-form-model-item label="产品编码" prop="productSn">
+            <productCodeList ref="productCodeList" @change="productCodeChange" />
+          </a-form-model-item>
+          <a-form-model-item label="产品名称" v-if="productName">
+            {{ productName || '--' }}
+          </a-form-model-item>
+          <a-form-model-item label="仓库" prop="warehouseSn">
+            <warehouse
+              v-model="form.warehouseSn"
+              isPermission
+              placeholder="请选择仓库"
+            />
+          </a-form-model-item>
+        </div>
         <a-form-model-item label="货位编号" prop="stackPlaceCode">
           <a-input v-model="form.stackPlaceCode" :maxLength="10" placeholder="请输入货位编号(最多10个字符)"></a-input>
           <div style="color:#fba200;font-size:12px;">货位编号允许为空,为空则表示此产品没有货位编号</div>
@@ -32,20 +50,20 @@
 </template>
 
 <script>
+import { VSelect } from '@/components'
 import { commonMixin } from '@/utils/mixin'
+import productCodeList from '@/views/common/productCodeList.vue'
+import warehouse from '@/views/common/chooseWarehouse.js'
 import { stackPlaceSave } from '@/api/product'
 export default {
   name: 'EditHwModal',
+  components: { VSelect, productCodeList, warehouse },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    type: {
-      type: String,
-      default: 'edit'
-    },
     nowData: {
       type: Object,
       default: () => {
@@ -72,9 +90,17 @@ export default {
       rules: {
         shelfPlaceCode: [
           { required: true, message: '请输入货位编号', trigger: 'blur' }
+        ],
+        productSn: [
+          { required: true, message: '请选择产品', trigger: 'blur' }
+        ],
+        warehouseSn: [
+          { required: true, message: '请选择仓库', trigger: 'blur' }
         ]
       },
-      productName: ''
+      productName: '',
+      title: '',
+      type: 'add'
     }
   },
   methods: {
@@ -107,7 +133,14 @@ export default {
         }
       })
     },
+    productCodeChange (val) {
+      this.form.productSn = val.key || undefined
+      this.form.productCode = val.row && val.row.code ? val.row.code : undefined
+      this.productName = val.row && val.row.name ? val.row.name : undefined
+    },
     resetData () {
+      this.productName = ''
+      this.$refs.productCodeList.resetForm()
       this.form.stackPlaceCode = undefined
       this.$refs.ruleForm.resetFields()
     }
@@ -123,6 +156,8 @@ export default {
         this.$emit('close')
         this.resetData()
       } else {
+        this.type = this.nowData ? 'edit' : 'add'
+        this.title = (this.nowData ? '编辑' : '新增') + '货位编号'
         if (this.type == 'edit') {
           this.form.stackPlaceCode = this.nowData.stackPlaceCode
         }

+ 11 - 19
src/views/productManagement/shelfNoManage/importGuideModal.vue

@@ -15,11 +15,16 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”的列,且名称必须相同</li>
-            <li>2) “产品编码”必须是列表中已存在的产品</li>
-            <li>3) “货位编号”可为空,为空表示此产品没有货位信息</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“仓库”的列,且名称必须相同</li>
+            <li>2) “产品编码”必须是系统中已存在的产品</li>
+            <li>3) “仓库”必须是系统中已存在的仓库</li>
+            <li>4) “货位编号”可为空,为空表示此产品没有货位信息</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </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">
@@ -65,8 +70,6 @@
 <script>
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { stackPlaceImportTemplate } from '@/api/product'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -89,7 +92,8 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/货位编号管理导入模板.xlsx'
     }
   },
   methods: {
@@ -120,18 +124,6 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
-    //  位编号管理导入模板
-    handleExport () {
-      const _this = this
-      this.spinning = true
-      this.exportLoading = true
-      setTimeout(() => {
-        _this.exportLoading = false
-      }, 1000)
-      hdExportExcel(stackPlaceImportTemplate, {}, '货位编号管理导入模板', function () {
-        _this.spinning = false
-      })
     }
   },
   watch: {

+ 13 - 10
src/views/productManagement/shelfNoManage/list.vue

@@ -31,7 +31,7 @@
                   <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="shelfNoMan-productType"></productTypeAll>
                 </a-form-item>
               </a-col>
-              <!-- <a-col :md="4" :sm="24" v-show="isShowWarehouse">
+              <a-col :md="4" :sm="24" v-show="isShowWarehouse">
                 <a-form-item label="仓库">
                   <warehouse
                     v-model="queryParam.product.warehouseSn"
@@ -40,7 +40,7 @@
                     placeholder="请选择仓库"
                   />
                 </a-form-item>
-              </a-col> -->
+              </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="产品状态">
                   <v-select code="PRODUCT_STATUS" id="shelfNoMan-state" v-model="queryParam.product.state" allowClear placeholder="请选择产品状态"></v-select>
@@ -92,6 +92,7 @@
           type="primary"
           @click="openGuideModal = true"
         >批量导入</a-button>
+        <a-button type="primary" @click="openNewModal" class="button-warning" id="shelfNoMan-add">新增</a-button>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -209,19 +210,16 @@ export default {
 	  columns () {
 	    const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productVO.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productVO.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productVO.name', align: 'center', width: '20%', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productVO.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productVO.productBrandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productVO.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productVO.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '10%', align: 'center' },
-        // { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品状态', dataIndex: 'productVO.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '货位编号', dataIndex: 'stackPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.isShowWarehouse) {
-        // arr.splice(6, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
-      }
 	    return arr
 	  }
   },
@@ -254,6 +252,11 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
+    // 新增
+    openNewModal () {
+      this.nowData = null
+      this.openModal = true
+    },
     // 编辑
     handleEdit (row) {
       this.nowData = row

+ 24 - 30
src/views/salesManagement/stockPrint/list.vue

@@ -111,7 +111,7 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
-          :scroll="{ y:tableHeight, x: 1500 }"
+          :scroll="{ y:tableHeight, x: 1600 }"
           :defaultLoadData="false"
           bordered>
           <!-- 销售单号 -->
@@ -273,38 +273,32 @@ export default {
     },
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '120px', align: 'center' },
+        { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '110px', align: 'center' },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '120px', align: 'center' },
-        { title: '发货编号', dataIndex: 'sendNo', width: '50px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'sendNo', width: '40px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发货说明', scopedSlots: { customRender: 'explainInfo' }, width: '80px', align: 'center', ellipsis: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: '130px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '仓库', dataIndex: 'warehouseName', width: '130px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '100px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收货客户名称', dataIndex: 'receiverName', width: '100px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品款数', dataIndex: 'totalCategory', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品数量', dataIndex: 'totalQty', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '90px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备货打印状态', width: '100px', align: 'center', scopedSlots: { customRender: 'printStatus' } },
-        { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center', fixed: 'right' }
+        { title: '产品款数', dataIndex: 'totalCategory', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品数量', dataIndex: 'totalQty', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货打印状态', width: '60px', align: 'center', scopedSlots: { customRender: 'printStatus' } },
+        { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '80px', align: 'center', fixed: 'right' }
       ]
-      if (this.isShowWarehouse) {
-        arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-      }
+
       if (this.$hasPermissions('M_stockPrintList_salesPrice')) { //  售价权限
-        const ind = this.isShowWarehouse ? 11 : 10
-		    arr.splice(ind, 0, { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind+1, 0, { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind+2, 0, { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind+3, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind+4, 0, { title: '轮胎售价', dataIndex: 'receiveLtTotalAmount', width: '70px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        const ind = this.isShowWarehouse ? 10 : 9
+		    arr.splice(ind, 0, { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '60px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 1, 0, { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '60px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 2, 0, { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '60px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 3, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '60px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 4, 0, { title: '轮胎售价', dataIndex: 'receiveLtTotalAmount', width: '60px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }
@@ -354,11 +348,11 @@ export default {
         params.type = params.type + '_STACK_PLACE'
       }
       // 原厂编码
-      if(obj.origCode == 1){
+      if (obj.origCode == 1) {
         params.type = params.type + '_ORIG_CODE'
       }
       // 装箱号
-      if(obj.packNo == 1){
+      if (obj.packNo == 1) {
         params.type = params.type + '_PACK_NUM'
       }
       _this.spinning = true