|
@@ -16,6 +16,7 @@
|
|
|
size="small"
|
|
|
class="el-button--small-yh"
|
|
|
@click.stop="openEdit"
|
|
|
+ v-if="disabled"
|
|
|
>编 辑</el-button>
|
|
|
<el-button
|
|
|
type="success"
|
|
@@ -48,33 +49,35 @@
|
|
|
corpType="KH"
|
|
|
/>
|
|
|
</template>
|
|
|
- <template slot="createUser">
|
|
|
+ <template slot="fromUser">
|
|
|
<el-select
|
|
|
- v-model="form.createUser"
|
|
|
+ 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.realName"
|
|
|
+ :value="item.id"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- <template slot="oppositePerson">
|
|
|
+ <template slot="toUser">
|
|
|
<el-select
|
|
|
- v-model="form.oppositePerson"
|
|
|
+ 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.realName"
|
|
|
+ :value="item.id"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -117,47 +120,49 @@
|
|
|
@click="rowDel(row, index)"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
- <template slot="date" slot-scope="{ row, index }">
|
|
|
+ <template slot="bizDate" slot-scope="{ row, index }">
|
|
|
<el-date-picker
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.date"
|
|
|
+ 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.date}}</span>
|
|
|
+ <span v-else>{{row.bizDate}}</span>
|
|
|
</template>
|
|
|
- <template slot="content" slot-scope="{ row, index }">
|
|
|
+ <template slot="bizContent" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.content"
|
|
|
+ v-model="row.bizContent"
|
|
|
size="small"
|
|
|
placeholder="输入内容"
|
|
|
/>
|
|
|
- <span v-else>{{row.content}}</span>
|
|
|
+ <span v-else>{{row.bizContent}}</span>
|
|
|
</template>
|
|
|
- <template slot="attn" slot-scope="{ row, index }">
|
|
|
+ <template slot="contacts" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.attn"
|
|
|
+ v-model="row.contacts"
|
|
|
size="small"
|
|
|
placeholder="输入客户联系人"
|
|
|
/>
|
|
|
- <span v-else>{{row.attn}}</span>
|
|
|
+ <span v-else>{{row.contacts}}</span>
|
|
|
</template>
|
|
|
- <template slot="contact" slot-scope="{ row, index }">
|
|
|
+ <template slot="tel" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.contact"
|
|
|
+ v-model="row.tel"
|
|
|
size="small"
|
|
|
placeholder="输入联系方式"
|
|
|
/>
|
|
|
- <span v-else>{{row.contact}}</span>
|
|
|
+ <span v-else>{{row.tel}}</span>
|
|
|
</template>
|
|
|
- <template slot="satisfy" slot-scope="{ row, index }">
|
|
|
+ <template slot="approval" slot-scope="{ row, index }">
|
|
|
<el-switch
|
|
|
- v-model="row.satisfy"
|
|
|
+ v-model="row.approval"
|
|
|
:disabled="!row.$cellEdit"
|
|
|
:inactive-value="0"
|
|
|
:active-value="1"
|
|
@@ -181,18 +186,26 @@ import { gainUser } from "@/api/basicData/customerInquiry";
|
|
|
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";
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
const validateRemark = (rule, value, callback) => {
|
|
|
- if (this.form.state == 2 && !this.form.orderRemark) {
|
|
|
+ if (this.form.status == 2 && !this.form.remarks) {
|
|
|
callback(new Error('备注不能为空'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ disabled: false,
|
|
|
+ checkDisabled: false,
|
|
|
pageLoading: false,
|
|
|
btnLoading: false,
|
|
|
form: {},
|
|
@@ -202,12 +215,12 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: "客户名称",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "corpName",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
- trigger: "change"
|
|
|
+ trigger: "blur"
|
|
|
}
|
|
|
],
|
|
|
span: 8,
|
|
@@ -215,7 +228,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "客户联系人",
|
|
|
- prop: "corpr",
|
|
|
+ prop: "contacts",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -228,7 +241,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "客户电话",
|
|
|
- prop: "corpTel",
|
|
|
+ prop: "tel",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -247,7 +260,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "业务内容",
|
|
|
- prop: "businessContent",
|
|
|
+ prop: "bizContent",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -260,7 +273,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "业务日期",
|
|
|
- prop: "b",
|
|
|
+ prop: "bizDate",
|
|
|
span: 8,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
@@ -275,7 +288,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "承揽人",
|
|
|
- prop: "createUser",
|
|
|
+ prop: "fromUser",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -288,7 +301,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "对接人",
|
|
|
- prop: "oppositePerson",
|
|
|
+ prop: "toUser",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -301,7 +314,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "状态",
|
|
|
- prop: "state",
|
|
|
+ prop: "status",
|
|
|
span: 8,
|
|
|
type: 'select',
|
|
|
dicData: [
|
|
@@ -319,7 +332,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "备注",
|
|
|
- prop: "orderRemark",
|
|
|
+ prop: "remarks",
|
|
|
type: "textarea",
|
|
|
minRows: 2,
|
|
|
span: 24,
|
|
@@ -342,10 +355,11 @@ export default {
|
|
|
userList: [],
|
|
|
dic: [],
|
|
|
loginUser: '', // 登录人
|
|
|
+ loginUserId: null,
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
- this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
|
|
|
+ this.$set(this.form, 'bizDate', getCurrentDate()); // 默认当前日期
|
|
|
this.tableOption = await this.getColumnData(
|
|
|
this.getColumnName(102),
|
|
|
tableOption
|
|
@@ -354,9 +368,10 @@ export default {
|
|
|
this.userList = res.data.data;
|
|
|
});
|
|
|
getUserInfo().then(res => {
|
|
|
- this.$set(this.form, 'createUser', res.data.data.realName);
|
|
|
- this.$set(this.form, 'oppositePerson', res.data.data.realName);
|
|
|
+ this.$set(this.form, 'fromUser', res.data.data.id);
|
|
|
+ this.$set(this.form, 'toUser', res.data.data.id);
|
|
|
this.loginUser = res.data.data.realName;
|
|
|
+ this.loginUserId = res.data.data.id;
|
|
|
})
|
|
|
getDeptTree().then(res => {
|
|
|
this.dic = res.data.data
|
|
@@ -364,6 +379,17 @@ export default {
|
|
|
this.getWorkDicts('unit').then(res => {
|
|
|
this.unitOption = res.data.data;
|
|
|
})
|
|
|
+ if (this.detailData.query) {
|
|
|
+ this.disabled = true;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ } else if (this.detailData.auditId) {
|
|
|
+ this.checker = true;
|
|
|
+ this.batchNo = this.detailData.check.batchNo
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ }
|
|
|
},
|
|
|
filters: {
|
|
|
IntegerFormat(num) {
|
|
@@ -374,12 +400,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 查询
|
|
|
+ queryData(id) {
|
|
|
+ this.pageLoading = true;
|
|
|
+ dataDetail({id: id}).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = this.form.itemList? this.form.itemList: [];
|
|
|
+ this.oldForm = {...this.form};
|
|
|
+ this.oldDataList = [...this.dataList];
|
|
|
+ delete this.form.itemList;
|
|
|
+ this.checkDisabled = this.form.status > 0? true: false;
|
|
|
+ if (this.form.status > 0) {
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$emit("goBack");
|
|
|
},
|
|
|
// 编辑按钮触发
|
|
|
- openEdit() {},
|
|
|
+ openEdit() {
|
|
|
+ this.disabled = false;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ if (this.checkDisabled) {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ } else {
|
|
|
+ this.$set(e, 'disabled', false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 复制
|
|
|
copyDoc() {
|
|
|
this.$emit("copyOrder", this.form.id);
|
|
@@ -389,13 +443,14 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- // this.btnLoading = true;
|
|
|
- // typeSave(this.form).then(res => {
|
|
|
- // this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
- // this.queryData(res.data.data.id);
|
|
|
- // }).finally(() => {
|
|
|
- // this.btnLoading = false;
|
|
|
- // })
|
|
|
+ this.btnLoading = true;
|
|
|
+ this.$set(this.form, 'itemList', this.dataList)
|
|
|
+ typeSave(this.form).then(res => {
|
|
|
+ this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
+ this.queryData(res.data.data);
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
@@ -441,8 +496,9 @@ export default {
|
|
|
done()
|
|
|
if (valid) {
|
|
|
this.dataList.push({
|
|
|
- createTime: getCurrentDate('date'),
|
|
|
- createUser: this.loginUser,
|
|
|
+ bizTime: getCurrentDate(),
|
|
|
+ bizUserName: this.loginUser,
|
|
|
+ bizUser: this.loginUserId,
|
|
|
$cellEdit: true,
|
|
|
})
|
|
|
}
|