master
xy 3 years ago
parent d3f770400e
commit 51763ea1c7

@ -221,7 +221,6 @@ const actions = {
Object.assign(loadMenuData, data)
asyncRoutes.length=0;
generaMenu(asyncRoutes, loadMenuData)
console.log(123321,asyncRoutes)
let accessedRoutes
if (roles.includes('admin')) {
// alert(JSON.stringify(asyncRoutes))

@ -0,0 +1,199 @@
<template>
<div>
<el-drawer
ref="elDrawer"
:title="detail.name || '成交'"
:visible.sync="isShow"
size="45%"
direction="rtl"
>
<template>
<el-descriptions
size="medium"
direction="vertical"
:column="3"
:labelStyle="{ 'font-weight': '600', width: '33%' }"
:content-style="{ width: '33%' }"
border
style="margin: 20px 10px"
>
<template v-for="info in columns">
<el-descriptions-item :label="info.name">
<template v-if="info.edit_input === 'richtext'">
<div v-html="detail[info.field]"></div>
</template>
<template v-else>
{{ contentFormat(info) }}
</template>
</el-descriptions-item>
</template>
</el-descriptions>
<div class="form">
<div>
<span class="title"
><span style="color: red; padding-right: 10px">*</span
>确认日期</span
>
<el-date-picker
style="margin-left: 20px;"
v-model="detail.querenriqi"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
clearable
></el-date-picker>
</div>
<div style="margin-top: 20px;">
<span class="title"
><span style="color: red; padding-right: 10px">*</span
>确认场馆</span
>
<el-select style="margin-left: 20px;" v-model="detail.venue_id"></el-select>
</div>
<div class="btns">
<el-button type="primary" size="small" @click="confirm"
>确认</el-button
>
<el-button size="small" @click="hidden"></el-button>
</div>
</div>
</template>
</el-drawer>
</div>
</template>
<script>
import { show, save } from "@/api/system/baseForm";
import { deepCopy } from "@/utils";
export default {
props: {
formInfo: {
type: Array,
default: () => [],
},
tableName: String,
},
data() {
return {
id: "",
isShow: false,
detail: {},
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
getId() {
return this.id;
},
confirm() {
if (!this.detail.querenriqi) {
this.$message({
type: "warning",
message: "请填写确认日期",
});
return;
}
let copyForm = deepCopy(this.detail);
for (const key in copyForm) {
if (key.includes("_relation")) {
delete copyForm[key];
}
}
copyForm.zhuangtai = 2;
console.log(copyForm);
// save(Object.assign(copyForm, { table_name: this.tableName })).then(
// (res) => {
// this.$message({
// type: "success",
// message: "",
// });
// }
// );
// this.$emit("refresh");
// this.hidden();
},
},
computed: {
columns() {
return this.formInfo.filter((i) => {
return (
i.list_show && i.field !== "liushiyuanyin" && i.field !== "querenriqi"
);
});
},
contentFormat() {
return function (i) {
if (i.parameter_id) {
return this.detail[i.link_with_name]?.value;
}
if (i.link_table_name) {
if (i.link_relation === "hasOne") {
return (
this.detail[i.link_with_name]?.name ||
this.detail[i.link_with_name]?.no ||
this.detail[i.link_with_name]?.value
);
}
if (i.link_relation === "hasMany") {
return this.detail[i.link_with_name]
?.map((o) => o?.name || o?.no || o?.value)
?.toString();
}
}
document.querySelector('input').setAttribute('checked')
return this.detail[i.field];
};
},
},
watch: {
isShow(newVal) {
if (newVal) {
show(
{
table_name: this.tableName,
id: this.id,
},
true
).then((res) => {
this.detail = res;
this.detail['querenriqi'] ? '' : (this.detail['querenriqi'] = this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss'))
});
}
},
},
mounted() {},
};
</script>
<style scoped lang="scss">
.btns {
text-align: center;
margin-top: 20px;
}
.form {
padding: 20px 10px;
.title {
font-weight: 600;
color: #333333;
}
}
</style>

@ -0,0 +1,176 @@
<template>
<div>
<el-drawer
ref="elDrawer"
:title="detail.name || '流失'"
:visible.sync="isShow"
size="45%"
direction="rtl"
>
<template>
<el-descriptions
size="medium"
direction="vertical"
:column="3"
:labelStyle="{ 'font-weight': '600', width: '33%' }"
:content-style="{ width: '33%' }"
border
style="margin: 20px 10px"
>
<template v-for="info in columns">
<el-descriptions-item :label="info.name">
<template v-if="info.edit_input === 'richtext'">
<div v-html="detail[info.field]"></div>
</template>
<template v-else>
{{
contentFormat(info)
}}
</template>
</el-descriptions-item>
</template>
</el-descriptions>
<div class="form">
<span class="title"><span style="color: red;padding-right: 10px;">*</span>流失原因</span>
<el-input v-model="detail.liushiyuanyin" type="textarea" :autosize="{ minRows: 2 }"></el-input>
<div class="btns">
<el-button type="primary" size="small" @click="confirm"></el-button>
<el-button size="small" @click="hidden"></el-button>
</div>
</div>
</template>
</el-drawer>
</div>
</template>
<script>
import { show, save } from "@/api/system/baseForm";
import { deepCopy } from "@/utils";
export default {
props: {
formInfo: {
type: Array,
default: () => [],
},
tableName: String,
},
data() {
return {
id: "",
isShow: false,
detail: {},
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
getId() {
return this.id;
},
confirm () {
if (!this.detail.liushiyuanyin) {
this.$message({
type: 'warning',
message: '请填写流失原因'
})
return
}
let copyForm = deepCopy(this.detail)
for (const key in copyForm) {
if (key.includes("_relation")) {
delete copyForm[key];
}
}
copyForm.zhuangtai = 3;
console.log(copyForm)
save(Object.assign(copyForm,{ table_name: this.tableName })).then(res => {
this.$message({
type: 'success',
message: '操作成功'
})
})
this.$emit('refresh')
this.hidden()
}
},
computed: {
columns () {
return this.formInfo.filter(i => {
return i.list_show && i.field !== 'liushiyuanyin' && i.field !== 'querenriqi'
})
},
contentFormat() {
return function (i) {
if (i.parameter_id) {
return this.detail[i.link_with_name]?.value;
}
if (i.link_table_name) {
if (i.link_relation === "hasOne") {
return (
this.detail[i.link_with_name]?.name ||
this.detail[i.link_with_name]?.no ||
this.detail[i.link_with_name]?.value
);
}
if (i.link_relation === "hasMany") {
return this.detail[i.link_with_name]
?.map((o) => o?.name || o?.no || o?.value)
?.toString();
}
}
return this.detail[i.field]
};
},
},
watch: {
isShow(newVal) {
if (newVal) {
show(
{
table_name: this.tableName,
id: this.id,
},
true
).then((res) => {
console.log(111, res);
this.detail = res;
});
}
},
},
mounted() {},
};
</script>
<style scoped lang="scss">
.btns {
text-align: center;
margin-top: 20px;
}
.form {
padding: 20px 10px;
.title {
font-weight: 600;
color: #333333;
}
}
</style>

@ -267,8 +267,7 @@
</LxHeader>
</div>
</div>
<!--$refs['drawer'].setId(row.id);
$refs['drawer'].show();-->
<xy-table
:auths="auths_auth_mixin"
:delay-req="true"
@ -279,6 +278,8 @@
:req-opt="select"
:destroy-req-opt="select"
:table-item="table"
:btn-to-more="true"
:more-auths="['edit', 'delete']"
@detail="
(row) => {
$router.push({
@ -300,12 +301,22 @@
}
"
>
<template #confirm="{ row }">
<template v-if="row.zhuangtai != 3 && row.zhuangtai != 2">
<Button size="small" type="primary" @click="$refs['loss'].setId(row.id),$refs['loss'].show()"></Button>
<Button size="small" type="primary" @click="$refs['deal'].setId(row.id),$refs['deal'].show()"></Button>
</template>
</template>
<template #follow="{ row }">
<Button
size="small"
type="primary"
@click="$refs['addFollow'].setId(row.id),$refs['addFollow'].show()"
>跟进</Button
@click="
$refs['addFollow'].setRow(row),
$refs['addFollow'].setId(row.id),
$refs['addFollow'].show()
"
>跟进</Button
>
</template>
</xy-table>
@ -335,6 +346,16 @@
@refresh="$refs['xyTable'].getTableData()"
></addVenue>
<addFollow ref="addFollow"></addFollow>
<loss
ref="loss"
:table-name="customForm.tableName"
:form-info="form"
@refresh="$refs['xyTable'].getTableData()"
></loss>
<deal ref="deal"
:table-name="customForm.tableName"
:form-info="form"
@refresh="$refs['xyTable'].getTableData()"></deal>
</div>
</template>
@ -356,7 +377,9 @@ import headerContent from "@/components/LxHeader/XyContent.vue";
import drawer from "@/views/component/drawer.vue";
import imports from "./imports.vue";
import addVenue from "@/views/venues/components/add.vue";
import addFollow from "@/views/orders/components/addFollow.vue"
import addFollow from "@/views/orders/components/addFollow.vue";
import loss from "@/views/component/loss.vue";
import deal from "./deal.vue";
export default {
components: {
LxHeader,
@ -366,6 +389,8 @@ export default {
imports,
addVenue,
addFollow,
loss,
deal,
},
mixins: [authMixin],
provide: {

@ -110,42 +110,6 @@ export default {
writable: true,
});
}
let promiseAll = []
this.formInfo.forEach((info) => {
if (
info._relations?.link_relation === "newHasMany" ||
info._relations?.link_relation === "hasMany"
) {
if (this.originalForm[info._relations.link_with_name]) {
this.originalForm[info._relations.link_with_name].map((i) => {
promiseAll.push(
destroy({
id: i.id,
table_name: info._relations.link_table_name,
})
);
});
}
}
if (
info._relations?.link_relation === "newHasMany" ||
info._relations?.link_relation === "hasMany"
) {
if (info.edit_input === "files") {
this.form[info._relations.link_with_name] = this.file[
info.field
]?.map((i) => {
let copyRelation = i?.response ? deepCopy(i?.response) : "";
delete copyRelation.id;
return {
file_id: i?.response?.id,
...copyRelation,
};
});
}
}
})
save(Object.assign(this.form, { table_name: 'follows' })).then(res => {
this.$Message.success({

Loading…
Cancel
Save