123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- <template>
- <div class="showGoodsDataTable" v-loading="loading">
- <show-data-table
- v-if="
- (type === '1' || type === '2' || type === '5' || type === '6') &&
- this.sitem &&
- this.sitem.addtime &&
- !iscgd
- "
- :sitem="sitem"
- :columns="onlineColumns"
- :border="border"
- >
- <template slot="good_name">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- v-if="sitem.good_thumb_img"
- :src="sitem.good_thumb_img"
- alt=""
- />
- <span>{{ sitem.good_name }}</span>
- <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
- </span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>上线商品编号:</span><span>{{ sitem.skuCode }}</span>
- </li>
- <li
- v-if="
- newTime !== '' &&
- private_field &&
- private_field.length > 0 &&
- private_field.some((item) => item == '1')
- "
- >
- <span>商品成本编号:</span><span>{{ sitem.spuCode }}</span>
- </li>
- <li>
- <span>平台商品编码:</span
- ><span>{{ sitem.platform_code_en }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="good_img">
- <img
- class="fl"
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- v-viewer
- v-for="(si, i) in sitem.good_img"
- :src="si"
- :key="si + i"
- />
- </template>
- <template slot="good_info_img">
- <img
- class="fl"
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- v-viewer
- v-for="(si, i) in sitem.good_info_img"
- :src="si"
- :key="si + i"
- />
- </template>
- <template slot="company">
- <span>{{ sitem.company }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>业务企业编号:</span><span>{{ sitem.companyNo }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="exclusive">
- <span v-for="(si, sii) in sitem.exclusive" :key="si.id">
- <span v-if="sii !== 0">/</span> <span>{{ si.name }}</span>
- </span>
- </template>
- <template slot="supply_area">
- <el-tag
- :size="'mini'"
- v-text="
- (options6.find((item) => item.id == sitem.supply_area) || {})
- .name || '--'
- "
- />
- </template>
- <template slot="is_stock">
- <el-tag
- :size="'mini'"
- v-text="
- (options4.find((item) => item.id == sitem.is_stock) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="good_type">
- <el-tag
- :size="'mini'"
- v-text="
- (options1.find((item) => item.id == sitem.good_type) || {}).name ||
- '--'
- "
- />
- <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
- >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
- >
- </template>
- <template slot="noble">
- <span v-if="sitem.noble_metal"
- >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
- sitem.noble_name
- }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
- sitem.is_gold_price === "0" ? "不" : ""
- }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
- sitem.config
- }}-{{ sitem.other_config }}</span
- >
- </template>
- </show-data-table>
- <show-data-table
- v-else-if="
- (type === '1' || type === '2' || type === '5' || type === '6') &&
- this.sitem &&
- this.sitem.addtime &&
- iscgd
- "
- :sitem="sitem"
- :columns="costColumns"
- :border="border"
- >
- <template slot="good_name">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- v-if="sitem.good_thumb_img"
- :src="sitem.good_thumb_img"
- alt=""
- />
- <span>{{ sitem.good_name }}</span>
- <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
- </span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>商品成本编号:</span><span>{{ sitem.spuCode }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="good_img">
- <img
- class="fl"
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- v-viewer
- v-for="(si, i) in sitem.good_img"
- :src="si"
- :key="si + i"
- />
- </template>
- <template slot="good_info_img">
- <img
- class="fl"
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- v-viewer
- v-for="(si, i) in sitem.good_info_img"
- :src="si"
- :key="si + i"
- />
- </template>
- <template slot="company">
- <span>{{ sitem.company }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>业务企业编号:</span><span>{{ sitem.companyNo }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="supplierName">
- <span>{{ sitem.supplierName }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>供应商编号:</span><span>{{ sitem.supplierNo }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="exclusive">
- <span v-for="(si, sii) in sitem.exclusive" :key="si.id">
- <span v-if="sii !== 0">/</span> <span>{{ si.name }}</span>
- </span>
- </template>
- <template slot="supply_area">
- <el-tag
- :size="'mini'"
- v-text="
- (options6.find((item) => item.id == sitem.supply_area) || {})
- .name || '--'
- "
- />
- </template>
- <template slot="is_stock">
- <el-tag
- :size="'mini'"
- v-text="
- (options4.find((item) => item.id == sitem.is_stock) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="is_auth">
- <el-tag
- :size="'mini'"
- v-text="
- (options3.find((item) => item.id == sitem.is_auth) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="good_type">
- <el-tag
- :size="'mini'"
- v-text="
- (options1.find((item) => item.id == sitem.good_type) || {}).name ||
- '--'
- "
- />
- <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
- >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
- >
- </template>
- <template slot="noble">
- <span v-if="sitem.noble_metal"
- >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
- sitem.noble_name
- }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
- sitem.is_gold_price === "0" ? "不" : ""
- }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
- sitem.config
- }}-{{ sitem.other_config }}</span
- >
- </template>
- </show-data-table>
- <show-data-table
- v-else-if="
- (type === '3' || type === '4') &&
- this.sitem &&
- this.sitem.addtime &&
- !iscgd
- "
- :sitem="sitem"
- :columns="reColumns"
- :border="border"
- >
- <template slot="good_name">
-
- <span>{{ sitem.good_name }}</span>
- <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
- </span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="send_way">
- <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
- </template>
- <template slot="good_type">
- <el-tag
- :size="'mini'"
- v-text="
- (options1.find((item) => item.id == sitem.good_type) || {}).name ||
- '--'
- "
- />
- <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
- >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
- >
- </template>
- <template slot="supply_area">
- <el-tag
- :size="'mini'"
- v-text="
- (options6.find((item) => item.id === sitem.supply_area) || {})
- .name || '--'
- "
- ></el-tag>
- </template>
- <template slot="pay_way">
- <el-tag
- :size="'mini'"
- v-text="
- (options9.find((item) => item.id == sitem.pay_way) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="noble">
- <span v-if="sitem.noble_name"
- >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
- sitem.noble_name
- }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
- sitem.is_gold_price === "0" ? "不" : ""
- }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
- sitem.config
- }}-{{ sitem.other_config }}</span
- >
- <span v-else>--</span>
- </template>
- <template slot="good_img">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- v-for="(si, sii) in sitem.good_img"
- :key="si + sii"
- :src="si"
- alt=""
- />
- </template>
- </show-data-table>
- <show-data-table
- v-else-if="
- (type === '3' || type === '4') &&
- this.sitem &&
- this.sitem.addtime &&
- iscgd
- "
- :sitem="sitem"
- :columns="coveColumns"
- :border="border"
- >
- <template slot="good_name">
- <span>{{ sitem.good_name }}</span>
- <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
- </span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
- </li>
- </ul>
- <i class="el-icon-warning-outline fr" slot="reference"></i>
- </el-popover>
- </template>
- <template slot="send_way">
- <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
- </template>
- <template slot="good_type">
- <el-tag
- :size="'mini'"
- v-text="
- (options1.find((item) => item.id == sitem.good_type) || {}).name ||
- '--'
- "
- />
- <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
- >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
- >
- </template>
- <template slot="supply_area">
- <el-tag
- :size="'mini'"
- v-text="
- (options6.find((item) => item.id === sitem.supply_area) || {})
- .name || '--'
- "
- ></el-tag>
- </template>
-
- <template slot="pay_way">
- <el-tag
- :size="'mini'"
- v-text="
- (options9.find((item) => item.id == sitem.pay_way) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="noble">
- <span v-if="sitem.noble_name"
- >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
- sitem.noble_name
- }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
- sitem.is_gold_price === "0" ? "不" : ""
- }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
- sitem.config
- }}-{{ sitem.other_config }}</span
- >
- <span v-else>--</span>
- </template>
- <template slot="good_img">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- v-for="(si, sii) in sitem.good_img"
- :key="si + sii"
- :src="si"
- alt=""
- />
- </template>
- </show-data-table>
- <div v-else>商品编号有误</div>
- </div>
- </template>
- <script>
- import asyncRequest from "@/apis/components/show-goods-data-table";
- import {
- onlineColumns,
- reColumns,
- costColumns,
- coveColumns,
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- options10,
- options11,
- options12,
- } from "./ShowDataTableColumns";
- export default {
- name: "showGoodsDataTable",
- props: {
- newTime: {
- type: String,
- default: "",
- },
- type: {
- type: String,
- default: "",
- },
- skucode: {
- type: String,
- default: "",
- },
- iscgd: {
- type: Boolean,
- default: false,
- },
- spucode: {
- type: String,
- default: "",
- },
- border: {
- type: Boolean,
- default: false,
- },
- },
- computed: {},
- data() {
- return {
- loading: true,
- sitem: {},
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- options10,
- options11,
- options12,
- onlineColumns,
- reColumns,
- costColumns,
- coveColumns,
- };
- },
- watch: {
- newTime: function (val) {
- if (val) {
- this.initForm();
- }
- },
- },
- mounted() {
- this.initForm();
- },
- methods: {
- async initForm() {
- console.log(
- `${this.type}---${this.skucode}---${this.spucode}---${this.iscgd}`
- );
- this.columns = [];
- this.loading = true;
- if (this.type) {
- let res = {};
- if (
- this.type === "1" ||
- this.type === "2" ||
- this.type === "5" ||
- this.type === "6"
- ) {
- if (this.iscgd) {
- res = await asyncRequest.cost_detail({
- spuCode: this.spucode,
- });
- } else {
- res = await asyncRequest.online_detail({
- skuCode: this.skucode,
- });
- }
- } else {
- if (this.iscgd) {
- res = await asyncRequest.cove_detail({
- spuCode: this.spucode,
- });
- } else {
- res = await asyncRequest.re_detail({
- spuCode: this.spucode,
- });
- }
- }
- const { code, message, data } = res;
- this.loading = false;
- if (code === 0) {
- this.sitem = JSON.parse(JSON.stringify(data));
- const { cat_info } = this.sitem;
- let cat = "";
- if (cat_info && cat_info.length > 0) {
- cat_info.forEach((e, i) => {
- cat += i === 0 ? e.name : "_" + e.name;
- });
- }
- this.sitem.cat = cat;
-
- if (this.sitem && this.sitem.good_img) {
- this.sitem.good_img = this.sitem.good_img.split(",");
- }
- if (this.sitem && this.sitem.good_info_img) {
- this.sitem.good_info_img = this.sitem.good_info_img.split(",");
- }
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- }
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- </style>
|