定制化报表,基础核心
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:27:50
|
||||
* @LastEditTime: 2023-12-12 16:04:44
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -15,25 +15,26 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户编号" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入客户编号" />
|
||||
<el-input v-model="dataForm.code" :disabled="isdetail" clearable placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入客户名称" />
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人" prop="contact">
|
||||
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
|
||||
<el-input v-model="dataForm.contact" :disabled="isdetail" clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input
|
||||
v-model="dataForm.telephone"
|
||||
:disabled="isdetail"
|
||||
maxlength="11"
|
||||
placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
@@ -42,22 +43,34 @@
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="特殊要求" prop="specialRequirements">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="dataForm.specialRequirements"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入备注" />
|
||||
<imageUpload v-model="files" :disabled="isdetail" :limit="5"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { ImageUpload },
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -67,6 +80,8 @@ export default {
|
||||
updateURL: updateCustomer,
|
||||
infoURL: getCustomer
|
||||
},
|
||||
files: [],
|
||||
isdetail: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
@@ -74,7 +89,9 @@ export default {
|
||||
telephone: undefined,
|
||||
contact: undefined,
|
||||
address: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
specialRequirements: undefined,
|
||||
files: []
|
||||
},
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "客户编号不能为空", trigger: "blur" }],
|
||||
@@ -100,6 +117,66 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
init(id, isdetail) {
|
||||
this.dataForm.id = id || "";
|
||||
this.isdetail = isdetail || false;
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
if (this.setData) {
|
||||
this.setDataForm()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
console.log('122', this.files)
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.dataForm.files = []
|
||||
if (this.files.length > 0) {
|
||||
this.files.forEach(item => {
|
||||
const temp = {
|
||||
fileType: 1,
|
||||
fileUrl: item
|
||||
}
|
||||
this.dataForm.files.push(temp)
|
||||
})
|
||||
}
|
||||
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user