This commit is contained in:
liushuai
2020-04-07 19:13:53 +08:00
14 changed files with 148 additions and 60 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: '',
标准件和外购件流水号: [],
@@ -934,12 +939,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 {
@@ -1106,6 +1114,7 @@ export default {
this.form2.供应商名称 = ''
this.form2.规定到货时间 = ''
this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
this.submitAddOfflineContract_disable = false
this.dialogVisible2 = true
})
},
@@ -1119,9 +1128,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++) {
@@ -1133,11 +1144,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('新建离线合同失败')
}
})
}
})
@@ -1159,11 +1172,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 => { // 先查询判断是否存在
@@ -1177,10 +1192,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('修改离线合同失败')
}
})
}
})
@@ -1680,12 +1697,12 @@ export default {
this.loading2 = true
searchMaterial22(check1, this.materialName, this.pageCurrent22, this.pageSize22).then(response => {
console.log(response.data, 3333)
this.tableData22 = response.data.rows
this.total22 = response.data.total
this.tableData22 = response.data.result
this.total22 = parseInt(response.data.output[0].ItemCount)
const supplier = []
this.remarkFilters = []
this.supplierFilters = []
response.data.rows.map(v => {
response.data.result.map(v => {
if (v.供货商 === null) { v.供货商 = '' }
if (!supplier.includes(v.供货商)) {
supplier.push(v.供货商)