|
@@ -1,14 +1,8 @@
|
|
|
-<!-- 产品管理 -->
|
|
|
+<!-- 采购管理 -->
|
|
|
<template>
|
|
|
<div class="purchase">
|
|
|
- <template v-if="!addOrUpdateVisible && !detailVisible">
|
|
|
+ <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible">
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
|
|
|
- <el-form-item label="采购编码">
|
|
|
- <el-input v-model="dataForm.purchaseCode" placeholder="采购编码" clearable/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="说明">
|
|
|
- <el-input v-model="dataForm.notes" placeholder="说明" clearable/>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="类别">
|
|
|
<el-select
|
|
|
v-model="dataForm.purchaseType"
|
|
@@ -22,11 +16,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="申请日期">
|
|
|
+ <el-form-item label="物品名称">
|
|
|
+ <el-input v-model="dataForm.materialName" placeholder="物品名称" clearable/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间">
|
|
|
<el-date-picker
|
|
|
- v-model="dataForm.applyDate"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- type="date">
|
|
|
+ v-model="dataForm.date"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
@@ -204,7 +204,7 @@
|
|
|
<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) <= 1)" type="text" size="small" @click="addOrUpdateHandle(scope.row.procurementId, false)">编辑</el-button>
|
|
|
- <el-button v-if="isAuth('purchase:detail:updatePurchaseDetail') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">采购</el-button>
|
|
|
+ <el-button v-if="isAuth('purchase:detail:updatePurchaseDetail') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="operateHandle(scope.row)">采购</el-button>
|
|
|
<el-button v-if="isAuth('purchase:detail:infoPutIn') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">入库</el-button>
|
|
|
<el-button v-if="isAuth('purchase:detail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">再次入库</el-button>
|
|
|
</template>
|
|
@@ -223,23 +223,27 @@
|
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
|
|
|
<detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
|
|
|
+ <!-- 采购操作 -->
|
|
|
+ <operate v-if="operateVisible" ref="operate" @onChose="onChose"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import AddOrUpdate from './purchase-add-or-update'
|
|
|
import Detail from './purchase-detail'
|
|
|
+ import Operate from './purchase-operate'
|
|
|
import { getDictList } from '@/api/dict'
|
|
|
import { getPurchaseList, revokePurchase } from '@/api/sale'
|
|
|
export default {
|
|
|
name: 'purchase',
|
|
|
components: {
|
|
|
- AddOrUpdate, Detail
|
|
|
+ AddOrUpdate, Detail, Operate
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
addOrUpdateVisible: false,
|
|
|
detailVisible: false,
|
|
|
+ operateVisible: false,
|
|
|
dataForm: {},
|
|
|
dataList: [],
|
|
|
pageIndex: 1,
|
|
@@ -270,6 +274,7 @@
|
|
|
onChose () {
|
|
|
this.addOrUpdateVisible = false
|
|
|
this.detailVisible = false
|
|
|
+ this.operateVisible = false
|
|
|
},
|
|
|
// 获取采购类别字典
|
|
|
getTypeList () {
|
|
@@ -291,11 +296,11 @@
|
|
|
let params = {
|
|
|
'current': this.pageIndex,
|
|
|
'size': this.pageSize,
|
|
|
- 'applyDate': this.dataForm.applyDate ? this.dataForm.applyDate : null,
|
|
|
- 'notes': this.dataForm.notes ? this.dataForm.notes : null,
|
|
|
+ 'materialName': this.dataForm.materialName ? this.dataForm.materialName : null,
|
|
|
'purchaseState': this.dataForm.purchaseState ? this.dataForm.purchaseState : null,
|
|
|
'purchaseType': this.dataForm.purchaseType ? this.dataForm.purchaseType : null,
|
|
|
- 'purchaseCode': this.dataForm.purchaseCode ? this.dataForm.purchaseCode : 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') {
|
|
@@ -379,6 +384,13 @@
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.detail.init(id)
|
|
|
})
|
|
|
+ },
|
|
|
+ // 采购操作
|
|
|
+ operateHandle (row) {
|
|
|
+ this.operateVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.operate.init(row)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|