瀏覽代碼

修改bug

chenrui 1 年之前
父節點
當前提交
162e4f200c

+ 58 - 33
src/views/allocationManagement/allocationList/list.vue

@@ -2,31 +2,38 @@
   <a-card size="small" :bordered="false" class="pushOrder-wrap">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model
+        id="allocateBillList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :rules="rules"
+        :model="queryParam"
+        @keyup.enter.native="handleSearch">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="调往对象">
+            <a-form-model-item label="调往对象">
               <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="费用/调拨类型">
+            <a-form-model-item label="费用/调拨类型">
               <AllocateType id="allocateBillList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-item label="收货客户名称">
+              <a-form-model-item label="收货客户名称">
                 <dealerSearchList ref="receiverSn" @change="custChange" />
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
+              <a-form-model-item label="业务状态">
                 <v-select
                   v-model="queryParam.state"
                   ref="state"
@@ -35,24 +42,24 @@
                   placeholder="请选择业务状态"
                   allowClear
                 ></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨单号">
+              <a-form-model-item label="调拨单号">
                 <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调出仓库">
+              <a-form-model-item label="调出仓库">
                 <warehouse
                   v-model="queryParam.warehouseSn"
                   id="allocateBillList-warehouseSn"
                   placeholder="请选择调出仓库"
                 />
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="打印状态">
+              <a-form-model-item label="打印状态">
                 <v-select
                   v-model="queryParam.printState"
                   ref="printState"
@@ -61,10 +68,10 @@
                   placeholder="请选择打印状态"
                   allowClear
                 ></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="对单状态">
+              <a-form-model-item label="对单状态">
                 <v-select
                   v-model="queryParam.checkStatus"
                   ref="checkStatus"
@@ -73,7 +80,7 @@
                   placeholder="请选择对单状态"
                   allowClear
                 ></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
@@ -85,7 +92,7 @@
             </a>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
 
     <a-spin :spinning="spinning" tip="Loading...">
@@ -167,12 +174,13 @@ export default {
       bizSn: null,
       tableHeight: 0,
       allocateTypeVal: [],
-      time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ],
+
       // 查询参数
       queryParam: { //  查询条件
+        time: [
+          moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+          moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        ],
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
@@ -186,6 +194,9 @@ export default {
         printState: undefined,
         warehouseSn: undefined
       },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+      },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -247,12 +258,17 @@ export default {
     }
   },
   methods: {
+    // 查询
     handleSearch () {
-      if (!this.queryParam.beginDate || !this.queryParam.endDate) {
-        this.$message.error('请选择创建时间')
-        return
-      }
-      this.$refs.table.refresh(true)
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择创建时间')
+          return false
+        }
+      })
     },
     // 调拨详情
     handleDetail (row, typeNum) {
@@ -266,8 +282,13 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     // 调拨类型
     changeAllocatype (val, opts) {
@@ -288,9 +309,13 @@ export default {
     },
     // 重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.targetName = ''
       this.queryParam.costTypeSn = undefined
       this.queryParam.allocateSortSn = undefined

+ 1 - 1
src/views/salesManagement/salesList/list.vue

@@ -106,7 +106,7 @@
           bordered>
           <!-- 超时环节提示 -->
           <template slot="tip" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.dispatchOverDay*1!=0&&record.sendOverDay*1!=0&&record.settleOverDay*1!=0">
+            <a-tooltip placement="top" v-if="record.dispatchOverDay*1!=0||record.sendOverDay*1!=0||record.settleOverDay*1!=0">
               <template slot="title">
                 <span>已超时{{ record.dispatchOverDay }}天(要求销售单下推后2天内备货)</span>
               </template>

+ 26 - 4
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -3,7 +3,14 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" style="padding:16px 24px;">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        </template>
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="primary"
+            class="button-info"
+            @click="handlePrint">导出Excel</a-button>
         </template>
       </a-page-header>
       <!-- 基础信息 -->
@@ -58,6 +65,8 @@
         </s-table>
       </a-card>
     </a-spin>
+    <!-- 导出excel -->
+    <print-modal :openModal="openModal" :itemData="detailData" @ok="handleOk" @close="closePrint" />
   </div>
 </template>
 
@@ -65,10 +74,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { queryPageForWarehouseDetail, queryCountForWarehouseDetail, salesDetailBySn } from '@/api/sales'
+import printModal from './printModal.vue'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect },
+  components: { STable, VSelect ,printModal},
   data () {
     return {
       disabled: false,
@@ -91,7 +101,9 @@ export default {
       },
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null
+      fromRouter: null,
+      openModal:false,
+      detailData:null
     }
   },
   computed: {
@@ -111,6 +123,16 @@ export default {
     }
   },
   methods: {
+    handlePrint(){
+      this.openModal = true
+    },
+    // 导出
+    handleOk(){
+      
+    },
+    closePrint () {
+      this.openModal = false
+    },
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesOrderWarehouseList' })
@@ -158,7 +180,7 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .salesDetail-wrap{
     .salesDetail-cont{
       margin-bottom: 10px;

+ 171 - 0
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -0,0 +1,171 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="sales-print-type-modal"
+    title="导出Excel"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="sales-print-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="销售单号">{{ itemData&&itemData.salesBillNo || '--' }}</a-form-model-item>
+        <a-form-model-item label="客户名称">{{ itemData&&itemData.buyerName || '--' }}</a-form-model-item>
+        <a-form-model-item label="是否缺货产品" prop="dataScope">
+          <a-radio-group v-model="form.dataScope">
+            <a-radio value="all">全部</a-radio>
+            <a-radio value="ENOUGH">有库存</a-radio>
+            <a-radio value="LESS">缺货</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="sbd.STACK_PLACE_CODE ASC">导出</a-radio>
+            <a-radio value="sbd.STACK_PLACE_CODE DESC">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <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>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { salesDetailProductType } from '@/api/sales'
+export default {
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        id: 'all',
+        dataScope: 'all',
+        orderBy: undefined
+      },
+      rules: {
+        dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      spinning: false
+    }
+  },
+  methods: {
+    // 确认
+    handleSave (isPrint) {
+      const _this = this
+      this.$refs.ruleForm.validate(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
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消导出
+    handleCancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.form = {
+          id: 'all',
+          dataScope: 'all',
+          priceType: undefined,
+          orderBy: undefined
+        }
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sales-print-type-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 1 - 1
src/views/salesManagement/sendOutOrder/list.vue

@@ -243,7 +243,7 @@ export default {
         { title: '收款时间', dataIndex: 'settleTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收货时间', dataIndex: 'receiveDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '物流情况', dataIndex: 'transportStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'transportRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'transportRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.isShowWarehouse) {