lilei 1 yıl önce
ebeveyn
işleme
b2c296d2ed

+ 14 - 6
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -36,7 +36,7 @@
       </a-card>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
         <!-- alert -->
-        <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">
+        <a-alert type="info" style="margin-bottom: 10px;" v-if="countData">
           <div slot="message">
           <div slot="message">
             <span>
             <span>
               总款数:<strong>{{ countData.totalCategory || countData.totalCategory==0? countData.totalCategory : '--' }}</strong>;
               总款数:<strong>{{ countData.totalCategory || countData.totalCategory==0? countData.totalCategory : '--' }}</strong>;
@@ -73,7 +73,9 @@
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
-import { queryPageForWarehouseDetail, queryCountForWarehouseDetail, salesDetailBySn } from '@/api/sales'
+import moment from 'moment'
+import { exportExcel } from '@/libs/JGPrint.js'
+import { queryPageForWarehouseDetail, queryCountForWarehouseDetail, salesDetailBySn, salesDetailExcel } from '@/api/sales'
 import printModal from './printModal.vue'
 import printModal from './printModal.vue'
 export default {
 export default {
   name: 'SalesOrderWarehouseDetail',
   name: 'SalesOrderWarehouseDetail',
@@ -103,7 +105,6 @@ export default {
       countData: null, // 数量数据
       countData: null, // 数量数据
       fromRouter: null,
       fromRouter: null,
       openModal:false,
       openModal:false,
-      detailData:null
     }
     }
   },
   },
   computed: {
   computed: {
@@ -126,9 +127,16 @@ export default {
     handlePrint(){
     handlePrint(){
       this.openModal = true
       this.openModal = true
     },
     },
-    // 导出
-    handleOk(){
-      
+    // 确定打印或预览,导出
+    handleOk (objs) {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(objs))
+      console.log(params)
+      delete params.type
+      _this.spinning = true
+      exportExcel(salesDetailExcel, params, '销售清单' + moment().format('YYYYMMDDHHmmss'), () => {
+        _this.spinning = false
+      })
     },
     },
     closePrint () {
     closePrint () {
       this.openModal = false
       this.openModal = false

+ 36 - 62
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -4,7 +4,7 @@
     :footer="null"
     :footer="null"
     :maskClosable="false"
     :maskClosable="false"
     class="sales-print-type-modal"
     class="sales-print-type-modal"
-    title="导出Excel"
+    :title="modalTit"
     v-model="isShow"
     v-model="isShow"
     @cancel="isShow=false"
     @cancel="isShow=false"
     :width="600">
     :width="600">
@@ -26,17 +26,16 @@
             <a-radio value="LESS">缺货</a-radio>
             <a-radio value="LESS">缺货</a-radio>
           </a-radio-group>
           </a-radio-group>
         </a-form-model-item>
         </a-form-model-item>
-        <a-form-model-item label="原厂编码" prop="printType">
-          <a-radio-group
-            v-model="form.printType">
-            <a-radio value="SALES_BILL_ORIG_CODE">导出</a-radio>
-            <a-radio value="SALES_BILL_NOT_LACK_ORIG_CODE">不导出</a-radio>
+        <a-form-model-item label="原厂编码" prop="orgCode">
+          <a-radio-group v-model="form.orgCode">
+            <a-radio value="1">导出</a-radio>
+            <a-radio value="0">不导出</a-radio>
           </a-radio-group>
           </a-radio-group>
         </a-form-model-item>
         </a-form-model-item>
       </a-form-model>
       </a-form-model>
       <div class="btn-cont">
       <div class="btn-cont">
-        <a-button id="sales-print-save" type="primary" @click="handleSave">导出</a-button>
-        <a-button id="sales-print-back" @click="handleCancel" style="margin-left: 15px;">取消</a-button>
+        <a-button id="sales-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" style="margin-left: 15px;" id="sales-print-save" @click="handleSave">导出</a-button>
       </div>
       </div>
     </a-spin>
     </a-spin>
   </a-modal>
   </a-modal>
@@ -55,6 +54,10 @@ export default {
       default: () => {
       default: () => {
         return null
         return null
       }
       }
+    },
+    nowType: {
+      type: String,
+      default: ''
     }
     }
   },
   },
   data () {
   data () {
@@ -63,17 +66,25 @@ export default {
       form: {
       form: {
         id: 'all',
         id: 'all',
         dataScope: 'all',
         dataScope: 'all',
-        orderBy: undefined
+        priceType: undefined,
+        orgCode: "1"
       },
       },
       rules: {
       rules: {
+        id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
-        orderBy: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
+        orgCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
       },
       },
       formItemLayout: {
       formItemLayout: {
         labelCol: { span: 6 },
         labelCol: { span: 6 },
         wrapperCol: { span: 15 }
         wrapperCol: { span: 15 }
       },
       },
-      spinning: false
+      spinning: false,
+      typeList: []
+    }
+  },
+  computed: {
+    modalTit () {
+      return '导出Excel'
     }
     }
   },
   },
   methods: {
   methods: {
@@ -82,63 +93,26 @@ export default {
       const _this = this
       const _this = this
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
         if (valid) {
-          // 分类打印
-          if (_this.nowType == 'SALES_BILL_TYPE') {
-            // 销售分类无权限不打印
-            if (!_this.$hasPermissions('B_salesTypePrint_salesPrice')) {
-              _this.form.priceType = 'SALES_BILL_TYPE'
-            }
-            const item = _this.typeList.find(item => item.id == _this.form.id)
-            if (item) {
-              const obj = {
-                salesBillSn: _this.itemData.salesBillSn,
-                productBrandSn: item.productBrandSn,
-                productTypeSn3: item.productTypeSn3,
-                priceType: _this.form.priceType,
-                type: isPrint || 'preview'
-              }
-              // 打印货位编号
-              if (_this.form.orderBy != '-1') {
-                obj.orderBy = _this.form.orderBy
-                obj.priceType = obj.priceType + '_STACK_PLACE'
-              }
-              _this.$emit('ok', obj)
-            }
-          } else if (_this.nowType == 'SALES_BILL') {
-            // 销售打印无权限不打印
-            if (!_this.$hasPermissions('B_salesPrint_salesPrice')) {
-              _this.form.priceType = 'SALES_BILL'
-            }
-            const obj = {
-              salesBillSn: _this.itemData.salesBillSn,
-              priceType: _this.form.priceType,
-              type: isPrint || 'preview'
-            }
-            _this.$emit('ok', obj)
-          } else if (_this.nowType == 'export') {
-            // 销售导出无权限不导出
-            if (!_this.$hasPermissions('B_salesDetailExport_salesPrice')) {
-              _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
-            }
-            const obj = {
-              salesBillSn: _this.itemData.salesBillSn,
-              priceType: _this.form.priceType,
-              dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
-              type: isPrint || 'preview'
-            }
-            _this.$emit('ok', obj)
-          }
-          _this.isShow = false
+           _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
+           _this.form.priceType += _this.form.orgCode == "1" ? '_ORIG_CODE':''
+           const obj = {
+             salesBillSn: _this.itemData.salesBillSn,
+             priceType: _this.form.priceType,
+             dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+             type: isPrint || 'preview'
+           }
+           _this.$emit('ok', obj)
+           _this.isShow = false
         } else {
         } else {
           console.log('error submit!!')
           console.log('error submit!!')
           return false
           return false
         }
         }
       })
       })
     },
     },
-    // 取消导出
+    // 取消选择分类
     handleCancel () {
     handleCancel () {
-      this.isShow = false
-    }
+       this.isShow = false
+    },
   },
   },
   watch: {
   watch: {
     //  父页面传过来的弹框状态
     //  父页面传过来的弹框状态
@@ -153,7 +127,7 @@ export default {
           id: 'all',
           id: 'all',
           dataScope: 'all',
           dataScope: 'all',
           priceType: undefined,
           priceType: undefined,
-          orderBy: undefined
+          orgCode: "1"
         }
         }
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
       }
       }

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        // target: 'http://192.168.2.111/ocs-admin',
+        target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         ws: false,
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {