|
@@ -392,28 +392,28 @@
|
|
|
|
|
|
<script>
|
|
|
// import templateChose from '../product/template-chose'
|
|
|
-import { getCustomer, getCoDetail } from "@/api/cus";
|
|
|
-import { getDictList } from "@/api/dict";
|
|
|
-import uploadComponent from "../common/upload-component-v2";
|
|
|
-import AddOrUpdate from "../product/template-add-or-update";
|
|
|
-import WorderAddOrUpdate from "../worder/add-or-update";
|
|
|
-import AttachDetailDialog from "../common/attach-detail-dialog";
|
|
|
+import { getCustomer, getCoDetail } from '@/api/cus'
|
|
|
+import { getDictList } from '@/api/dict'
|
|
|
+import uploadComponent from '../common/upload-component-v2'
|
|
|
+import AddOrUpdate from '../product/template-add-or-update'
|
|
|
+import WorderAddOrUpdate from '../worder/add-or-update'
|
|
|
+import AttachDetailDialog from '../common/attach-detail-dialog'
|
|
|
export default {
|
|
|
- name: "communicate-add-or-update",
|
|
|
+ name: 'communicate-add-or-update',
|
|
|
components: {
|
|
|
AddOrUpdate,
|
|
|
uploadComponent,
|
|
|
WorderAddOrUpdate,
|
|
|
- AttachDetailDialog,
|
|
|
+ AttachDetailDialog
|
|
|
},
|
|
|
computed: {
|
|
|
orgId: {
|
|
|
- get() {
|
|
|
- return this.$store.state.user.orgId;
|
|
|
- },
|
|
|
- },
|
|
|
+ get () {
|
|
|
+ return this.$store.state.user.orgId
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
inboundVisible: false,
|
|
|
detailVisible: false,
|
|
@@ -421,122 +421,122 @@ export default {
|
|
|
attachVisible: false,
|
|
|
visible: false,
|
|
|
display: false,
|
|
|
- dictType: "material_type",
|
|
|
+ dictType: 'material_type',
|
|
|
options: [],
|
|
|
optionsCus: [],
|
|
|
dataList: [],
|
|
|
- attachListTechnical: [], //技术资料
|
|
|
- attachListDrawing: [], //数模/图纸
|
|
|
- attachList: [], //沟通表原件
|
|
|
- attachListOther: [], //其他附件
|
|
|
+ attachListTechnical: [], // 技术资料
|
|
|
+ attachListDrawing: [], // 数模/图纸
|
|
|
+ attachList: [], // 沟通表原件
|
|
|
+ attachListOther: [], // 其他附件
|
|
|
id: 0,
|
|
|
cusRCommProductVOS: [],
|
|
|
workInfoList: [],
|
|
|
dataForm: {},
|
|
|
taskTypeOption: [
|
|
|
- { label: "开始", value: "start" },
|
|
|
- { label: "生产", value: "produce" },
|
|
|
- { label: "检验", value: "check" },
|
|
|
- { label: "总检", value: "t-check" },
|
|
|
- { label: "结束", value: "end" },
|
|
|
- { label: "常规", value: "routine" },
|
|
|
+ { label: '开始', value: 'start' },
|
|
|
+ { label: '生产', value: 'produce' },
|
|
|
+ { label: '检验', value: 'check' },
|
|
|
+ { label: '总检', value: 't-check' },
|
|
|
+ { label: '结束', value: 'end' },
|
|
|
+ { label: '常规', value: 'routine' }
|
|
|
],
|
|
|
rankTypeOption: [
|
|
|
- { label: "普通", value: 1 },
|
|
|
- { label: "紧急", value: 2 },
|
|
|
- { label: "加急", value: 3 },
|
|
|
+ { label: '普通', value: 1 },
|
|
|
+ { label: '紧急', value: 2 },
|
|
|
+ { label: '加急', value: 3 }
|
|
|
],
|
|
|
dataRule: {
|
|
|
cusId: [
|
|
|
- { required: true, message: "客户名称不能为空", trigger: "blur" },
|
|
|
+ { required: true, message: '客户名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
coType: [
|
|
|
- { required: true, message: "沟通类别不能为空", trigger: "change" },
|
|
|
+ { required: true, message: '沟通类别不能为空', trigger: 'change' }
|
|
|
],
|
|
|
contact: [
|
|
|
- { required: true, message: "联系人不能为空", trigger: "blur" },
|
|
|
+ { required: true, message: '联系人不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
contactTel: [
|
|
|
- { required: true, message: "联系电话不能为空", trigger: "blur" },
|
|
|
+ { required: true, message: '联系电话不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
- way: [{ required: true, message: "沟通方式不能为空", trigger: "blur" }],
|
|
|
+ way: [{ required: true, message: '沟通方式不能为空', trigger: 'blur' }],
|
|
|
content: [
|
|
|
- { required: true, message: "沟通内容不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
- };
|
|
|
+ { required: true, message: '沟通内容不能为空', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
- "dataForm.cusId"(value) {
|
|
|
+ 'dataForm.cusId' (value) {
|
|
|
this.optionsCus.forEach((v) => {
|
|
|
if (v.customerId === value) {
|
|
|
- this.dataForm.contact = v.contact;
|
|
|
+ this.dataForm.contact = v.contact
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- onChose() {
|
|
|
- this.$emit("onChose");
|
|
|
- this.inboundVisible = false;
|
|
|
- this.detailVisible = false;
|
|
|
- this.worderVisible = false;
|
|
|
- this.attachVisible = false;
|
|
|
+ onChose () {
|
|
|
+ this.$emit('onChose')
|
|
|
+ this.inboundVisible = false
|
|
|
+ this.detailVisible = false
|
|
|
+ this.worderVisible = false
|
|
|
+ this.attachVisible = false
|
|
|
},
|
|
|
- async init(id, display) {
|
|
|
- this.dataForm = {};
|
|
|
- this.cusRCommProductVOS = [];
|
|
|
- this.workInfoList = [];
|
|
|
- this.visible = true;
|
|
|
- this.id = id || 0;
|
|
|
- this.display = display;
|
|
|
+ async init (id, display) {
|
|
|
+ this.dataForm = {}
|
|
|
+ this.cusRCommProductVOS = []
|
|
|
+ this.workInfoList = []
|
|
|
+ this.visible = true
|
|
|
+ this.id = id || 0
|
|
|
+ this.display = display
|
|
|
// 获取沟通类别
|
|
|
- await getDictList({ type: "communication_type" }).then(({ data }) => {
|
|
|
+ await getDictList({ type: 'communication_type' }).then(({ data }) => {
|
|
|
if (data) {
|
|
|
- this.options = data;
|
|
|
+ this.options = data
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
await getCustomer().then(({ data }) => {
|
|
|
- if (data && data.code === "200") {
|
|
|
- this.optionsCus = data.data;
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.optionsCus = data.data
|
|
|
}
|
|
|
- });
|
|
|
- if (!id) return;
|
|
|
- this.detailVisible = true;
|
|
|
+ })
|
|
|
+ if (!id) return
|
|
|
+ this.detailVisible = true
|
|
|
await getCoDetail(this.id).then(({ data }) => {
|
|
|
- if (data && data.code === "200") {
|
|
|
- this.dataForm = data.data;
|
|
|
- if (this.dataForm.coType !== "1") {
|
|
|
- this.detailVisible = false;
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm = data.data
|
|
|
+ if (this.dataForm.coType !== '1') {
|
|
|
+ this.detailVisible = false
|
|
|
}
|
|
|
// 附件显示
|
|
|
- this.fileList = [];
|
|
|
+ this.fileList = []
|
|
|
data.data.attachList.forEach((item) => {
|
|
|
this.fileList.push({
|
|
|
name: item.fileName,
|
|
|
url: item.url,
|
|
|
- id: item.url,
|
|
|
- });
|
|
|
- });
|
|
|
+ id: item.url
|
|
|
+ })
|
|
|
+ })
|
|
|
if (data.data.cusRCommProductVOS) {
|
|
|
data.data.cusRCommProductVOS.forEach((item) => {
|
|
|
- this.addItem(item);
|
|
|
- });
|
|
|
+ this.addItem(item)
|
|
|
+ })
|
|
|
}
|
|
|
if (data.data.workInfoList) {
|
|
|
data.data.workInfoList.forEach((item) => {
|
|
|
- this.addWorderItem(item);
|
|
|
- });
|
|
|
+ this.addWorderItem(item)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
// 表单提交
|
|
|
- dataFormSubmit() {
|
|
|
- this.$refs["dataForm"].validate((valid) => {
|
|
|
+ dataFormSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
// 添加附件
|
|
|
- let fList = this.fileList;
|
|
|
+ // let fList = this.fileList
|
|
|
// console.log('fileList = ' + fList)
|
|
|
// if (fList.length > 0) {
|
|
|
// this.dataForm.attachList = [];
|
|
@@ -556,51 +556,51 @@ export default {
|
|
|
// return;
|
|
|
// }
|
|
|
// }
|
|
|
- this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS;
|
|
|
- this.dataForm.workInfoList = this.workInfoList;
|
|
|
+ this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS
|
|
|
+ this.dataForm.workInfoList = this.workInfoList
|
|
|
this.$http({
|
|
|
url: !this.id
|
|
|
? this.$http.adornUrl(`/biz-service/cusCommunication/save`)
|
|
|
: this.$http.adornUrl(`/biz-service/cusCommunication/update`),
|
|
|
- method: "post",
|
|
|
- data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
|
|
|
}).then(({ data }) => {
|
|
|
- if (data && data.code === "200") {
|
|
|
+ if (data && data.code === '200') {
|
|
|
this.$message({
|
|
|
- message: "操作成功",
|
|
|
- type: "success",
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
- this.onChose();
|
|
|
- this.$emit("refreshDataList");
|
|
|
- },
|
|
|
- });
|
|
|
+ this.onChose()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$message.error(data.msg);
|
|
|
+ this.$message.error(data.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- validateField(type) {
|
|
|
- this.$refs.dataForm.validateField(type);
|
|
|
+ validateField (type) {
|
|
|
+ this.$refs.dataForm.validateField(type)
|
|
|
},
|
|
|
- inBound() {
|
|
|
- this.inboundVisible = true;
|
|
|
+ inBound () {
|
|
|
+ this.inboundVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.inbound.init(1);
|
|
|
- });
|
|
|
+ this.$refs.inbound.init(1)
|
|
|
+ })
|
|
|
},
|
|
|
// 编辑产品项
|
|
|
- updateProductHandle(row) {
|
|
|
- this.inboundVisible = true;
|
|
|
+ updateProductHandle (row) {
|
|
|
+ this.inboundVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.inbound.init(1, row);
|
|
|
- });
|
|
|
+ this.$refs.inbound.init(1, row)
|
|
|
+ })
|
|
|
},
|
|
|
- addItem(item) {
|
|
|
+ addItem (item) {
|
|
|
if (!item.recordId) {
|
|
|
- item.recordId = Math.round(Math.random() * 1000000);
|
|
|
+ item.recordId = Math.round(Math.random() * 1000000)
|
|
|
}
|
|
|
if (
|
|
|
this.cusRCommProductVOS.findIndex(
|
|
@@ -608,65 +608,65 @@ export default {
|
|
|
) === -1
|
|
|
) {
|
|
|
this.cusRCommProductVOS.push({
|
|
|
- ...item,
|
|
|
- });
|
|
|
+ ...item
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- //添加工单
|
|
|
- addWorderItem(item) {
|
|
|
+ // 添加工单
|
|
|
+ addWorderItem (item) {
|
|
|
if (!item.recordId) {
|
|
|
- item.recordId = Math.round(Math.random() * 1000000);
|
|
|
+ item.recordId = Math.round(Math.random() * 1000000)
|
|
|
}
|
|
|
if (
|
|
|
this.workInfoList.findIndex(
|
|
|
(item1) => item1.recordId === item.recordId
|
|
|
) === -1
|
|
|
) {
|
|
|
- this.workInfoList.push({ ...item });
|
|
|
+ this.workInfoList.push({ ...item })
|
|
|
}
|
|
|
},
|
|
|
- uploadSuccessTechnical(fileList) {
|
|
|
- this.attachListTechnical = fileList;
|
|
|
+ uploadSuccessTechnical (fileList) {
|
|
|
+ this.attachListTechnical = fileList
|
|
|
},
|
|
|
- uploadSuccessDrawing(fileList) {
|
|
|
- this.attachListDrawing = fileList;
|
|
|
+ uploadSuccessDrawing (fileList) {
|
|
|
+ this.attachListDrawing = fileList
|
|
|
},
|
|
|
- uploadSuccess(fileList) {
|
|
|
- this.attachList = fileList;
|
|
|
+ uploadSuccess (fileList) {
|
|
|
+ this.attachList = fileList
|
|
|
},
|
|
|
- uploadSuccessOther(fileList) {
|
|
|
- this.attachListOther = fileList;
|
|
|
+ uploadSuccessOther (fileList) {
|
|
|
+ this.attachListOther = fileList
|
|
|
},
|
|
|
- typeChanged(item) {
|
|
|
- this.detailVisible = item === "1";
|
|
|
+ typeChanged (item) {
|
|
|
+ this.detailVisible = item === '1'
|
|
|
},
|
|
|
// 删除产品项
|
|
|
- deleteProductHandle(recordId) {
|
|
|
+ deleteProductHandle (recordId) {
|
|
|
this.cusRCommProductVOS.splice(
|
|
|
this.cusRCommProductVOS.findIndex((item) => item.recordId === recordId),
|
|
|
1
|
|
|
- );
|
|
|
+ )
|
|
|
},
|
|
|
- worderAdd() {
|
|
|
- this.worderVisible = true;
|
|
|
+ worderAdd () {
|
|
|
+ this.worderVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.worder.init(0, null);
|
|
|
- });
|
|
|
+ this.$refs.worder.init(0, null)
|
|
|
+ })
|
|
|
},
|
|
|
- updateWorderHandle(row) {
|
|
|
- this.worderVisible = true;
|
|
|
+ updateWorderHandle (row) {
|
|
|
+ this.worderVisible = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.worder.init(1, row);
|
|
|
- });
|
|
|
+ this.$refs.worder.init(1, row)
|
|
|
+ })
|
|
|
},
|
|
|
- attachDetails(attachList) {
|
|
|
+ attachDetails (attachList) {
|
|
|
attachList.forEach((item) => {
|
|
|
- item.fileName = item.name;
|
|
|
- });
|
|
|
- this.$refs.attachDetail.init(attachList);
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ item.fileName = item.name
|
|
|
+ })
|
|
|
+ this.$refs.attachDetail.init(attachList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|