浏览代码

bug修复

chenrui 4 年之前
父节点
当前提交
c9fa0563e9

+ 2 - 2
src/api/stockPut.js

@@ -12,9 +12,9 @@ export const stockPutList = (params) => {
   })
 }
 //  入库 根据业务信息查询入库单
-export const stockPutOut = (params) => {
+export const stockPutBizInfo = (params) => {
   return axios({
-    url: '/stockPut/out',
+    url: '/stockPut/findByBizInfo',
     data: params,
     method: 'post'
   })

+ 1 - 1
src/config/router.config.js

@@ -1284,7 +1284,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'detail/:id',
+                path: 'detail/:sn/:type',
                 name: 'warehousingAuditDetail',
                 component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingAudit/detail.vue'),
                 meta: {

+ 1 - 1
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -11,7 +11,7 @@
           style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
           id="bulkWarehousingOrderDetail-edit-btn"
           @click.stop="handleEdit">编辑</a-button>
-        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p>
+        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '--' }}</p>
       </template>
       <template slot="tags">
         <a-tag color="red" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>

+ 24 - 8
src/views/financialManagement/warehousingAudit/detail.vue

@@ -1,9 +1,10 @@
 <template>
   <div class="warehousingAuditDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" >
+    <a-page-header :ghost="false" :backIcon="false" class="warehousingAuditDetail-cont" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="warehousingAuditDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="warehousingAuditDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '--' }}</p>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
@@ -11,8 +12,6 @@
         <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn">快速打印</a-button>
       </template>
     </a-page-header>
-    <!-- 内容 -->
-    <a-page-header title="单号:CG2021010100001" ></a-page-header>
     <!-- 基础信息 -->
     <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
       <a-collapse :activeKey="['1']">
@@ -26,9 +25,9 @@
             <a-descriptions-item label="采购总款数">2</a-descriptions-item>
             <a-descriptions-item label="采购总数量">20</a-descriptions-item>
             <a-descriptions-item label="采购总成本">¥120.36</a-descriptions-item>
-            <a-descriptions-item label="入库总款数">3</a-descriptions-item>
-            <a-descriptions-item label="入库总数量">4</a-descriptions-item>
-            <a-descriptions-item label="入库总成本">¥11.2</a-descriptions-item>
+            <a-descriptions-item label="入库总款数">{{ (bizInfo&&bizInfo.productTotalCategory!=0) ? bizInfo.productTotalCategory : 0 }}</a-descriptions-item>
+            <a-descriptions-item label="入库总数量">{{ (bizInfo&&bizInfo.productTotalQty!=0) ? bizInfo.productTotalQty : 0 }}</a-descriptions-item>
+            <a-descriptions-item label="入库总成本">¥{{ (bizInfo&&bizInfo.productTotalCost!=0) ? bizInfo.productTotalCost : 0 }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
@@ -57,6 +56,7 @@
 <script>
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { STable, VSelect } from '@/components'
+import { stockPutBizInfo } from '@/api/stockPut'
 export default {
   components: { STable, VSelect },
   data () {
@@ -116,14 +116,30 @@ export default {
           _this.disabled = false
           resolve(data)
         })
-      }
+      },
+      basicInfoData: null, //  基本信息
+      bizInfo: null
     }
   },
   methods: {
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/financialManagement/warehousingAudit/list' })
+    },
+    getBizInfoDetail () {
+      stockPutBizInfo({ putBizSn: this.$route.params.sn, putBizType: this.$route.params.type }).then(res => {
+        if (res.status == 200) {
+          this.bizInfo = res.data
+        } else {
+          this.bizInfo = null
+        }
+      })
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getBizInfoDetail()
+    })
   }
 }
 </script>

+ 33 - 38
src/views/financialManagement/warehousingAudit/list.vue

@@ -6,12 +6,12 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="采购单号">
-              <a-input id="warehousingAuditList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入采购单号"/>
+              <a-input id="warehousingAuditList-putBizNo" v-model.trim="queryParam.putBizNo" allowClear placeholder="请输入采购单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="采购入库单号">
-              <a-input id="warehousingAuditList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入采购入库单号"/>
+              <a-input id="warehousingAuditList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入采购入库单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -20,7 +20,7 @@
                 style="width:100%"
                 id="warehousingAuditList-creatDate"
                 :disabledDate="disabledDate"
-                v-model="createDate"
+                v-model="auditTime"
                 :format="dateFormat"
                 :placeholder="['开始时间', '结束时间']" />
             </a-form-item>
@@ -29,9 +29,9 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="财务审核状态">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="warehousingAuditList-billStatus"
+                  v-model="queryParam.auditState"
+                  ref="auditState"
+                  id="warehousingAuditList-auditState"
                   code="PAYMENT_TYPE"
                   placeholder="请选择财务审核状态"
                   allowClear></v-select>
