Bläddra i källkod

销售单查询仓库管理

chenrui 1 år sedan
förälder
incheckning
d0277443eb
1 ändrade filer med 196 tillägg och 187 borttagningar
  1. 196 187
      src/views/salesManagement/salesQueryNew/list.vue

+ 196 - 187
src/views/salesManagement/salesQueryNew/list.vue

@@ -1,8 +1,8 @@
 <template>
- <div>
-  <a-card size="small" :bordered="false" class="salesManagementList-wrap">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper" style="margin: 0;">
+  <div>
+    <a-card size="small" :bordered="false" class="salesManagementList-wrap">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper" style="margin: 0;">
         <a-form layout="inline">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -21,10 +21,10 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-                <a-form-item label="采购单号">
-                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
-                </a-form-item>
-              </a-col>
+              <a-form-item label="采购单号">
+                <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+              </a-form-item>
+            </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="备货打印状态">
@@ -97,32 +97,32 @@
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align: center;">
-                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-                <a-button
-                  style="margin-left: 10px"
-                  type="primary"
-                  class="button-warning"
-                  @click="handleExport"
-                  :disabled="disabled"
-                  :loading="exportLoading"
-                  v-if="$hasPermissions('B_sales_export')"
-                >导出</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
-                  {{ advanced ? '收起' : '展开' }}
-                  <a-icon :type="advanced ? 'up' : 'down'"/>
-                </a>
+              <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+              <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_sales_export')"
+              >导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
           </a-row>
         </a-form>
       </div>
-  </a-card>
-  <a-card size="small" :bordered="false" class="salesManagementList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 操作按钮 -->
-      <div class="table-operator" style="display: flex;justify-content: space-between;align-items: center;">
-        <div style="padding-right: 15px;"><a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesAdd')" @click="handleAdd">新增</a-button></div>
-        <div style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
+    </a-card>
+    <a-card size="small" :bordered="false" class="salesManagementList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator" style="display: flex;justify-content: space-between;align-items: center;">
+          <div style="padding-right: 15px;"><a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesAdd')" @click="handleAdd">新增</a-button></div>
+          <div style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
             <div>
               <div>
                 总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
@@ -145,140 +145,140 @@
               <a-checkbox v-model="showCancelNum"><span style="display: inline-block;margin-top: 1px;">显示取消数量</span></a-checkbox>
             </div>
           </div>
-      </div>
-      
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+75+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 销售单号 -->
-        <template slot="salesBillNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-          <span v-else>{{ record.salesBillNo }}</span>
-          <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'80%' }" v-if="record.changeTimes>0"></a-badge>
-          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        </template>
-        <!-- 出库仓库 -->
-        <template slot="warehouseBox" slot-scope="text, record">
-          <a-tooltip placement="right" v-if="record.warehouseNameSet && record.warehouseNameSet.length>0">
-            <template slot="title">
-              <span>{{ record.warehouseNameSet.toString() }}</span>
-            </template>
-            <div class="warehouse_box">
-              <span>{{ record.warehouseNameSet.toString() }}</span>
+        </div>
+
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+75+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 销售单号 -->
+          <template slot="salesBillNo" slot-scope="text, record">
+            <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            <span v-else>{{ record.salesBillNo }}</span>
+            <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'80%' }" v-if="record.changeTimes>0"></a-badge>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          </template>
+          <!-- 出库仓库 -->
+          <template slot="warehouseBox" slot-scope="text, record">
+            <a-tooltip placement="right" v-if="record.newWarehouseNameSet && record.newWarehouseNameSet.length>0">
+              <template slot="title">
+                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+              </template>
+              <div class="warehouse_box">
+                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+              </div>
+            </a-tooltip>
+            <div v-else>--</div>
+          </template>
+          <!-- 总数量 -->
+          <template slot="totalQty" slot-scope="text, record">
+            {{ record.totalQty }}
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+                @click="handleDetailAudit(record)"
+              >审核</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
+                @click="handleDispatch(record)"
+              >下推</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesEdit')"
+                @click="handleEdit(record)"
+              >
+                编辑
+              </a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesEdit')"
+                @click="handleEdit(record)"
+              >
+                改单
+              </a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesDel')"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesDel')"
+                @click="handleDel(record)"
+              >
+                取消
+              </a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="record.printStatus=='UNABLE_PRINT'&&$hasPermissions('B_Sales_UNABLE_PRINT')"
+                @click="handlePrint(record)"
+              >允许备货打印</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="record.billStatus=='FINISH' && record.expenseClainFlag == 'N'"
+                @click="handleExpense(record)"
+              >转费用报销单</a-button>
             </div>
