|
...
|
...
|
@@ -5,22 +5,34 @@ |
|
|
|
<a-row>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="招标号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderNumber">
|
|
|
|
<a-input v-model="model.tenderNumber" placeholder="请输入招标号"></a-input>
|
|
|
|
<a-input
|
|
|
|
v-model="model.tenderNumber"
|
|
|
|
placeholder="请输入招标号"
|
|
|
|
@blur="autoInput"
|
|
|
|
@keyup.enter.native="autoInput"
|
|
|
|
:disabled="isBianhaoDisabled2"
|
|
|
|
></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="客户料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
|
|
|
|
<a-input v-model="model.partNumber" placeholder="请输入客户料号"></a-input>
|
|
|
|
<a-input
|
|
|
|
v-model="model.partNumber"
|
|
|
|
placeholder="请输入客户料号"
|
|
|
|
@blur="autoInput"
|
|
|
|
@keyup.enter.native="autoInput"
|
|
|
|
:disabled="isBianhaoDisabled2"
|
|
|
|
></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="采购厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgManufacturer">
|
|
|
|
<a-input v-model="model.cgManufacturer" placeholder="请输入采购厂商" ></a-input>
|
|
|
|
<a-input v-model="model.cgManufacturer" placeholder="请输入采购厂商" :disabled="isBianhaoDisabled"></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="采购品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgProductname">
|
|
|
|
<a-input v-model="model.cgProductname" placeholder="请输入采购品名" ></a-input>
|
|
|
|
<a-input v-model="model.cgProductname" placeholder="请输入采购品名" ></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -30,17 +42,17 @@ |
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="采购时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgTime">
|
|
|
|
<j-date placeholder="请选择采购时间" v-model="model.cgTime" style="width: 100%" />
|
|
|
|
<j-date placeholder="请选择采购时间" v-model="model.cgTime" style="width: 100%" />
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="到货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
|
|
|
|
<j-date placeholder="请选择到货时间" v-model="model.deliveryTime" style="width: 100%" />
|
|
|
|
<j-date placeholder="请选择到货时间" v-model="model.deliveryTime" style="width: 100%" />
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="采购单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cgPrice">
|
|
|
|
<a-input-number v-model="model.cgPrice" placeholder="请输入采购单价" style="width: 100%" />
|
|
|
|
<a-input-number v-model="model.cgPrice" placeholder="请输入采购单价" style="width: 100%"/>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -55,12 +67,12 @@ |
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="发票类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceType">
|
|
|
|
<a-input v-model="model.invoiceType" placeholder="请输入发票类型" ></a-input>
|
|
|
|
<a-input v-model="model.invoiceType" placeholder="请输入发票类型" ></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="发票号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceNum">
|
|
|
|
<a-input v-model="model.invoiceNum" placeholder="请输入发票号" ></a-input>
|
|
|
|
<a-input v-model="model.invoiceNum" placeholder="请输入发票号" ></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -70,22 +82,22 @@ |
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
|
|
|
|
<a-input v-model="model.notes" placeholder="请输入备注" ></a-input>
|
|
|
|
<a-input v-model="model.notes" placeholder="请输入备注" ></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="送货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
|
|
|
|
<j-date placeholder="请选择送货时间" v-model="model.deliveryTime" style="width: 100%" />
|
|
|
|
<j-date placeholder="请选择送货时间" v-model="model.deliveryTime" style="width: 100%" />
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="交接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jiaojieren">
|
|
|
|
<a-input v-model="model.jiaojieren" placeholder="请输入交接人" ></a-input>
|
|
|
|
<a-input v-model="model.jiaojieren" placeholder="请输入交接人"></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="送货单扫描件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="scannedCopies">
|
|
|
|
<a-input v-model="model.scannedCopies" placeholder="请输入送货单扫描件" ></a-input>
|
|
|
|
<a-input v-model="model.scannedCopies" placeholder="请输入送货单扫描件"></a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -100,90 +112,132 @@ |
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TblTradTenderForm',
|
|
|
|
components: {
|
|
|
|
export default {
|
|
|
|
name: 'TblTradTenderForm',
|
|
|
|
components: {},
|
|
|
|
props: {
|
|
|
|
//表单禁用
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
//表单禁用
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
required: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isBianhaoDisabled: true,
|
|
|
|
isBianhaoDisabled2:false,
|
|
|
|
model: {},
|
|
|
|
labelCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 5 },
|
|
|
|
},
|
|
|
|
wrapperCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 16 },
|
|
|
|
},
|
|
|
|
confirmLoading: false,
|
|
|
|
validatorRules: {
|
|
|
|
tenderNumber: [{ required: true, message: '请输入招标号!' }],
|
|
|
|
partNumber: [{ required: true, message: '请输入客户料号!' }],
|
|
|
|
cgManufacturer: [{ required: true, message: '请输入采购厂商!' }],
|
|
|
|
cgProductname: [{ required: true, message: '请输入采购品名!' }],
|
|
|
|
cgNum: [{ required: true, message: '请输入采购数量!' }],
|
|
|
|
cgPrice: [{ required: true, message: '请输入采购单价!' }],
|
|
|
|
invoiceNum: [{ required: true, message: '请输入发票号!' }],
|
|
|
|
invoiceType: [{ required: true, message: '请输入发票类型!' }],
|
|
|
|
},
|
|
|
|
url: {
|
|
|
|
add: '/trad/tblTradTender/add',
|
|
|
|
edit: '/trad/tblTradTender/edit',
|
|
|
|
queryById: '/trad/tblTradTender/queryById',
|
|
|
|
queryBy: '/trad/tblTradTender/queryBy',
|
|
|
|
querytenderBy: '/trad/tblTradTender/querytenderBy',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
formDisabled() {
|
|
|
|
return this.disabled
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
model:{
|
|
|
|
},
|
|
|
|
labelCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 5 },
|
|
|
|
},
|
|
|
|
wrapperCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 16 },
|
|
|
|
},
|
|
|
|
confirmLoading: false,
|
|
|
|
validatorRules: {
|
|
|
|
},
|
|
|
|
url: {
|
|
|
|
add: "/trad/tblTradTender/add",
|
|
|
|
edit: "/trad/tblTradTender/edit",
|
|
|
|
queryById: "/trad/tblTradTender/queryById"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
//备份model原始值
|
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model))
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async autoInput() {
|
|
|
|
this.confirmLoading = true
|
|
|
|
const param = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
|
|
|
|
const param2 = { tenderNumber: this.model.tenderNumber, partNumber: this.model.partNumber }
|
|
|
|
let res2 = await getAction(this.url.querytenderBy, param2)
|
|
|
|
let res = await getAction(this.url.queryBy, param)
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
console.log(res2)
|
|
|
|
if (res2.result) {
|
|
|
|
this.$message.error('这个招标已存在合同信息')
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
this.isBianhaoDisabled = true
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (!res.result) {
|
|
|
|
this.$message.error('没有这个招标信息,请重新输入')
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
this.isBianhaoDisabled = true
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.isBianhaoDisabled=false
|
|
|
|
this.confirmLoading = false
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
formDisabled(){
|
|
|
|
return this.disabled
|
|
|
|
},
|
|
|
|
add() {
|
|
|
|
this.edit(this.modelDefault)
|
|
|
|
this.isBianhaoDisabled=true
|
|
|
|
this.isBianhaoDisabled2=false
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
//备份model原始值
|
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
|
edit(record) {
|
|
|
|
this.model = Object.assign({}, record)
|
|
|
|
this.visible = true
|
|
|
|
this.isBianhaoDisabled2=true
|
|
|
|
this.isBianhaoDisabled=false
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
add () {
|
|
|
|
this.edit(this.modelDefault);
|
|
|
|
},
|
|
|
|
edit (record) {
|
|
|
|
this.model = Object.assign({}, record);
|
|
|
|
this.visible = true;
|
|
|
|
},
|
|
|
|
submitForm () {
|
|
|
|
const that = this;
|
|
|
|
// 触发表单验证
|
|
|
|
this.$refs.form.validate(valid => {
|
|
|
|
if (valid) {
|
|
|
|
that.confirmLoading = true;
|
|
|
|
let httpurl = '';
|
|
|
|
let method = '';
|
|
|
|
if(!this.model.id){
|
|
|
|
httpurl+=this.url.add;
|
|
|
|
method = 'post';
|
|
|
|
}else{
|
|
|
|
httpurl+=this.url.edit;
|
|
|
|
method = 'put';
|
|
|
|
}
|
|
|
|
httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
|
if(res.success){
|
|
|
|
that.$message.success(res.message);
|
|
|
|
that.$emit('ok');
|
|
|
|
}else{
|
|
|
|
that.$message.warning(res.message);
|
|
|
|
submitForm() {
|
|
|
|
const that = this
|
|
|
|
// 触发表单验证
|
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
|
if (valid && !this.isBianhaoDisabled) {
|
|
|
|
that.confirmLoading = true
|
|
|
|
let httpurl = ''
|
|
|
|
let method = ''
|
|
|
|
if (!this.model.id) {
|
|
|
|
httpurl += this.url.add
|
|
|
|
method = 'post'
|
|
|
|
} else {
|
|
|
|
httpurl += this.url.edit
|
|
|
|
method = 'put'
|
|
|
|
}
|
|
|
|
httpAction(httpurl, this.model, method)
|
|
|
|
.then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
that.$message.success(res.message)
|
|
|
|
that.$emit('ok')
|
|
|
|
} else {
|
|
|
|
that.$message.warning(res.message)
|
|
|
|
}
|
|
|
|
}).finally(() => {
|
|
|
|
that.confirmLoading = false;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.finally(() => {
|
|
|
|
that.confirmLoading = false
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
that.$message.error("招标信息错误")
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script> |
|
|
\ No newline at end of file |
...
|
...
|
|