|
|
|
@ -45,6 +45,7 @@
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新 增</el-button> |
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain>删 除</el-button> |
|
|
|
|
<el-button type="danger" icon="Upload" @click="handleImport">导 入 </el-button> |
|
|
|
|
<el-button type="danger" icon="Upload" @click="BatchModify">批量修改 </el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
@ -196,7 +197,7 @@
|
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="客户主体" v-if="form.cleanObjType !=3"> |
|
|
|
|
<el-form-item label="客户主体" v-if="form.cleanObjType != 3"> |
|
|
|
|
<el-select v-model="form.mainId" class="m-2" placeholder="请选择客户主体" style="width: 100%" filterable> |
|
|
|
|
<el-option v-for="item in dictList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
|
</el-select> |
|
|
|
@ -327,6 +328,28 @@
|
|
|
|
|
<template #default="{ scope }"> </template> |
|
|
|
|
</tablecmt> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="dialogTime" title="批量修改" width="500"> |
|
|
|
|
<el-form :model="formTime" label-width="auto" style="max-width: 600px" v-loading="loadingTime"> |
|
|
|
|
<el-form-item label="开始日期"> |
|
|
|
|
<el-date-picker v-model="formTime.contractStartTime" type="date" placeholder="选择时间" format="YYYY/MM/DD" |
|
|
|
|
value-format="YYYY-MM-DD" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="结束日期"> |
|
|
|
|
<el-date-picker v-model="formTime.contractEndTime" type="date" placeholder="选择时间" format="YYYY/MM/DD" |
|
|
|
|
value-format="YYYY-MM-DD" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button @click="dialogTime = false">关闭</el-button> |
|
|
|
|
<el-button :disabled="loadingTime" type="primary" @click="TimeSubmit"> |
|
|
|
|
提交 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -343,14 +366,16 @@ import {
|
|
|
|
|
getClientLogList, |
|
|
|
|
$_exportclientTemplate, |
|
|
|
|
$_mainList, |
|
|
|
|
$_updateClientTime, |
|
|
|
|
} from '@/api/basicdata/basicClient'; |
|
|
|
|
import option from '@/option/basicdata/basicClient'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
|
|
import BasicShopSub from '@/views/basicdata/brand/basicShopSub.vue'; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
|
import { getSelect, getLazyTree, getLazyList, getLazyTreeAll } from '@/api/base/region'; |
|
|
|
|
import { getToken } from '@/utils/auth'; |
|
|
|
|
import globalc from '@/api/basicdata/globalc'; |
|
|
|
|
// import globalc from '@/api/basicdata/globalc'; |
|
|
|
|
import { Base64 } from 'js-base64'; |
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
import { exportBlob } from '@/api/common'; |
|
|
|
@ -363,6 +388,12 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
formTime: { |
|
|
|
|
contractEndTime: '', |
|
|
|
|
contractStartTime: '', |
|
|
|
|
}, |
|
|
|
|
loadingTime: false, |
|
|
|
|
dialogTime: false, |
|
|
|
|
excelForm: {}, |
|
|
|
|
clientloading: false, |
|
|
|
|
dictList: [], |
|
|
|
@ -1075,7 +1106,76 @@ export default {
|
|
|
|
|
encodeURIComponent(Base64.encode(row.leaseAccessories)) |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
// 批量修改合同时间 |
|
|
|
|
BatchModify() { |
|
|
|
|
if (!this.selectionList.length) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '请勾选要修改的数据', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.formTime = {} |
|
|
|
|
this.dialogTime = true; |
|
|
|
|
}, |
|
|
|
|
// 批量修改时间提交 |
|
|
|
|
TimeSubmit() { |
|
|
|
|
if (!this.formTime.contractEndTime && !this.formTime.contractStartTime) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '开始时间和结束时间至少选择一个', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
ElMessageBox.confirm( |
|
|
|
|
'是否确认批量修改?', |
|
|
|
|
'提示', |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
this.loading = true |
|
|
|
|
this.loadingTime = true |
|
|
|
|
let data = { |
|
|
|
|
...this.formTime, |
|
|
|
|
ids: this.selectionList.map(item => item.id) |
|
|
|
|
} |
|
|
|
|
if (!data.contractEndTime) { |
|
|
|
|
delete data.contractEndTime |
|
|
|
|
} |
|
|
|
|
if (!data.contractStartTime) { |
|
|
|
|
delete data.contractStartTime |
|
|
|
|
} |
|
|
|
|
console.log(data, '准备提交的数据'); |
|
|
|
|
let res = await $_updateClientTime(data) |
|
|
|
|
const { code, msg } = res.data |
|
|
|
|
if (code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}) |
|
|
|
|
this.dialogTime = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
this.loading = false; |
|
|
|
|
console.log(e, 'e:=>>>>'); |
|
|
|
|
|
|
|
|
|
} finally { |
|
|
|
|
this.loadingTime = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
async changeclientId() { |
|
|
|
|
$_mainList( |
|
|
|
|
{ |
|
|
|
@ -1306,10 +1406,10 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(this.form.mainId){ |
|
|
|
|
this.form.mainName = this.dictList.find(item=>item.id == this.form.mainId).name;//客户主体名称 |
|
|
|
|
if (this.form.mainId) { |
|
|
|
|
this.form.mainName = this.dictList.find(item => item.id == this.form.mainId).name;//客户主体名称 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await add(this.form); |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
@ -1350,8 +1450,8 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(this.form.mainId){ |
|
|
|
|
this.form.mainName = this.dictList.find(item=>item.id == this.form.mainId).name;//客户主体名称 |
|
|
|
|
if (this.form.mainId) { |
|
|
|
|
this.form.mainName = this.dictList.find(item => item.id == this.form.mainId).name;//客户主体名称 |
|
|
|
|
} |
|
|
|
|
await update(this.form); |
|
|
|
|
this.box = false; |
|
|
|
|