|
@@ -23,28 +23,28 @@
|
|
|
@searchChange="company_idsearchChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="上线原因" prop="company_id">
|
|
|
+ <el-form-item label="上线原因" prop="online_reason">
|
|
|
<el-input
|
|
|
:disabled="type === 'view' || type === 'editCoin'"
|
|
|
placeholder="上线原因"
|
|
|
- v-model="ruleForm.good_remark"
|
|
|
+ v-model="ruleForm.online_reason"
|
|
|
maxlength="200"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
- <el-form-item label="上线备注" prop="company_id">
|
|
|
+ <el-form-item label="上线备注" prop="online_remark">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
:rows="3"
|
|
|
:disabled="type === 'view' || type === 'editCoin'"
|
|
|
placeholder="商品备注"
|
|
|
+ maxlength="2000"
|
|
|
v-model="ruleForm.good_remark"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col>
|
|
|
- <el-form-item label="上线商品" required>
|
|
|
+ <el-col v-if="type==='add'">
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
stripe
|
|
@@ -52,11 +52,92 @@
|
|
|
:size="'mini'"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
- <el-table-column prop="date" label="日期" width="180">
|
|
|
+ <el-table-column
|
|
|
+ prop="spuCode"
|
|
|
+ label="商品编号"
|
|
|
+ width="180"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="good_thumb_img"
|
|
|
+ label="图片"
|
|
|
+ width="45"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ v-if="scope.row.good_thumb_img"
|
|
|
+ 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>
|
|
|
- <el-table-column prop="name" label="姓名" width="180">
|
|
|
+ <el-table-column
|
|
|
+ prop="good_name"
|
|
|
+ label="商品名称"
|
|
|
+ min-width="160"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="cat_name"
|
|
|
+ label="分类"
|
|
|
+ min-width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="good_name"
|
|
|
+ label="品牌"
|
|
|
+ min-width="brand_name"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="good_type"
|
|
|
+ label="是否定制"
|
|
|
+ min-width="70"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag
|
|
|
+ :size="'mini'"
|
|
|
+ :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 prop="address" label="地址"> </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="supplierNo"
|
|
|
+ label="供应商编号"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="supplier_name"
|
|
|
+ label="供应商名称"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="companyNo"
|
|
|
+ label="业务公司编号"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="company"
|
|
|
+ label="业务公司名称"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
v-if="type === 'add' || type === 'editBase'"
|
|
@@ -77,19 +158,21 @@
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click="openEdit(scope.$index, scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button type="text" size="small" @click="openEdit('0', {})"
|
|
|
- >移除</el-button
|
|
|
- >
|
|
|
+ <el-tooltip effect="dark" content="修改" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-edit tb-icon"
|
|
|
+ @click="openEdit(scope.$index, scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="dark" content="删除" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-delete tb-icon"
|
|
|
+ @click="openEdit('0', {})"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- </el-form-item>
|
|
|
<!--添加商品-->
|
|
|
<search-good-modal
|
|
|
:showModel="showModel"
|
|
@@ -114,26 +197,13 @@ import asyncRequest from "@/apis/service/goodStore/goodsCost";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import searchGoodModal from "@/components/search-good-modal";
|
|
|
-// import baseFormAddEdit from "./baseFormAddEdit";
|
|
|
-// import costFormAddEdit from "./costFormAddEdit";
|
|
|
-import {
|
|
|
- options1,
|
|
|
- options2,
|
|
|
- options3,
|
|
|
- options4,
|
|
|
- options5,
|
|
|
- options6,
|
|
|
- options7,
|
|
|
- rules,
|
|
|
-} from "../columns";
|
|
|
+import { rules, options1 } from "../columns";
|
|
|
export default {
|
|
|
name: "goodsCostAdd",
|
|
|
mixins: [resToken],
|
|
|
props: ["showModel", "id", "type", "sitem"],
|
|
|
components: {
|
|
|
searchGoodModal,
|
|
|
- // baseFormAddEdit,
|
|
|
- // costFormAddEdit,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
@@ -167,13 +237,8 @@ export default {
|
|
|
rulesThis: this.rules,
|
|
|
activeName: "1",
|
|
|
loading: true,
|
|
|
- // options1: options1,
|
|
|
- // options2: options2,
|
|
|
- // options3: options3,
|
|
|
- // options4: options4,
|
|
|
- // options5: options5,
|
|
|
- // options6: options6,
|
|
|
- // options7: options7,
|
|
|
+ //是否定制
|
|
|
+ options1: options1,
|
|
|
ruleForm: {},
|
|
|
rules: rules,
|
|
|
};
|
|
@@ -184,7 +249,6 @@ export default {
|
|
|
methods: {
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
-
|
|
|
this.resetFormData();
|
|
|
this.rulesThis = this.rules;
|
|
|
await this.resetForm();
|
|
@@ -218,7 +282,6 @@ export default {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
-
|
|
|
let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
model.cat_id = model.cat_id[model.cat_id.length - 1];
|
|
|
model.brandid = model.brandid.toString();
|
|
@@ -227,19 +290,7 @@ export default {
|
|
|
model.origin_place = model.origin_place.toString();
|
|
|
model.good_info_img = model.good_info_img.toString();
|
|
|
model.unit = model.unit.toString();
|
|
|
- let res = {};
|
|
|
- delete model["id"];
|
|
|
- if (this.type === "add") {
|
|
|
- delete model["id"];
|
|
|
- delete model["spuCode"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
- } else if (this.type === "editBase") {
|
|
|
- let item1 = this.setModel(model, "1");
|
|
|
- res = await asyncRequest.update(item1);
|
|
|
- } else {
|
|
|
- let item2 = this.setModel(model, "2");
|
|
|
- res = await asyncRequest.updateP(item2);
|
|
|
- }
|
|
|
+ let res = await asyncRequest.add(model);
|
|
|
console.log(res);
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
@@ -266,25 +317,34 @@ export default {
|
|
|
},
|
|
|
|
|
|
resetFormData() {
|
|
|
- const {
|
|
|
- id,
|
|
|
- platform, //string 平台id
|
|
|
- // good_code, //string 无
|
|
|
- online_reason, //string 上线原因
|
|
|
- online_remark, //string 上线备注
|
|
|
- company_id, // string 企业公司id
|
|
|
- status,
|
|
|
- } = this.sitem;
|
|
|
+ if (this.type === "add") {
|
|
|
+ this.ruleForm = {
|
|
|
+ platform: "", //string 平台id
|
|
|
+ good_code:[], //string 无
|
|
|
+ online_reason: "", //string 上线原因
|
|
|
+ online_remark: "", //string 上线备注
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ const {
|
|
|
+ id,
|
|
|
+ platform, //string 平台id
|
|
|
+ // good_code, //string 无
|
|
|
+ online_reason, //string 上线原因
|
|
|
+ online_remark, //string 上线备注
|
|
|
+ company_id, // string 企业公司id
|
|
|
+ status,
|
|
|
+ } = this.sitem;
|
|
|
|
|
|
- this.status = status;
|
|
|
- this.ruleForm = {
|
|
|
- id: id || "",
|
|
|
- platform: platform || "", //string 平台id
|
|
|
- // good_code, //string 无
|
|
|
- online_reason: online_reason || "", //string 上线原因
|
|
|
- online_remark: online_remark || "", //string 上线备注
|
|
|
- company_id: company_id || "", // string 企业公司id
|
|
|
- };
|
|
|
+ // this.status = status;
|
|
|
+ this.ruleForm = {
|
|
|
+ id: id || "",
|
|
|
+ platform: platform || "", //string 平台id
|
|
|
+ // good_code, //string 无
|
|
|
+ online_reason: online_reason || "", //string 上线原因
|
|
|
+ online_remark: online_remark || "", //string 上线备注
|
|
|
+ company_id: company_id || "", // string 企业公司id
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
async resetForm() {
|
|
|
// 重置
|