-          </a-tooltip>
-          <div v-else>--</div>
-        </template>
-        <!-- 总数量 -->
-        <template slot="totalQty" slot-scope="text, record">
-          {{ record.totalQty }}
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <div>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
-              @click="handleDetailAudit(record)"
-            >审核</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              v-if="record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
-              @click="handleDispatch(record)"
-            >下推</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-info"
-              v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesEdit')"
-              @click="handleEdit(record)"
-            >
-              编辑
-            </a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-info"
-              v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesEdit')"
-              @click="handleEdit(record)"
-            >
-              改单
-            </a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-error"
-              v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesDel')"
-              @click="handleDel(record)"
-            >
-              删除
-            </a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-error"
-              v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesDel')"
-              @click="handleDel(record)"
-            >
-              取消
-            </a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              v-if="record.printStatus=='UNABLE_PRINT'&&$hasPermissions('B_Sales_UNABLE_PRINT')"
-              @click="handlePrint(record)"
-            >允许备货打印</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              v-if="record.billStatus=='FINISH' && record.expenseClainFlag == 'N'"
-              @click="handleExpense(record)"
-            >转费用报销单</a-button>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 选择客户弹框 -->
+      <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
+      <!-- 操作提示 -->
+      <commonModal modalTit="操作提示" :width="this.tipData&&this.tipData.length == 1?'500px':'800px'" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
+        <div style="text-align: center;" v-if="this.tipData&&this.tipData.length">
+          <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认允许此单进行备货打印吗?</strong></div>
+          <div style="line-height: 24px;" v-if="this.tipData.length == 1">
+            <div>备货单号:{{ tipData[0]&&tipData[0].dispatchBillNo }}</div>
+            <div>客户名称:{{ tipData[0]&&tipData[0].buyerName }}</div>
+          </div>
+          <div v-else>
+            <a-table
+              :row-selection="{ selectedRowKeys: selectedRowKeys,onChange: onSelectChange, getCheckboxProps: record => ({ props: { disabled: record.printStatus!=='UNABLE_PRINT' }})}"
+              :columns="bhColumns"
+              :data-source="tipData"
+              :pagination="false"
+            />
           </div>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 选择客户弹框 -->
-    <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
-    <!-- 操作提示 -->
-    <commonModal modalTit="操作提示" :width="this.tipData&&this.tipData.length == 1?'500px':'800px'" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
-      <div style="text-align: center;" v-if="this.tipData&&this.tipData.length">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认允许此单进行备货打印吗?</strong></div>
-        <div style="line-height: 24px;" v-if="this.tipData.length == 1">
-          <div>备货单号:{{ tipData[0]&&tipData[0].dispatchBillNo }}</div>
-          <div>客户名称:{{ tipData[0]&&tipData[0].buyerName }}</div>
-        </div>
-        <div v-else>
-          <a-table
-            :row-selection="{ selectedRowKeys: selectedRowKeys,onChange: onSelectChange, getCheckboxProps: record => ({ props: { disabled: record.printStatus!=='UNABLE_PRINT' }})}"
-            :columns="bhColumns"
-            :data-source="tipData"
-            :pagination="false"
-          />
         </div>
-      </div>
-    </commonModal>
-    <!-- 新增费用单 -->
-    <baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-  </a-card>
- </div>
+      </commonModal>
+      <!-- 新增费用单 -->
+      <baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -294,7 +294,7 @@ import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { salesList, salesDel,salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
+import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
 import { hdExportExcel } from '@/libs/exportExcel'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
@@ -367,9 +367,18 @@ export default {
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
+            data.list.forEach((con, i) => {
+              con.no = no + i + 1
+              const newWarehouseName = []
+              if (con.warehouseNameSet) {
+                con.warehouseNameSet.forEach(item => {
+                  if (item) {
+                    newWarehouseName.push(item)
+                  }
+                })
+                con.newWarehouseNameSet = newWarehouseName
+              }
+            })
             this.disabled = false
           }
           this.spinning = false
@@ -417,7 +426,7 @@ export default {
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
-      
+
       if (this.$hasPermissions('M_salesQueryList_salesPrice')) { // 售价权限
         arr.splice(6, 0, { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(8, 0, { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -504,16 +513,16 @@ export default {
       })
     },
     // 转费用单
-    async handleExpense(row){
+    async handleExpense (row) {
       const _this = this
-      const hasExpense = await queryCreateBySalesBillSn({salesBillSn: row.salesBillSn}).then(res => res.data||[])
+      const hasExpense = await queryCreateBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => res.data || [])
       console.log(hasExpense)
       // 有2个以上采购额时
-      if(hasExpense && hasExpense.exceed && hasExpense.balance){
+      if (hasExpense && hasExpense.exceed && hasExpense.balance) {
         _this.$confirm({
           title: '转费用报销单?',
           centered: true,
-          class:'confirm-center',
+          class: 'confirm-center',
           content: <div>
             <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
             <div style="padding:0 0 10px 0;text-align:center;">
@@ -527,35 +536,35 @@ export default {
               </aRadioGroup>
             </div>
           </div>,
-          onOk() {
-            if(_this.expenseOption){
-              _this.expenseSave(hasExpense,_this.expenseOption)
-            }else{
-              _this.$message.info("请选择费用报销单类型!")
+          onOk () {
+            if (_this.expenseOption) {
+              _this.expenseSave(hasExpense, _this.expenseOption)
+            } else {
+              _this.$message.info('请选择费用报销单类型!')
               return true
             }
           },
-          onCancel() {
+          onCancel () {
             _this.expenseOption = null
-          },
-        });
-      }else{
+          }
+        })
+      } else {
         // 直接转费用单
-        _this.expenseSave(hasExpense,null)
+        _this.expenseSave(hasExpense, null)
       }
     },
     // 转费用单
-    expenseSave(data, type){
-      console.log(data,type)
-      const params = type ? data[type] : (data.balance||data.exceed)
-      if(params){
+    expenseSave (data, type) {
+      console.log(data, type)
+      const params = type ? data[type] : (data.balance || data.exceed)
+      if (params) {
         this.openBaseModal = true
         this.$refs.expenseModal.setDetail(params, 'sales')
       }
     },
-    expenseSaveOk(params){
+    expenseSaveOk (params) {
       expenseAccountSave(params).then(res => {
-        if(res.status == 200){
+        if (res.status == 200) {
           this.$message.info(res.message)
           this.$refs.table.refresh()
           this.openBaseModal = false
@@ -564,7 +573,7 @@ export default {
         }
       })
     },
-    changeDaOpt(e){
+    changeDaOpt (e) {
       this.expenseOption = e.target.value
     },
     // 允许备货打印