| | |
| | | |
| | | <div style="margin-left: 13px"> |
| | | <div class="div-zoom"> |
| | | <a @click="linkTo(row.id, row.skuId)">{{ row.goodsName }}</a> |
| | | {{ row.goodsName }} |
| | | </div> |
| | | <Poptip trigger="hover" title="扫码在手机中查看" transfer> |
| | | <div slot="content"> |
| | | <vue-qr |
| | | :text="wapLinkTo(row.id, row.skuId)" |
| | | :margin="0" |
| | | colorDark="#000" |
| | | colorLight="#fff" |
| | | :size="150" |
| | | ></vue-qr> |
| | | </div> |
| | | <img |
| | | src="../../../assets/qrcode.svg" |
| | | class="hover-pointer" |
| | | width="20" |
| | | height="20" |
| | | alt="" |
| | | /> |
| | | </Poptip> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </Table> |
| | | <Modal |
| | | v-model="showGeneralQrCode" |
| | | title="二维码" |
| | | width="800" |
| | | :mask-closable="false" |
| | | :loading="codeLoading" |
| | | > |
| | | <vue-qr |
| | | :text="QRCodeUrl" |
| | | :margin="0" |
| | | colorDark="#000" |
| | | colorLight="#fff" |
| | | :size="150" |
| | | ></vue-qr> |
| | | <div slot="footer"> |
| | | <Button type="text" @click="closeGeneralQrCode">关闭</Button> |
| | | <!-- <Button type="primary" @click="generalQrCode">确认</Button>--> |
| | | </div> |
| | | </Modal> |
| | | <Row type="flex" justify="end" class="mt_10"> |
| | | <Page |
| | | :current="searchForm.pageNumber" |
| | |
| | | > |
| | | </div> |
| | | </Modal> |
| | | <Modal |
| | | title="设置商品排序" |
| | | v-model="showSort" |
| | | :mask-closable="false" |
| | | :width="500" |
| | | > |
| | | <Form ref="underForm" :model="sortForm" :label-width="100"> |
| | | <FormItem label="商品排序" prop="reason"> |
| | | <InputNumber v-model="sortForm.sort" :min="0" :max="999" clearable style="width: 100%" /> |
| | | </FormItem> |
| | | </Form> |
| | | <div slot="footer"> |
| | | <Button type="text" @click="showSort= false">取消</Button> |
| | | <Button type="primary" :loading="submitLoading" @click="submitSort" |
| | | >提交</Button |
| | | > |
| | | </div> |
| | | </Modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getGoodsListData, upGoods, lowGoods } from "@/api/goods"; |
| | | import { getGoodsListData, upGoods, lowGoods ,getGoodsFirstSkuId ,goodsSort} from "@/api/goods"; |
| | | import {getSts} from '@/api/file' |
| | | import vueQr from "vue-qr"; |
| | | export default { |
| | |
| | | name: "goods", |
| | | data() { |
| | | return { |
| | | sortForm:{ |
| | | goodsId:'', |
| | | sort:0 |
| | | }, |
| | | showSort:false, |
| | | showGeneralQrCode:false, |
| | | QRCodeUrl:'', |
| | | codeUrl: this.QRcodeBaseUrl+ '/scanpage/goods', |
| | | codeLoading:false, |
| | | |
| | | id: "", //要操作的id |
| | | loading: true, // 表单加载状态 |
| | | modalVisible: false, // 添加或编辑显示 |
| | |
| | | return h("Tag", { props: { color: "orange" } }, "零售"); |
| | | } else if (params.row.salesModel === "WHOLESALE") { |
| | | return h("Tag", { props: { color: "magenta" } }, "批发"); |
| | | } else if (params.row.salesModel === "PRESALE") { |
| | | return h("Tag", { props: { color: "magenta" } }, "预售"); |
| | | } else { |
| | | return h("Tag", { props: { color: "volcano" } }, "其他类型"); |
| | | } |
| | |
| | | key: "action", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 150, |
| | | width: 400, |
| | | render: (h, params) => { |
| | | if (params.row.marketEnable == "DOWN") { |
| | | return h("div", [ |
| | |
| | | h( |
| | | "Button", |
| | | { |
| | | style: { |
| | | marginRight: "5px", |
| | | }, |
| | | props: { |
| | | size: "small", |
| | | }, |
| | |
| | | }, |
| | | "查看" |
| | | ), |
| | | h( |
| | | "Button", |
| | | { |
| | | style: { |
| | | marginRight: "5px", |
| | | }, |
| | | props: { |
| | | size: "small", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | this.generalQrCode(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | "生成二维码" |
| | | ) |
| | | ]); |
| | | } else { |
| | | return h("div", [ |
| | |
| | | h( |
| | | "Button", |
| | | { |
| | | style: { |
| | | marginRight: "5px", |
| | | }, |
| | | props: { |
| | | size: "small", |
| | | }, |
| | |
| | | }, |
| | | "查看" |
| | | ), |
| | | h( |
| | | "Button", |
| | | { |
| | | style: { |
| | | marginRight: "5px", |
| | | }, |
| | | props: { |
| | | type: "error", |
| | | size: "small", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | this.generalQrCode(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | "生成二维码" |
| | | ), h( |
| | | "Button", |
| | | { |
| | | props: { |
| | | type: "error", |
| | | size: "small", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | this.goodsSort(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | "设置商品排序" |
| | | ) |
| | | ]); |
| | | } |
| | | }, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | cancelSort(){ |
| | | console.log('点击了取消') |
| | | this.showSort = false; |
| | | }, |
| | | async submitSort(){ |
| | | const response = await goodsSort(this.sortForm) |
| | | console.log(response) |
| | | this.showSort = false; |
| | | this.getDataList(); |
| | | }, |
| | | goodsSort(row){ |
| | | // this.sortForm = { |
| | | // |
| | | // } |
| | | this.sortForm.goodsId = row.id; |
| | | this.sortForm.sort = row.goodsSort |
| | | this.showSort = true; |
| | | }, |
| | | closeGeneralQrCode(){ |
| | | this.showGeneralQrCode = false; |
| | | }, |
| | | generalQrCode(row){ |
| | | this.QRCodeUrl = ''; |
| | | this.showGeneralQrCode = true |
| | | this.codeLoading = true; |
| | | |
| | | //获得商品对应的第一个skuid |
| | | getGoodsFirstSkuId(row.id).then(res =>{ |
| | | this.codeLoading = false; |
| | | |
| | | if (res.code){ |
| | | this.QRCodeUrl = this.codeUrl + "?id="+ res.result +"&goodsId=" + row.id |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | |
| | | // 初始化数据 |
| | | init() { |
| | | this.getDataList(); |