|
|
|
@ -3,7 +3,8 @@
|
|
|
|
<el-dialog
|
|
|
|
<el-dialog
|
|
|
|
:title="!dataForm.id ? '添加' : '修改'"
|
|
|
|
:title="!dataForm.id ? '添加' : '修改'"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:visible.sync="visible">
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
|
|
|
width="80%">
|
|
|
|
<!-- 新增和修改表单 -->
|
|
|
|
<!-- 新增和修改表单 -->
|
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="120px">
|
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataSubmit()" label-width="120px">
|
|
|
|
<el-form-item label="计划采购日期" prop="demandDate">
|
|
|
|
<el-form-item label="计划采购日期" prop="demandDate">
|
|
|
|
@ -30,22 +31,127 @@
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
<el-select v-model="dataForm.status" placeholder="请选择状态" style="width: 100%">
|
|
|
|
<DictTag :options="dict.type.demand_status" :value="dataForm.status"/>
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.demand_status"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-input v-model="dataForm.remark" type="textarea" placeholder="备注" rows="4"></el-input>
|
|
|
|
<el-input v-model="dataForm.remark" type="textarea" placeholder="备注" rows="4"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 商品明细部分 -->
|
|
|
|
|
|
|
|
<div style="margin-top: 20px;">
|
|
|
|
|
|
|
|
<el-card>
|
|
|
|
|
|
|
|
<template slot="header">
|
|
|
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
|
|
|
<span>商品明细</span>
|
|
|
|
|
|
|
|
<div class="button-group">
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" @click="openBatchAddModal">批量添加商品</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" @click="addSingleProduct">添加单个商品</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
|
|
:data="productList"
|
|
|
|
|
|
|
|
border
|
|
|
|
|
|
|
|
style="width: 100%;">
|
|
|
|
|
|
|
|
<el-table-column prop="goodsName" header-align="center" align="center" label="采购商品名称"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column prop="goodsCode" header-align="center" align="center" label="商品编号"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column prop="spec" header-align="center" align="center" label="规格"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column prop="unit" header-align="center" align="center" label="单位"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column prop="demandQuantity" header-align="center" align="center" label="需求采购数量">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
<el-input-number v-model="scope.row.demandQuantity" placeholder="数量" :min="1" style="width: 100%"></el-input-number>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column prop="remark" header-align="center" align="center" label="备注">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
<el-input v-model="scope.row.remark" placeholder="备注"></el-input>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column header-align="center" align="center" width="100" label="操作">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
<el-button type="text" size="small" @click="removeProduct(scope.$index)" style="color: #f56c6c;">删除</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 批量添加商品弹窗 -->
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
|
|
title="批量添加商品"
|
|
|
|
|
|
|
|
:visible.sync="batchAddVisible"
|
|
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
|
|
width="70%">
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="selectedGoods"
|
|
|
|
|
|
|
|
multiple
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
allow-create
|
|
|
|
|
|
|
|
default-first-option
|
|
|
|
|
|
|
|
placeholder="请选择商品"
|
|
|
|
|
|
|
|
style="width: 100%; margin-bottom: 20px;">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="goods in goodsList"
|
|
|
|
|
|
|
|
:key="goods.id"
|
|
|
|
|
|
|
|
:label="goods.goodsName + '|' + goods.spec + '|' + goods.unit"
|
|
|
|
|
|
|
|
:value="goods.id"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="confirmBatchAdd">确认添加</el-button>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 单个添加商品弹窗 -->
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
|
|
title="添加商品"
|
|
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
|
|
:visible.sync="singleAddVisible"
|
|
|
|
|
|
|
|
width="50%">
|
|
|
|
|
|
|
|
<el-form :model="singleProductForm" :rules="singleProductRule" ref="singleProductForm" label-width="120px">
|
|
|
|
|
|
|
|
<el-form-item label="采购商品" prop="goodsName">
|
|
|
|
|
|
|
|
<el-select v-model="singleProductForm.goodsName" placeholder="请选择采购商品" style="width: 100%" @change="handleGoodsChange">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="goods in goodsList"
|
|
|
|
|
|
|
|
:key="goods.id"
|
|
|
|
|
|
|
|
:label="goods.goodsName + '|' + goods.spec + '|' + goods.unit"
|
|
|
|
|
|
|
|
:value="goods.id"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="商品编号" prop="goodsCode">
|
|
|
|
|
|
|
|
<el-input v-model="singleProductForm.goodsCode" placeholder="商品编号" disabled></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="规格" prop="spec">
|
|
|
|
|
|
|
|
<el-input v-model="singleProductForm.spec" placeholder="规格" disabled></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="单位" prop="unit">
|
|
|
|
|
|
|
|
<el-input v-model="singleProductForm.unit" placeholder="单位" disabled></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="需求采购数量" prop="demandQuantity">
|
|
|
|
|
|
|
|
<el-input-number v-model="singleProductForm.demandQuantity" placeholder="需求采购数量" :min="1" style="width: 100%"></el-input-number>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
|
|
|
<el-input v-model="singleProductForm.remark" type="textarea" placeholder="备注" rows="4"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button @click="singleAddVisible = false">取消</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="confirmSingleAdd">确定</el-button>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="visible = false">取消</el-button>
|
|
|
|
<el-button @click="visible = false">取消</el-button>
|
|
|
|
<el-button type="primary" @click="dataSubmit()">确定</el-button>
|
|
|
|
<template v-if="!dataForm.id || dataForm.status === '0' || dataForm.status === '2'">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="dataSubmit()">保存</el-button>
|
|
|
|
|
|
|
|
<el-button v-hasPermi="['autogencode:pmcanteendemand:submit']" type="primary" @click="submitDemand">提交</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-if="dataForm.id && dataForm.status === '3'">
|
|
|
|
|
|
|
|
<el-button v-hasPermi="['autogencode:pmcanteendemand:audit']" type="danger" @click="rejectDemand">驳回</el-button>
|
|
|
|
|
|
|
|
<el-button v-hasPermi="['autogencode:pmcanteendemand:audit']" type="success" @click="approveDemand">通过</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -53,20 +159,34 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import * as api from '@/api/pmcanteendemand.js'
|
|
|
|
import * as api from '@/api/pmcanteendemand.js'
|
|
|
|
import * as ebuserApi from '@/api/ebuser.js'
|
|
|
|
import * as ebuserApi from '@/api/ebuser.js'
|
|
|
|
|
|
|
|
import * as cmcustproductApi from '@/api/cmcustproduct.js'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
dicts: ['owner_type', 'demand_status'],
|
|
|
|
dicts: ['owner_type', 'demand_status'],
|
|
|
|
data () {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
|
|
|
|
batchAddVisible: false,
|
|
|
|
|
|
|
|
singleAddVisible: false,
|
|
|
|
userList: [],
|
|
|
|
userList: [],
|
|
|
|
|
|
|
|
goodsList: [],
|
|
|
|
|
|
|
|
selectedGoods: [],
|
|
|
|
|
|
|
|
productList: [],
|
|
|
|
dataForm: {
|
|
|
|
dataForm: {
|
|
|
|
id: 0,
|
|
|
|
id: '',
|
|
|
|
demandDate: '' ,
|
|
|
|
demandDate: '' ,
|
|
|
|
demandUser: '' ,
|
|
|
|
demandUser: '' ,
|
|
|
|
userType: '' ,
|
|
|
|
userType: '' ,
|
|
|
|
status: '' ,
|
|
|
|
status: '0' ,
|
|
|
|
remark: '' ,
|
|
|
|
remark: '' ,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
singleProductForm: {
|
|
|
|
|
|
|
|
goodsName: '',
|
|
|
|
|
|
|
|
goodsCode: '',
|
|
|
|
|
|
|
|
spec: '',
|
|
|
|
|
|
|
|
unit: '',
|
|
|
|
|
|
|
|
demandQuantity: 1,
|
|
|
|
|
|
|
|
remark: ''
|
|
|
|
|
|
|
|
},
|
|
|
|
dataRule: {
|
|
|
|
dataRule: {
|
|
|
|
demandDate: [
|
|
|
|
demandDate: [
|
|
|
|
{ required: true, message: '计划采购日期 为必填项', trigger: 'blur' }
|
|
|
|
{ required: true, message: '计划采购日期 为必填项', trigger: 'blur' }
|
|
|
|
@ -77,14 +197,20 @@
|
|
|
|
userType: [
|
|
|
|
userType: [
|
|
|
|
{ required: true, message: '申请人类型 为必填项', trigger: 'blur' }
|
|
|
|
{ required: true, message: '申请人类型 为必填项', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
status: [
|
|
|
|
},
|
|
|
|
{ required: true, message: '状态 为必填项', trigger: 'blur' }
|
|
|
|
singleProductRule: {
|
|
|
|
|
|
|
|
goodsName: [
|
|
|
|
|
|
|
|
{ required: true, message: '采购商品名称 为必填项', trigger: 'blur' }
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
demandQuantity: [
|
|
|
|
|
|
|
|
{ required: true, message: '需求采购数量 为必填项', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.loadUserList()
|
|
|
|
this.loadUserList()
|
|
|
|
|
|
|
|
this.loadGoodsList()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
loadUserList() {
|
|
|
|
loadUserList() {
|
|
|
|
@ -98,8 +224,82 @@
|
|
|
|
this.userList = res.list || []
|
|
|
|
this.userList = res.list || []
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
loadGoodsList() {
|
|
|
|
|
|
|
|
cmcustproductApi.cmcustproductListApi({ page: 1, limit: 9999 }).then(res => {
|
|
|
|
|
|
|
|
this.goodsList = res.list || []
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleGoodsChange(id) {
|
|
|
|
|
|
|
|
const selectedGoods = this.goodsList.find(goods => goods.id === id)
|
|
|
|
|
|
|
|
if (selectedGoods) {
|
|
|
|
|
|
|
|
this.singleProductForm.goodsName = selectedGoods.goodsName
|
|
|
|
|
|
|
|
this.singleProductForm.goodsCode = selectedGoods.goodsCode
|
|
|
|
|
|
|
|
this.singleProductForm.spec = selectedGoods.spec
|
|
|
|
|
|
|
|
this.singleProductForm.unit = selectedGoods.unit
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
openBatchAddModal() {
|
|
|
|
|
|
|
|
this.selectedGoods = []
|
|
|
|
|
|
|
|
this.batchAddVisible = true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
confirmBatchAdd() {
|
|
|
|
|
|
|
|
if (this.selectedGoods.length === 0) {
|
|
|
|
|
|
|
|
this.$message.warning('请选择商品')
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.selectedGoods.forEach(id => {
|
|
|
|
|
|
|
|
const selectedGoods = this.goodsList.find(goods => goods.id === id)
|
|
|
|
|
|
|
|
const existingProduct = this.productList.find(p => p.goodsName === selectedGoods.goodsName && p.goodsCode === selectedGoods.goodsCode)
|
|
|
|
|
|
|
|
if (!existingProduct) {
|
|
|
|
|
|
|
|
this.productList.push({
|
|
|
|
|
|
|
|
goodsName: selectedGoods.goodsName,
|
|
|
|
|
|
|
|
goodsCode: selectedGoods.goodsCode,
|
|
|
|
|
|
|
|
spec: selectedGoods.spec,
|
|
|
|
|
|
|
|
unit: selectedGoods.unit,
|
|
|
|
|
|
|
|
demandQuantity: 1,
|
|
|
|
|
|
|
|
remark: ''
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.batchAddVisible = false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addSingleProduct() {
|
|
|
|
|
|
|
|
this.singleProductForm = {
|
|
|
|
|
|
|
|
goodsName: '',
|
|
|
|
|
|
|
|
goodsCode: '',
|
|
|
|
|
|
|
|
spec: '',
|
|
|
|
|
|
|
|
unit: '',
|
|
|
|
|
|
|
|
demandQuantity: 1,
|
|
|
|
|
|
|
|
remark: ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.singleAddVisible = true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
confirmSingleAdd() {
|
|
|
|
|
|
|
|
this.$refs['singleProductForm'].validate((valid) => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
const existingProduct = this.productList.find(p => p.goodsName === this.singleProductForm.goodsName)
|
|
|
|
|
|
|
|
if (!existingProduct) {
|
|
|
|
|
|
|
|
this.productList.push({
|
|
|
|
|
|
|
|
goodsName: this.singleProductForm.goodsName,
|
|
|
|
|
|
|
|
goodsCode: this.singleProductForm.goodsCode,
|
|
|
|
|
|
|
|
spec: this.singleProductForm.spec,
|
|
|
|
|
|
|
|
unit: this.singleProductForm.unit,
|
|
|
|
|
|
|
|
demandQuantity: this.singleProductForm.demandQuantity,
|
|
|
|
|
|
|
|
remark: this.singleProductForm.remark
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.singleAddVisible = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
removeProduct(index) {
|
|
|
|
|
|
|
|
this.productList.splice(index, 1)
|
|
|
|
|
|
|
|
},
|
|
|
|
init (id) { // 初始化表单验证规则
|
|
|
|
init (id) { // 初始化表单验证规则
|
|
|
|
this.dataForm.id = id || 0
|
|
|
|
this.dataForm.id = id
|
|
|
|
|
|
|
|
this.productList = []
|
|
|
|
this.visible = true
|
|
|
|
this.visible = true
|
|
|
|
this.$nextTick(function() {
|
|
|
|
this.$nextTick(function() {
|
|
|
|
this.$refs['dataForm'].resetFields()
|
|
|
|
this.$refs['dataForm'].resetFields()
|
|
|
|
@ -108,22 +308,37 @@
|
|
|
|
this.dataForm = res;
|
|
|
|
this.dataForm = res;
|
|
|
|
// 加载用户列表,确保编辑时能正确显示用户
|
|
|
|
// 加载用户列表,确保编辑时能正确显示用户
|
|
|
|
this.loadUserList()
|
|
|
|
this.loadUserList()
|
|
|
|
|
|
|
|
// 这里可以添加加载商品明细的逻辑
|
|
|
|
|
|
|
|
if (res.pmCanteenDemandDetails) {
|
|
|
|
|
|
|
|
this.productList = res.pmCanteenDemandDetails
|
|
|
|
|
|
|
|
}
|
|
|
|
}.bind(this))
|
|
|
|
}.bind(this))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.bind(this))
|
|
|
|
}.bind(this))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单数据提交
|
|
|
|
// 表单数据提交
|
|
|
|
dataSubmit () {
|
|
|
|
dataSubmit (status) {
|
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
if (this.productList.length === 0) {
|
|
|
|
|
|
|
|
this.$message.warning('请添加商品明细')
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitData = {
|
|
|
|
|
|
|
|
...this.dataForm,
|
|
|
|
|
|
|
|
status: status || this.dataForm.status,
|
|
|
|
|
|
|
|
pmCanteenDemandDetails: this.productList
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
api.pmcanteendemandUpdateApi(this.dataForm).then(function(res) {
|
|
|
|
api.pmcanteendemandBatchUpdateApi([submitData]).then(function(res) {
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
this.visible = false
|
|
|
|
this.visible = false
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
}.bind(this));
|
|
|
|
}.bind(this));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
api.pmcanteendemandCreateApi(this.dataForm).then(function(res) {
|
|
|
|
api.pmcanteendemandBatchCreateApi([submitData]).then(function(res) {
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
this.visible = false
|
|
|
|
this.visible = false
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
@ -131,7 +346,60 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// 驳回需求
|
|
|
|
|
|
|
|
rejectDemand() {
|
|
|
|
|
|
|
|
this.$confirm(`确定驳回该需求吗?`, '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
// 调用API更新状态
|
|
|
|
|
|
|
|
this.dataSubmit('2');
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 通过需求
|
|
|
|
|
|
|
|
approveDemand() {
|
|
|
|
|
|
|
|
this.$confirm(`确定通过该需求吗?`, '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
this.dataSubmit('1');
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 提交需求
|
|
|
|
|
|
|
|
submitDemand() {
|
|
|
|
|
|
|
|
this.$confirm(`确定提交该需求吗?`, '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
this.dataSubmit('3');
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
.card-header {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.button-group {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.button-group .el-button {
|
|
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.button-group .el-button:first-child {
|
|
|
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|