|
|
|
@ -7,8 +7,8 @@
|
|
|
|
|
<div class="item-box">
|
|
|
|
|
<van-field v-model="form.contractNumber" @blur="handleCtBlur" placeholder="请输入" :disabled="['edit','show'].includes(this.$route.query.type)" :rules="[{ required: true, message: '请输入' }]" required label="合同编号" clear-trigger="always" input-align="right" />
|
|
|
|
|
<van-field v-model="form.contractName" required placeholder="请输入" :disabled="disabled" :rules="[{ required: true, message: '请输入' }]" label="合同名称" clear-trigger="always" input-align="right" />
|
|
|
|
|
<!-- <van-field :value="form.time" label="合同起止时间" :disabled="disabled ||oaListIsDisabled " :class="disabled ? 'actived-disabled':''" placeholder="请选择" required :rules="[{ required: true, message: '请选择' }]" @click="handleDateShow(1)" :right-icon="form.time ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">-->
|
|
|
|
|
<!-- </van-field>-->
|
|
|
|
|
<!-- <van-field :value="form.time" label="合同起止时间" :disabled="disabled ||oaListIsDisabled " :class="disabled ? 'actived-disabled':''" placeholder="请选择" required :rules="[{ required: true, message: '请选择' }]" @click="handleDateShow(1)" :right-icon="form.time ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">-->
|
|
|
|
|
<!-- </van-field>-->
|
|
|
|
|
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" />
|
|
|
|
|
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" />
|
|
|
|
|
<RePick v-model="form.supplierId" :disabled="disabled ||oaListIsDisabled " titleKey="companyName" idKey="id" label="供应商名称" name="supplierId" :list="supplierList" isRequrie isCell clearable />
|
|
|
|
@ -29,19 +29,19 @@
|
|
|
|
|
<van-field v-model="form.dealContent" :disabled="disabled" name="reason" autosize rows="2" label="交易内容" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
|
|
|
|
|
<RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable />
|
|
|
|
|
<van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" />
|
|
|
|
|
<!-- <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />-->
|
|
|
|
|
<!-- <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />-->
|
|
|
|
|
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" />
|
|
|
|
|
<van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" />
|
|
|
|
|
<van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" />
|
|
|
|
|
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" />
|
|
|
|
|
<van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同简述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
|
|
|
|
|
|
|
|
|
|
<!-- 元素控制-->
|
|
|
|
|
<!-- 元素控制-->
|
|
|
|
|
<template v-for="(item,index) in form.fieldTemplateList">
|
|
|
|
|
<van-field v-if="item.type == '1'" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :required="item.required" v-model="item.value" :label="item.label" :disabled="disabled || oaListIsDisabled" :name="item.field" placeholder="请输入" input-align="right"></van-field>
|
|
|
|
|
<van-field v-if="item.type == '2'" :label="item.label" required :name="item.field" :disabled="disabled || oaListIsDisabled" input-align="right" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" label-width="9em">
|
|
|
|
|
<template #input>
|
|
|
|
|
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled"/>
|
|
|
|
|
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled" />
|
|
|
|
|
</template>
|
|
|
|
|
</van-field>
|
|
|
|
|
<van-field v-if="item.type == '3'" right-icon="arrow" :required="item.required" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :disabled="disabled || oaListIsDisabled" :class="item.value ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.fieldTemplateList[index][`${item.field}1`]" @click="handleDateShow(item.field,index)" :label="item.label" clear-trigger="always" input-align="right" />
|
|
|
|
@ -108,7 +108,7 @@ import {
|
|
|
|
|
listUser,
|
|
|
|
|
} from "@/api/system/user";
|
|
|
|
|
import { getCustomerContractTypeListAll } from '@/api/bs/contractType'
|
|
|
|
|
import {getProjectPage} from "@/api/bs/project";
|
|
|
|
|
import { getProjectPage } from "@/api/bs/project";
|
|
|
|
|
import { queryFieldTemplate } from '@/api/bs/template'
|
|
|
|
|
export default {
|
|
|
|
|
//import引入组件才能使用
|
|
|
|
@ -160,8 +160,8 @@ export default {
|
|
|
|
|
isRereset: false,
|
|
|
|
|
VerifyFunc,
|
|
|
|
|
typeList: [],
|
|
|
|
|
capitalSource:[],
|
|
|
|
|
projectList:[],
|
|
|
|
|
capitalSource: [],
|
|
|
|
|
projectList: [],
|
|
|
|
|
signatoryList: [],
|
|
|
|
|
departmentList: [],
|
|
|
|
|
dayjs,
|
|
|
|
@ -190,9 +190,9 @@ export default {
|
|
|
|
|
other: null,
|
|
|
|
|
},
|
|
|
|
|
oaReimburseFeeitemList: [],
|
|
|
|
|
dateType:'',
|
|
|
|
|
fieldType:'',
|
|
|
|
|
fieldTemplateList:[]
|
|
|
|
|
dateType: '',
|
|
|
|
|
fieldType: '',
|
|
|
|
|
fieldTemplateList: []
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -393,6 +393,10 @@ export default {
|
|
|
|
|
}),
|
|
|
|
|
// proposerPerson:this.userInfo.id
|
|
|
|
|
}
|
|
|
|
|
if (!this.oaReimburseFeeitemList.length) {
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
return this.$fm('暂无付款计划,无法提交!')
|
|
|
|
|
}
|
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
|
createSupplierContract(newForm).then((res) => {
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
@ -405,10 +409,6 @@ export default {
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
})
|
|
|
|
|
// })
|
|
|
|
|
if (!this.oaReimburseFeeitemList.length) {
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
return this.$fm('暂无付款计划,无法提交!')
|
|
|
|
|
}
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
if (err && err.length > 0 && err[0].name) {
|
|
|
|
@ -463,23 +463,23 @@ export default {
|
|
|
|
|
this.$set(this.form, 'proposerTime1', `${dayjs(this.form.proposerTime).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'startTime1', `${dayjs(this.form.startTime).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'endTime1', `${dayjs(this.form.endTime).format('YYYY/MM/DD')}`)
|
|
|
|
|
res.data.fieldTemplateList.forEach(function (item){
|
|
|
|
|
if(item.type == 3){
|
|
|
|
|
res.data.fieldTemplateList.forEach(function (item) {
|
|
|
|
|
if (item.type == 3) {
|
|
|
|
|
_this.$set(item, `${item.field}1`, `${dayjs(item.value).format('YYYY/MM/DD')}`)
|
|
|
|
|
}
|
|
|
|
|
if(item.type == 2){
|
|
|
|
|
item.value =item.value? Boolean(item.value):false
|
|
|
|
|
if (item.type == 2) {
|
|
|
|
|
item.value = item.value ? Boolean(item.value) : false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('this.form..', this.form);
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
queryFieldTemplate(2).then((res) => {
|
|
|
|
|
res.data.forEach(function (item){
|
|
|
|
|
if(item.type == 6){
|
|
|
|
|
item.value = item.value?item.value:[]
|
|
|
|
|
res.data.forEach(function (item) {
|
|
|
|
|
if (item.type == 6) {
|
|
|
|
|
item.value = item.value ? item.value : []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.fieldTemplateList = res.data
|
|
|
|
@ -566,8 +566,10 @@ export default {
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.typeList = res.data || []
|
|
|
|
|
})
|
|
|
|
|
getProjectPage({type:2,pageNo: 1,
|
|
|
|
|
pageSize: 500}).then(res=>{
|
|
|
|
|
getProjectPage({
|
|
|
|
|
type: 2, pageNo: 1,
|
|
|
|
|
pageSize: 500
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.projectList = res.data.list || []
|
|
|
|
|
})
|
|
|
|
|
listData({
|
|
|
|
@ -579,12 +581,12 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleDateShow(dateType,type) {
|
|
|
|
|
handleDateShow(dateType, type) {
|
|
|
|
|
let _this = this
|
|
|
|
|
if (this.disabled) return
|
|
|
|
|
_this.dateType = dateType
|
|
|
|
|
_this.fieldType = type
|
|
|
|
|
if(type){
|
|
|
|
|
if (type) {
|
|
|
|
|
_this.$nextTick(() => {
|
|
|
|
|
let date = _this.form.fieldTemplateList[type][dateType] || ''
|
|
|
|
|
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset()
|
|
|
|
@ -594,9 +596,9 @@ export default {
|
|
|
|
|
_this.defaultDate = new Date(time)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
_this.$nextTick(() => {
|
|
|
|
|
let date = dateType == 'dateSigning'?_this.form.dateSigning:dateType=='proposerTime'?_this.form.proposerTime:dateType=='startTime'?_this.form.startTime:dateType=='endTime'?_this.form.endTime:''
|
|
|
|
|
let date = dateType == 'dateSigning' ? _this.form.dateSigning : dateType == 'proposerTime' ? _this.form.proposerTime : dateType == 'startTime' ? _this.form.startTime : dateType == 'endTime' ? _this.form.endTime : ''
|
|
|
|
|
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset()
|
|
|
|
|
_this.dateShow = true
|
|
|
|
|
if (date) {
|
|
|
|
@ -608,25 +610,25 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleDateSelect(val) {
|
|
|
|
|
if(this.fieldType){
|
|
|
|
|
if (this.fieldType) {
|
|
|
|
|
this.$set(this.form.fieldTemplateList[this.fieldType], `${this.dateType}1`, `${dayjs(val).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form.fieldTemplateList[this.fieldType], 'value', `${dayjs(val).valueOf()}`)
|
|
|
|
|
this.dateShow = false
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.dateType == 'dateSigning'){
|
|
|
|
|
if (this.dateType == 'dateSigning') {
|
|
|
|
|
this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`)
|
|
|
|
|
}
|
|
|
|
|
if(this.dateType == 'proposerTime'){
|
|
|
|
|
if (this.dateType == 'proposerTime') {
|
|
|
|
|
this.$set(this.form, 'proposerTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'proposerTime', `${dayjs(val).valueOf()}`)
|
|
|
|
|
}
|
|
|
|
|
if(this.dateType == 'startTime'){
|
|
|
|
|
if (this.dateType == 'startTime') {
|
|
|
|
|
this.$set(this.form, 'startTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'startTime', `${dayjs(val).valueOf()}`)
|
|
|
|
|
}
|
|
|
|
|
if(this.dateType == 'endTime'){
|
|
|
|
|
if (this.dateType == 'endTime') {
|
|
|
|
|
this.$set(this.form, 'endTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
|
|
|
|
|
this.$set(this.form, 'endTime', `${dayjs(val).valueOf()}`)
|
|
|
|
|
}
|
|
|
|
|