|
@@ -39,15 +39,15 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div
|
|
|
v-if="scope.row.good_thumb_img"
|
|
|
+ v-viewer
|
|
|
style="width: 20px; height: 20px"
|
|
|
class="hover"
|
|
|
- v-viewer
|
|
|
>
|
|
|
<img
|
|
|
:src="scope.row.good_thumb_img"
|
|
|
style="display: inline-block; width: 100%; height: 100%"
|
|
|
alt=""
|
|
|
- />
|
|
|
+ >
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -76,9 +76,9 @@
|
|
|
:type="scope.row.good_type == '1' ? '' : 'warning'"
|
|
|
v-text="
|
|
|
(options1.find((item) => item.id == scope.row.status) || {}).name ||
|
|
|
- '--'
|
|
|
+ '--'
|
|
|
"
|
|
|
- ></el-tag>
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -122,7 +122,7 @@
|
|
|
<search-terrace
|
|
|
:value="ruleForm.platform"
|
|
|
:disabled="false"
|
|
|
- :isDetail="false"
|
|
|
+ :is-detail="false"
|
|
|
:is_show="'1'"
|
|
|
:placeholder="'所属平台'"
|
|
|
@searchChange="platform_codesearchChange"
|
|
@@ -130,9 +130,9 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上线原因" prop="online_reason">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.online_reason"
|
|
|
:disabled="false"
|
|
|
placeholder="上线原因"
|
|
|
- v-model="ruleForm.online_reason"
|
|
|
maxlength="200"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -140,13 +140,13 @@
|
|
|
<el-col :span="16" style="text-align: right">
|
|
|
<el-form-item label="上线备注" prop="online_remark">
|
|
|
<el-input
|
|
|
+ v-model="ruleForm.online_remark"
|
|
|
type="textarea"
|
|
|
:rows="3"
|
|
|
:disabled="false"
|
|
|
placeholder="商品备注"
|
|
|
maxlength="2000"
|
|
|
show-word-limit
|
|
|
- v-model="ruleForm.online_remark"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-button
|
|
@@ -154,7 +154,7 @@
|
|
|
type="primary"
|
|
|
:size="'mini'"
|
|
|
@click="submitForm"
|
|
|
- >保 存
|
|
|
+ >保 存
|
|
|
</el-button>
|
|
|
<el-button :size="'mini'" @click="showModelThis = false">{{
|
|
|
id == "007" ? "关 闭" : "取 消"
|
|
@@ -168,173 +168,173 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/service/goodStore/goodsCost";
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
+import asyncRequest from '@/apis/service/goodStore/goodsCost'
|
|
|
+import resToken from '@/mixins/resToken'
|
|
|
export default {
|
|
|
- name: "brand",
|
|
|
- props: ["showModel", "id", "sitem"],
|
|
|
+ name: 'Brand',
|
|
|
mixins: [resToken],
|
|
|
+ props: ['showModel', 'id', 'sitem'],
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
showModelThis: this.showModel,
|
|
|
ruleForm: {
|
|
|
- platform: "", //string 平台id
|
|
|
- online_reason: "", //string 上线原因
|
|
|
- online_remark: "", //string 上线备注
|
|
|
+ platform: '', // string 平台id
|
|
|
+ online_reason: '', // string 上线原因
|
|
|
+ online_remark: '' // string 上线备注
|
|
|
},
|
|
|
- //是否定制
|
|
|
+ // 是否定制
|
|
|
options1: [
|
|
|
- { id: "0", name: "否" },
|
|
|
- { id: "1", name: "是" },
|
|
|
+ { id: '0', name: '否' },
|
|
|
+ { id: '1', name: '是' }
|
|
|
],
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
platform: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择所属平台",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
+ message: '请选择所属平台',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
],
|
|
|
online_reason: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "上线原因不能为空",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ message: '上线原因不能为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
online_remark: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "上线备注不能为空",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- };
|
|
|
+ message: '上线备注不能为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
- showModel: function (val) {
|
|
|
- this.showModelThis = val;
|
|
|
+ showModel: function(val) {
|
|
|
+ this.showModelThis = val
|
|
|
if (val) {
|
|
|
- this.initForm();
|
|
|
+ this.initForm()
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
|
if (!val) {
|
|
|
- this.$emit("cancel");
|
|
|
+ this.$emit('cancel')
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
async initForm() {
|
|
|
- this.loading = true;
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- this.loading = false;
|
|
|
+ this.loading = true
|
|
|
+ this.rulesThis = this.rules
|
|
|
+ await this.resetForm()
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
- this.$refs.ruleForm.resetFields();
|
|
|
- this.$refs.ruleForm.clearValidate();
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
+ this.$refs.ruleForm.clearValidate()
|
|
|
this.ruleForm = {
|
|
|
- platform: "", //string 平台id
|
|
|
- online_reason: "", //string 上线原因
|
|
|
- online_remark: "", //string 上线备注
|
|
|
- };
|
|
|
+ platform: '', // string 平台id
|
|
|
+ online_reason: '', // string 上线原因
|
|
|
+ online_remark: '' // string 上线备注
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
platform_codesearchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- this.ruleForm.platform = id || "";
|
|
|
- this.$refs.ruleForm.validateField("platform");
|
|
|
+ const { id, code, label } = e
|
|
|
+ this.ruleForm.platform = id || ''
|
|
|
+ this.$refs.ruleForm.validateField('platform')
|
|
|
},
|
|
|
async submitForm() {
|
|
|
- await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ await this.$refs.ruleForm.validate(async(valid) => {
|
|
|
if (valid) {
|
|
|
if (!this.loading) {
|
|
|
- this.loading = true;
|
|
|
- let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ this.loading = true
|
|
|
+ const model = JSON.parse(JSON.stringify(this.ruleForm))
|
|
|
// model.platform = model.platform.toString();
|
|
|
- model.codes = [];
|
|
|
- let list = JSON.parse(JSON.stringify(this.sitem));
|
|
|
+ model.codes = []
|
|
|
+ const list = JSON.parse(JSON.stringify(this.sitem))
|
|
|
list.forEach((e) => {
|
|
|
- model.codes.push(e.spuCode);
|
|
|
- });
|
|
|
- let { code, data, message } = await asyncRequest.online_add(model);
|
|
|
- this.loading = false;
|
|
|
+ model.codes.push(e.spuCode)
|
|
|
+ })
|
|
|
+ const { code, data, message } = await asyncRequest.online_add(model)
|
|
|
+ this.loading = false
|
|
|
if (code === 0) {
|
|
|
this.$notify.success({
|
|
|
- title: "已成功添加至上线流程!",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.showModelThis = false;
|
|
|
+ title: '已成功添加至上线流程!',
|
|
|
+ message: ''
|
|
|
+ })
|
|
|
+ this.showModelThis = false
|
|
|
// 刷新
|
|
|
- this.$emit("refresh");
|
|
|
+ this.$emit('refresh')
|
|
|
} else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
+ await this.logout()
|
|
|
} else if (code === 1009) {
|
|
|
- let resList = JSON.parse(JSON.stringify(data));
|
|
|
+ const resList = JSON.parse(JSON.stringify(data))
|
|
|
|
|
|
- let htmlList = "<ul>";
|
|
|
+ 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>";
|
|
|
+ <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>";
|
|
|
+ str += `${ai !== 0 ? '--' : ''}${a.spec_name}[${a.spec_value}]`
|
|
|
+ })
|
|
|
+ htmlList += str + '</span>' + `</li>`
|
|
|
+ })
|
|
|
+ htmlList += '</ul>'
|
|
|
this.$notify({
|
|
|
- title: "以下商品已上线或已经在审批流程中!",
|
|
|
+ title: '以下商品已上线或已经在审批流程中!',
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- message: htmlList,
|
|
|
- });
|
|
|
+ message: htmlList
|
|
|
+ })
|
|
|
} else if (code === 1010) {
|
|
|
- let resList = JSON.parse(JSON.stringify(data));
|
|
|
+ const resList = JSON.parse(JSON.stringify(data))
|
|
|
|
|
|
- let htmlList = "<ul>";
|
|
|
+ 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>";
|
|
|
+ <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>";
|
|
|
+ str += `${ai !== 0 ? '--' : ''}${a.spec_name}[${a.spec_value}]`
|
|
|
+ })
|
|
|
+ htmlList += str + '</span>' + `</li>`
|
|
|
+ })
|
|
|
+ htmlList += '</ul>'
|
|
|
this.$notify({
|
|
|
- title: "该平台要求商品必须要有一件的成本!",
|
|
|
+ title: '该平台要求商品必须要有一件的成本!',
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- message: htmlList,
|
|
|
- });
|
|
|
+ message: htmlList
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
// console.log("error submit!!");
|
|
|
- return false;
|
|
|
+ return false
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|