7d52e2b0f5ccf41e72ea4ad2d02a8c08.json 14 KB

1
  1. {"remainingRequest":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\front\\item\\zyAdmin\\src\\components\\goodsList\\index.vue?vue&type=style&index=0&id=db32e292&lang=scss&scoped=true","dependencies":[{"path":"D:\\front\\item\\zyAdmin\\src\\components\\goodsList\\index.vue","mtime":1761614938956},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\css-loader\\index.js","mtime":1761614929364},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1761614937403},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\postcss-loader\\src\\index.js","mtime":1761614935133},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1761614936391},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1761614927801},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js","mtime":1761614937402}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:DQo6OnYtZGVlcCAuZWwtY2hlY2tib3h7DQogIG1hcmdpbi1ib3R0b206IDAgIWltcG9ydGFudDsNCn0NCi5mb290ZXIgew0KICBtYXJnaW46IDE1cHggMDsNCn0NCi50YWJCb3hfaW1nIHsNCiAgd2lkdGg6IDM2cHg7DQogIGhlaWdodDogMzZweDsNCiAgYm9yZGVyLXJhZGl1czogNHB4Ow0KICBjdXJzb3I6IHBvaW50ZXI7DQoNCiAgaW1nIHsNCiAgICB3aWR0aDogMTAwJTsNCiAgICBoZWlnaHQ6IDEwMCU7DQogIH0NCn0NCi50YWJmb3JtIHsNCiAgOjp2LWRlZXAgLml2dS1mb3JtLWl0ZW0gew0KICAgIG1hcmdpbi1ib3R0b206IDE2cHggIWltcG9ydGFudDsNCiAgfQ0KfQ0KLmJ0biB7DQogIG1hcmdpbi10b3A6IDIwcHg7DQogIGZsb2F0OiByaWdodDsNCn0NCi5nb29kTGlzdCB7DQogIDo6di1kZWVwdGFibGUgew0KICAgIHdpZHRoOiAxMDAlICFpbXBvcnRhbnQ7DQogIH0NCn0NCg=="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";AAkYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/components/goodsList","sourcesContent":["<template>\r\n <div class=\"goodList\">\r\n <el-form ref=\"formValidate\" :model=\"formValidate\" label-width=\"80px\" label-position=\"right\" inline class=\"tabform\">\r\n <el-form-item label=\"商品分类:\" v-if=\"!liveStatus\">\r\n <el-cascader\r\n v-model=\"formValidate.cate_id\"\r\n size=\"small\"\r\n :options=\"treeSelect\"\r\n :props=\"{ checkStrictly: true, emitPath: false, multiple: true }\"\r\n clearable\r\n class=\"form_content_width\"\r\n ></el-cascader>\r\n </el-form-item>\r\n <el-form-item label=\"商品类型:\" v-if=\"!type && diy\">\r\n <el-select v-model=\"goodType\" clearable @change=\"userSearchs\" class=\"form_content_width\">\r\n <el-option v-for=\"item in goodList\" :value=\"item.activeValue\" :key=\"item.activeValue\" :label=\"item.title\">\r\n </el-option>\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"商品搜索:\">\r\n <el-input\r\n clearable\r\n placeholder=\"请输入商品名称/关键字/ID\"\r\n v-model=\"formValidate.store_name\"\r\n class=\"form_content_width\"\r\n />\r\n <el-button type=\"primary\" v-db-click @click=\"userSearchs\" class=\"ml15\">查询</el-button>\r\n </el-form-item>\r\n </el-form>\r\n <el-table\r\n ref=\"table\"\r\n empty-text=\"暂无数据\"\r\n max-height=\"400\"\r\n :highlight-current-row=\"many !== 'many'\"\r\n :data=\"tableList\"\r\n v-loading=\"loading\"\r\n @select=\"changeCheckbox\"\r\n @select-all=\"changeCheckbox\"\r\n >\r\n <el-table-column v-if=\"many == 'many'\" type=\"selection\" width=\"55\"> </el-table-column>\r\n <el-table-column v-else width=\"50\">\r\n <template slot-scope=\"scope\">\r\n <el-radio v-model=\"templateRadio\" :label=\"scope.row.id\" @change.native=\"getTemplateRow(scope.row)\"\r\n >&nbsp;</el-radio\r\n >\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"商品ID\" width=\"80\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.id }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"图片\" width=\"80\">\r\n <template slot-scope=\"scope\">\r\n <div class=\"tabBox_img\" v-viewer>\r\n <img v-lazy=\"scope.row.image\" />\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"商品名称\" min-width=\"250\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.store_name }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"商品分类\" min-width=\"150\" v-if=\"liveStatus\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.cate_name }}</span>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <div class=\"acea-row row-right page\">\r\n <pagination\r\n v-if=\"total\"\r\n :total=\"total\"\r\n :page.sync=\"formValidate.page\"\r\n :limit.sync=\"formValidate.limit\"\r\n @pagination=\"pageChange\"\r\n />\r\n <el-button type=\"primary\" v-db-click @click=\"ok\" v-if=\"many === 'many' && !diy\" class=\"ml15\">提交</el-button>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex';\r\nimport { cascaderListApi, changeListApi } from '@/api/product';\r\nimport { liveGoods } from '@/api/live';\r\nimport { getProductList } from '@/api/diy';\r\nexport default {\r\n name: 'index',\r\n props: {\r\n is_new: {\r\n type: String,\r\n default: '',\r\n },\r\n type: {\r\n type: Number,\r\n default: 0,\r\n },\r\n diy: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n ischeckbox: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n liveStatus: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n isLive: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n isdiy: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n selectIds: {\r\n type: Array,\r\n default: () => {\r\n return [];\r\n },\r\n },\r\n datas: {\r\n type: Object,\r\n default: function () {\r\n return {};\r\n },\r\n },\r\n },\r\n data() {\r\n return {\r\n templateRadio: 0,\r\n modal_loading: false,\r\n treeSelect: [],\r\n formValidate: {\r\n page: 1,\r\n limit: 15,\r\n cate_id: '',\r\n store_name: '',\r\n is_new: this.is_new,\r\n },\r\n total: 0,\r\n modals: false,\r\n loading: false,\r\n grid: {\r\n xl: 10,\r\n lg: 10,\r\n md: 12,\r\n sm: 24,\r\n xs: 24,\r\n },\r\n tableList: [],\r\n currentid: 0,\r\n productRow: {},\r\n images: [],\r\n many: '',\r\n goodType: '',\r\n goodList: [\r\n {\r\n activeValue: 0,\r\n title: '商品列表',\r\n },\r\n // {\r\n // activeValue: '4',\r\n // title: '热门榜单',\r\n // },\r\n // {\r\n // activeValue: '5',\r\n // title: '首发新品',\r\n // },\r\n // {\r\n // activeValue: '6',\r\n // title: '促销单品',\r\n // },\r\n {\r\n activeValue: '7',\r\n title: '优品推荐',\r\n },\r\n ],\r\n };\r\n },\r\n computed: {},\r\n watch: {\r\n ischeckbox: {\r\n handler(newVal, oldVal) {\r\n if (newVal) {\r\n this.many = 'many';\r\n }\r\n },\r\n immediate: true,\r\n },\r\n },\r\n created() {\r\n let many = '';\r\n if (this.ischeckbox) {\r\n many = 'many';\r\n } else {\r\n many = this.$route.query.type;\r\n }\r\n this.many = many;\r\n },\r\n mounted() {\r\n this.goodsCategory();\r\n if (this.diy) {\r\n this.productList();\r\n } else {\r\n this.getList();\r\n }\r\n },\r\n methods: {\r\n productList() {\r\n let data = {\r\n page: this.formValidate.page,\r\n limit: this.formValidate.limit,\r\n cate_id: this.formValidate.cate_id,\r\n store_name: this.formValidate.store_name,\r\n type: this.type ? this.type : this.goodType,\r\n };\r\n this.loading = true;\r\n getProductList(data)\r\n .then((res) => {\r\n let data = res.data;\r\n this.tableList = data.list;\r\n this.total = res.data.count;\r\n this.loading = false;\r\n })\r\n .catch((res) => {\r\n this.loading = false;\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n getTemplateRow(row) {\r\n let images = [];\r\n let imageObject = {\r\n image: row.image,\r\n product_id: row.id,\r\n store_name: row.store_name,\r\n temp_id: row.temp_id,\r\n };\r\n images.push(imageObject);\r\n this.images = images;\r\n this.diyVal = row;\r\n this.$emit('getProductId', row);\r\n },\r\n changeCheckbox(selection) {\r\n let images = [];\r\n selection.forEach(function (item) {\r\n let imageObject = {\r\n image: item.image,\r\n product_id: item.id,\r\n store_name: item.store_name,\r\n temp_id: item.temp_id,\r\n };\r\n images.push(imageObject);\r\n });\r\n\r\n this.images = images;\r\n this.diyVal = selection;\r\n this.$emit('getProductDiy', selection);\r\n },\r\n // 商品分类;\r\n goodsCategory() {\r\n cascaderListApi(1)\r\n .then((res) => {\r\n this.treeSelect = res.data;\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n pageChange() {\r\n if (this.diy) {\r\n this.productList();\r\n } else {\r\n this.getList();\r\n }\r\n },\r\n // 列表\r\n getList() {\r\n this.loading = true;\r\n if (!this.liveStatus) {\r\n if (this.isLive) {\r\n this.formValidate.is_live = 1;\r\n }\r\n changeListApi(this.formValidate)\r\n .then(async (res) => {\r\n let data = res.data;\r\n this.tableList = data.list;\r\n this.total = res.data.count;\r\n this.loading = false;\r\n this.$nextTick(() => {\r\n if (this.selectIds.length) {\r\n let arr = [];\r\n this.selectIds.map((item) => {\r\n data.list.map((i) => {\r\n if (i.id == item) {\r\n this.$refs.table.toggleRowSelection(i, true);\r\n arr.push(i);\r\n }\r\n });\r\n });\r\n this.changeCheckbox(arr);\r\n }\r\n });\r\n })\r\n .catch((res) => {\r\n this.loading = false;\r\n this.$message.error(res.msg);\r\n });\r\n } else {\r\n liveGoods({\r\n is_show: '1',\r\n status: '1',\r\n live_id: this.datas.id,\r\n kerword: this.formValidate.store_name,\r\n page: this.formValidate.page,\r\n limit: this.formValidate.limit,\r\n })\r\n .then(async (res) => {\r\n let data = res.data;\r\n data.list.forEach((el) => {\r\n el.image = el.cover_img;\r\n });\r\n if (this.selectIds.length) {\r\n this.selectIds.map((item) => {\r\n data.list.map((i) => {\r\n if (i.id == item) {\r\n this.$refs.table.toggleRowSelection(i);\r\n }\r\n });\r\n });\r\n }\r\n this.$nextTick((e) => {\r\n this.tableList = data.list;\r\n this.total = res.data.count;\r\n this.loading = false;\r\n });\r\n })\r\n .catch((res) => {\r\n this.loading = false;\r\n this.$message.error(res.msg);\r\n });\r\n }\r\n },\r\n ok() {\r\n if (this.images.length > 0) {\r\n if (this.$route.query.fodder === 'image') {\r\n let imageValue = form_create_helper.get('image');\r\n form_create_helper.set('image', imageValue.concat(this.images));\r\n form_create_helper.close('image');\r\n } else {\r\n this.$refs.table.clearSelection();\r\n if (this.isdiy) {\r\n this.$emit('getProductId', this.diyVal);\r\n } else {\r\n this.$emit('getProductId', this.images);\r\n }\r\n }\r\n } else {\r\n this.$message.warning('请先选择商品');\r\n }\r\n },\r\n // 表格搜索\r\n userSearchs() {\r\n this.currentid = 0;\r\n this.productRow = {};\r\n this.formValidate.page = 1;\r\n if (this.diy) {\r\n this.productList();\r\n } else {\r\n this.getList();\r\n }\r\n },\r\n clear() {\r\n this.productRow.id = '';\r\n this.currentid = '';\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .el-checkbox{\r\n margin-bottom: 0 !important;\r\n}\r\n.footer {\r\n margin: 15px 0;\r\n}\r\n.tabBox_img {\r\n width: 36px;\r\n height: 36px;\r\n border-radius: 4px;\r\n cursor: pointer;\r\n\r\n img {\r\n width: 100%;\r\n height: 100%;\r\n }\r\n}\r\n.tabform {\r\n ::v-deep .ivu-form-item {\r\n margin-bottom: 16px !important;\r\n }\r\n}\r\n.btn {\r\n margin-top: 20px;\r\n float: right;\r\n}\r\n.goodList {\r\n ::v-deeptable {\r\n width: 100% !important;\r\n }\r\n}\r\n</style>\r\n"]}]}