Explorar o código

销售单查询优化

lilei %!s(int64=2) %!d(string=hai) anos
pai
achega
57c14ccf36

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1670838549944
+  "version": 1672727976508
 }

+ 30 - 9
src/views/salesManagement/salesQuery/list.vue

@@ -7,11 +7,11 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate :allowClear="false" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate :allowClear="isByCustQuery" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}" :required="isByCustQuery">
                 <custList ref="custList" @change="custChange"></custList>
               </a-form-item>
             </a-col>
@@ -111,6 +111,13 @@
       <div class="table-operator">
         <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
         <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
+        <a-checkbox style="margin-left:10px;" v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox>
+        <a-popover placement="right">
+          <template slot="content">
+            使用此查询时,时间可清空,必须选择一个客户
+          </template>
+          <a-icon type="question-circle" />
+        </a-popover>
       </div>
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
@@ -242,6 +249,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
+      isByCustQuery: false, // 是否按客户查询
       time: [
         getDate.getMonthDays(12).starttime,
         getDate.getMonthDays(12).endtime
@@ -439,14 +447,22 @@ export default {
       })
     },
     searchForm () {
-      const a = moment(this.queryParam.beginDate)
-      const b = moment(this.queryParam.endDate)
-      console.log(b.diff(a, 'days'), 365 * 2)
-      if (b.diff(a, 'days') > 730) {
-        this.$message.info('最多只能选择2年的时间区间')
-        return false
+      if (!this.isByCustQuery) {
+        const a = moment(this.queryParam.beginDate)
+        const b = moment(this.queryParam.endDate)
+        if (b.diff(a, 'days') > 730) {
+          this.$message.info('最多只能选择2年的时间区间')
+          return false
+        }
+        this.$refs.table.refresh(true)
+      } else {
+        if (this.queryParam.buyerSn) {
+          this.$refs.table.refresh(true)
+        } else {
+          this.$message.info('请选择客户')
+          return false
+        }
       }
-      this.$refs.table.refresh(true)
     },
     // 重置
     resetSearchForm () {
@@ -556,6 +572,11 @@ export default {
     },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
+    },
+    isByCustQuery (newValue, oldValue) {
+      if (!newValue) {
+        this.resetSearchForm()
+      }
     }
   },
   activated () {

+ 3 - 3
src/views/salesManagement/salesQuery/queryPart.vue

@@ -59,15 +59,15 @@
               </a-form-model-item>
             </a-col>
           </template>
-          <a-col :lg="4" :md="6" :sm="12" style="margin-bottom: 10px;">
+          <a-col :lg="3" :md="8" :sm="12" style="margin-bottom: 10px;">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin:0 30px 0 10px">
+            <a @click="advanced=!advanced" style="margin:0 0 0 10px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
           </a-col>
-          <a-col :lg="4" :md="8" :sm="12" style="margin-top: 6px;">
+          <a-col :lg="5" :md="8" :sm="12" style="margin-top: 6px;">
             <a-checkbox v-model="cost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
             <a-checkbox v-model="cityPrice" id="salesQuery-cityPrice">市级价</a-checkbox>
             <a-checkbox v-model="tyuePrice" v-if="$store.state.user.isShowSpecialPrice==1" id="salesQuery-tyuePrice">特约价</a-checkbox>

+ 2 - 2
vue.config.js

@@ -211,8 +211,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.215:8503/qpls-md',
-        // target: 'http://p.iscm.360arrow.com/qpls-md',
+        // target: 'http://192.168.0.215:8503/qpls-md',
+        target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,