peng
2025-08-07 771717c4dd5e4bea1df90527685a767e9221c9f1
manager/src/views/goods/goods-info/goods.vue
@@ -158,11 +158,29 @@
        >
      </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 ,getGoodsFirstSkuId } from "@/api/goods";
import { getGoodsListData, upGoods, lowGoods ,getGoodsFirstSkuId ,goodsSort} from "@/api/goods";
import {getSts} from '@/api/file'
import vueQr from "vue-qr";
export default {
@@ -172,6 +190,11 @@
  name: "goods",
  data() {
    return {
      sortForm:{
        goodsId:'',
        sort:0
      },
      showSort:false,
      showGeneralQrCode:false,
      QRCodeUrl:'',
      codeUrl: this.QRcodeBaseUrl+ '/scanpage/goods',
@@ -280,7 +303,7 @@
          key: "action",
          align: "center",
          fixed: "right",
          width: 220,
          width: 400,
          render: (h, params) => {
            if (params.row.marketEnable == "DOWN") {
              return h("div", [
@@ -322,6 +345,9 @@
                h(
                  "Button",
                  {
                    style: {
                      marginRight: "5px",
                    },
                    props: {
                      size: "small",
                    },
@@ -374,6 +400,9 @@
                h(
                  "Button",
                  {
                    style: {
                      marginRight: "5px",
                    },
                    props: {
                      type: "error",
                      size: "small",
@@ -385,6 +414,20 @@
                    },
                  },
                  "生成二维码"
                ),                h(
                  "Button",
                  {
                    props: {
                      type: "error",
                      size: "small",
                    },
                    on: {
                      click: () => {
                        this.goodsSort(params.row);
                      },
                    },
                  },
                  "设置商品排序"
                )
              ]);
            }
@@ -396,6 +439,24 @@
    };
  },
  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;
    },