Browse Source

散件入库加单条审核功能

chenrui 3 years ago
parent
commit
cbf805a177
1 changed files with 32 additions and 12 deletions
  1. 32 12
      src/views/purchasingManagement/bulkWarehousingOrder/list.vue

+ 32 - 12
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -28,7 +28,7 @@
       <div class="table-operator">
       <div class="table-operator">
         <a-button v-if="$hasPermissions('B_sparePartsNew')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
         <a-button v-if="$hasPermissions('B_sparePartsNew')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
         <a-button
         <a-button
-          v-if="$hasPermissions('B_sparePartsAudit')"
+          v-if="$hasPermissions('B_sparePartsBatchAudit')"
           id="bulkWarehousingOrderList-batchAudit"
           id="bulkWarehousingOrderList-batchAudit"
           type="primary"
           type="primary"
           class="button-warning"
           class="button-warning"
@@ -49,7 +49,7 @@
         :rowKey="(record) => record.sparePartsSn"
         :rowKey="(record) => record.sparePartsSn"
         :columns="columns"
         :columns="columns"
         :data="loadData"
         :data="loadData"
-        :scroll="{ x: 1350, y: tableHeight }"
+        :scroll="{ x: 1390, y: tableHeight }"
         :defaultLoadData="false"
         :defaultLoadData="false"
         bordered>
         bordered>
         <!-- 入库单号 -->
         <!-- 入库单号 -->
@@ -58,6 +58,13 @@
         </template>
         </template>
         <!-- 操作 -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_sparePartsAudit')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="allocateBillList-examine-btn">审核</a-button>
           <a-button
           <a-button
             size="small"
             size="small"
             type="link"
             type="link"
@@ -72,7 +79,7 @@
             @click="handleDel(record)"
             @click="handleDel(record)"
             class="button-error"
             class="button-error"
             id="bulkWarehousingOrderList-del-btn">删除</a-button>
             id="bulkWarehousingOrderList-del-btn">删除</a-button>
-          <span v-if="record.state != 'WAIT_AUDIT'||(!$hasPermissions('B_sparePartsEdit') && !$hasPermissions('B_sparePartsDel'))">--</span>
+          <span v-if="!(record.state == 'WAIT_AUDIT'&&($hasPermissions('B_sparePartsEdit') || $hasPermissions('B_sparePartsDel') || $hasPermissions('B_sparePartsAudit')))">--</span>
         </template>
         </template>
       </s-table>
       </s-table>
     </a-spin>
     </a-spin>
@@ -112,7 +119,7 @@ export default {
         { title: '金蝶单号', dataIndex: 'kingdeeNo', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '金蝶单号', dataIndex: 'kingdeeNo', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'stateDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'stateDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remark', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '备注', dataIndex: 'remark', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
       ],
       ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
       selectedRows: [],
@@ -141,7 +148,7 @@ export default {
       return this.selectedRowKeys.length > 0
       return this.selectedRowKeys.length > 0
     },
     },
     rowSelection () {
     rowSelection () {
-      if (this.$hasPermissions('B_sparePartsAudit')) {
+      if (this.$hasPermissions('B_sparePartsBatchAudit')) {
         return {
         return {
           selectedRowKeys: this.selectedRowKeys,
           selectedRowKeys: this.selectedRowKeys,
           onChange: (selectedRowKeys, selectedRows) => {
           onChange: (selectedRowKeys, selectedRows) => {
@@ -244,20 +251,25 @@ export default {
       this.queryParam.relationNo = ''
       this.queryParam.relationNo = ''
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
-    // 批量审核
-    handleBatchAudit () {
+    //  单条审核
+    handleAudit (row, isBatch) {
       const _this = this
       const _this = this
-      if (_this.selectedRowKeys.length < 1) {
-        _this.$message.warning('请在列表勾选后再进行批量操作!')
-        return
+      let content = ''
+      let params = []
+      if (isBatch) { //  批量
+        content = '确认要批量审核吗?'
+        params = row
+      } else { //  单条
+        content = '确认要审核通过吗?'
+        params = [row.sparePartsSn]
       }
       }
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
-        content: '确认要批量审核吗?',
+        content: content,
         centered: true,
         centered: true,
         onOk () {
         onOk () {
           _this.spinning = true
           _this.spinning = true
-          sparePartsAudit(_this.selectedRowKeys).then(res => {
+          sparePartsAudit(params).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.selectedRowKeys = []
               _this.selectedRowKeys = []
               _this.selectedRows = []
               _this.selectedRows = []
@@ -271,6 +283,14 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 批量审核
+    handleBatchAudit () {
+      if (this.selectedRowKeys.length < 1) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      this.handleAudit(this.selectedRowKeys, 'batch')
+    },
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调