|
@@ -2,176 +2,104 @@
|
|
|
<div class="borderless" v-loading="pageLoading">
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- style="border: none;background: none;color: red"
|
|
|
- icon="el-icon-arrow-left"
|
|
|
- @click="backToList"
|
|
|
- :loading="btnLoading"
|
|
|
- >返回列表</el-button>
|
|
|
+ <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
+ @click="backToList" :loading="btnLoading">返回列表</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- class="el-button--small-yh"
|
|
|
- @click.stop="openEdit"
|
|
|
- v-if="disabled"
|
|
|
- >编 辑</el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- :disabled="!form.id"
|
|
|
- size="small"
|
|
|
- @click="copyDoc"
|
|
|
- :loading="btnLoading"
|
|
|
- v-if="false"
|
|
|
- >复制单据</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="editCustomer"
|
|
|
- size="small"
|
|
|
- :loading="btnLoading"
|
|
|
- >保存数据</el-button>
|
|
|
+ <el-button type="primary" size="small" class="el-button--small-yh" @click.stop="openEdit"
|
|
|
+ v-if="disabled && !approvalStatus">编 辑
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="small" class="el-button--small-yh" @click.stop="submit" v-if="form.status == 1">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown style="margin-right: 8px;margin-left: 8px;">
|
|
|
+ <el-button type="primary" size="small">
|
|
|
+ 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item :disabled="form.status > 0 || approvalStatus" @click.native="pleaseCheck">请核数据
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item disabled>审核进度</el-dropdown-item>
|
|
|
+ <el-dropdown-item disabled>撤销请核</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-button type="success" :disabled="!form.id" size="small" @click="copyDoc" :loading="btnLoading" v-if="false">
|
|
|
+ 复制单据</el-button>
|
|
|
+ <el-button type="primary" @click="editCustomer" size="small" :loading="btnLoading">保存数据</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="customer-main">
|
|
|
- <containerTitle title="基础信息"/>
|
|
|
+ <containerTitle title="基础信息" />
|
|
|
<basic-container :showBtn="true">
|
|
|
- <avue-form
|
|
|
- ref="form"
|
|
|
- class="trading-form"
|
|
|
- v-model="form"
|
|
|
- :option="option"
|
|
|
- >
|
|
|
- <template slot="corpId">
|
|
|
- <crop-select
|
|
|
- v-model="form.corpId"
|
|
|
- @getCorpData="getKHData"
|
|
|
- corpType="KH"
|
|
|
- />
|
|
|
+ <avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
+ <template slot-scope="{}" slot="corpNameLabel">
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit">客户名称:</span>
|
|
|
</template>
|
|
|
+ <!-- <template slot-scope="{row,index}" slot="corpName">
|
|
|
+ <warehous-Kh v-model="form.corpName" :zhKey="true" :disabled="disabled || approvalStatus"
|
|
|
+ @getCropId="getCropId"></warehous-Kh>
|
|
|
+ </template> -->
|
|
|
<template slot="fromUser">
|
|
|
- <el-select
|
|
|
- v-model="form.fromUser"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- :disabled="disabled"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item,index) in userList"
|
|
|
- :key="index"
|
|
|
- :label="item.realName"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
+ <el-select v-model="form.fromUser" filterable clearable size="small" :disabled="disabled || approvalStatus">
|
|
|
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.id">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<template slot="toUser">
|
|
|
- <el-select
|
|
|
- v-model="form.toUser"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- :disabled="disabled"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item,index) in userList"
|
|
|
- :key="index"
|
|
|
- :label="item.realName"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
+ <el-select v-model="form.toUser" filterable clearable size="small" :disabled="disabled || approvalStatus">
|
|
|
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.id">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
|
- <containerTitle title="沟通记录"/>
|
|
|
+ <containerTitle title="沟通记录" />
|
|
|
<basic-container>
|
|
|
- <avue-crud
|
|
|
- ref="crud"
|
|
|
- :data="dataList"
|
|
|
- :option="tableOption"
|
|
|
- :cell-style="cellStyle"
|
|
|
- @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn"
|
|
|
- >
|
|
|
+ <avue-crud ref="crud" :data="dataList" :option="tableOption" :cell-style="cellStyle" @saveColumn="saveColumn"
|
|
|
+ @resetColumn="resetColumn">
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="small"
|
|
|
- @click.stop="newDetails"
|
|
|
- :disabled="disabled"
|
|
|
- >录入明细</el-button>
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- icon="el-icon-printer"
|
|
|
- size="small"
|
|
|
- v-if="false"
|
|
|
- >报表打印</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
|
|
|
+ :disabled="disabled || approvalStatus">
|
|
|
+ 录入明细</el-button>
|
|
|
+ <el-button type="info" icon="el-icon-printer" size="small" v-if="false">报表打印</el-button>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- icon="el-icon-edit"
|
|
|
- type="text"
|
|
|
- @click="rowCell(row, index)"
|
|
|
- :disabled="disabled"
|
|
|
- >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- icon="el-icon-delete"
|
|
|
- type="text"
|
|
|
- @click="rowDel(row, index)"
|
|
|
- :disabled="disabled"
|
|
|
- >删除</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
|
|
|
+ :disabled="disabled || approvalStatus">{{
|
|
|
+ row.$cellEdit ? "保存" : "修改"
|
|
|
+ }}</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
+ :disabled="disabled || approvalStatus">
|
|
|
+ 删除</el-button>
|
|
|
</template>
|
|
|
<template slot="bizDate" slot-scope="{ row, index }">
|
|
|
- <el-date-picker
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.bizDate"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- size="small"
|
|
|
- style="width: 100%"
|
|
|
- format="yyyy-MM-dd"
|
|
|
- valueFormat="yyyy-MM-dd"
|
|
|
- ></el-date-picker>
|
|
|
- <span v-else>{{row.bizDate}}</span>
|
|
|
+ <el-date-picker v-if="row.$cellEdit" v-model="row.bizDate" type="date" placeholder="选择日期" size="small"
|
|
|
+ style="width: 100%" format="yyyy-MM-dd" valueFormat="yyyy-MM-dd"></el-date-picker>
|
|
|
+ <span v-else>{{ row.bizDate }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="spId" slot-scope="{ row, index }">
|
|
|
+ <el-select v-if="row.$cellEdit" v-model="row.spId" filterable clearable size="small" :disabled="disabled"
|
|
|
+ @change="spIdChange(row)">
|
|
|
+ <el-option v-for="(item, index) in goodsDescList" :key="index" :label="item.cname" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.serviceProjectName }}</span>
|
|
|
</template>
|
|
|
<template slot="bizContent" slot-scope="{ row, index }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.bizContent"
|
|
|
- size="small"
|
|
|
- placeholder="输入内容"
|
|
|
- />
|
|
|
- <span v-else>{{row.bizContent}}</span>
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.bizContent" size="small" placeholder="输入内容" />
|
|
|
+ <span v-else>{{ row.bizContent }}</span>
|
|
|
</template>
|
|
|
<template slot="contacts" slot-scope="{ row, index }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.contacts"
|
|
|
- size="small"
|
|
|
- placeholder="输入客户联系人"
|
|
|
- />
|
|
|
- <span v-else>{{row.contacts}}</span>
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.contacts" size="small" placeholder="输入客户联系人" />
|
|
|
+ <span v-else>{{ row.contacts }}</span>
|
|
|
</template>
|
|
|
<template slot="tel" slot-scope="{ row, index }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.tel"
|
|
|
- size="small"
|
|
|
- placeholder="输入联系方式"
|
|
|
- />
|
|
|
- <span v-else>{{row.tel}}</span>
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.tel" size="small" placeholder="输入联系方式" />
|
|
|
+ <span v-else>{{ row.tel }}</span>
|
|
|
</template>
|
|
|
<template slot="approval" slot-scope="{ row, index }">
|
|
|
- <el-switch
|
|
|
- v-model="row.approval"
|
|
|
- :disabled="!row.$cellEdit"
|
|
|
- :inactive-value="0"
|
|
|
- :active-value="1"
|
|
|
- ></el-switch>
|
|
|
+ <el-switch v-model="row.approval" :disabled="!row.$cellEdit" :inactive-value="0" :active-value="1">
|
|
|
+ </el-switch>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
@@ -188,10 +116,10 @@ import {
|
|
|
IntegerFormat
|
|
|
} from "@/util/validate";
|
|
|
import { gainUser } from "@/api/basicData/customerInquiry";
|
|
|
-import {getUserInfo} from "@/api/system/user";
|
|
|
-import {getDeptTree} from "@/api/system/dept";
|
|
|
+import { getUserInfo } from "@/api/system/user";
|
|
|
+import { getDeptTree } from "@/api/system/dept";
|
|
|
import { getCurrentDate } from "@/util/date";
|
|
|
-import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/standAlone/saleLeads";
|
|
|
+import { dataDetail, typeSave, removeGoods, pleaseCheck, getGoodsDescList } from "@/api/standAlone/saleLeads";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
|
|
|
export default {
|
|
@@ -210,6 +138,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ approvalStatus: false,
|
|
|
disabled: false,
|
|
|
checkDisabled: false,
|
|
|
pageLoading: false,
|
|
@@ -324,9 +253,9 @@ export default {
|
|
|
span: 8,
|
|
|
type: 'select',
|
|
|
dicData: [
|
|
|
- {label: '沟通中', value: 0},
|
|
|
- {label: '成交', value: 1},
|
|
|
- {label: '未成交', value: 2},
|
|
|
+ { label: '沟通中', value: 0 },
|
|
|
+ { label: '成交', value: 1, disabled: true },
|
|
|
+ { label: '未成交', value: 2 },
|
|
|
],
|
|
|
rules: [
|
|
|
{
|
|
@@ -343,7 +272,7 @@ export default {
|
|
|
minRows: 2,
|
|
|
span: 24,
|
|
|
rules: [
|
|
|
- {validator: validateRemark, trigger: 'blur'}
|
|
|
+ { validator: validateRemark, trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
],
|
|
@@ -364,6 +293,7 @@ export default {
|
|
|
loginUserId: null,
|
|
|
oldForm: {},
|
|
|
oldDataList: [],
|
|
|
+ goodsDescList: []
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -384,6 +314,9 @@ export default {
|
|
|
getDeptTree().then(res => {
|
|
|
this.dic = res.data.data
|
|
|
})
|
|
|
+ getGoodsDescList().then(res => {
|
|
|
+ this.goodsDescList = res.data.data
|
|
|
+ })
|
|
|
this.getWorkDicts('unit').then(res => {
|
|
|
this.unitOption = res.data.data;
|
|
|
})
|
|
@@ -397,6 +330,12 @@ export default {
|
|
|
this.checker = true;
|
|
|
this.batchNo = this.detailData.check.batchNo
|
|
|
this.queryData(this.detailData.id);
|
|
|
+ } else if (this.detailData.check) {
|
|
|
+ this.disabled = true;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ this.queryData(this.detailData.check.billId);
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
@@ -408,16 +347,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ khEdit() {
|
|
|
+ this.$router.push('/basicData/customerInformation/index')
|
|
|
+ },
|
|
|
// 查询
|
|
|
queryData(id) {
|
|
|
this.pageLoading = true;
|
|
|
- dataDetail({id: id}).then(res => {
|
|
|
+ dataDetail({ id: id }).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.dataList = this.form.itemList? this.form.itemList: [];
|
|
|
+ this.dataList = this.form.itemList ? this.form.itemList : [];
|
|
|
delete this.form.itemList;
|
|
|
- this.oldForm = {...this.form};
|
|
|
+ this.oldForm = { ...this.form };
|
|
|
this.oldDataList = [...this.dataList];
|
|
|
- this.checkDisabled = this.form.status > 0? true: false;
|
|
|
+ this.checkDisabled = this.form.status > 0 ? true : false;
|
|
|
+ this.approvalStatus = this.form.approvalStatus == "S" || this.form.approvalStatus == "A" ? true : false;
|
|
|
if (this.form.status > 0) {
|
|
|
this.option.column.map(e => {
|
|
|
this.$set(e, 'disabled', true)
|
|
@@ -427,6 +370,33 @@ export default {
|
|
|
this.pageLoading = false;
|
|
|
})
|
|
|
},
|
|
|
+ pleaseCheck() {
|
|
|
+ this.$confirm("您确定提交此次申请吗?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.btnLoading = true;
|
|
|
+ this.$set(this.form, 'itemList', this.dataList)
|
|
|
+ const data = {
|
|
|
+ ...this.form,
|
|
|
+ checkType: "xsjh",
|
|
|
+ url: "/saleLeads/index",
|
|
|
+ pageStatus: "this.$store.getters.xsjhStatus",
|
|
|
+ pageLabel: "销售机会"
|
|
|
+ };
|
|
|
+ pleaseCheck(data).then(res => {
|
|
|
+ this.$message({ type: "success", message: '请核成功' });
|
|
|
+ this.disabled = true;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ this.queryData(this.form.id);
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$emit("goBack");
|
|
@@ -446,6 +416,19 @@ export default {
|
|
|
copyDoc() {
|
|
|
this.$emit("copyOrder", this.form.id);
|
|
|
},
|
|
|
+ submit() {
|
|
|
+ let data = {
|
|
|
+ ...this.form,
|
|
|
+ itemList:this.dataList
|
|
|
+ }
|
|
|
+ this.$router.push({
|
|
|
+ path: '/workManagement/main-items/list',
|
|
|
+ query: { data: data }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCropId(row) {
|
|
|
+ this.form.corpId = row
|
|
|
+ },
|
|
|
//修改提交触发
|
|
|
editCustomer(status) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
@@ -454,7 +437,7 @@ export default {
|
|
|
this.btnLoading = true;
|
|
|
this.$set(this.form, 'itemList', this.dataList)
|
|
|
typeSave(this.form).then(res => {
|
|
|
- this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
+ this.$message({ type: "success", message: this.form.id ? "修改成功!" : "新增成功!" });
|
|
|
this.queryData(res.data.data);
|
|
|
}).finally(() => {
|
|
|
this.btnLoading = false;
|
|
@@ -543,7 +526,13 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getKHData(row) {},
|
|
|
+ spIdChange(row) {
|
|
|
+ console.log(row)
|
|
|
+ this.goodsDescList.forEach(e => {
|
|
|
+ row.serviceProjectName = e.cname
|
|
|
+ row.chargeProposal = e.remarks
|
|
|
+ });
|
|
|
+ },
|
|
|
// 验证新旧值对比
|
|
|
verification() {
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
@@ -566,5 +555,4 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
</style>
|