Commit 0e4bf210 authored by youjie's avatar youjie

设置主门店

parent e0511ef4
...@@ -109,17 +109,21 @@ ...@@ -109,17 +109,21 @@
<el-button type="success" size="small" icon="el-icon-download" circle @click="DownLoadContract(item)"> <el-button type="success" size="small" icon="el-icon-download" circle @click="DownLoadContract(item)">
</el-button> </el-button>
</el-tooltip> --> </el-tooltip> -->
<el-tooltip class="item" effect="dark" :content="$t('objFill.v101.administrative.shiezhizmd')" placement="top">
<el-button type="danger" size="small" icon="el-icon-s-tools" circle @click="clickSetAdmin(item)"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('fnc.chakan')+$t('objFill.v102.lianmenght')" placement="top-start"> <el-tooltip class="item" effect="dark" :content="$t('fnc.chakan')+$t('objFill.v102.lianmenght')" placement="top-start">
<el-button type="success" size="small" icon="el-icon-view" circle @click="ViewContract(item)"></el-button> <el-button type="success" size="small" icon="el-icon-view" circle @click="ViewContract(item)"></el-button>
</el-tooltip> </el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
<el-dialog :title="addType == 1 ?$t('objFill.v102.xinzenghet') : $t('objFill.v102.bianjihet')" <el-dialog :title="addType == 1 ?$t('objFill.v102.xinzenghet') : $t('objFill.v101.administrative.shiezhizmd')"
width="700px" :visible.sync="dialogFormVisible" width="700px" :visible.sync="dialogFormVisible"
center :before-close="closeChangeMachie" > center :before-close="closeChangeMachie" >
<el-form label-width="110px" :model="addMsg" :rules="rules" ref="addMsg" class="demo-ruleForm"> <el-form label-width="110px" :model="addMsg" :rules="rules" ref="addMsg" class="demo-ruleForm">
<el-row> <el-row>
<template v-if="addType==1">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('objFill.v102.youxiaoqks')" prop="C_StartDate"> <el-form-item :label="$t('objFill.v102.youxiaoqks')" prop="C_StartDate">
<el-date-picker class="h34 " style="width: 100%;" <el-date-picker class="h34 " style="width: 100%;"
...@@ -163,6 +167,7 @@ ...@@ -163,6 +167,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</template>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('objFill.v102.zhuzhanghxx')" prop="Id"> <el-form-item :label="$t('objFill.v102.zhuzhanghxx')" prop="Id">
<el-select <el-select
...@@ -172,7 +177,7 @@ ...@@ -172,7 +177,7 @@
<el-option v-for='item in CustomerList' <el-option v-for='item in CustomerList'
:label='item.CustomerName+"("+item.ContactNumber+")"' :label='item.CustomerName+"("+item.ContactNumber+")"'
:value='item.ID' :value='item.ID'
:key='item.CustomerName'> :key='item.ID'>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -180,6 +185,9 @@ ...@@ -180,6 +185,9 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('objFill.quanxianshezhi')" prop="CustomerChildrenIdList"> <el-form-item :label="$t('objFill.quanxianshezhi')" prop="CustomerChildrenIdList">
<el-select <el-select
placeholder="Select"
size="large"
style="width: 100%"
multiple multiple
collapse-tags collapse-tags
collapse-tags-tooltip collapse-tags-tooltip
...@@ -189,7 +197,7 @@ ...@@ -189,7 +197,7 @@
<el-option v-for='item in CustomerChildrenList' <el-option v-for='item in CustomerChildrenList'
:label='item.CustomerName+"("+item.ContactPhone+")"' :label='item.CustomerName+"("+item.ContactPhone+")"'
:value='item.ID' :value='item.ID'
:key='item.CustomerName'> :key='item.ID'>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -197,16 +205,13 @@ ...@@ -197,16 +205,13 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('fnc.acc')" prop=""> <el-form-item :label="$t('fnc.acc')" prop="">
<el-select v-loading="optionloading" <el-select v-loading="optionloading"
multiple
collapse-tags
collapse-tags-tooltip
v-model='addMsg.accountId' v-model='addMsg.accountId'
@change="getCustomer(2)" @change="getCustomer(2)"
class="" clearable> class="" clearable>
<el-option v-for='item in accountList' <el-option v-for='item in accountList'
:label='item.AccountHolder' :label='item.AccountHolder+"("+item.CardNum+")"'
:value='item.ID' :value='item.ID'
:key='item.AccountHolder'> :key='item.ID'>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -231,9 +236,9 @@ ...@@ -231,9 +236,9 @@
<el-input type="text" v-model="addMsg.AccountHolder" :placeholder="$t('rule.qsrkhuren')"></el-input> <el-input type="text" v-model="addMsg.AccountHolder" :placeholder="$t('rule.qsrkhuren')"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24" v-if="addType==1">
<el-form-item :label="$t('objFill.fj')" prop="ContractUrl"> <el-form-item :label="$t('objFill.fj')" prop="ContractUrl">
<el-upload class="upload-demo" style="display:inline-block;position:relative;top:-1px;left:3px;" <el-upload :loading="fileLoading" class="upload-demo" style="display:inline-block;position:relative;top:-1px;left:3px;"
:http-request="UploadAttachment" :show-file-list="false" action=""> :http-request="UploadAttachment" :show-file-list="false" action="">
<el-button size="small" type="primary">{{$t('objFill.v101.Rest.tianjiafuj')}}</el-button> <el-button size="small" type="primary">{{$t('objFill.v101.Rest.tianjiafuj')}}</el-button>
</el-upload> </el-upload>
...@@ -246,16 +251,6 @@ ...@@ -246,16 +251,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="dialogFormVisible=false, iniTAddMsg">{{$t('pub.cancelBtn')}}</button> <button class="hollowFixedBtn" @click="dialogFormVisible=false, iniTAddMsg">{{$t('pub.cancelBtn')}}</button>
...@@ -373,6 +368,7 @@ export default { ...@@ -373,6 +368,7 @@ export default {
CustomerChildrenList: [], CustomerChildrenList: [],
NightNumList: [], NightNumList: [],
accountList: [], accountList: [],
fileLoading: false,
} }
}, },
watch: { watch: {
...@@ -398,6 +394,21 @@ export default { ...@@ -398,6 +394,21 @@ export default {
}, },
methods: { methods: {
clickSetAdmin(obj){
this.dialogFormVisible = true
this.addType = 2
console.log(obj)
this.addMsg = {
...JSON.parse(JSON.stringify(obj)),
CustomerChildrenIds: obj.CllianceChildList.map(x=>{
return x.ID
}).join(','),
CustomerChildrenIdList: obj.CllianceChildList.map(x=>{
return x.ID
}),
accountId: obj.ClientBankAccountId
}
},
ViewContract(item){ ViewContract(item){
window.open(item.TravelAgency_SignAddress, '_blank'); window.open(item.TravelAgency_SignAddress, '_blank');
}, },
...@@ -420,6 +431,13 @@ export default { ...@@ -420,6 +431,13 @@ export default {
this.addMsg.CustomerId = list[0].CustomerId; this.addMsg.CustomerId = list[0].CustomerId;
this.getAccountPageList() this.getAccountPageList()
} }
this.addMsg.CustomerChildrenIds = ''
this.addMsg.CustomerChildrenIdList = []
this.addMsg.accountId = ''
this.addMsg.OpenBankName = '';
this.addMsg.AccountHolder = '';
this.addMsg.BankName = '';
this.addMsg.CardNum = ''
}else if(type==2){ }else if(type==2){
if(this.addMsg.accountId){ if(this.addMsg.accountId){
let list = this.accountList.filter(x=>{ let list = this.accountList.filter(x=>{
...@@ -429,7 +447,7 @@ export default { ...@@ -429,7 +447,7 @@ export default {
this.addMsg.OpenBankName = list[0].OpenBankName; this.addMsg.OpenBankName = list[0].OpenBankName;
this.addMsg.AccountHolder = list[0].AccountHolder; this.addMsg.AccountHolder = list[0].AccountHolder;
this.addMsg.BankName = list[0].BankName; this.addMsg.BankName = list[0].BankName;
this.addMsg.CardNum = list[0].CardNum.trim(); this.addMsg.CardNum = list[0].CardNum.replace(/\s/g,'')
} }
} }
}else{ }else{
...@@ -510,6 +528,8 @@ export default { ...@@ -510,6 +528,8 @@ export default {
}, },
UploadAttachment(file) { UploadAttachment(file) {
//上传 //上传
if(!this.fileLoading) return
this.fileLoading = true;
let newArr = []; let newArr = [];
newArr.push(file.file); newArr.push(file.file);
let path = "/Upload/Temporary/"; let path = "/Upload/Temporary/";
...@@ -517,6 +537,7 @@ export default { ...@@ -517,6 +537,7 @@ export default {
this.UploadSelfFileT(path, newArr, (x) => { this.UploadSelfFileT(path, newArr, (x) => {
var newUrl = this.domainManager().ViittoFileUrl + x.data.FilePath; var newUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.addMsg.ContractUrl = newUrl this.addMsg.ContractUrl = newUrl
this.fileLoading = false
this.Success(this.$t("tips.scchenggong")); this.Success(this.$t("tips.scchenggong"));
}); });
}, },
...@@ -559,10 +580,49 @@ export default { ...@@ -559,10 +580,49 @@ export default {
UpdateDate: function (formName) { UpdateDate: function (formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if(this.addType==1){
this.SetAllianceContract()
}else{
this.AllianceContrac()
}
} else {
return false;
}
});
},
AllianceContrac(){
if(this.saveLoading) return
this.saveLoading = true
this.apipost('app_customer_UpdateAllianceContract', {
Id: this.addMsg.Id,
ContractId: this.addMsg.ContractId,
CustomerChildrenIds: this.addMsg.CustomerChildrenIdList.join(','),
OpenBankName: this.addMsg.OpenBankName,
AccountHolder: this.addMsg.AccountHolder,
BankName: this.addMsg.BankName,
CardNum: this.addMsg.CardNum.trim(),
}, res => {
if (res.data.resultCode === 1) {
this.dialogFormVisible = false;
this.iniTAddMsg();
this.getList();
this.$message.success(res.data.message);
this.saveLoading = false
} else {
this.$message.error(res.data.message);
this.saveLoading = false
}
}, err=>{
this.saveLoading = false
})
},
SetAllianceContract(){
if(this.addMsg.ContractUrl == ''){ if(this.addMsg.ContractUrl == ''){
this.$message.error(this.$t('objFill.v101.Rest.tianjiafuj')); this.$message.error(this.$t('objFill.v101.Rest.tianjiafuj'));
return return
} }
if(this.saveLoading) return if(this.saveLoading) return
this.saveLoading = true this.saveLoading = true
this.apipost('app_customer_SetAllianceContract', this.addMsg, res => { this.apipost('app_customer_SetAllianceContract', this.addMsg, res => {
...@@ -579,10 +639,6 @@ export default { ...@@ -579,10 +639,6 @@ export default {
}, err=>{ }, err=>{
this.saveLoading = false this.saveLoading = false
}) })
} else {
return false;
}
});
}, },
iniTAddMsg: function () { iniTAddMsg: function () {
this.addMsg = { this.addMsg = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment