|
@@ -32,7 +32,6 @@
|
|
|
placeholder="上线原因"
|
|
|
v-model="ruleForm.online_reason"
|
|
|
maxlength="200"
|
|
|
-
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -280,10 +279,9 @@ export default {
|
|
|
model.codes.push(e.spuCode);
|
|
|
});
|
|
|
// model.platform = model.platform.toString();
|
|
|
- let res = await asyncRequest.add(model);
|
|
|
+ const { code, data, message } = await asyncRequest.add(model);
|
|
|
this.loading = false;
|
|
|
- if (res && res.code === 0) {
|
|
|
- const { spuCode } = res.data;
|
|
|
+ if (code === 0) {
|
|
|
this.$notify.success({
|
|
|
title: "新建成功",
|
|
|
message: "",
|
|
@@ -291,6 +289,33 @@ export default {
|
|
|
this.showModelThis = false;
|
|
|
// 刷新
|
|
|
this.routeReGoto("goodsOnline", {});
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
+ await this.logout(code <= 104);
|
|
|
+ } else if (code == 1009) {
|
|
|
+ let resList = JSON.parse(JSON.stringify(data));
|
|
|
+
|
|
|
+ let htmlList = "<ul>";
|
|
|
+ resList.forEach((v) => {
|
|
|
+ htmlList += `<li>
|
|
|
+ <img src='${v.good_img}' style='width: 20px; height: 20px'
|
|
|
+ class='hover'
|
|
|
+ v-viewer/>
|
|
|
+ <span>${v.good_name}__</span>`;
|
|
|
+ const { speclist } = v;
|
|
|
+ let str = "<span>";
|
|
|
+ speclist.forEach((a, ai) => {
|
|
|
+ str += `${ai !== 0 ? "--" : ""}${a.spec_name}[${a.spec_value}]`;
|
|
|
+ });
|
|
|
+ htmlList += str + "</span>" + `</li>`;
|
|
|
+ });
|
|
|
+ htmlList += "</ul>";
|
|
|
+ this.$notify({
|
|
|
+ title: "以下商品已上线或已经在审批流程中!",
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: htmlList,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.warning(message);
|
|
|
}
|
|
|
} else {
|
|
|
console.log("error submit!!");
|
|
@@ -321,7 +346,7 @@ export default {
|
|
|
|
|
|
platform_codesearchChange(e) {
|
|
|
const { id, code, label } = e;
|
|
|
- this.ruleForm.platform = id ||"";
|
|
|
+ this.ruleForm.platform = id || "";
|
|
|
this.$refs.ruleForm.validateField("platform");
|
|
|
},
|
|
|
},
|