Переглянути джерело

下推订单 分类打印更改

chenrui 3 роки тому
батько
коміт
bb1fb8f4b9

+ 17 - 7
src/views/salesManagement/pushOrderManagement/chooseTypeModal.vue

@@ -17,9 +17,12 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="选择二级分类" prop="productTypeSn2">
-          <a-select id="pushOrderManagement-print-form" v-model="form.productTypeSn2" placeholder="请选择分类">
-            <a-select-option v-for="item in typeList" :value="item.productTypeSn2" :key="item.productTypeSn2">{{ item.productTypeName2 }}</a-select-option>
+        <a-form-model-item label="产品分类" prop="id">
+          <a-select id="pushOrderManagement-print-form" v-model="form.id" placeholder="请选择产品分类">
+            <a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
+              <span v-if="item.id != 'all'">{{ item.productBrandName }} - {{ item.productTypeName3 }}</span>
+              <span v-else>全部</span>
+            </a-select-option>
           </a-select>
         </a-form-model-item>
       </a-form-model>
@@ -48,10 +51,10 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       form: {
-        productTypeSn2: undefined
+        id: undefined
       },
       rules: {
-        productTypeSn2: [{ required: true, message: '请选择分类', trigger: 'change' }]
+        id: [{ required: true, message: '请选择产品分类', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -67,7 +70,14 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.$emit('ok', _this.form.productTypeSn2)
+          const item = this.typeList.find(item => item.id == this.form.id)
+          if (item) {
+            const obj = {
+              productBrandSn: item.productBrandSn,
+              productTypeSn3: item.productTypeSn3
+            }
+            _this.$emit('ok', obj)
+          }
           _this.isShow = false
         } else {
           console.log('error submit!!')
@@ -82,7 +92,7 @@ export default {
     },
     // 获取该销售单产品二级分类
     getTypeData () {
-      this.typeList = [{ productTypeSn2: 'all', productTypeName2: '全部' }]
+      this.typeList = [{ id: 'all' }]
       dispatchDetailType({ dispatchBillSn: this.outBizSubSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           if (res.data && res.data.length > 0) {

+ 4 - 4
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -173,8 +173,8 @@ export default {
       })
     },
     // 分类选择
-    handleOk (type) {
-      this.requestFun({ productTypeSn2: type })
+    handleOk (obj) {
+      this.requestFun(obj)
     },
     // 打印预览/快捷打印
     handlePrint (type) {
@@ -185,14 +185,14 @@ export default {
         this.openModal = true
       }
     },
-    requestFun (productType) {
+    requestFun (obj) {
       const _this = this
       const params = {
         type: this.nowPrintType,
         dispatchBillSn: this.outBizSubSn || this.$route.params.sn
       }
       _this.spinning = true
-      dispatchDetailPrint(Object.assign(params, productType || {})).then(res => {
+      dispatchDetailPrint(Object.assign(params, obj || {})).then(res => {
         _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()