Browse Source

打印货架编号

lilei 2 years ago
parent
commit
5181777246

+ 3 - 2
src/api/allocateReturn.js

@@ -42,8 +42,9 @@ export const allocateReturnExcel = params => {
 // 打印
 export const allocateReturnPrint = params => {
   return axios({
-    url: `/allocateReturn/print/${params.allocateReturnSn}/${params.printType}`,
-    method: 'get',
+    url: `/allocateReturn/print/${params.printType}`,
+    method: 'post',
+    data: params,
     responseType: 'blob'
   })
 }

+ 17 - 2
src/views/allocationManagement/transferOut/printModal.vue

@@ -29,6 +29,13 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
+        <a-form-model-item label="货架编号" prop="orderBy" v-if="nowType=='dbflPrint'">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
         <a-form-model-item label="产品价格" prop="priceType" v-if="nowType=='dbPrint'||nowType=='dbExport'">
           <a-radio-group v-model="form.priceType">
             <a-radio value="ALLOCATE_BILL_PRICE">销售价</a-radio>
@@ -87,11 +94,13 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         id: 'all',
-        priceType: undefined
+        priceType: undefined,
+        orderBy: undefined
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
-        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }]
+        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货架编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -140,6 +149,12 @@ export default {
               obj.productTypeSn3 = item.productTypeSn3
               obj.printType = 'ALLOCATE_BILL_TYPE'
             }
+            // 打印货架编号
+            if (_this.nowType == 'dbflPrint') {
+              if (_this.form.orderBy != '-1') {
+                obj.orderBy = _this.form.orderBy
+              }
+            }
           }
           // 打印
           if (_this.nowType == 'dbPrint' || _this.nowType == 'dbflPrint') {

+ 4 - 0
src/views/allocationManagement/transferReturn/print.vue

@@ -73,6 +73,10 @@ export default {
         allocateReturnSn: obj.allocateReturnSn || '',
         printType: obj.printType
       }
+      // 打印货架编号
+      if (obj.orderBy) {
+        params.orderBy = obj.orderBy
+      }
       _this.$emit('loading')
       printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => { _this.$emit('unloading') })
     },

+ 14 - 2
src/views/allocationManagement/transferReturn/printModal.vue

@@ -26,6 +26,13 @@
             <a-radio value="bdy">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <a-form-model-item label="货架编号" prop="orderBy">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button id="allocateBill-print-save" @click="handleSave(0)">取消</a-button>
@@ -58,10 +65,12 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         id: 'all',
-        priceType: undefined
+        priceType: undefined,
+        orderBy: undefined
       },
       rules: {
-        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }]
+        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货架编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -87,6 +96,9 @@ export default {
               printType: _this.form.priceType,
               isPreview: this.nowType
             }
+            if (_this.form.orderBy != '-1') {
+              obj.orderBy = _this.form.orderBy
+            }
             _this.$emit('ok', obj)
           }
           _this.isShow = false