Browse Source

Merge branch 'develop_yh43' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh43

chenrui 11 months ago
parent
commit
7d778cad76
1 changed files with 134 additions and 114 deletions
  1. 134 114
      src/views/financialManagement/warehousingConfirmation/list.vue

+ 134 - 114
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -1,106 +1,121 @@
 <template>
   <div>
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="入库单号">
-              <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单据状态">
-              <v-select
-                v-model="queryParam.auditState"
-                ref="auditState"
-                id="warehousingConfirmationList-auditState"
-                code="PUT_CONFIRM_STATE"
-                placeholder="请选择单据状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-            <a-form-model-item label="仓库">
-              <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="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </a-card>
-  <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 列表 -->
-      <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
-        <span style="margin-left: 10px">
-          <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
-        </span>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库单号">
+                <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据状态">
+                <v-select
+                  v-model="queryParam.auditState"
+                  ref="auditState"
+                  id="warehousingConfirmationList-auditState"
+                  code="PUT_CONFIRM_STATE"
+                  placeholder="请选择单据状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务单号">
+                <a-input id="warehousingConfirmationList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入业务单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库类型">
+                <v-select
+                  v-model="queryParam.incomingType"
+                  id="warehousingConfirmationList-incomingType"
+                  code="PUT_CONFIRM_STATE"
+                  placeholder="请选择入库类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-model-item label="仓库">
+                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="isShowWarehouse?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign:isShowWarehouse?'left':'center'}">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+70+'px' }"
-        size="small"
-        :rowKey="(record) => record.stockPutSn"
-        rowKeyName="stockPutSn"
-        :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
-        @rowSelection="rowSelectionFun"
-        :columns="columns"
-        :data="loadData"
-        :pageSize="30"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 入库单号 -->
-        <template slot="stockPutNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_warehousingConfirmationDetail')" class="link-bule" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
-          <span v-else>{{ record.stockPutNo }}</span>
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            v-if="record.auditState=='WAIT' && $hasPermissions('B_warehousingConfirmationAlone')"
-            class="button-info"
-            @click="handleAudit(record)"
-            id="warehousingConfirmationList-audit-btn">入库确认</a-button>
-          <span v-else>--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 查看 -->
-    <confirmation-detail-modal v-drag :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
-    <!-- 入库确认 -->
-    <a-modal
-      centered
-      v-drag
-      class="confirmation-modal"
-      :footer="null"
-      :maskClosable="false"
-      v-model="confirmationModal"
-      @cancel="confirmationModal=false"
-      :width="416">
-      <div class="confirmation-main">
-        <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
-        <div class="confirmation-cont">
-          <p class="confirmation-tit">提示</p>
-          <p class="confirmation-txt">请点击下方按钮确认操作?</p>
+    </a-card>
+    <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 10px">
+          <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
+          <span style="margin-left: 10px">
+            <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
+          </span>
         </div>
