Commit 3a00a5de by chenwq

格式化代码

1 parent a30999f7
<!-- 新增交付数&修改交付数&交付数详情 --> <!-- 新增交付数&修改交付数&交付数详情 -->
<template> <template>
<baseDialog :dialog-config="dialogConfig" <baseDialog class="accountDailog"
:is-show.sync="dialogShow"
:config="config" :config="config"
class="accountDailog" :dialog-config="dialogConfig"
:is-show.sync="dialogShow"
@handleClick="handleAddConfirm"> @handleClick="handleAddConfirm">
<div class="add-dialog"> <div class="add-dialog">
<el-form ref="infoForm" <el-form ref="infoForm"
class="infoForm d2-container-content" class="infoForm d2-container-content"
label-width="130px"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules">
label-width="130px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="4S门店:" <el-form-item label="4S门店:"
:prop="operationType =='add'?'merchantId':''"> :prop="operationType == 'add' ? 'merchantId' : ''">
<div v-if="operationType =='add'"> <div v-if="operationType == 'add'">
<el-select v-model="formData.merchantId" <el-select v-model="formData.merchantId"
v-el-select-loadmore="interestsLoadmore"
class="sortInput"
placeholder="请选择" placeholder="请选择"
filterable
remote remote
reserve-keyword reserve-keyword
@visible-change="visibleChange"
@change="choose4S"
:remote-method="remoteMethod" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" @change="choose4S"
filterable @visible-change="visibleChange">
class="sortInput">
<el-option v-for="subItem in baseData.merchantList" <el-option v-for="subItem in baseData.merchantList"
:key="subItem.merchantId" :key="subItem.merchantId"
:label="`${subItem.merchantName}(${subItem.merchantId})`" :label="`${subItem.merchantName}(${subItem.merchantId})`"
...@@ -34,23 +34,23 @@ ...@@ -34,23 +34,23 @@
</el-select> </el-select>
</div> </div>
<div v-else> <div v-else>
{{ formData.merchantName +'('+ formData.merchantId +')' }} {{ `${formData.merchantName}(${formData.merchantId})` }}
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="品牌:" <el-form-item label="品牌:"
:prop="operationType =='add'?'brand':''"> :prop="operationType == 'add' ? 'brand' : ''">
<div v-if="operationType =='add'"> <div v-if="operationType == 'add'">
<el-cascader ref="cascader" <el-cascader ref="cascader"
:options="carBrands"
v-model="formData.brand" v-model="formData.brand"
class="sortInput"
placeholder="请先选择4S门店" placeholder="请先选择4S门店"
filterable
@change="chooseBrand"
clearable clearable
:props="{ label: 'name', value: 'id', children:'subList' }" filterable
class="sortInput"> :options="carBrands"
:props="{ label: 'name', value: 'id', children: 'subList' }"
@change="chooseBrand">
</el-cascader> </el-cascader>
</div> </div>
<div v-else> <div v-else>
...@@ -62,15 +62,15 @@ ...@@ -62,15 +62,15 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="交付目标月份:" <el-form-item label="交付目标月份:"
:prop="operationType =='add'?'targetMonth':''"> :prop="operationType == 'add' ? 'targetMonth' : ''">
<div v-if="operationType =='add'"> <div v-if="operationType == 'add'">
<el-date-picker v-model="formData.targetMonth" <el-date-picker v-model="formData.targetMonth"
type="month" class="sortInput"
value-format="yyyy-MM"
format="yyyy-MM" format="yyyy-MM"
placeholder="选择月" placeholder="选择月"
type="month"
value-format="yyyy-MM"
:picker-options="pickerOption" :picker-options="pickerOption"
class="sortInput"
@change="handleTargetMonthChange"> @change="handleTargetMonthChange">
</el-date-picker> </el-date-picker>
</div> </div>
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="归属周期:" <el-form-item label="归属周期:"
:prop="operationType !='detail'?'periodRange':''"> :prop="operationType != 'detail' ? 'periodRange' : ''">
<div v-if="operationType !='detail'"> <div v-if="operationType != 'detail'">
<period-date-range v-model="formData.periodRange" <PeriodDateRange v-model="formData.periodRange"
:target-month="formData.targetMonth" /> :target-month="formData.targetMonth" />
</div> </div>
<div v-else> <div v-else>
...@@ -95,12 +95,12 @@ ...@@ -95,12 +95,12 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="交付数:" <el-form-item label="交付数:"
:prop="operationType !='detail'?'targetValue':''"> :prop="operationType != 'detail' ? 'targetValue' : ''">
<div v-if="operationType !='detail'"> <div v-if="operationType != 'detail'">
<el-input v-model="formData.targetValue" <el-input v-model="formData.targetValue"
@input="targetValue_handleInput" class="sortInput"
placeholder="请输入" placeholder="请输入"
class="sortInput" /> @input="targetValue_handleInput" />
</div> </div>
<div v-else> <div v-else>
{{ formData.targetValue }} {{ formData.targetValue }}
...@@ -108,21 +108,23 @@ ...@@ -108,21 +108,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="录入时间:" <el-form-item v-if="operationType != 'add'"
v-if="operationType!='add'"> label="录入时间:">
{{ formData.createdDateShow }} {{ formData.createdDateShow }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div v-if="operationType!='add'"> <div v-if="operationType != 'add'">
<div class="div-title">操作记录</div> <div class="div-title">
操作记录
</div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table ref="recordTable" <d2-table ref="recordTable"
:has-page="false"
:has-num="false" :has-num="false"
:table-data="tableData" :has-page="false"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-data="tableData"
:table-params="tableParams"> :table-params="tableParams">
</d2-table> </d2-table>
</div> </div>
...@@ -132,180 +134,180 @@ ...@@ -132,180 +134,180 @@
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { getList } from "@api/merchant";
import { limitPrice, rangePickerOptions_deliveryQuantity, getMonthDateRange, parsePeriodDateStr } from '@/common/format' import { getById_deliver, getCarBrand, insertDeliverTargeConfig, updateDeliverTargeConfig } from "@api/shopConfig";
import { getList } from "@api/merchant" import { outputValue_operTypeOpt } from "@/common/constants.js";
import { outputValue_operTypeOpt } from "@/common/constants.js" import { getMonthDateRange, limitPrice, parsePeriodDateStr, rangePickerOptions_deliveryQuantity } from "@/common/format";
import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig' import { deepClone, Util } from "@/common/util";
import periodDateRange from './periodDateRange' import periodDateRange from "./periodDateRange";
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' // import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
name: 'EditDialog', name: "EditDialog",
components: { components: {
periodDateRange PeriodDateRange: periodDateRange,
}, },
// mixins: [reportTrackFunMixin], // mixins: [reportTrackFunMixin],
directives: { directives: {
'el-select-loadmore': { "el-select-loadmore": {
bind(el, binding) { bind(el, binding) {
setTimeout(() => { setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector( const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap' ".el-select-dropdown .el-select-dropdown__wrap",
) );
SELECTWRAP_DOM.addEventListener('scroll', function () { SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = const condition
this.scrollHeight - this.scrollTop <= this.clientHeight = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) { if (condition) {
binding.value() binding.value();
}
})
}, 100)
}
} }
});
}, 100);
},
},
},
props: {
visible: {
type: Boolean,
default: false,
},
paramsObj: {
type: Object,
default: null,
},
operationType: {
type: String,
default: "",
},
}, },
data() { data() {
return { return {
config: { config: {
appendToBody: true, appendToBody: true,
isShowFooter: true, isShowFooter: true,
confirm_name: '确定', confirm_name: "确定",
cancel_name: '取消' cancel_name: "取消",
}, },
pickerOption: rangePickerOptions_deliveryQuantity, pickerOption: rangePickerOptions_deliveryQuantity,
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
formData: { formData: {
merchantId: '', merchantId: "",
merchantName: '', merchantName: "",
brand: [], brand: [],
brandId: '', brandId: "",
brandName: '', brandName: "",
childId: '', childId: "",
childName: '', childName: "",
targetValue: '', targetValue: "",
targetMonth: '', targetMonth: "",
periodRange: [], periodRange: [],
periodDateStr: '' periodDateStr: "",
}, },
oldVal: { oldVal: {
targetValue: '' targetValue: "",
}, },
dialogConfig: { dialogConfig: {
title: '新增交付数', title: "新增交付数",
// width: '700px' // width: '700px'
width: '1080px' width: "1080px",
}, },
formRules: { formRules: {
merchantId: [{ required: true, message: '请选择4S门店', trigger: 'change' }], merchantId: [{ required: true, message: "请选择4S门店", trigger: "change" }],
brand: [{ required: true, message: '请选择品牌', trigger: 'change' }], brand: [{ required: true, message: "请选择品牌", trigger: "change" }],
targetMonth: [{ required: true, message: '请选择交付目标月份', trigger: 'change' }], targetMonth: [{ required: true, message: "请选择交付目标月份", trigger: "change" }],
periodRange: [{ periodRange: [{
required: true, required: true,
trigger: 'change', trigger: "change",
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!value || value.length !== 2 || !value[0] || !value[1]) { if (!value || value.length !== 2 || !value[0] || !value[1]) {
callback(new Error('请选择归属周期')) callback(new Error("请选择归属周期"));
return return;
} }
const monthRange = getMonthDateRange(this.formData.targetMonth) const monthRange = getMonthDateRange(this.formData.targetMonth);
if (!monthRange) { if (!monthRange) {
callback(new Error('请先选择交付目标月份')) callback(new Error("请先选择交付目标月份"));
return return;
} }
if (value[0] !== monthRange.startDate) { if (value[0] !== monthRange.startDate) {
callback(new Error('归属周期开始日期必须为当月1号')) callback(new Error("归属周期开始日期必须为当月1号"));
return return;
} }
if (value[1] < value[0] || value[1] > monthRange.endDate) { if (value[1] < value[0] || value[1] > monthRange.endDate) {
callback(new Error('归属周期结束日期无效')) callback(new Error("归属周期结束日期无效"));
return return;
}
callback()
} }
callback();
},
}], }],
targetValue: [{ required: true, message: '请输入交付数', trigger: 'blur' }] targetValue: [{ required: true, message: "请输入交付数", trigger: "blur" }],
}, },
searchForm: { searchForm: {
id: '' id: "",
}, },
searchFormSearch: {}, searchFormSearch: {},
// getListApi: findByMsgId, // getListApi: findByMsgId,
tableData: [], tableData: [],
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: 'list', listName: "list",
tableOption: false, tableOption: false,
tableColumns: [{ tableColumns: [{
label: '操作项', label: "操作项",
prop: 'operType', prop: "operType",
formatter: (cellValue) => { formatter: (cellValue) => {
return this.operTypeOpt.find(item => item.confId === cellValue.operType)?.confValue + '交付数数据' return this.operTypeOpt.find(item => item.confId === cellValue.operType)?.confValue + "交付数数据";
} },
}, { }, {
label: '操作时间', label: "操作时间",
prop: 'createdDate', prop: "createdDate",
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') return Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss");
} },
}, { }, {
label: '操作人', label: "操作人",
prop: 'createdBy' prop: "createdBy",
}] }],
}, },
baseData: { baseData: {
merchantList: [] merchantList: [],
}, },
carBrands: [], carBrands: [],
operTypeOpt: deepClone(outputValue_operTypeOpt), operTypeOpt: deepClone(outputValue_operTypeOpt),
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20,
// track_event_code: 'shopConfig_merchantDeliverTargeConfig_add', // track_event_code: 'shopConfig_merchantDeliverTargeConfig_add',
// track_businessParam_key: 'searchForm' // track_businessParam_key: 'searchForm'
} };
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: null
},
operationType: {
type: String,
default: ""
}
},
watch: {
}, },
computed: { computed: {
dialogShow: { dialogShow: {
get() { get() {
// this.setCode() // this.setCode()
// this.onPageShow() // this.onPageShow()
return this.visible return this.visible;
}, },
set(newVal) { set(newVal) {
// this.onPageHide() // this.onPageHide()
this.$emit('dialogClose', { flag: newVal }) this.$emit("dialogClose", { flag: newVal });
} },
} },
},
watch: {
}, },
mounted() { mounted() {
if (this.paramsObj) { if (this.paramsObj) {
this.getInfo(this.paramsObj.id) this.getInfo(this.paramsObj.id);
if (this.operationType == 'edit') { if (this.operationType == "edit") {
this.dialogConfig.title = '修改交付数' this.dialogConfig.title = "修改交付数";
} else { } else {
this.dialogConfig.title = '查看交付数详情' this.dialogConfig.title = "查看交付数详情";
this.config.isShowFooter = false this.config.isShowFooter = false;
} }
} else { } else {
this.dialogConfig.title = '新增交付数' this.dialogConfig.title = "新增交付数";
this.getSelectingList() this.getSelectingList();
} }
}, },
...@@ -323,117 +325,121 @@ export default { ...@@ -323,117 +325,121 @@ export default {
// }, // },
// 获取4S门店数据 // 获取4S门店数据
remoteMethod(query) { remoteMethod(query) {
this.merchantName = query this.merchantName = query;
this.currentPage = 1 this.currentPage = 1;
this.baseData.merchantList = [] this.baseData.merchantList = [];
this.getSelectingList() // 请求接口 this.getSelectingList(); // 请求接口
}, },
getSelectingList(defaultSelect) { getSelectingList(defaultSelect) {
getList({ getList({
merchantName: this.merchantName, merchantName: this.merchantName,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize,
}).then(res => { }).then((res) => {
this.allPages = res.pages this.allPages = res.pages;
const resArr = [...res.list] const resArr = [...res.list];
let arr = this.baseData.merchantList.concat(resArr) let arr = this.baseData.merchantList.concat(resArr);
if (defaultSelect?.length) arr = arr.concat(defaultSelect) if (defaultSelect?.length) {
this.baseData.merchantList = arr arr = arr.concat(defaultSelect);
}
this.baseData.merchantList = arr;
}).catch(() => { }).catch(() => {
}) });
}, },
visibleChange(data) { visibleChange(data) {
// 获取焦点重新渲染下拉框数据 // 获取焦点重新渲染下拉框数据
if (data) { if (data) {
if (this.merchantName) { if (this.merchantName) {
this.merchantName = '' this.merchantName = "";
this.currentPage = 1 this.currentPage = 1;
this.baseData.merchantList = [] this.baseData.merchantList = [];
this.getSelectingList() this.getSelectingList();
} }
} }
}, },
// 获取更多4S店 // 获取更多4S店
interestsLoadmore() { interestsLoadmore() {
setTimeout(() => { setTimeout(() => {
this.currentPage = this.currentPage + 1 this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) { if (this.allPages < this.currentPage) {
this.currentPage = this.allPages this.currentPage = this.allPages;
return return;
} }
this.getSelectingList() this.getSelectingList();
}, 10) }, 10);
}, },
getInfo(id) { getInfo(id) {
getById_deliver({ getById_deliver({
id: id id,
}).then(res => { }).then((res) => {
this.formData = deepClone(res) this.formData = deepClone(res);
this.tableData = deepClone(res.logList) this.tableData = deepClone(res.logList);
// this.formData.brand = [this.formData.brandId, this.formData.childId] // this.formData.brand = [this.formData.brandId, this.formData.childId]
// const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName } // const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName }
// this.getSelectingList(obj) // this.getSelectingList(obj)
// this.getCarBrand(this.formData.merchantId) // this.getCarBrand(this.formData.merchantId)
this.formData.createdDateShow = this.formData.createdDate this.formData.createdDateShow = this.formData.createdDate
? Util.dateFormate(this.formData.createdDate, 'YYYY-MM-DD HH:mm:ss') ? Util.dateFormate(this.formData.createdDate, "YYYY-MM-DD HH:mm:ss")
: "" : "";
this.fillPeriodRange() this.fillPeriodRange();
}).catch(() => { }).catch(() => {
}) });
}, },
fillPeriodRange() { fillPeriodRange() {
if (this.operationType === 'detail') return if (this.operationType === "detail") {
let start = '' return;
let end = '' }
let start = "";
let end = "";
if (this.formData.periodStartDate && this.formData.periodEndDate) { if (this.formData.periodStartDate && this.formData.periodEndDate) {
start = Util.dateFormate(this.formData.periodStartDate, 'YYYY-MM-DD') start = Util.dateFormate(this.formData.periodStartDate, "YYYY-MM-DD");
end = Util.dateFormate(this.formData.periodEndDate, 'YYYY-MM-DD') end = Util.dateFormate(this.formData.periodEndDate, "YYYY-MM-DD");
} else if (this.formData.periodDateStr) { } else if (this.formData.periodDateStr) {
const parsed = parsePeriodDateStr(this.formData.periodDateStr) const parsed = parsePeriodDateStr(this.formData.periodDateStr);
if (parsed) { if (parsed) {
start = parsed[0] start = parsed[0];
end = parsed[1] end = parsed[1];
} }
} }
if (start && end) { if (start && end) {
this.$set(this.formData, 'periodRange', [start, end]) this.$set(this.formData, "periodRange", [start, end]);
} }
}, },
handleTargetMonthChange() { handleTargetMonthChange() {
this.formData.periodRange = [] this.formData.periodRange = [];
}, },
choose4S(merchantId) { choose4S(merchantId) {
this.formData.brand = [] this.formData.brand = [];
this.formData.brandId = '' this.formData.brandId = "";
this.formData.brandName = '' this.formData.brandName = "";
this.formData.childId = '' this.formData.childId = "";
this.formData.childName = '' this.formData.childName = "";
if (merchantId) { if (merchantId) {
this.getCarBrand(merchantId) this.getCarBrand(merchantId);
} }
}, },
getCarBrand(merchantId) { getCarBrand(merchantId) {
getCarBrand({ getCarBrand({
merchantId: merchantId merchantId,
}).then(res => { }).then((res) => {
this.carBrands = deepClone(res) this.carBrands = deepClone(res);
}).catch(() => { }).catch(() => {
}) });
}, },
chooseBrand(value) { chooseBrand(value) {
const checkedNode = this.$refs.cascader.getCheckedNodes()[0] const checkedNode = this.$refs.cascader.getCheckedNodes()[0];
const brandNode = checkedNode.pathNodes[0] const brandNode = checkedNode.pathNodes[0];
const childNode = checkedNode.pathNodes[1] const childNode = checkedNode.pathNodes[1];
this.formData.brandId = brandNode.value this.formData.brandId = brandNode.value;
this.formData.brandName = brandNode.label this.formData.brandName = brandNode.label;
this.formData.childId = childNode.value this.formData.childId = childNode.value;
this.formData.childName = childNode.label this.formData.childName = childNode.label;
}, },
targetValue_handleInput(newVal) { targetValue_handleInput(newVal) {
...@@ -443,41 +449,42 @@ export default { ...@@ -443,41 +449,42 @@ export default {
11, 11,
0, 0,
0, 0,
99999999999 99999999999,
) );
this.oldVal.targetValue = this.formData.targetValue this.oldVal.targetValue = this.formData.targetValue;
}, },
handleAddConfirm() { handleAddConfirm() {
if (this.operationType == 'detail') { if (this.operationType == "detail") {
this.dialogShow = false this.dialogShow = false;
return return;
} }
this.$refs.infoForm.validate(valid => { this.$refs.infoForm.validate((valid) => {
if (valid) { if (valid) {
var params = deepClone(this.formData) let params = deepClone(this.formData);
params.periodStartDate = params.periodRange[0] params.periodStartDate = params.periodRange[0];
params.periodEndDate = params.periodRange[1] params.periodEndDate = params.periodRange[1];
delete params.periodRange delete params.periodRange;
if (params.id) { if (params.id) {
updateDeliverTargeConfig(params).then(res => { updateDeliverTargeConfig(params).then((res) => {
this.notice.okTips('操作成功') this.notice.okTips("操作成功");
this.dialogShow = true this.dialogShow = true;
}) });
} else { } else {
params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId).merchantName params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId).merchantName;
insertDeliverTargeConfig(params).then(res => { insertDeliverTargeConfig(params).then((res) => {
this.notice.okTips('操作成功') this.notice.okTips("操作成功");
this.dialogShow = true this.dialogShow = true;
}) });
} }
} }
}) });
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-dialog { .add-dialog {
margin: 20px 0; margin: 20px 0;
......
<!-- 主机厂交付数 --> <!-- 主机厂交付数 -->
<template> <template>
<d2-container class="m-t-40"> <d2-container class="m-t-40">
<div class="header" <div slot="header"
slot="header" class="header"
style="padding-bottom: 20px;"> style="padding-bottom: 20px;">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" label-width="120px"
:form-data="showFormData" :form-data="showFormData"
label-width="120px"> :search-form="searchForm">
<div slot="4sHtml"> <div slot="4sHtml">
<el-select v-model="searchForm.merchantIdList" <el-select v-model="searchForm.merchantIdList"
multiple v-el-select-loadmore="interestsLoadmore"
placeholder="请选择4S店"
style="width: 100%;"
collapse-tags collapse-tags
filterable
multiple
remote remote
reserve-keyword reserve-keyword
placeholder="请选择4S店"
@visible-change="visibleChange"
:remote-method="remoteMethod" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" @visible-change="visibleChange">
style="width: 100%;"
filterable>
<el-option v-for="subItem in baseData.merchantList" <el-option v-for="subItem in baseData.merchantList"
:key="subItem.merchantId" :key="subItem.merchantId"
:label="`${subItem.merchantName}(${subItem.merchantId})`" :label="`${subItem.merchantName}(${subItem.merchantId})`"
...@@ -30,17 +30,18 @@ ...@@ -30,17 +30,18 @@
</div> </div>
<div slot="targetMonthHtml"> <div slot="targetMonthHtml">
<el-date-picker v-model="searchForm.targetMonth" <el-date-picker v-model="searchForm.targetMonth"
type="month"
value-format="yyyy-MM"
format="yyyy-MM" format="yyyy-MM"
placeholder="选择月" placeholder="选择月"
style="width: 100%;"> style="width: 100%;"
type="month"
value-format="yyyy-MM">
</el-date-picker> </el-date-picker>
</div> </div>
<div slot="targetValueHtml"> <div slot="targetValueHtml">
<input-range start-placeholder="最小交付数" <InputRange end-placeholder="最大交付数"
end-placeholder="最大交付数" start-placeholder="最小交付数"
:display-value="searchForm.targetValue"></input-range> :display-value="searchForm.targetValue">
</InputRange>
</div> </div>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
...@@ -50,7 +51,9 @@ ...@@ -50,7 +51,9 @@
查询 查询
</el-button> </el-button>
<el-button size="small" <el-button size="small"
@click="handleReset"> 重置 </el-button> @click="handleReset">
重置
</el-button>
</div> </div>
</div> </div>
<!-- </div> --> <!-- </div> -->
...@@ -58,13 +61,14 @@ ...@@ -58,13 +61,14 @@
<d2-table-header> <d2-table-header>
<span> <span>
<auth-button category="Button" <auth-button category="Button"
:show-btn-ids="['9061921','9061922','9061923']" /></span> :show-btn-ids="['9061921', '9061922', '9061923']" />
</span>
</d2-table-header> </d2-table-header>
<d2-table ref="recordTable" <d2-table ref="recordTable"
:search-form="searchFormSearch" :before-search-fn="beforeSearchFn"
:table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :search-form="searchFormSearch"
:table-params="tableParams">
<div slot="auth-button" <div slot="auth-button"
slot-scope="scope"> slot-scope="scope">
<!-- 详情 --> <!-- 详情 -->
...@@ -73,22 +77,22 @@ ...@@ -73,22 +77,22 @@
:show-btn-ids="['9061924']" /> :show-btn-ids="['9061924']" />
</span> </span>
<!-- 修改 --> <!-- 修改 -->
<span style="margin-right: 10px" <span v-if="scope.scope.allowUpdate == true"
v-if="scope.scope.allowUpdate == true"> style="margin-right: 10px">
<auth-button :data="scope.scope" <auth-button :data="scope.scope"
:show-btn-ids="['9061925']" /> :show-btn-ids="['9061925']" />
</span> </span>
<!-- 删除 --> <!-- 删除 -->
<span style="margin-right: 10px" <span v-if="scope.scope.allowUpdate == true"
v-if="scope.scope.allowUpdate == true"> style="margin-right: 10px">
<auth-button :data="scope.scope" <auth-button :data="scope.scope"
:show-btn-ids="['9061926']" /> :show-btn-ids="['9061926']" />
</span> </span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
<d2-file-import-dialog :is-visible="fileVisible" <d2-file-import-dialog title="交付数导入"
title="交付数导入" :is-visible="fileVisible"
@closeDialog="handleImport" @closeDialog="handleImport"
@confirmDialog="handleConfirmImport" @confirmDialog="handleConfirmImport"
@downloadTemplate="exportTemplate"> @downloadTemplate="exportTemplate">
...@@ -96,61 +100,68 @@ ...@@ -96,61 +100,68 @@
<el-form-item label="交付目标月份:" <el-form-item label="交付目标月份:"
required> required>
<el-date-picker v-model="importForm.targetMonth" <el-date-picker v-model="importForm.targetMonth"
type="month"
value-format="yyyy-MM"
format="yyyy-MM" format="yyyy-MM"
placeholder="选择月" placeholder="选择月"
:picker-options="importMonthPickerOption"
style="width: 100%;" style="width: 100%;"
type="month"
value-format="yyyy-MM"
:picker-options="importMonthPickerOption"
@change="handleImportTargetMonthChange" /> @change="handleImportTargetMonthChange" />
</el-form-item> </el-form-item>
<el-form-item label="归属周期:" <el-form-item label="归属周期:"
required> required>
<period-date-range v-model="importForm.periodRange" <PeriodDateRange v-model="importForm.periodRange"
:target-month="importForm.targetMonth" /> :target-month="importForm.targetMonth" />
</el-form-item> </el-form-item>
</template> </template>
</d2-file-import-dialog> </d2-file-import-dialog>
<!-- 新增&修改&详情 --> <!-- 新增&修改&详情 -->
<edit-dialog :visible.sync="editVisible" <EditDialog v-if="editVisible"
v-if="editVisible"
:params-obj="recordInfo"
:operation-type="operationType" :operation-type="operationType"
:params-obj="recordInfo"
:visible.sync="editVisible"
@dialogClose="closeEditDialog" /> @dialogClose="closeEditDialog" />
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { mapActions, mapState } from "vuex" import { getList } from "@api/merchant";
import { Util, deepClone } from "@/common/util" import { deleteById_deliver, deliverTargeConfigImport, distinctAllBrand, listWithPage_deliver } from "@api/shopConfig";
import inputRange from './components/inputRange' import { mapActions, mapState } from "vuex";
import editDialog from "./components/editDialog" import { rangePickerOptions_deliveryQuantity_import } from "@/common/format";
import periodDateRange from './components/periodDateRange' import { deepClone, Util } from "@/common/util";
import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig' import reportTrackFunMixin from "@/mixins/reportTrackFunMixin";
import { getList } from "@api/merchant" import editDialog from "./components/editDialog";
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' import inputRange from "./components/inputRange";
import { rangePickerOptions_deliveryQuantity_import } from '@/common/format' import periodDateRange from "./components/periodDateRange";
export default { export default {
name: "DeliveryQuantity", name: "DeliveryQuantity", // 导入混入
mixins: [reportTrackFunMixin], // 导入混入
directives: { directives: {
'el-select-loadmore': { "el-select-loadmore": {
bind(el, binding) { bind(el, binding) {
setTimeout(() => { setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector( const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap' ".el-select-dropdown .el-select-dropdown__wrap",
) );
SELECTWRAP_DOM.addEventListener('scroll', function () { SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = const condition
this.scrollHeight - this.scrollTop <= this.clientHeight = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) { if (condition) {
binding.value() binding.value();
}
})
}, 100)
}
} }
});
}, 100);
}, },
},
},
components: {
InputRange: inputRange,
EditDialog: editDialog,
PeriodDateRange: periodDateRange,
},
mixins: [reportTrackFunMixin],
data() { data() {
return { return {
searchForm: { searchForm: {
...@@ -158,14 +169,14 @@ export default { ...@@ -158,14 +169,14 @@ export default {
brandChildIdList: [], brandChildIdList: [],
targetMonth: "", targetMonth: "",
targetValue: [], targetValue: [],
createTime: "" createTime: "",
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
{ {
label: "4S门店", label: "4S门店",
name: "merchantIdList", name: "merchantIdList",
addHtml: "4sHtml" addHtml: "4sHtml",
}, },
{ {
label: "品牌", label: "品牌",
...@@ -175,30 +186,30 @@ export default { ...@@ -175,30 +186,30 @@ export default {
optionList: [], optionList: [],
optionId: "childId", optionId: "childId",
optionLabel: "childName", optionLabel: "childName",
optionsName: "brandList" optionsName: "brandList",
}, },
{ {
label: '交付目标月份', label: "交付目标月份",
name: 'targetMonth', name: "targetMonth",
addHtml: "targetMonthHtml" addHtml: "targetMonthHtml",
}, },
{ {
label: '交付数', label: "交付数",
name: 'targetValue', name: "targetValue",
addHtml: "targetValueHtml" addHtml: "targetValueHtml",
}, },
{ {
label: '导入时间', label: "导入时间",
name: 'createTime', name: "createTime",
type: 'datePicker', type: "datePicker",
isClear: true, isClear: true,
pickerOptions: 'rangePickerOptions' pickerOptions: "rangePickerOptions",
} },
], ],
getListApi: listWithPage_deliver, getListApi: listWithPage_deliver,
// 表格参数 // 表格参数
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list", listName: "list",
tableOption: { width: "150px" }, tableOption: { width: "150px" },
tableColumns: [ tableColumns: [
...@@ -206,48 +217,48 @@ export default { ...@@ -206,48 +217,48 @@ export default {
label: "4S门店", label: "4S门店",
prop: "merchantId", prop: "merchantId",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.merchantName + "(" + cellValue.merchantId + ")" return cellValue.merchantName + "(" + cellValue.merchantId + ")";
} },
}, },
{ {
label: "品牌", label: "品牌",
prop: "childName", prop: "childName",
width: "300" width: "300",
}, },
{ {
label: "交付目标月份", label: "交付目标月份",
prop: "targetMonth", prop: "targetMonth",
width: "150" width: "150",
}, },
{ {
label: "归属周期", label: "归属周期",
prop: "periodDateStr", prop: "periodDateStr",
width: "200", width: "200",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.periodDateStr || "-" return cellValue.periodDateStr || "-";
} },
}, },
{ {
label: "交付数", label: "交付数",
prop: "targetValue", prop: "targetValue",
width: "200", width: "200",
formatter: (cellValue) => { formatter: (cellValue) => {
return (cellValue.targetValue || cellValue.targetValue == 0) ? cellValue.targetValue : "-" return (cellValue.targetValue || cellValue.targetValue == 0) ? cellValue.targetValue : "-";
} },
}, },
{ {
label: "导入时间", label: "导入时间",
prop: "createdDate", prop: "createdDate",
width: "180", width: "180",
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss") return Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss");
} },
} },
] ],
}, },
baseData: { baseData: {
merchantList: [], merchantList: [],
brandList: [] brandList: [],
}, },
recordInfo: null, recordInfo: null,
operationType: "add", operationType: "add",
...@@ -257,118 +268,112 @@ export default { ...@@ -257,118 +268,112 @@ export default {
editVisible: false, editVisible: false,
importMonthPickerOption: rangePickerOptions_deliveryQuantity_import, importMonthPickerOption: rangePickerOptions_deliveryQuantity_import,
importForm: { importForm: {
targetMonth: '', targetMonth: "",
periodRange: [] periodRange: [],
},
track_event_code: 'shopConfig_deliver_list',
track_businessParam_key: 'searchForm'
}
}, },
track_event_code: "shopConfig_deliver_list",
components: { track_businessParam_key: "searchForm",
inputRange, };
editDialog,
periodDateRange
}, },
computed: { computed: {
...mapState({ ...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList, dowloadList: state => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList updateList: state => state.d2admin.user.updateList,
}) }),
}, },
mounted() { mounted() {
this.onPageShow() this.onPageShow();
this.getBaseData() this.getBaseData();
}, },
methods: { methods: {
...mapActions({ ...mapActions({
get: "d2admin/base/get", get: "d2admin/base/get",
close: "d2admin/page/close" close: "d2admin/page/close",
}), }),
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
async getBaseData() { async getBaseData() {
this.getOptionsList() this.getOptionsList();
this.getSelectingList() this.getSelectingList();
this.getBrands() this.getBrands();
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm);
if (this.searchFormSearch.createTime) { if (this.searchFormSearch.createTime) {
this.searchFormSearch.startCreatedDate = Util.dateFormate(this.searchFormSearch.createTime[0], 'YYYY-MM-DD HH:mm:ss') this.searchFormSearch.startCreatedDate = Util.dateFormate(this.searchFormSearch.createTime[0], "YYYY-MM-DD HH:mm:ss");
this.searchFormSearch.endCreatedDate = Util.dateFormate(this.searchFormSearch.createTime[1], 'YYYY-MM-DD') + ' 23:59:59' this.searchFormSearch.endCreatedDate = Util.dateFormate(this.searchFormSearch.createTime[1], "YYYY-MM-DD") + " 23:59:59";
} else { } else {
delete this.searchFormSearch.startCreatedDate delete this.searchFormSearch.startCreatedDate;
delete this.searchFormSearch.endCreatedDate delete this.searchFormSearch.endCreatedDate;
} }
if (this.searchFormSearch.targetValue && this.searchFormSearch.targetValue.length > 0) { if (this.searchFormSearch.targetValue && this.searchFormSearch.targetValue.length > 0) {
this.searchFormSearch.minTargetValue = this.searchFormSearch.targetValue[0] this.searchFormSearch.minTargetValue = this.searchFormSearch.targetValue[0];
this.searchFormSearch.maxTargetValue = this.searchFormSearch.targetValue[1] this.searchFormSearch.maxTargetValue = this.searchFormSearch.targetValue[1];
} else { } else {
delete this.searchFormSearch.minTargetValue delete this.searchFormSearch.minTargetValue;
delete this.searchFormSearch.maxTargetValue delete this.searchFormSearch.maxTargetValue;
} }
if (this.searchFormSearch.brandId) { if (this.searchFormSearch.brandId) {
this.searchFormSearch.brandChildIdList.push(this.searchFormSearch.brandId) this.searchFormSearch.brandChildIdList.push(this.searchFormSearch.brandId);
delete this.searchFormSearch.brandId delete this.searchFormSearch.brandId;
} else { } else {
this.searchFormSearch.brandChildIdList = [] this.searchFormSearch.brandChildIdList = [];
} }
resolve() resolve();
}) });
}, },
// 获取商品数据 // 获取商品数据
remoteMethod(query) { remoteMethod(query) {
this.merchantName = query this.merchantName = query;
this.currentPage = 1 this.currentPage = 1;
this.baseData.merchantList = [] this.baseData.merchantList = [];
this.getSelectingList() // 请求接口 this.getSelectingList(); // 请求接口
}, },
getSelectingList(defaultSelect) { getSelectingList(defaultSelect) {
getList({ getList({
merchantName: this.merchantName, merchantName: this.merchantName,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize,
}).then(res => { }).then((res) => {
this.allPages = res.pages this.allPages = res.pages;
const resArr = [...res.list] const resArr = [...res.list];
const arr = this.baseData.merchantList.concat(resArr) const arr = this.baseData.merchantList.concat(resArr);
this.baseData.merchantList = arr this.baseData.merchantList = arr;
this.getOptionsList() this.getOptionsList();
}).catch(() => { }).catch(() => {
}) });
}, },
visibleChange(data) { visibleChange(data) {
// 获取焦点重新渲染下拉框数据 // 获取焦点重新渲染下拉框数据
if (data) { if (data) {
if (this.merchantName) { if (this.merchantName) {
this.merchantName = '' this.merchantName = "";
this.currentPage = 1 this.currentPage = 1;
this.baseData.merchantList = [] this.baseData.merchantList = [];
this.getSelectingList() this.getSelectingList();
} }
} }
}, },
// 获取更多4S店 // 获取更多4S店
interestsLoadmore() { interestsLoadmore() {
setTimeout(() => { setTimeout(() => {
this.currentPage = this.currentPage + 1 this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) { if (this.allPages < this.currentPage) {
this.currentPage = this.allPages this.currentPage = this.allPages;
return return;
} }
this.getSelectingList() this.getSelectingList();
}, 10) }, 10);
}, },
getBrands() { getBrands() {
distinctAllBrand({}).then(res => { distinctAllBrand({}).then((res) => {
this.baseData.brandList = res this.baseData.brandList = res;
this.getOptionsList() this.getOptionsList();
}).catch(() => { }).catch(() => {
}) });
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -376,182 +381,184 @@ export default { ...@@ -376,182 +381,184 @@ export default {
brandChildIdList: [], brandChildIdList: [],
targetMonth: "", targetMonth: "",
targetValue: [], targetValue: [],
createTime: "" createTime: "",
} };
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable();
}, },
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === "select") {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== "全部") {
const temp = {} const temp = {};
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = "";
temp[this.showFormData[index].optionLabel] = '全部' temp[this.showFormData[index].optionLabel] = "全部";
this.baseData[item.optionsName].unshift(temp) this.baseData[item.optionsName].unshift(temp);
} }
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName]) this.$set(this.showFormData[index], "optionList", this.baseData[item.optionsName]);
} }
}) });
}, },
handleAdd() { handleAdd() {
this.recordInfo = null this.recordInfo = null;
this.operationType = 'add' this.operationType = "add";
this.editVisible = true this.editVisible = true;
}, },
handleDetail(row) { handleDetail(row) {
this.recordInfo = row this.recordInfo = row;
this.operationType = 'detail' this.operationType = "detail";
this.editVisible = true this.editVisible = true;
}, },
handleEdit(row) { handleEdit(row) {
this.recordInfo = row this.recordInfo = row;
this.operationType = 'edit' this.operationType = "edit";
this.editVisible = true this.editVisible = true;
}, },
closeEditDialog(obj) { closeEditDialog(obj) {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible;
if (obj.flag) { if (obj.flag) {
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true);
} }
}, },
handleExport() { handleExport() {
var params = this.searchFormSearch let params = this.searchFormSearch;
if (params.merchantIdList.length > 0) { if (params.merchantIdList.length > 0) {
params.merchantIdList.forEach((item, index) => { params.merchantIdList.forEach((item, index) => {
const merchantId = `merchantIdList[${index}]` const merchantId = `merchantIdList[${index}]`;
params[merchantId] = item params[merchantId] = item;
}) });
delete params.merchantIdList delete params.merchantIdList;
} }
if (params.brandChildIdList.length > 0) { if (params.brandChildIdList.length > 0) {
params.brandChildIdList.forEach((item, index) => { params.brandChildIdList.forEach((item, index) => {
const brandChildId = `brandChildIdList[${index}]` const brandChildId = `brandChildIdList[${index}]`;
params[brandChildId] = item params[brandChildId] = item;
}) });
delete params.brandChildIdList delete params.brandChildIdList;
} }
// 去除为null的值 // 去除为null的值
for (const key in params) { for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) { if (params[key] === null || params[key] === "" || params[key].length == 0) {
delete params[key] delete params[key];
} }
} }
params.method = 'dj.api.smartcarlife.merchantDeliverTargeConfig.export.async' params.method = "dj.api.smartcarlife.merchantDeliverTargeConfig.export.async";
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
name: '门店主机厂交付数', name: "门店主机厂交付数",
exportParam: JSON.stringify(params), exportParam: JSON.stringify(params),
status: 'waiting', status: "waiting",
timeid: new Date().getTime() timeid: new Date().getTime(),
} },
] ];
this.actionSetDownloadList({ list, type: 'dowloadList' }) this.actionSetDownloadList({ list, type: "dowloadList" });
}, },
// 门店主机厂交付数导入模版下载 // 门店主机厂交付数导入模版下载
exportTemplate() { exportTemplate() {
var params = {} let params = {};
params.method = 'dj.api.smartcarlife.merchantDeliverTargeConfig.template.export' params.method = "dj.api.smartcarlife.merchantDeliverTargeConfig.template.export";
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
name: '门店主机厂交付数导入模版', name: "门店主机厂交付数导入模版",
exportParam: JSON.stringify(params), exportParam: JSON.stringify(params),
status: 'waiting', status: "waiting",
timeid: new Date().getTime() timeid: new Date().getTime(),
} },
] ];
this.actionSetDownloadList({ list, type: 'dowloadList' }) this.actionSetDownloadList({ list, type: "dowloadList" });
}, },
handleImport() { handleImport() {
if (this.fileVisible) { if (this.fileVisible) {
this.resetImportForm() this.resetImportForm();
} }
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible;
}, },
resetImportForm() { resetImportForm() {
this.importForm = { this.importForm = {
targetMonth: '', targetMonth: "",
periodRange: [] periodRange: [],
} };
}, },
handleImportTargetMonthChange() { handleImportTargetMonthChange() {
this.importForm.periodRange = [] this.importForm.periodRange = [];
}, },
validateImportForm() { validateImportForm() {
if (!this.importForm.targetMonth) { if (!this.importForm.targetMonth) {
this.notice.warningTips('请选择交付目标月份') this.notice.warningTips("请选择交付目标月份");
return false return false;
} }
const { periodRange } = this.importForm const { periodRange } = this.importForm;
if (!periodRange || periodRange.length !== 2 || !periodRange[0] || !periodRange[1]) { if (!periodRange || periodRange.length !== 2 || !periodRange[0] || !periodRange[1]) {
this.notice.warningTips('请选择归属周期') this.notice.warningTips("请选择归属周期");
return false return false;
} }
return true return true;
}, },
handleConfirmImport({ fileName, fileData }) { handleConfirmImport({ fileName, fileData }) {
if (!this.validateImportForm()) return if (!this.validateImportForm()) {
var params = { return;
}
let params = {
file: fileData, file: fileData,
targetMonth: this.importForm.targetMonth, targetMonth: this.importForm.targetMonth,
periodStartDate: this.importForm.periodRange[0], periodStartDate: this.importForm.periodRange[0],
periodEndDate: this.importForm.periodRange[1] periodEndDate: this.importForm.periodRange[1],
} };
deliverTargeConfigImport(params).then(res => { deliverTargeConfigImport(params).then((res) => {
if (res) { if (res) {
const list = [...this.updateList, { const list = [...this.updateList, {
name: fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: 'upload' type: "upload",
}] }];
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: "updateList" });
this.notice.okTips('上传成功') this.notice.okTips("上传成功");
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true);
this.resetImportForm() this.resetImportForm();
this.handleImport() this.handleImport();
} }
}) });
}, },
// 删除 // 删除
handleDelete(row) { handleDelete(row) {
this.$confirm('请确认是否要执行当前操作?', '提示', { this.$confirm("请确认是否要执行当前操作?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
closeOnClickModal: false closeOnClickModal: false,
}).then(() => { }).then(() => {
deleteById_deliver({ id: row.id }).then(res => { deleteById_deliver({ id: row.id }).then((res) => {
this.notice.okTips() this.notice.okTips();
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable();
}) });
}).catch(err => { }).catch((err) => {
console.log(err) console.log(err);
}) });
} },
}, },
beforeDestroy() { beforeDestroy() {
this.onPageHide() this.onPageHide();
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-t-40 { .m-t-40 {
margin-top: 40px; margin-top: 40px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!