|
@@ -16,10 +16,7 @@
|
|
|
<search-work-company
|
|
|
:value="ruleForm.companyNo"
|
|
|
:placeholder="'销售方公司'"
|
|
|
- :disabled="
|
|
|
- type === 'view' ||
|
|
|
- (type === 'edit' && ruleForm.is_project === '1')
|
|
|
- "
|
|
|
+ :disabled="type === 'view' || type === 'edit'"
|
|
|
:size="'mini'"
|
|
|
:isDetail="type === 'view' || type === 'edit'"
|
|
|
@searchChange="company_idsearchChange"
|
|
@@ -34,10 +31,7 @@
|
|
|
:placeholder="'购买方公司'"
|
|
|
:size="'mini'"
|
|
|
@searchChange="customerChange"
|
|
|
- :disabled="
|
|
|
- type === 'view' ||
|
|
|
- (type === 'edit' && ruleForm.is_project === '1')
|
|
|
- "
|
|
|
+ :disabled="type === 'view' || type === 'edit'"
|
|
|
:is-detail="type === 'view' || type === 'edit'"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -46,10 +40,7 @@
|
|
|
<el-form-item label="所属平台" prop="platform_code">
|
|
|
<search-terrace
|
|
|
:value="ruleForm.platform_code"
|
|
|
- :disabled="
|
|
|
- type === 'view' ||
|
|
|
- (type === 'edit' && ruleForm.is_project === '1')
|
|
|
- "
|
|
|
+ :disabled="type === 'view' || type === 'edit'"
|
|
|
:size="'mini'"
|
|
|
:isDetail="type === 'view' || type === 'edit'"
|
|
|
:names="platform_name"
|
|
@@ -80,7 +71,6 @@
|
|
|
placeholder="咨询类型"
|
|
|
clearable
|
|
|
:disabled="type === 'view' || type === 'edit'"
|
|
|
- @change="is_project_change"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -233,7 +223,7 @@
|
|
|
(type === 'edit' && ruleForm.is_project === '1')
|
|
|
"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- :picker-options="pickerOptions"
|
|
|
+ :picker-options="pickerOptions1"
|
|
|
placeholder="到货日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -273,7 +263,7 @@
|
|
|
"
|
|
|
:controls="false"
|
|
|
:append="'元'"
|
|
|
- @reschange="budget_price_change"
|
|
|
+ @reschange="digitalInput($event, 'budget_price')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -293,7 +283,7 @@
|
|
|
"
|
|
|
:controls="false"
|
|
|
:append="''"
|
|
|
- @reschange="num_change"
|
|
|
+ @reschange="digitalInput($event, 'num')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -303,7 +293,7 @@
|
|
|
<search-brand
|
|
|
:value="ruleForm.brand_id"
|
|
|
:size="'mini'"
|
|
|
- :isDetail="type === 'view'"
|
|
|
+ :isDetail="type === 'view' || type === 'edit'"
|
|
|
:names="brand_name"
|
|
|
:disabled="type === 'view' || type === 'edit'"
|
|
|
:placeholder="'品牌'"
|
|
@@ -342,7 +332,7 @@
|
|
|
:size="'mini'"
|
|
|
:append="'g'"
|
|
|
:disabled="type === 'view'"
|
|
|
- @reschange="total_weight_change"
|
|
|
+ @reschange="digitalInput($event, 'total_weight')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -498,7 +488,7 @@
|
|
|
:size="'mini'"
|
|
|
:disabled="type === 'view'"
|
|
|
:append="'g'"
|
|
|
- @reschange="specs_weight_change"
|
|
|
+ @reschange="digitalInput($event, 'specs_weight')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -636,6 +626,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ od_form: null,
|
|
|
unit_name: "",
|
|
|
modelIndex: "",
|
|
|
modelSitem: {},
|
|
@@ -776,7 +767,10 @@ export default {
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
-
|
|
|
+ async digitalInput(e, key) {
|
|
|
+ this.ruleForm[key] = e + "" || "0";
|
|
|
+ this.$refs.ruleForm.validateField(key);
|
|
|
+ },
|
|
|
sch_is_noble() {
|
|
|
this.rulesThis["projectNo"][0].required =
|
|
|
this.ruleForm.is_project === "1";
|
|
@@ -799,14 +793,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //咨询类型选择
|
|
|
- is_project_change() {
|
|
|
- const { is_project } = this.ruleForm;
|
|
|
- if (is_project === "0") {
|
|
|
- } else {
|
|
|
- // this.ptableData = [];
|
|
|
- }
|
|
|
- },
|
|
|
async resetForm() {
|
|
|
this.resign_name = "";
|
|
|
this.hand_name = "";
|
|
@@ -860,7 +846,7 @@ export default {
|
|
|
p_good_img,
|
|
|
p_arrtime,
|
|
|
specinfo,
|
|
|
- } = this.sitem;
|
|
|
+ } = JSON.parse(JSON.stringify(this.sitem));
|
|
|
this.unit_name = unit_name;
|
|
|
this.brand_name = brand;
|
|
|
this.spec_tableData =
|
|
@@ -926,6 +912,8 @@ export default {
|
|
|
if (this.ruleForm.projectNo && this.ruleForm.projectNo.length === 1) {
|
|
|
await this.selectChange(this.ruleForm.projectNo);
|
|
|
}
|
|
|
+
|
|
|
+ this.od_form = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -987,9 +975,18 @@ export default {
|
|
|
delete model["arrtime"];
|
|
|
delete model["puse_desc"];
|
|
|
delete model["budget_total"];
|
|
|
+ delete model["khname"];
|
|
|
+
|
|
|
this.loading = false;
|
|
|
console.log(model);
|
|
|
-
|
|
|
+ console.log(this.sitem);
|
|
|
+ Object.keys(model).forEach((key) => {
|
|
|
+ if (model[key] !== this.sitem[key]) {
|
|
|
+ console.log(key + "---" + model[key] + "----" + this.sitem[key]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // this.loading = false;
|
|
|
+ // return;
|
|
|
const res = await asyncRequest.update(model);
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
@@ -1142,6 +1139,12 @@ export default {
|
|
|
this.ruleForm.brand_id = id ? [id] : [];
|
|
|
this.$refs.ruleForm.validateField("brand_id");
|
|
|
},
|
|
|
+ unitsearchChange(e) {
|
|
|
+ const { code, label } = e;
|
|
|
+ this.ruleForm.unit = code ? [code] : [];
|
|
|
+ this.unit_name = label || "";
|
|
|
+ this.$refs.ruleForm.validateField("unit");
|
|
|
+ },
|
|
|
//销售方公司选择
|
|
|
company_idsearchChange(e) {
|
|
|
if (e) {
|
|
@@ -1162,7 +1165,6 @@ export default {
|
|
|
this.$refs.ruleForm.validateField("khNo");
|
|
|
this.ruleForm.projectNo = [];
|
|
|
this.ruleForm.budget_total = "0";
|
|
|
- this.ruleForm.use_desc = "";
|
|
|
this.ruleForm.pendtime = "";
|
|
|
this.ruleForm.arrtime = "";
|
|
|
this.ptableData = [];
|
|
@@ -1184,6 +1186,48 @@ export default {
|
|
|
this.$refs.ruleForm.validateField("cat_id");
|
|
|
this.is_noble = pid === "6";
|
|
|
},
|
|
|
+ //判断图片规格
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
+ let isJPG = false,
|
|
|
+ isLt2M = false;
|
|
|
+ if (file) {
|
|
|
+ if (
|
|
|
+ file.type === "image/jpg" ||
|
|
|
+ file.type === "image/png" ||
|
|
|
+ file.type === "image/jpeg"
|
|
|
+ ) {
|
|
|
+ isJPG = true;
|
|
|
+ }
|
|
|
+ isLt2M = file.size / 1024 / 1024 < 1;
|
|
|
+ if (!isJPG) {
|
|
|
+ this.$message.error("图片格式不正确!");
|
|
|
+ }
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error("图片大小不能超过 1MB!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return isJPG && isLt2M;
|
|
|
+ },
|
|
|
+ //图片上传失败
|
|
|
+ UploadErrorEvent(res) {
|
|
|
+ if (res !== "break") {
|
|
|
+ this.$message.error("图片上传失败!");
|
|
|
+ this.ruleForm.good_img = "";
|
|
|
+ this.$refs.ruleForm.validateField("good_img");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //图片上传成功
|
|
|
+ async UploadSuccessEvent(data) {
|
|
|
+ const { url } = data;
|
|
|
+ if (url === "noToken") {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.ruleForm.good_img = url;
|
|
|
+ this.$message.success("图片上传成功!");
|
|
|
+ this.$refs.ruleForm.validateField("good_img");
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|