|
@@ -1,23 +1,38 @@
|
|
|
<!-- 采购列表 -->
|
|
|
<template>
|
|
|
<div class="purchase">
|
|
|
- <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible && !inboundVisible && !noticeChangeAttachVisible && !amountMaskSettingVisible">
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ !addOrUpdateVisible &&
|
|
|
+ !detailVisible &&
|
|
|
+ !operateVisible &&
|
|
|
+ !inboundVisible &&
|
|
|
+ !noticeChangeAttachVisible &&
|
|
|
+ !amountMaskSettingVisible
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
|
|
|
<el-form-item label="类别">
|
|
|
<el-select
|
|
|
v-model="dataForm.purchaseType"
|
|
|
remote
|
|
|
- placeholder="请选择">
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in optionsType"
|
|
|
:key="item.code"
|
|
|
:label="item.value"
|
|
|
- :value="item.code">
|
|
|
+ :value="item.code"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="物品名称">
|
|
|
- <el-input v-model="dataForm.materialName" placeholder="物品名称" clearable/>
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.materialName"
|
|
|
+ placeholder="物品名称"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="申请时间">
|
|
|
<el-date-picker
|
|
@@ -26,29 +41,59 @@
|
|
|
type="datetimerange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期">
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
<el-select
|
|
|
v-model="dataForm.purchaseState"
|
|
|
remote
|
|
|
- placeholder="请选择">
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in optionsState"
|
|
|
:key="item.code"
|
|
|
:label="item.value"
|
|
|
- :value="item.code">
|
|
|
+ :value="item.code"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="search()">查询</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:save')" type="primary" @click="addOrUpdateHandle(0)">新建采购申请</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">工作提示通知设置</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:priceConfig')" type="primary" @click="setAmountMaskHandel()">采购金额屏蔽设置</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:updatePurchaseDetail')" type="primary" @click="batchBuyHandel()" :disabled="batchBuyBtnDisabled">批量采购</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:infoPutIn')" type="primary" @click="batchIncomeHandel()" :disabled="batchIncomeBtnDisabled">批量入库</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:save')"
|
|
|
+ type="primary"
|
|
|
+ @click="addOrUpdateHandle(0)"
|
|
|
+ >新建采购申请</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:noteChangeConfig')"
|
|
|
+ type="primary"
|
|
|
+ @click="setNoticeChangeHandel()"
|
|
|
+ >工作提示通知设置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:priceConfig')"
|
|
|
+ type="primary"
|
|
|
+ @click="setAmountMaskHandel()"
|
|
|
+ >采购金额屏蔽设置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:updatePurchaseDetail')"
|
|
|
+ type="primary"
|
|
|
+ @click="batchBuyHandel()"
|
|
|
+ :disabled="batchBuyBtnDisabled"
|
|
|
+ >批量采购</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:infoPutIn')"
|
|
|
+ type="primary"
|
|
|
+ @click="batchIncomeHandel()"
|
|
|
+ :disabled="batchIncomeBtnDisabled"
|
|
|
+ >批量入库</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table
|
|
@@ -56,16 +101,10 @@
|
|
|
:data="dataList"
|
|
|
border
|
|
|
v-loading="dataListLoading"
|
|
|
- style="width: 100%;">
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="序号"
|
|
|
- type="index"
|
|
|
- width="50"
|
|
|
- align="center">
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="procurementCode"
|
|
@@ -73,7 +112,17 @@
|
|
|
align="center"
|
|
|
min-width="180"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="采购编码">
|
|
|
+ label="采购编码"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="orderName"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="160"
|
|
|
+ :show-tooltip-when-overflow="true"
|
|
|
+ label="任务单"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="materialName"
|
|
@@ -81,14 +130,16 @@
|
|
|
align="center"
|
|
|
width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="物品名称">
|
|
|
+ label="物品名称"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="purchaseType"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
:formatter="formatType"
|
|
|
- label="采购类别">
|
|
|
+ label="采购类别"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="specification"
|
|
@@ -96,19 +147,22 @@
|
|
|
align="center"
|
|
|
width="120"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="型号及规格">
|
|
|
+ label="型号及规格"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="cnt"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- label="数量">
|
|
|
+ label="数量"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="qualifiedCnt"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- label="合格数量">
|
|
|
+ label="合格数量"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="unitName"
|
|
@@ -116,7 +170,8 @@
|
|
|
align="center"
|
|
|
min-width="100"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="单位">
|
|
|
+ label="单位"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="deadline"
|
|
@@ -124,7 +179,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="采购期限">
|
|
|
+ label="采购期限"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="arrivedTime"
|
|
@@ -132,7 +188,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="到料时间">
|
|
|
+ label="到料时间"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="batchNumber"
|
|
@@ -140,7 +197,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="批次号">
|
|
|
+ label="批次号"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="purpose"
|
|
@@ -148,7 +206,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="用途">
|
|
|
+ label="用途"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="procurementBasis"
|
|
@@ -156,9 +215,16 @@
|
|
|
align="center"
|
|
|
min-width="120"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="采购依据">
|
|
|
+ label="采购依据"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{scope.row.procurementBasis?(Number(scope.row.procurementBasis) === 1?'合同采购':'计划采购'):''}}</span>
|
|
|
+ <span>{{
|
|
|
+ scope.row.procurementBasis
|
|
|
+ ? Number(scope.row.procurementBasis) === 1
|
|
|
+ ? "合同采购"
|
|
|
+ : "计划采购"
|
|
|
+ : ""
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -167,7 +233,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="供应商">
|
|
|
+ label="供应商"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="applyTime"
|
|
@@ -175,7 +242,8 @@
|
|
|
align="center"
|
|
|
min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="申请时间">
|
|
|
+ label="申请时间"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="applier"
|
|
@@ -183,7 +251,8 @@
|
|
|
align="center"
|
|
|
min-width="100"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="申请人">
|
|
|
+ label="申请人"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="orgName"
|
|
@@ -191,7 +260,8 @@
|
|
|
align="center"
|
|
|
min-width="120"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="申请部门">
|
|
|
+ label="申请部门"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
@@ -199,7 +269,8 @@
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
:formatter="formatState"
|
|
|
- label="审批状态">
|
|
|
+ label="审批状态"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
@@ -207,7 +278,8 @@
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
:formatter="formatPurchaseState"
|
|
|
- label="采购状态">
|
|
|
+ label="采购状态"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="notes"
|
|
@@ -215,23 +287,94 @@
|
|
|
align="center"
|
|
|
min-width="180"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- label="备注">
|
|
|
+ label="备注"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
width="150"
|
|
|
- label="操作">
|
|
|
+ label="操作"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="isAuth('purchase:detail:info')" type="text" size="small" @click="detailHandle(scope.row.procurementId)">查看</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) === 0) && scope.row.creatorId === userId.toString()" type="text" size="small" @click="addOrUpdateHandle(scope.row.procurementId)">编辑</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:updatePurchaseDetail')&& (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 1)" type="text" size="small" @click="operateHandle(scope.row)">采购</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:infoPutIn') && (Number(scope.row.approvalState) === 3 && (Number(scope.row.purchaseState) === 2 || Number(scope.row.purchaseState) === 5))" type="text" size="small" @click="inboundHandle(scope.row)">入库</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inboundHandle(scope.row.procurementId)">再次入库</el-button>
|
|
|
- <el-button type="text" size="small" @click="exportHandle(scope.row.procurementId)">导出</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) === 1)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">撤回</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) === 0)" type="text" size="small" @click="deleteHandle(scope.row.procurementId)">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('purchase:detail:info')"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="detailHandle(scope.row.procurementId)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:update') &&
|
|
|
+ Number(scope.row.approvalState) === 0 &&
|
|
|
+ scope.row.creatorId === userId.toString()
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="addOrUpdateHandle(scope.row.procurementId)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:updatePurchaseDetail') &&
|
|
|
+ Number(scope.row.approvalState) === 3 &&
|
|
|
+ Number(scope.row.purchaseState) === 1
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="operateHandle(scope.row)"
|
|
|
+ >采购</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:infoPutIn') &&
|
|
|
+ Number(scope.row.approvalState) === 3 &&
|
|
|
+ (Number(scope.row.purchaseState) === 2 ||
|
|
|
+ Number(scope.row.purchaseState) === 5)
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="inboundHandle(scope.row)"
|
|
|
+ >入库</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:infoPutInAgain') &&
|
|
|
+ Number(scope.row.purchaseState) === 5
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="inboundHandle(scope.row.procurementId)"
|
|
|
+ >再次入库</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="exportHandle(scope.row.procurementId)"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:update') &&
|
|
|
+ Number(scope.row.approvalState) === 1
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="revokeHandle(scope.row.procurementId)"
|
|
|
+ >撤回</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ isAuth('purchase:detail:update') &&
|
|
|
+ Number(scope.row.approvalState) === 0
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="deleteHandle(scope.row.procurementId)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -242,136 +385,173 @@
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
|
:page-size="pageSize"
|
|
|
:total="totalPage"
|
|
|
- layout="total, sizes, prev, pager, next, jumper">
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ >
|
|
|
</el-pagination>
|
|
|
</template>
|
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
|
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :options-type="optionsType" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
|
|
|
- <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
|
|
|
+ <add-or-update
|
|
|
+ v-if="addOrUpdateVisible"
|
|
|
+ ref="addOrUpdate"
|
|
|
+ :options-type="optionsType"
|
|
|
+ @refreshDataList="getDataList"
|
|
|
+ @onChose="onChose"
|
|
|
+ ></add-or-update>
|
|
|
+ <detail v-if="detailVisible" ref="detail" @onChose="onChose" />
|
|
|
<!-- 采购操作 -->
|
|
|
- <operate v-if="operateVisible" ref="operate" @onChose="onChose" @refreshDataList="getDataList"/>
|
|
|
+ <operate
|
|
|
+ v-if="operateVisible"
|
|
|
+ ref="operate"
|
|
|
+ @onChose="onChose"
|
|
|
+ @refreshDataList="getDataList"
|
|
|
+ />
|
|
|
<!-- 入库 -->
|
|
|
- <inbound v-if="inboundVisible" ref="inbound" @onChose="onChose" @refreshDataList="getDataList"/>
|
|
|
- <notice-change-setting v-if="noticeChangeAttachVisible" ref="noticeChangeSetting" @onChose="onChose"/>
|
|
|
- <amount-mask-setting v-if="amountMaskSettingVisible" ref="amountMaskSetting" @onChose="onChose"/>
|
|
|
-<!-- <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>-->
|
|
|
+ <inbound
|
|
|
+ v-if="inboundVisible"
|
|
|
+ ref="inbound"
|
|
|
+ @onChose="onChose"
|
|
|
+ @refreshDataList="getDataList"
|
|
|
+ />
|
|
|
+ <notice-change-setting
|
|
|
+ v-if="noticeChangeAttachVisible"
|
|
|
+ ref="noticeChangeSetting"
|
|
|
+ @onChose="onChose"
|
|
|
+ />
|
|
|
+ <amount-mask-setting
|
|
|
+ v-if="amountMaskSettingVisible"
|
|
|
+ ref="amountMaskSetting"
|
|
|
+ @onChose="onChose"
|
|
|
+ />
|
|
|
+ <!-- <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import AddOrUpdate from './purchase-add-or-update'
|
|
|
- import Detail from './purchase-detail'
|
|
|
- import Operate from './purchase-operate'
|
|
|
- import Inbound from '../warehouse/stock-order-inbound'
|
|
|
- import { getDictList } from '@/api/dict'
|
|
|
- import { getPurchaseList, revokePurchase, del } from '@/api/sale'
|
|
|
- import NoticeChangeSetting from './purchase-notice-change-setting'
|
|
|
- import AmountMaskSetting from './purchase-amount-mask-setting'
|
|
|
- import Vue from 'vue'
|
|
|
- export default {
|
|
|
- name: 'purchase',
|
|
|
- components: {
|
|
|
- AddOrUpdate, Detail, Operate, Inbound, NoticeChangeSetting, AmountMaskSetting
|
|
|
+import AddOrUpdate from './purchase-add-or-update'
|
|
|
+import Detail from './purchase-detail'
|
|
|
+import Operate from './purchase-operate'
|
|
|
+import Inbound from '../warehouse/stock-order-inbound'
|
|
|
+import { getDictList } from '@/api/dict'
|
|
|
+import { getPurchaseList, revokePurchase, del } from '@/api/sale'
|
|
|
+import NoticeChangeSetting from './purchase-notice-change-setting'
|
|
|
+import AmountMaskSetting from './purchase-amount-mask-setting'
|
|
|
+import Vue from 'vue'
|
|
|
+export default {
|
|
|
+ name: 'purchase',
|
|
|
+ components: {
|
|
|
+ AddOrUpdate,
|
|
|
+ Detail,
|
|
|
+ Operate,
|
|
|
+ Inbound,
|
|
|
+ NoticeChangeSetting,
|
|
|
+ AmountMaskSetting
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ addOrUpdateVisible: false,
|
|
|
+ detailVisible: false,
|
|
|
+ operateVisible: false,
|
|
|
+ inboundVisible: false,
|
|
|
+ noticeChangeAttachVisible: false,
|
|
|
+ amountMaskSettingVisible: false,
|
|
|
+ dataForm: {},
|
|
|
+ userId: 0,
|
|
|
+ dataList: [],
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalPage: 0,
|
|
|
+ dataListLoading: false,
|
|
|
+ dataListSelections: [],
|
|
|
+ optionsType: [],
|
|
|
+ // 审批状态:0 待提交 1 待审批 2 审批中 3 审批完成 4 审批不通过
|
|
|
+ optionsState: [],
|
|
|
+ // 采购状态:1 待采购 2 采购中 3 已入库 4 入库中 5 入库异常
|
|
|
+ optionsPurchaseState: [
|
|
|
+ { code: null, value: '全部' },
|
|
|
+ { code: '1', value: '待采购' },
|
|
|
+ { code: '2', value: '采购中' },
|
|
|
+ { code: '3', value: '已入库' },
|
|
|
+ { code: '4', value: '入库中' },
|
|
|
+ { code: '5', value: '入库异常' }
|
|
|
+ ],
|
|
|
+ batchIncomeBtnDisabled: false,
|
|
|
+ batchBuyBtnDisabled: false,
|
|
|
+ selectedRows: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.optionsState = this.$store.state.common.approveStates
|
|
|
+ this.userId = this.$store.state.user.id
|
|
|
+ this.getTypeList()
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onChose () {
|
|
|
+ this.addOrUpdateVisible = false
|
|
|
+ this.detailVisible = false
|
|
|
+ this.operateVisible = false
|
|
|
+ this.inboundVisible = false
|
|
|
+ this.noticeChangeAttachVisible = false
|
|
|
+ this.amountMaskSettingVisible = false
|
|
|
+ this.batchIncomeBtnDisabled = false
|
|
|
+ this.batchBuyBtnDisabled = false
|
|
|
+ this.selectedRows = []
|
|
|
},
|
|
|
- data () {
|
|
|
- return {
|
|
|
- addOrUpdateVisible: false,
|
|
|
- detailVisible: false,
|
|
|
- operateVisible: false,
|
|
|
- inboundVisible: false,
|
|
|
- noticeChangeAttachVisible: false,
|
|
|
- amountMaskSettingVisible: false,
|
|
|
- dataForm: {},
|
|
|
- userId: 0,
|
|
|
- dataList: [],
|
|
|
- pageIndex: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalPage: 0,
|
|
|
- dataListLoading: false,
|
|
|
- dataListSelections: [],
|
|
|
- optionsType: [],
|
|
|
- // 审批状态:0 待提交 1 待审批 2 审批中 3 审批完成 4 审批不通过
|
|
|
- optionsState: [],
|
|
|
- // 采购状态:1 待采购 2 采购中 3 已入库 4 入库中 5 入库异常
|
|
|
- optionsPurchaseState: [
|
|
|
- {code: null, value: '全部'},
|
|
|
- {code: '1', value: '待采购'},
|
|
|
- {code: '2', value: '采购中'},
|
|
|
- {code: '3', value: '已入库'},
|
|
|
- {code: '4', value: '入库中'},
|
|
|
- {code: '5', value: '入库异常'}
|
|
|
- ],
|
|
|
- batchIncomeBtnDisabled: false,
|
|
|
- batchBuyBtnDisabled: false,
|
|
|
- selectedRows: []
|
|
|
- }
|
|
|
+ // 获取采购类别字典
|
|
|
+ getTypeList () {
|
|
|
+ getDictList({ type: 'purchase_type' }).then(({ data }) => {
|
|
|
+ if (data) {
|
|
|
+ this.optionsType = data
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- created () {
|
|
|
- this.optionsState = this.$store.state.common.approveStates
|
|
|
- this.userId = this.$store.state.user.id
|
|
|
- this.getTypeList()
|
|
|
+ // 查询
|
|
|
+ search () {
|
|
|
+ this.pageIndex = 1
|
|
|
this.getDataList()
|
|
|
},
|
|
|
- methods: {
|
|
|
- onChose () {
|
|
|
- this.addOrUpdateVisible = false
|
|
|
- this.detailVisible = false
|
|
|
- this.operateVisible = false
|
|
|
- this.inboundVisible = false
|
|
|
- this.noticeChangeAttachVisible = false
|
|
|
- this.amountMaskSettingVisible = false
|
|
|
- this.batchIncomeBtnDisabled = false
|
|
|
- this.batchBuyBtnDisabled = false
|
|
|
- this.selectedRows = []
|
|
|
- },
|
|
|
- // 获取采购类别字典
|
|
|
- getTypeList () {
|
|
|
- getDictList({type: 'purchase_type'}).then(({data}) => {
|
|
|
- if (data) {
|
|
|
- this.optionsType = data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询
|
|
|
- search () {
|
|
|
- this.pageIndex = 1
|
|
|
- this.getDataList()
|
|
|
- },
|
|
|
- // 获取数据列表
|
|
|
- getDataList () {
|
|
|
- this.selectedRows = []
|
|
|
+ // 获取数据列表
|
|
|
+ getDataList () {
|
|
|
+ this.selectedRows = []
|
|
|
|
|
|
- this.dataListLoading = true
|
|
|
- this.addOrUpdateVisible = false
|
|
|
- let params = {
|
|
|
- 'current': this.pageIndex,
|
|
|
- 'size': this.pageSize,
|
|
|
- 'materialName': this.dataForm.materialName ? this.dataForm.materialName : null,
|
|
|
- 'purchaseState': this.dataForm.purchaseState ? this.dataForm.purchaseState : null,
|
|
|
- 'purchaseType': this.dataForm.purchaseType ? this.dataForm.purchaseType : null,
|
|
|
- 'beginTime': this.dataForm.date ? this.dataForm.date[0] : null,
|
|
|
- 'endTime': this.dataForm.date ? this.dataForm.date[1] : null
|
|
|
+ this.dataListLoading = true
|
|
|
+ this.addOrUpdateVisible = false
|
|
|
+ let params = {
|
|
|
+ current: this.pageIndex,
|
|
|
+ size: this.pageSize,
|
|
|
+ materialName: this.dataForm.materialName
|
|
|
+ ? this.dataForm.materialName
|
|
|
+ : null,
|
|
|
+ purchaseState: this.dataForm.purchaseState
|
|
|
+ ? this.dataForm.purchaseState
|
|
|
+ : null,
|
|
|
+ purchaseType: this.dataForm.purchaseType
|
|
|
+ ? this.dataForm.purchaseType
|
|
|
+ : null,
|
|
|
+ beginTime: this.dataForm.date ? this.dataForm.date[0] : null,
|
|
|
+ endTime: this.dataForm.date ? this.dataForm.date[1] : null
|
|
|
+ }
|
|
|
+ getPurchaseList(params).then(({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data.records
|
|
|
+ this.totalPage = Number(data.data.total)
|
|
|
+ } else {
|
|
|
+ this.dataList = []
|
|
|
+ this.totalPage = 0
|
|
|
}
|
|
|
- getPurchaseList(params).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataList = data.data.records
|
|
|
- this.totalPage = Number(data.data.total)
|
|
|
- } else {
|
|
|
- this.dataList = []
|
|
|
- this.totalPage = 0
|
|
|
- }
|
|
|
- this.dataListLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
- revokeHandle (id) {
|
|
|
- if (!id) return
|
|
|
- let data = {id: id}
|
|
|
- this.$confirm(`确定撤回?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- revokePurchase(data).then(({data}) => {
|
|
|
+ this.dataListLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ revokeHandle (id) {
|
|
|
+ if (!id) return
|
|
|
+ let data = { id: id }
|
|
|
+ this.$confirm(`确定撤回?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ revokePurchase(data).then(({ data }) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
@@ -385,88 +565,96 @@
|
|
|
this.$message.error(data.msg)
|
|
|
}
|
|
|
})
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- // 每页数
|
|
|
- sizeChangeHandle (val) {
|
|
|
- this.pageSize = val
|
|
|
- this.pageIndex = 1
|
|
|
- this.getDataList()
|
|
|
- },
|
|
|
- // 当前页
|
|
|
- currentChangeHandle (val) {
|
|
|
- this.pageIndex = val
|
|
|
- this.getDataList()
|
|
|
- },
|
|
|
- // 多选
|
|
|
- selectionChangeHandle (val) {
|
|
|
- this.dataListSelections = val
|
|
|
- },
|
|
|
- // 新增 / 修改
|
|
|
- addOrUpdateHandle (id) {
|
|
|
- this.addOrUpdateVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.addOrUpdate.init(id)
|
|
|
})
|
|
|
- },
|
|
|
- // 转换属性“类别”
|
|
|
- formatType (row) {
|
|
|
- if (this.optionsType && row.purchaseType) {
|
|
|
- const item1 = this.optionsType.find((item) => item.code === row.purchaseType.toString())
|
|
|
- return item1 ? item1.value : ''
|
|
|
- }
|
|
|
- },
|
|
|
- // 转换属性“审批状态”
|
|
|
- formatState (row) {
|
|
|
- if (!row.approvalState) return ''
|
|
|
- const item1 = this.optionsState.find((item) => item.code === row.approvalState.toString())
|
|
|
- return item1 ? item1.value : ''
|
|
|
- },
|
|
|
- // 转换属性“采购状态”
|
|
|
- formatPurchaseState (row) {
|
|
|
- if (!row.purchaseState) return ''
|
|
|
- const item1 = this.optionsPurchaseState.find((item) => item.code === row.purchaseState.toString())
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ // 每页数
|
|
|
+ sizeChangeHandle (val) {
|
|
|
+ this.pageSize = val
|
|
|
+ this.pageIndex = 1
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ // 当前页
|
|
|
+ currentChangeHandle (val) {
|
|
|
+ this.pageIndex = val
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ // 多选
|
|
|
+ selectionChangeHandle (val) {
|
|
|
+ this.dataListSelections = val
|
|
|
+ },
|
|
|
+ // 新增 / 修改
|
|
|
+ addOrUpdateHandle (id) {
|
|
|
+ this.addOrUpdateVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOrUpdate.init(id)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 转换属性“类别”
|
|
|
+ formatType (row) {
|
|
|
+ if (this.optionsType && row.purchaseType) {
|
|
|
+ const item1 = this.optionsType.find(
|
|
|
+ (item) => item.code === row.purchaseType.toString()
|
|
|
+ )
|
|
|
return item1 ? item1.value : ''
|
|
|
- },
|
|
|
- // 详情
|
|
|
- detailHandle (id) {
|
|
|
- this.detailVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.detail.init(id)
|
|
|
- })
|
|
|
- },
|
|
|
- // 采购操作
|
|
|
- operateHandle (row) {
|
|
|
- this.operateVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.operate.init(row)
|
|
|
- })
|
|
|
- },
|
|
|
- // 入库
|
|
|
- inboundHandle (row) {
|
|
|
- if (!row) return
|
|
|
- let dataForm = {
|
|
|
- ...row,
|
|
|
- buttonType: '1',
|
|
|
- sourceCategory: '1', // 入库依据类别
|
|
|
- // materialTypeId: row.purchaseType, // 类别
|
|
|
- source: row.supplierName, // 来源对应供应商
|
|
|
- tableId: row.purchaseDetailId,
|
|
|
- specifications: row.specification
|
|
|
- }
|
|
|
- this.inboundVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.inbound.init(0, false, dataForm)
|
|
|
- })
|
|
|
- },
|
|
|
- // 删除
|
|
|
- deleteHandle (priceId) {
|
|
|
- this.$confirm('是否确认要删除?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- del([priceId]).then(({data}) => {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 转换属性“审批状态”
|
|
|
+ formatState (row) {
|
|
|
+ if (!row.approvalState) return ''
|
|
|
+ const item1 = this.optionsState.find(
|
|
|
+ (item) => item.code === row.approvalState.toString()
|
|
|
+ )
|
|
|
+ return item1 ? item1.value : ''
|
|
|
+ },
|
|
|
+ // 转换属性“采购状态”
|
|
|
+ formatPurchaseState (row) {
|
|
|
+ if (!row.purchaseState) return ''
|
|
|
+ const item1 = this.optionsPurchaseState.find(
|
|
|
+ (item) => item.code === row.purchaseState.toString()
|
|
|
+ )
|
|
|
+ return item1 ? item1.value : ''
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ detailHandle (id) {
|
|
|
+ this.detailVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.detail.init(id)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 采购操作
|
|
|
+ operateHandle (row) {
|
|
|
+ this.operateVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.operate.init(row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 入库
|
|
|
+ inboundHandle (row) {
|
|
|
+ if (!row) return
|
|
|
+ let dataForm = {
|
|
|
+ ...row,
|
|
|
+ buttonType: '1',
|
|
|
+ sourceCategory: '1', // 入库依据类别
|
|
|
+ // materialTypeId: row.purchaseType, // 类别
|
|
|
+ source: row.supplierName, // 来源对应供应商
|
|
|
+ tableId: row.purchaseDetailId,
|
|
|
+ specifications: row.specification
|
|
|
+ }
|
|
|
+ this.inboundVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inbound.init(0, false, dataForm)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ deleteHandle (priceId) {
|
|
|
+ this.$confirm('是否确认要删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ del([priceId]).then(({ data }) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
@@ -483,96 +671,104 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
message: '已取消删除'
|
|
|
})
|
|
|
})
|
|
|
- },
|
|
|
- // 变更通知人设置
|
|
|
- setNoticeChangeHandel () {
|
|
|
- this.noticeChangeAttachVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.noticeChangeSetting.init()
|
|
|
- })
|
|
|
- },
|
|
|
- // 采购金额屏蔽设置
|
|
|
- setAmountMaskHandel () {
|
|
|
- this.amountMaskSettingVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.amountMaskSetting.init()
|
|
|
- })
|
|
|
- },
|
|
|
- exportHandle (procurementId) {
|
|
|
- if (!procurementId) {
|
|
|
- this.$message.error('参数不正确!')
|
|
|
- }
|
|
|
- location.href = this.$http.adornUrl(`/biz-service/purchaseDetail/exportExcel2/${procurementId}?_token=${Vue.cookie.get('token')}`)
|
|
|
- },
|
|
|
- // 监听批量选择的行
|
|
|
- handleSelectionChange (rows) {
|
|
|
- this.selectedRows = rows
|
|
|
-
|
|
|
- // 控制批量操作按钮
|
|
|
- this.batchIncomeBtnDisabled = false
|
|
|
- this.batchBuyBtnDisabled = false
|
|
|
- for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
- let item = this.selectedRows[index]
|
|
|
- if (Number(item.approvalState) === 3 && (Number(item.purchaseState) === 2 || Number(item.purchaseState) === 5)) {
|
|
|
-
|
|
|
- } else {
|
|
|
- this.batchIncomeBtnDisabled = true
|
|
|
- }
|
|
|
-
|
|
|
- if (Number(item.approvalState) === 3 && Number(item.purchaseState) === 1) {
|
|
|
+ },
|
|
|
+ // 变更通知人设置
|
|
|
+ setNoticeChangeHandel () {
|
|
|
+ this.noticeChangeAttachVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.noticeChangeSetting.init()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 采购金额屏蔽设置
|
|
|
+ setAmountMaskHandel () {
|
|
|
+ this.amountMaskSettingVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.amountMaskSetting.init()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ exportHandle (procurementId) {
|
|
|
+ if (!procurementId) {
|
|
|
+ this.$message.error('参数不正确!')
|
|
|
+ }
|
|
|
+ location.href = this.$http.adornUrl(
|
|
|
+ `/biz-service/purchaseDetail/exportExcel2/${procurementId}?_token=${Vue.cookie.get(
|
|
|
+ 'token'
|
|
|
+ )}`
|
|
|
+ )
|
|
|
+ },
|
|
|
+ // 监听批量选择的行
|
|
|
+ handleSelectionChange (rows) {
|
|
|
+ this.selectedRows = rows
|
|
|
|
|
|
- } else {
|
|
|
- this.batchBuyBtnDisabled = true
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 批量采购
|
|
|
- batchBuyHandel () {
|
|
|
- if (this.selectedRows.length === 0) {
|
|
|
- this.$message.error('请先勾选数据')
|
|
|
- return
|
|
|
- }
|
|
|
- this.operateVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.operate.init(this.selectedRows)
|
|
|
- })
|
|
|
- },
|
|
|
- // 批量入库
|
|
|
- batchIncomeHandel () {
|
|
|
- if (this.selectedRows.length === 0) {
|
|
|
- this.$message.error('请先勾选数据')
|
|
|
- return
|
|
|
+ // 控制批量操作按钮
|
|
|
+ this.batchIncomeBtnDisabled = false
|
|
|
+ this.batchBuyBtnDisabled = false
|
|
|
+ for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
+ let item = this.selectedRows[index]
|
|
|
+ if (
|
|
|
+ Number(item.approvalState) === 3 &&
|
|
|
+ (Number(item.purchaseState) === 2 || Number(item.purchaseState) === 5)
|
|
|
+ ) {
|
|
|
+ } else {
|
|
|
+ this.batchIncomeBtnDisabled = true
|
|
|
}
|
|
|
|
|
|
- let list = []
|
|
|
- for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
- let item = this.selectedRows[index]
|
|
|
- let dataForm = {
|
|
|
- ...item,
|
|
|
- buttonType: '1',
|
|
|
- sourceCategory: '1', // 入库依据类别
|
|
|
- source: item.supplierName, // 来源对应供应商
|
|
|
- tableId: item.purchaseDetailId,
|
|
|
- specifications: item.specification
|
|
|
- }
|
|
|
- list.push(dataForm)
|
|
|
+ if (
|
|
|
+ Number(item.approvalState) === 3 &&
|
|
|
+ Number(item.purchaseState) === 1
|
|
|
+ ) {
|
|
|
+ } else {
|
|
|
+ this.batchBuyBtnDisabled = true
|
|
|
}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 批量采购
|
|
|
+ batchBuyHandel () {
|
|
|
+ if (this.selectedRows.length === 0) {
|
|
|
+ this.$message.error('请先勾选数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.operateVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.operate.init(this.selectedRows)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 批量入库
|
|
|
+ batchIncomeHandel () {
|
|
|
+ if (this.selectedRows.length === 0) {
|
|
|
+ this.$message.error('请先勾选数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- this.inboundVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.inbound.init(0, false, list)
|
|
|
- })
|
|
|
+ let list = []
|
|
|
+ for (let index = 0; index < this.selectedRows.length; index++) {
|
|
|
+ let item = this.selectedRows[index]
|
|
|
+ let dataForm = {
|
|
|
+ ...item,
|
|
|
+ buttonType: '1',
|
|
|
+ sourceCategory: '1', // 入库依据类别
|
|
|
+ source: item.supplierName, // 来源对应供应商
|
|
|
+ tableId: item.purchaseDetailId,
|
|
|
+ specifications: item.specification
|
|
|
+ }
|
|
|
+ list.push(dataForm)
|
|
|
}
|
|
|
+
|
|
|
+ this.inboundVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inbound.init(0, false, list)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
</style>
|