创建采购合同

This commit is contained in:
zhangdingyu
2019-09-30 11:02:06 +08:00
parent 643e3379b5
commit f78dfa9952
2 changed files with 29 additions and 10 deletions

View File

@@ -1,18 +1,28 @@
import request from '@/utils/request' import request from '@/utils/request'
// 初始化供应商 // 初始化供应商
export function initSupplier(num) { export function initSupplier() {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '3', type: '3',
name: `SELECT distinct 供应商流水号,供应商名称 name: `SELECT distinct * from 采购管理_供应商`
FROM 采购管理_询价单_视图
where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
} }
}) })
} }
// export function initSupplier(num) {
// return request({
// url: '',
// method: 'post',
// data: {
// type: '3',
// name: `SELECT distinct 供应商流水号,供应商名称
// FROM 采购管理_询价单_视图
// where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
// }
// })
// }
// 查询询价单列表 表1 // 查询询价单列表 表1
export function searchInquirySheet(check1, value1, check2, value2, check3, id, check4, supplier) { export function searchInquirySheet(check1, value1, check2, value2, check3, id, check4, supplier) {
return request({ return request({

View File

@@ -4,10 +4,10 @@
<el-form label-width="90px" label-position="right"> <el-form label-width="90px" label-position="right">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="供应商:"> <el-form-item label="合同编号:">
<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange"> <el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
<el-option <el-option
v-for="item in supplier" v-for="item in contractNums"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
@@ -15,10 +15,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同编号:"> <el-form-item label="供应商:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange"> <!--<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange">-->
<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange9745">
<el-option <el-option
v-for="item in contractNums" v-for="item in supplier"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
@@ -370,6 +371,7 @@ export default {
}, },
fetchData() { fetchData() {
initSupplier(this.id).then(res => { initSupplier(this.id).then(res => {
// this.id
this.supplier = [] this.supplier = []
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
this.supplier.push({ this.supplier.push({
@@ -446,6 +448,13 @@ export default {
} }
}) })
}, },
supplierChange9745() {
for (let i = 0; i < this.supplier.length; i++) {
if (this.supplier[i].value === this.supplierValue) {
this.supplierName = this.supplier[i].label
}
}
},
contractChange() { // 选择合同select contractChange() { // 选择合同select
searchContractHeader(this.contractNumValue).then(response => { searchContractHeader(this.contractNumValue).then(response => {
this.deliveryDate = response.data[0].交货日期 this.deliveryDate = response.data[0].交货日期