123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961 |
- <template>
- <div class="car_add">
- <div>
- <div class="communal-title">
- <div>{{ title }}</div>
- </div>
- </div>
- <hr style='background-color:#5555; height:1px; border:none;' />
- <div class="opcustomers-box">
- <el-form :model="delegationInfo" label-width="100px" class="demo-ruleForm">
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="团组名称:" label-width="160px">
- <el-select v-model="OpCustomersData.diId" clearable filterable placeholder="团组选择"
- :disabled="isShow" @change="DiIdSelectChange">
- <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="团 号:" prop="tourCode" label-width="160px">
- <el-input placeholder="团号" v-model="delegationInfo.tourCode" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="客户:" prop="clientName" label-width="160px">
- <el-input placeholder="客户" v-model="delegationInfo.clientName" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="出访国家:" prop="visitCountry" label-width="160px">
- <el-input placeholder="出访国家" v-model="delegationInfo.visitCountry" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- </div>
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="出访时间:" label-width="160px">
- <el-input placeholder="出访时间" v-model="VisitDate" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="出访人数:" label-width="160px">
- <el-input placeholder="出访人数" v-model="delegationInfo.visitPNumber" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="出访天数:" label-width="160px">
- <el-input placeholder="出访天数" v-model="delegationInfo.visitDays" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- </div>
- </el-form>
- <el-form :model="OpCustomersData" ref="OpCustomersData" :rules="OpCustomersDataRules" label-width="100px"
- class="demo-ruleForm">
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="保险种类:" prop="iid" label-width="160px">
- <el-select v-model="OpCustomersData.iid" filterable placeholder="保险种类" @change="iidChane">
- <el-option v-for="item in insuranceCostList" :key="item.id" :label="item.gName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- <!-- <div style="width: 25%;">
- <el-form-item label="保险余额:" label-width="160px">
- <el-input placeholder="保险余额" v-model="Balance" :disabled="true">
- </el-input>
- </el-form-item>
- </div> -->
- <div style="width: 390px;">
- <el-form-item label="保险费用:" prop="insuranceCosts" label-width="160px">
- <el-input placeholder="保险费用" v-model="OpCustomersData.insuranceCosts" style="width: 48%;">
- </el-input>
- <el-select v-model="OpCustomersData.currency" filterable placeholder="币种"
- style="width: 50%;">
- <el-option v-for="item in currencyList" :key="item.currencyId"
- :label="item.currencyCode" :value="item.currencyId">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </div>
- <div style="width: 100%;">
- <el-form-item label="客户名称:" prop="clientName" label-width="160px">
- <el-select v-model="OpCustomersData.clientName" placeholder="客户名称" multiple clearable
- filterable>
- <el-option v-for="item in fliterClient" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- <!-- <div style="display: flex;">
- <div style="width: 25%;">
- <el-form-item label="附件" prop="attachment" label-width="160px">
- <el-upload :file-list="uploadFiles" ref="upload" :on-success="upLoadSuccess"
- style="width: 200px;" :before-remove="beforeRemove" :limit="1" :on-exceed="exceed"
- :action="uploadURL" :headers="headers" :auto-upload="false" :on-change="onChange">
- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
- </el-upload>
- </el-form-item>
- </div>
- </div> -->
- <div style="display: flex;">
- <div style="width: 100%;">
- <el-form-item label="备 注:" prop="Remark" label-width="160px">
- <el-input type="textarea" :rows="5" placeholder="备注"
- v-model="OpCustomersData.remark"></el-input>
- </el-form-item>
- </div>
- </div>
- <hr style='background-color:#5555; height:1px; border:none;margin-top: 10px;' />
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="支付方式:" prop="payDId" label-width="160px">
- <el-select v-model="OpCustomersData.payDId" placeholder="支付方式" style="width: 100%;"
- @change="payChange">
- <el-option v-for="item in payment" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="消费方式:" prop="consumptionPatterns" label-width="160px">
- <el-input placeholder="消费方式" v-model="OpCustomersData.consumptionPatterns">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="消费日期:" prop="consumptionDate" label-width="160px">
- <el-date-picker v-model="OpCustomersData.consumptionDate" placeholder="消费日期" type="date">
- </el-date-picker>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="付款金额:" prop="payMoney" label-width="160px">
- <el-input placeholder="付款金额" v-model="OpCustomersData.insuranceCosts" style="width: 52%;"
- :disabled="true">
- </el-input>
- <el-select v-model="OpCustomersData.currency" style="width: 45%;" :disabled="true">
- <el-option v-for="item in currencyList" :key="item.currencyId"
- :label="item.currencyCode" :value="item.currencyId">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </div>
- <div v-if="OpCustomersData.payDId == 72">
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="卡类型:" prop="ctdId" label-width="160px">
- <el-select v-model="OpCustomersData.ctdId" placeholder="卡类型" style="width: 100%;"
- @change="ctdChange">
- <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="银行卡号:" prop="bankNo" label-width="160px">
- <el-input placeholder="银行卡号" v-model="OpCustomersData.bankNo" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="持卡人姓名:" prop="cardholderName" label-width="160px">
- <el-input placeholder="持卡人姓名" v-model="OpCustomersData.cardholderName" :disabled="true">
- </el-input>
- </el-form-item>
- </div>
- </div>
- </div>
- <div v-else-if="OpCustomersData.payDId == 73">
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="公司银行账号:" label-width="160px" prop="companyBankNo">
- <el-input placeholder="公司银行账号" v-model="OpCustomersData.companyBankNo">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="对方开户行:" prop="otherBankName" label-width="160px">
- <el-input placeholder="对方开户行:" v-model="OpCustomersData.otherBankName">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="对方银行卡号:" prop="otherSideNo" label-width="160px">
- <el-input placeholder="对方银行卡号" v-model="OpCustomersData.otherSideNo">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="对方姓名:" prop="otherSideName" label-width="160px">
- <el-input placeholder="对方姓名" v-model="OpCustomersData.otherSideName">
- </el-input>
- </el-form-item>
- </div>
- </div>
- </div>
- <div v-else-if="OpCustomersData.payDId == 83">
- <div style="display: flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="对方开户行:" prop="otherBankName" label-width="160px">
- <el-input placeholder="对方开户行" v-model="OpCustomersData.otherBankName">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="对方银行卡号:" prop="otherSideNo" label-width="160px">
- <el-input placeholder="对方银行卡号" v-model="OpCustomersData.otherSideNo">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="对方姓名:" prop="otherSideName" label-width="160px">
- <el-input placeholder="对方姓名" v-model="OpCustomersData.otherSideName">
- </el-input>
- </el-form-item>
- </div>
- </div>
- </div>
- <div v-else></div>
- <div style="display:flex;flex-wrap: wrap;">
- <div style="width: 390px;">
- <el-form-item label="收款方:" prop="payee" label-width="160px">
- <el-input placeholder="对方姓名:" v-model="OpCustomersData.payee">
- </el-input>
- </el-form-item>
- </div>
- <div style="width: 390px;">
- <el-form-item label="费用标识:" prop="orbitalPrivateTransfer" label-width="160px">
- <el-select v-model="OpCustomersData.orbitalPrivateTransfer" placeholder="费用标识"
- style="width: 100%;">
- <el-option key="0" label="公转" :value=0>
- </el-option>
- <el-option key="1" label="私转" :value=1>
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </div>
- <div style="display: flex;">
- <div style="width: 100%;">
- <el-form-item label="备 注:" prop="Remark" label-width="160px">
- <el-input type="textarea" :rows="5" placeholder="备注"
- v-model="OpCustomersData.cRemark"></el-input>
- </el-form-item>
- </div>
- </div>
- <el-form-item>
- <div style="text-align: right;">
- <el-button type="primary" @click="addBtn">保存</el-button>
- <el-button @click="EscAdd">取消</el-button>
- </div>
- </el-form-item>
- </el-form>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- title: "新增保险费用",
- token: '',
- userId: 0,
- id: '',
- isShow: false,
- uploadURL: "http://132.232.92.186:8888/api/Groups/UploadCus",
- headers: {
- Authorization: JSON.parse(localStorage.getItem('userinif')).token,
- },
- projectName: "",
- uploadFiles: [],//上传的文件列表
- DelfileName: "",
- delegationInfo: {},
- delegationInfoList: [],//团组下拉框
- insuranceCostList: [],//保险类型下拉框
- Balance: 0,//保险余额
- currencyList: [],//币种下拉框
- bankCard: [],//卡类型下拉框
- payment: [],//支付方式下拉框
- OpCustomersData: {
- status: 0,
- id: 0,
- diId: 0,
- iid: 2,
- clientName: [],
- insuranceCosts: 0,
- currency: '',
- attachment: '',
- createUserId: 0,
- remark: '',
- payDId: 72,
- consumptionPatterns: '',
- consumptionDate: '',
- ctdId: '',
- companyBankNo: '',
- otherBankName: '',
- otherSideNo: '',
- otherSideName: '',
- bankNo: '',
- cardholderName: '',
- payee: '',
- orbitalPrivateTransfer: 0,
- cRemark: '',
- },
- IsAuditGM: 0,
- VisitDate: '',
- passengerTypeSelect: [],
- transformDateFormat: function (value) {
- // 将value转换为Date对象
- var date = new Date(value);
- // 获取年、月、日
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var day = date.getDate();
- // 将月份和日期转换为两位数的格式
- if (month < 10) {
- month = '0' + month;
- }
- if (day < 10) {
- day = '0' + day;
- }
- // 返回格式化后的日期字符串
- return year + '-' + month + '-' + day;
- },
- OpCustomersDataRules: {
- iid: [
- { required: true, message: '请选择保险名称', trigger: ['blur', 'change'] },
- ],
- clientName: [
- { type: "array", required: true, message: '请选择客户名称', trigger: ['blur', 'change'] },
- ],
- insuranceCosts: [
- { required: true, message: '请输入费用金额', trigger: ['blur', 'change'] },
- { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
- ],
- currency: [
- { required: true, message: '请选择支付币种', trigger: ['blur', 'change'] },
- ],
- payDId: [
- { required: true, message: '请选择支付方式', trigger: ['blur', 'change'] },
- ],
- consumptionPatterns: [
- { required: true, message: '请输入消费方式', trigger: ['blur', 'change'] },
- ],
- consumptionDate: [
- { required: true, message: '请选择消费日期', trigger: ['blur', 'change'] },
- ],
- payee: [
- { required: true, message: '请输入收款方', trigger: ['blur', 'change'] },
- ],
- ctdId: [
- { required: true, message: '请选择卡类型', trigger: ['blur', 'change'] },
- ],
- companyBankNo: [{ required: true, message: '公司银行账号', trigger: ['blur', 'change'] },],
- otherBankName: [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },],
- otherSideNo: [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },],
- totherSideName: [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },],
- },
- clientNameId: [],
- }
- },
- methods: {
- //初始化下拉框
- initializeSelect() {
- //团组下拉框绑定
- var url = "/api/Groups/DecreasePaymentsSelect"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data: {
- userId: that.userId,
- ctId: 82
- }
- }).then(function (res) {
- console.log('DecreasePaymentsSelect', res.data.data);
- if (res.data.code == 200) {
- that.delegationInfoList = res.data.data.groupName; //团组列表
- that.payment = res.data.data.payment; //支付方式
- for (let index = 0; index < that.delegationInfoList.length; index++) {
- if (that.delegationInfoList[index].id == that.OpCustomersData.diId) {
- that.delegationInfo = that.delegationInfoList[index];
- //that.OpCustomersData.diId = that.delegationInfo.id
- that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate); //时间
- var url = "/api/Groups/CustomersInitialize"
- that.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: {
- portType: 1,
- diId: that.OpCustomersData.diId
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- that.insuranceCostList = res.data.data.insuranceCost;//保险类型下拉框
- that.OpCustomersData.iid = that.insuranceCostList[0].id;
- that.Balance = that.insuranceCostList[0].balance;
- that.currencyList = res.data.data.currencyList;//币种下拉框
- if (that.currencyList.length != 0) {
- that.OpCustomersData.currency = that.currencyList[0].currencyId
- }
- that.bankCard = res.data.data.bankCard;//卡类型下拉框
- that.payment = res.data.data.payment;//支付方式下拉框
- if (that.OpCustomersData.id != null && that.OpCustomersData.id != undefined && that.OpCustomersData.id != 0) {
- that.QueryCustomersById();
- that.title = "修改保险费用";
- that.OpCustomersData.status = 2
- that.isShow = true
- } else {
- that.OpCustomersData.status = 1
- that.title = "新增保险费用"
- that.isShow = false
- }
- }
- })
- break;
- }
- }
- }
- })
- },
- DiIdSelectChange() {
- var that = this;
- for (let index = 0; index < that.delegationInfoList.length; index++) {
- if (that.delegationInfoList[index].id == that.OpCustomersData.diId) {
- that.delegationInfo = that.delegationInfoList[index];
- that.VisitDate = that.transformDateFormat(that.delegationInfo.visitStartDate) + '至' + that.transformDateFormat(that.delegationInfo.visitEndDate);
- var url = "/api/Groups/CustomersInitialize"
- that.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: {
- portType: 1,
- diId: that.OpCustomersData.diId
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- that.insuranceCostList = res.data.data.insuranceCost;//保险类型下拉框
- that.OpCustomersData.iid = that.insuranceCostList[0].id;
- that.Balance = that.insuranceCostList[0].balance;
- that.currencyList = res.data.data.currencyList;//币种下拉框
- if (that.currencyList.length != 0) {
- that.OpCustomersData.currency = that.currencyList[0].currencyId
- }
- that.bankCard = res.data.data.bankCard;//卡类型下拉框
- that.payment = res.data.data.payment;//支付方式下拉框
- }
- that.QueryClient();
- that.OpCustomersData.clientName = [];
- })
- break;
- }
- }
- that.$nextTick(() => {
- that.$refs.OpCustomersData.clearValidate();
- })
- },
- iidChane(row) {
- for (let index = 0; index < this.insuranceCostList.length; index++) {
- if (this.insuranceCostList[index].id == row) {
- this.Balance = this.insuranceCostList[index].balance;
- break;
- }
- }
- },
- payChange() {
- this.OpCustomersData.ctdId = '';
- this.OpCustomersData.bankNo = '';
- this.OpCustomersData.cardholderName = '';
- this.OpCustomersData.companyBankNo = '';
- this.OpCustomersData.otherBankName = '';
- this.OpCustomersData.otherSideNo = '';
- this.OpCustomersData.otherSideName = '';
- this.OpCustomersData.cRemark = '';
- if (this.OpCustomersData.payDId == 73) {
- this.OpCustomersDataRules.companyBankNo = [{ required: true, message: '公司银行账号', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.otherBankName = [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.otherSideNo = [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.otherSideName = [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.ctdId = []
- } else if (this.OpCustomersData.payDId == 72) {
- this.OpCustomersDataRules.ctdId = [{ required: true, message: '请选择卡类型', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.companyBankNo = []
- this.OpCustomersDataRules.otherBankName = []
- this.OpCustomersDataRules.otherSideNo = []
- this.OpCustomersDataRules.otherSideName = []
- } else if (this.OpCustomersData.payDId == 83) {
- this.OpCustomersDataRules.companyBankNo = []
- this.OpCustomersDataRules.otherBankName = [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.otherSideNo = [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.otherSideName = [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },]
- this.OpCustomersDataRules.ctdId = []
- } else {
- this.OpCustomersDataRules.companyBankNo = []
- this.OpCustomersDataRules.otherBankName = []
- this.OpCustomersDataRules.otherSideNo = []
- this.OpCustomersDataRules.otherSideName = []
- this.OpCustomersDataRules.ctdId = []
- }
- this.$nextTick(() => {
- this.$refs.OpCustomersData.clearValidate();
- })
- },
- ctdChange(id) {
- this.OpCustomersData.cardholderName = 'Zhang Hailin';
- for (var i = 0; i < this.bankCard.length; i++) {
- if (this.bankCard[i].id == parseInt(id)) {
- this.OpCustomersData.bankNo = this.bankCard[i].remark
- }
- }
- },
- //根据Id获取单挑数据及C表数据
- QueryCustomersById() {
- var url = "/api/Groups/CustomersById"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data: {
- id: that.OpCustomersData.id
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- var CreditCardPayment = res.data.data.creditCard;
- var Customers = res.data.data.customers;
- that.IsAuditGM = CreditCardPayment.isAuditGM;
- that.OpCustomersData.iid = Customers.iid
- for (let index = 0; index < that.insuranceCostList.length; index++) {
- if (that.insuranceCostList[index].id == that.OpCustomersData.iid) {
- that.Balance = that.insuranceCostList[index].balance;
- break;
- }
- }
- var respClientName = Customers.clientName
- that.OpCustomersData.clientName = that.ClientFormat(respClientName);
- that.OpCustomersData.insuranceCosts = Customers.insuranceCosts
- that.OpCustomersData.currency = Customers.currency
- that.OpCustomersData.attachment = Customers.attachment
- that.uploadFiles = []
- if (that.OpCustomersData.attachment != null && that.OpCustomersData.attachment != undefined && that.OpCustomersData.attachment != "") {
- that.uploadFiles.push({
- name: that.OpCustomersData.attachment,
- url: 'http://132.232.92.186:24/Office/GrpFile/保险费用文件上传/',
- })
- }
- that.OpCustomersData.remark = Customers.remark
- that.OpCustomersData.payDId = CreditCardPayment.payDId;
- that.OpCustomersData.consumptionPatterns = CreditCardPayment.consumptionPatterns;
- that.OpCustomersData.consumptionDate = CreditCardPayment.consumptionDate;
- that.OpCustomersData.ctdId = CreditCardPayment.ctdId;
- that.OpCustomersData.bankNo = CreditCardPayment.bankNo;
- that.OpCustomersData.cardholderName = CreditCardPayment.cardholderName;
- that.OpCustomersData.companyBankNo = CreditCardPayment.companyBankNo
- that.OpCustomersData.otherBankName = CreditCardPayment.otherBankName
- that.OpCustomersData.otherSideNo = CreditCardPayment.otherSideNo
- that.OpCustomersData.otherSideName = CreditCardPayment.otherSideName
- that.OpCustomersData.payee = CreditCardPayment.payee;
- that.OpCustomersData.orbitalPrivateTransfer = CreditCardPayment.orbitalPrivateTransfer;
- that.OpCustomersData.cRemark = CreditCardPayment.remark;
- }
- })
- },
- addBtn() {
- if (this.IsAuditGM == 1) {
- this.$message.error('已通过审核,不可修改!');
- } else {
- if (this.OpCustomersData.diId == null || this.OpCustomersData.diId == undefined || this.OpCustomersData.diId == "") {
- this.$message.error("请选择团组名称");
- return;
- } else {
- const that = this;
- that.$refs.OpCustomersData.validate((valid) => {
- if (valid) {
- {
- that.OpCustomersData.createUserId = that.userId;
- if (that.OpCustomersData.ctdId == '') {
- that.OpCustomersData.ctdId = 0
- }
- var url = "/api/Groups/OpCustomers"
- that.OpCustomersData.clientName = that.ClientFormat(that.OpCustomersData.clientName);//处理数组
- that.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: that.OpCustomersData
- }).then(function (res) {
- if (res.data.code == 200) {
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- that.loading = true;
- setTimeout(() => {
- that.$router.push({
- path: "/home/Customers",
- query: {
- diId: that.OpCustomersData.diId
- }
- })
- }, 500);
- } else {
- that.$message.error(res.data.msg);
- }
- }).finally(() => {
- that.OpCustomersData.clientName = that.ClientFormat(that.OpCustomersData.clientName);
- console.log('run finally code');
- });
- }
- } else {
- this.$message.error('请完善信息在保存!');
- return false;
- }
- })
- }
- }
- },
- /* 文件上传相关
- //上传
- // 文件超出限制
- exceed(files, fileList) {
- this.$message.warning(
- `当前限制选择 1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
- } 个文件,请取消要替换的文件`
- );
- },
- //文件上传成功时的钩子
- upLoadSuccess(response, file, fileList) {
- var that = this;
- if (response.code == 200) {
- if (that.DelfileName != null && that.DelfileName != "" && that.DelfileName != undefined) {
- that.$axios({
- method: 'post',
- url: "/api/Groups/DelFileCus",
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: {
- fileName: that.DelfileName,
- id: that.id
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- }
- })
- }
- //that.ctdId = that.ctdIdPay;
- that.OpCustomersData.createUserId = that.userId;
- that.OpCustomersData.attachment = that.projectName;
- if (that.OpCustomersData.ctdId == '') {
- that.OpCustomersData.ctdId = 0
- }
- var url = "/api/Groups/OpCustomers"
- that.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: that.OpCustomersData
- }).then(function (res) {
- if (res.data.code == 200) {
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- that.loading = true;
- setTimeout(() => {
- that.$router.push({
- path: "/home/Customers",
- query: {
- diId: that.OpCustomersData.diId
- }
- })
- }, 3000);
- } else {
- that.$message.error(res.data.msg);
- }
- })
- } else {
- if (that.DelfileName != null && that.DelfileName != "" && that.DelfileName != undefined) {
- that.$axios({
- method: 'post',
- url: "/api/Groups/DelFile",
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: {
- fileName: that.DelfileName,
- id: that.OpCustomersData.id
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- }
- })
- }
- that.OpCustomersData.createUserId = that.userId;
- if (that.OpCustomersData.ctdId == '') {
- that.OpCustomersData.ctdId = 0
- }
- var url = "/api/Groups/OpCustomers"
- that.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: that.OpCustomersData
- }).then(function (res) {
- if (res.data.code == 200) {
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- that.loading = true;
- setTimeout(() => {
- that.$router.push({
- path: "/home/Customers",
- query: {
- diId: that.OpCustomersData.diId
- }
- })
- }, 3000);
- } else {
- that.$message.error(res.data.msg);
- }
- })
- }
- },
- beforeRemove(file, fileList) {
- console.log(file.name)
- let id1 = this.uploadFiles.findIndex(item => {
- if (item.name == file.name) {
- return true
- }
- })
- this.uploadFiles.splice(id1, 1)
- this.projectName = ""
- this.DelfileName = file.name
- },
- onChange(file, fileList) {
- this.projectName = file.name
- },
- */
- EscAdd() {
- this.$router.push({
- path: "/home/Customers",
- query: {
- diId: this.OpCustomersData.diId
- }
- })
- },
- //加载团组客户名单
- QueryClient() {
- var url = "/api/Groups/QueryClientInfoByDIID"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- data: {
- diid: this.OpCustomersData.diId
- }
- }).then(function (res) {
- if (res.data.code == 200) {
- //客户名单
- console.log(res.data.data);
- that.clientNameId = res.data.data;
- }
- })
- },
- ClientFormat(val) {
- var result = [];
- if (typeof val == "string") {
- if (val.indexOf(',') != -1) {
- result = val.split(',').map(x => { return Number(x) }).filter(f => f > 0)
- } else {
- var clientId = Number(val);
- if (clientId > 0) {
- result = [clientId]
- }
- }
- } else if (Array.isArray(val)) {
- if (val.length > 0) {
- result = val.join();
- }
- } else {
- result = val;
- }
- return result;
- }
- },
- mounted() {
- this.token = JSON.parse(localStorage.getItem('userinif')).token;
- this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
- this.OpCustomersData.diId = parseInt(this.$route.query.DiId)
- this.QueryClient();
- this.initializeSelect();
- this.OpCustomersData.id = this.$route.query.id
- },
- computed: {
- //客户名单属性
- fliterClient() {
- var arr = [];
- if (this.clientNameId.length < 1) {
- return [];
- }
- this.clientNameId.forEach(element => {
- var item = "";
- if (element.pinyin) {
- item += element.pinyin;
- }
- if (element.firstName && element.lastName) {
- item += "(" + element.lastName + element.firstName + ")";
- }
- if (item) {
- arr.push({ id: element.id, name: item });
- }
- });
- return arr;
- }
- }
- }
- </script>
- <style>
- .communal-list {
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- }
- .car_add .communal-title {
- display: flex;
- font-size: 17px;
- font-weight: 600;
- color: #555;
- margin-bottom: 20px;
- justify-content: space-between;
- align-items: center;
- }
- .appraise-box {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin: 50px 0;
- }
- .appraise-box>div {
- width: 30%;
- }
- .communal-box {
- display: flex;
- }
- .communal-box>button {
- margin-left: 10px;
- padding: 8px 20px;
- }
- .car_add {
- background-color: #fff;
- padding: 20px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- }
- .opcustomers-box .el-select {
- width: 100%;
- }
- .opcustomers-box .el-date-editor .el-input {
- width: 100%;
- }
- @media screen and (max-width: 1700px) {
- .appraise-box>div {
- width: 48%;
- }
- .appraise-box>div el-form-item__content {
- width: 260px !important;
- }
- }
- </style>
|