采购部采购禁用

This commit is contained in:
Vergil
2020-04-07 15:24:10 +08:00
parent 3ad7c3118e
commit 7756bc0b3b
7 changed files with 91 additions and 24 deletions

View File

@@ -26,7 +26,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" size="small" icon="el-icon-search" plain style="margin-left: 5px" @click="pageCurrent11=1;pageSize11=20;total11=0;searchTable11()">查询</el-button>
<el-button type="primary" size="small" plain style="float: right;margin-right: 20px" @click="tiaozheng1">调整采购任务</el-button>
<el-button :disabled="tiaozheng1_disable" type="primary" size="small" plain style="float: right;margin-right: 20px" @click="tiaozheng1">调整采购任务</el-button>
<el-select v-model="PersonValue" style="width:100px; float: right" placeholder="人员" size="small" filterable clearable>
<el-option
v-for="item in Person"
@@ -586,12 +586,14 @@
<div slot="footer" class="dialog-footer">
<el-button
v-show="title2==='创建离线合同'"
:disabled="submitAddOfflineContract_disable"
type="distribution"
size="small"
icon="el-icon-circle-check"
@click="submitAddOfflineContract">确定</el-button>
<el-button
v-show="title2==='编辑离线合同'"
:disabled="submitEditOfflineContract_disable"
type="distribution"
size="small"
icon="el-icon-circle-check"
@@ -622,6 +624,9 @@ export default {
name: '', // 离线合同
data() {
return {
submitAddOfflineContract_disable: false,
submitEditOfflineContract_disable: false,
tiaozheng1_disable: false,
supplierNames: [],
startTime: '',
标准件和外购件流水号: [],
@@ -933,12 +938,15 @@ export default {
tiaozheng1() {
if (this.标准件和外购件流水号.length !== 0) {
if (this.PersonValue) {
this.tiaozheng1_disable = true
tiaozheng1(this.PersonValue, this.标准件和外购件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('调整成功')
this.searchTable11()
this.tiaozheng1_disable = false
} else {
this.$message.warning('调整失败')
this.tiaozheng1_disable = false
}
})
} else {
@@ -1104,6 +1112,7 @@ export default {
this.form2.供应商名称 = ''
this.form2.规定到货时间 = ''
this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
this.submitAddOfflineContract_disable = false
this.dialogVisible2 = true
})
},
@@ -1117,9 +1126,11 @@ export default {
}
})
},
submitAddOfflineContract() { // 新建离线合同
// 新建离线合同
submitAddOfflineContract() {
this.$refs['form2'].validate((valid) => {
if (valid) {
this.submitAddOfflineContract_disable = true
const numGroup1 = [] // 空数组,放现有的询价单号
searchOfflineContract2().then(response => { // 先查询判断是否存在
for (let i = 0; i < response.data.length; i++) {
@@ -1131,11 +1142,13 @@ export default {
} else {
addOfflineContract(this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
if (response.data[0].result === '1') {
this.dialogVisible2 = false
this.$message.success('新建离线合同成功')
this.offlineContract = this.form2.离线合同编号
this.searchTable2(this.offlineContract)
this.dialogVisible2 = false
} else { this.$message.error('新建离线合同失败') }
} else {
this.$message.error('新建离线合同失败')
}
})
}
})
@@ -1157,11 +1170,13 @@ export default {
this.form2.供应商名称 = row.供应商名称
this.form2.规定到货时间 = row.规定到货时间
this.form2.离线合同备注 = row.离线合同备注
this.submitEditOfflineContract_disable = false
this.dialogVisible2 = true
},
submitEditOfflineContract() {
this.$refs['form2'].validate((valid) => {
if (valid) {
this.submitEditOfflineContract_disable = true
const numGroup1 = [] // 空数组,放现有的离线合同号
const numGroup2 = [] // 空数组,放现有的离线合同流水号
searchOfflineContract2().then(response => { // 先查询判断是否存在
@@ -1175,10 +1190,12 @@ export default {
} else {
editOfflineContract(this.form2.离线合同流水号, this.form2.离线合同编号, this.form2.离线合同名称, this.form2.供应商流水号, this.id, this.form2.规定到货时间, this.form2.离线合同备注).then(response => {
if (response.data[0].result === '1') {
this.dialogVisible2 = false
this.$message.success('修改离线合同成功')
this.searchTable2()
this.dialogVisible2 = false
} else { this.$message.error('修改离线合同失败') }
} else {
this.$message.error('修改离线合同失败')
}
})
}
})