@@ -63,21 +63,17 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1460 }"
+      :scroll="{ x: 1420, y: tableHeight }"
       bordered>
-      <!-- 采购单号 -->
-      <template slot="purchaseBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseBillNo }}</span>
-      </template>
       <!-- 采购入库单号 -->
-      <template slot="purchaseNos" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
+      <template slot="stockPutNo" slot-scope="text, record">
+        <span v-if="record.stockPutNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
+        <span v-else>--</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="link" class="button-info" @click="handleExamine(record, 1)" id="warehousingAudit-adopt-btn">通过</a-button>
         <a-button size="small" type="link" class="button-warning" @click="handleExamine(record, 2)" id="warehousingAudit-unadopt-btn">不通过</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="warehousingAudit-detail-btn">详情</a-button>
       </template>
     </s-table>
   </a-card>
@@ -94,37 +90,41 @@ export default {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      createDate: [
+      auditTime: [
         moment(getDate.getLastThreeMonthDays().starttime, this.dateFormat),
         moment(getDate.getLastThreeMonthDays().endtime, this.dateFormat)
-      ], //  创建时间
+      ], //  入库时间
       dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        putBizNo: '',
+        stockPutNo: '',
+        auditState: undefined
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '采购单号', dataIndex: 'putBizNo', align: 'center' },
-        { title: '采购入库单号', scopedSlots: { customRender: 'purchaseNos' }, width: 220, align: 'center' },
+        { title: '采购单号', dataIndex: 'putBizNo', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: 220, align: 'center' },
         { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库总数量', dataIndex: 'productTotalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库总成本', dataIndex: 'productTotalCost', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 180, align: 'center', fixed: 'right' }
+        { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 440
+          this.tableHeight = window.innerHeight - 370
         }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        // 入库时间
+        if (this.auditTime && this.auditTime.length > 0) {
+          this.queryParam.beginDate = moment(this.auditTime[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.auditTime[1]).format(this.dateFormat)
         } else {
           this.queryParam.beginDate = undefined
           this.queryParam.endDate = undefined
@@ -148,20 +148,17 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.id}` })
+      this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.putBizSn}/${row.putBizType}` })
     },
     //  审核
     handleExamine (row, type) {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
+        content: '确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
+          // delectRolePower({ id: row.id }).then(res => {
           //   if (res.status == 200) {
           //     _this.$message.success(res.message)
           //     _this.$refs.table.refresh()
@@ -172,12 +169,10 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.putBizNo = ''
+      this.queryParam.stockPutNo = ''
+      this.queryParam.auditState = undefined
+      this.auditTime = []
       this.$refs.table.refresh(true)
     }
   }

+ 23 - 4
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -81,13 +81,17 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="inventoryWarningList-update" type="primary" @click="handleupdate">批量更新</a-button>
+      <a-button type="primary" id="inventoryWarningList-update" :disabled="!hasSelected" :loading="loading" @click="handleupdate">批量更新</a-button>
+      <span style="margin-left: 8px">
+        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+      </span>
     </div>
     <!-- 列表 -->
     <a-table
       class="sTable"
       ref="table"
       size="default"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
       :rowKey="(record) => record.id"
       :columns="columns"
       :dataSource="loadData"
@@ -142,7 +146,7 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button type="primary" class="button-primary" @click="handleSave(record)" id="inventoryWarningList-add-btn">保存</a-button>
+        <a-button type="primary" size="small" class="button-info" @click="handleSave(record)" id="inventoryWarningList-add-btn">保存</a-button>
       </template>
     </a-table>
   </a-card>
@@ -200,7 +204,15 @@ export default {
         current: 1,
         onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
         onChange: (current) => this.changePage(current)
-      }
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+      loading: false
+    }
+  },
+  computed: {
+    hasSelected () {
+      return this.selectedRowKeys.length > 0
     }
   },
   methods: {
@@ -246,7 +258,7 @@ export default {
       const params = []
       if (isBatch) { //  批量更新
         let dataInd = -1
-        this.loadData.map((item, index) => {
+        this.selectedRows.map((item, index) => {
           if ((!item.inTransit && item.inTransit != 0) || (!item.upperLimit && item.upperLimit != 0) || (!item.lowerLimit && item.lowerLimit != 0)) {
             dataInd = item.no
           }
@@ -285,9 +297,16 @@ export default {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.pageInit()
+          this.selectedRowKeys = []
+          this.selectedRows = []
         }
       })
     },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      console.log('selectedRowKeys changed: ', selectedRowKeys, selectedRows)
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.productCode = ''