소스 검색

修改bug

chenrui 2 년 전
부모
커밋
fa377fb06b
1개의 변경된 파일24개의 추가작업 그리고 22개의 파일을 삭제
  1. 24 22
      src/views/salesManagement/salesOrderWarehouse/list.vue

+ 24 - 22
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -38,11 +38,11 @@
             </a-col>
             <a-col :md="6" :sm="24" v-show="isShowWarehouse">
               <a-form-model-item label="出库仓库">
-                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="setSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
@@ -109,7 +109,7 @@ export default {
       spinning: false,
       tableHeight: 0,
       time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
       queryParam: { //  查询条件
@@ -121,16 +121,6 @@ export default {
         shippingAddrProvinceSn: undefined,
         warehouseSn: undefined
       },
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'stockOutNo' }, width: '10%', align: 'center' },
-        { title: '提交时间', dataIndex: 'submitDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       exportLoading: false,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false,
@@ -158,15 +148,27 @@ export default {
       }
     }
   },
-  methods: {
-    //  查询
-    setSearch  () {
-      if (!this.queryParam.beginDate && !this.queryParam.endDate) {
-        this.$message.error('请先选择创建时间!')
-        return
-      }
-      this.$refs.table.refresh(true)
+  computed: {
+    isShowWarehouse () {
+      return this.$store.state.app.isWarehouse
     },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'stockOutNo' }, width: '10%', align: 'center' },
+        { title: '提交时间', dataIndex: 'submitDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+	  if (this.isShowWarehouse) {
+	    arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+	  }
+      return arr
+    }
+  },
+  methods: {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -200,7 +202,7 @@ export default {
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.$refs.dealerSubareaScopeList.resetForm()
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.buyerSn = ''
       this.queryParam.billStatus = undefined