|
@@ -33,6 +33,14 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户名称:" prop="CompanyName">
|
|
|
<el-autocomplete
|
|
|
+ v-if="isRaiSellerShow"
|
|
|
+ v-model="sealForm.CompanyName"
|
|
|
+ :fetch-suggestions="querySearchCompany"
|
|
|
+ placeholder="请输入用户名称"
|
|
|
+ @select="handleSelectCustome"
|
|
|
+ ></el-autocomplete>
|
|
|
+ <el-autocomplete
|
|
|
+ v-else
|
|
|
ref="companySelector"
|
|
|
popper-class="custom-autocomplete"
|
|
|
placeholder="请输入用户名称"
|
|
@@ -50,7 +58,18 @@
|
|
|
</template>
|
|
|
</el-autocomplete>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="合同类型:" prop="ServiceType">
|
|
|
+ <el-form-item label="合同期限:" prop="time" v-if="isRaiSellerShow" :rules="{ required: true, message: '请选择合同期限', trigger: 'change' }">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="sealForm.time"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="合同类型:" prop="ServiceType" v-else :rules="{ required: true, message: '请选择合同类型', trigger: 'change'}">
|
|
|
<el-select
|
|
|
v-model="sealForm.ServiceType"
|
|
|
:disabled="sealForm.source === '系统合同'"
|
|
@@ -64,6 +83,7 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item
|
|
|
:class="{ required: sealForm.Use === '代付合同' }"
|
|
|
label="实际使用方:"
|
|
@@ -98,7 +118,18 @@
|
|
|
class="form-input"
|
|
|
placeholder="请填写统一社会信用码"
|
|
|
v-model.trim="sealForm.CreditCode"
|
|
|
- :disabled="sealForm.source === '系统合同'"
|
|
|
+ :disabled="sealForm.source === '系统合同' || isRaiSellerShow"
|
|
|
+ ></el-input
|
|
|
+ ></el-form-item>
|
|
|
+ <el-form-item label="合同金额:" prop="Money"
|
|
|
+ v-if="isRaiSellerShow"
|
|
|
+ :rules="{
|
|
|
+ required: true, message: '请输入实际付款金额', trigger: 'blur'
|
|
|
+ }">
|
|
|
+ <el-input
|
|
|
+ class="form-input"
|
|
|
+ placeholder="请输入实际付款金额(优惠后)"
|
|
|
+ v-model="sealForm.Money"
|
|
|
></el-input
|
|
|
></el-form-item>
|
|
|
<el-form-item label="文件份数:" prop="FileNum"
|
|
@@ -189,7 +220,9 @@ export default {
|
|
|
Remark: "", //审批备注
|
|
|
fileList: [], //合同附件
|
|
|
ContractId: 0, //合同id(默认为0)
|
|
|
- AffiliatedCompany:''
|
|
|
+ AffiliatedCompany:'',
|
|
|
+ time: [],
|
|
|
+ Money: '',// 实际付款金额
|
|
|
},
|
|
|
sealRules: {
|
|
|
//表单校验规则
|
|
@@ -198,9 +231,6 @@ export default {
|
|
|
CompanyName: [
|
|
|
{ required: true, message: "请选择客户名称", trigger: "blur" },
|
|
|
],
|
|
|
- ServiceType: [
|
|
|
- { required: true, message: "请选择合同类型", trigger: "change" },
|
|
|
- ],
|
|
|
UseCompanyName: [
|
|
|
{ validator: ValidateUseCompanyName, trigger: "change" },
|
|
|
],
|
|
@@ -240,7 +270,7 @@ export default {
|
|
|
],
|
|
|
isWatch: true, // 控制watch是否触发
|
|
|
|
|
|
- belongCompanyOption:[]
|
|
|
+ belongCompanyOption:[],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -262,6 +292,11 @@ export default {
|
|
|
this.sealForm.source === "系统合同"
|
|
|
);
|
|
|
},
|
|
|
+ isRaiSellerShow() {
|
|
|
+ return (
|
|
|
+ this.sealForm.source === "上传附件" && localStorage.getItem('Role') === 'rai_seller'
|
|
|
+ );
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
async getBelongCompanyOptions() {
|
|
@@ -298,6 +333,9 @@ export default {
|
|
|
this.sealForm.ServiceType = SealDetail.ServiceType;
|
|
|
this.sealForm.UseCompanyName = SealDetail.UseCompanyName;
|
|
|
this.sealForm.AffiliatedCompany = SealDetail.AffiliatedCompany;
|
|
|
+ if(SealDetail.StartDate && SealDetail.EndDate) {
|
|
|
+ this.sealForm.time = [SealDetail.StartDate, SealDetail.EndDate]
|
|
|
+ }
|
|
|
this.sealForm.source =
|
|
|
SealDetail.ContractId > 0 ? "系统合同" : "上传附件";
|
|
|
// 打开监听
|
|
@@ -367,22 +405,41 @@ export default {
|
|
|
// 关键字联想
|
|
|
async querySearch(queryString, cb) {
|
|
|
// 合同来源为上传附件时不进行联想
|
|
|
- if (this.sealForm.source === "上传附件" || queryString === "")
|
|
|
+ if (this.sealForm.source === "上传附件" || queryString === "")
|
|
|
return cb([]);
|
|
|
- let results = [];
|
|
|
- try {
|
|
|
- const res = await sealInterence.getContractListBySeal({
|
|
|
- Keyword: queryString,
|
|
|
+ let results = [];
|
|
|
+ try {
|
|
|
+ const res = await sealInterence.getContractListBySeal({
|
|
|
+ Keyword: queryString,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ results = res.Data;
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ if (!results.length) this.sealForm.ContractId = 0;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ cb(results);
|
|
|
+ },
|
|
|
+ // 关键字公司联想
|
|
|
+ async querySearchCompany(query, cb) {
|
|
|
+ if (query === "") return cb([]);
|
|
|
+ const res = await sealInterence.getCompanyListSearch({
|
|
|
+ KeyWord: query,
|
|
|
});
|
|
|
if (res.Ret === 200) {
|
|
|
- results = res.Data;
|
|
|
+ if(res.Data.length>0){
|
|
|
+ let arr=res.Data.map(item=>{
|
|
|
+ return {value:item.CompanyName,...item}
|
|
|
+ })
|
|
|
+ cb(arr)
|
|
|
+ }
|
|
|
}
|
|
|
- } catch (err) {
|
|
|
- console.log(err);
|
|
|
- }
|
|
|
- if (!results.length) this.sealForm.ContractId = 0;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
+ },
|
|
|
+ // 关键字公司联想后的选择事件
|
|
|
+ handleSelectCustome(val){
|
|
|
+ this.sealForm.CreditCode = val.CreditCode;
|
|
|
},
|
|
|
// 选择事件
|
|
|
selectHandel(item) {
|
|
@@ -408,6 +465,7 @@ export default {
|
|
|
ContractId: this.sealForm.ContractId,
|
|
|
CreditCode: this.sealForm.CreditCode,
|
|
|
FileNum: this.sealForm.FileNum,
|
|
|
+ Money: +this.sealForm.Money,
|
|
|
FileUrls: this.sealForm.fileList.map(item => item.FileUrl),
|
|
|
Remark: this.sealForm.Remark,
|
|
|
SealType: this.sealForm.SealType.join(","),
|
|
@@ -415,6 +473,8 @@ export default {
|
|
|
Use: this.sealForm.Use,
|
|
|
UseCompanyName: this.sealForm.UseCompanyName,
|
|
|
AffiliatedCompany: this.sealForm.AffiliatedCompany,
|
|
|
+ StartDate: this.isRaiSellerShow ? this.sealForm.time[0] : '',
|
|
|
+ EndDate: this.isRaiSellerShow ? this.sealForm.time[1] : '',
|
|
|
};
|
|
|
let res = {};
|
|
|
if (this.sealId) {
|
|
@@ -469,7 +529,8 @@ export default {
|
|
|
Remark: "", //审批备注
|
|
|
fileList: [], //合同附件
|
|
|
ContractId: 0, //合同id(默认为0)
|
|
|
- AffiliatedCompany:''
|
|
|
+ AffiliatedCompany:'',
|
|
|
+ Money:'',
|
|
|
};
|
|
|
// 清除校验提示
|
|
|
this.$nextTick(() => {
|
|
@@ -487,6 +548,7 @@ export default {
|
|
|
.box {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+ .el-range-editor.el-input__inner,
|
|
|
.el-select,
|
|
|
.el-autocomplete,
|
|
|
.form-input {
|