-      </div>
-      <div class="btn-box">
-        <a-button type="primary" :loading="spinning" class="button-error" @click="handleConfirmationFail">不通过</a-button>
-        <a-button type="primary" :loading="spinning" class="button-info" @click="handleConfirmationOk">通过</a-button>
-      </div>
-    </a-modal>
-  </a-card>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.stockPutSn"
+          rowKeyName="stockPutSn"
+          :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="30"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 入库单号 -->
+          <template slot="stockPutNo" slot-scope="text, record">
+            <span :id="'warehousingConfirmationList-detail-'+record.stockPutNo" v-if="$hasPermissions('B_warehousingConfirmationDetail')" class="link-bule" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
+            <span v-else>{{ record.stockPutNo }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.auditState=='WAIT' && $hasPermissions('B_warehousingConfirmationAlone')"
+              class="button-info"
+              @click="handleAudit(record)"
+              :id="'warehousingConfirmationList-audit-btn-'+record.stockPutNo">入库确认</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 查看 -->
+      <confirmation-detail-modal v-drag :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
+      <!-- 入库确认 -->
+      <a-modal
+        centered
+        v-drag
+        class="confirmation-modal"
+        :footer="null"
+        :maskClosable="false"
+        v-model="confirmationModal"
+        @cancel="confirmationModal=false"
+        :width="416">
+        <div class="confirmation-main">
+          <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
+          <div class="confirmation-cont">
+            <p class="confirmation-tit">提示</p>
+            <p class="confirmation-txt">请点击下方按钮确认操作?</p>
+          </div>
+        </div>
+        <div class="btn-box">
+          <a-button id="confir-ruku-cancel" type="primary" :loading="spinning" class="button-error" @click="handleConfirmationFail">不通过</a-button>
+          <a-button id="confir-ruku-ok" type="primary" :loading="spinning" class="button-info" @click="handleConfirmationOk">通过</a-button>
+        </div>
+      </a-modal>
+    </a-card>
   </div>
 </template>
 
@@ -117,14 +132,14 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
       queryParam: { //  查询条件
         stockPutNo: '', //  入库单号
         auditState: undefined, //  状态
         warehouseSn: undefined // 仓库
       },
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -139,13 +154,13 @@ export default {
           return data
         })
       },
-      openModal: false,
-      itemSn: '',
-      nowData: null,
-      confirmationModal: false,
-      confirmationInfo: null,
-      isBatch: false,
-      rowSelectionInfo: null
+      openModal: false, // 详情弹框
+      itemSn: '', // 详情弹框单据sn
+      nowData: null, // 详情弹框当前操作数据
+      confirmationModal: false, // 入库确认弹框
+      confirmationInfo: null, // 确认入库得单据数据
+      isBatch: false, // 是否批量确认入库
+      rowSelectionInfo: null // 批量操作已选数据
     }
   },
   computed: {
@@ -154,20 +169,21 @@ export default {
       const arr = [
         { title: '入库时间', dataIndex: 'putTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: '12%', align: 'center' },
+        { title: '业务单号', dataIndex: 'stockPutNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户名称', dataIndex: 'providerName', align: 'left', width: '18%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '入库数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remark', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 是否显示仓库
       if (this.isShowWarehouse) {
         arr.splice(3, 0, { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       }
       if (this.$hasPermissions('M_warehousingConfirmationList_costPrice')) { // 成本价权限
-        arr.splice(this.isShowWarehouse?5:4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(this.isShowWarehouse ? 5 : 4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
 
       return arr
@@ -193,12 +209,13 @@ export default {
         this.openModal = true
       }
     },
+    // 关闭详情弹框
     closeModal () {
       this.itemSn = ''
       this.nowData = null
       this.openModal = false
     },
-    // 通过
+    // 入库确认通过
     handleConfirmationOk () {
       if (this.isBatch) { //  批量
         this.auditOrder(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys, true)
@@ -206,7 +223,7 @@ export default {
         this.auditOrder([this.confirmationInfo.stockPutSn], true)
       }
     },
-    // 不通过
+    // 入库确认不通过
     handleConfirmationFail () {
       if (this.isBatch) { //  批量
         this.auditOrder(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys, false)
@@ -214,12 +231,13 @@ export default {
         this.auditOrder([this.confirmationInfo.stockPutSn], false)
       }
     },
-    // 单个审核
+    // 打开入库确认
     handleAudit (row) {
       this.confirmationInfo = row
       this.isBatch = false
       this.confirmationModal = true
     },
+    // 入库确认接口调用
     auditOrder (snList, flag) {
       const _this = this
       if (this.isBatch) {
@@ -244,7 +262,7 @@ export default {
         }
       })
     },
-    // 批量审核
+    // 批量入库确认
     handleBatchAudit () {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
@@ -254,6 +272,7 @@ export default {
       this.isBatch = true
       this.confirmationModal = true
     },
+    // 页面初始
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -262,6 +281,7 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240