Prechádzať zdrojové kódy

编辑盲票添加实物商品新增价格筛选,商品列表新增供应商和商品采购链接字段

DELL 3 rokov pred
rodič
commit
a2e4b89250

+ 51 - 3
src/views/business/goods/add.vue

@@ -40,6 +40,29 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row :gutter="40" style="width: 500px">
+        <el-col :span="23">
+          <el-form-item label="供应商:" prop="supplerId">
+            <el-select
+              v-model="addData.supplerId"
+              placeholder="请选择供应商"
+              clearable
+            >
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in SupplierList" :key="index" />
+            </el-select>
+            <a style="margin-left: 20px;color:#3983EF;" @click="handleAdd">创建供应商</a>
+          </el-form-item>
+
+        </el-col>
+      </el-row>
+      <el-row :gutter="40" style="width: 500px">
+        <el-col :span="23">
+          <el-form-item label="商品采购链接:">
+            <el-input v-model="addData.shoppingLink" placeholder="请输入商品采购链接"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
        <el-row :gutter="40" style="width: 500px">
         <el-col :span="23">
           <el-form-item label="商品标签:">
@@ -132,6 +155,11 @@
         <el-button type="primary" @click="updateItem()">保存</el-button>
       </el-col>
     </el-row>
+    <add-supplier
+      v-if="createShow"
+      :dialog-show="createShow"
+      @close="close"
+    />
   </div>
 </template>
 <script>
@@ -141,30 +169,36 @@ import Spec from './components/spec'
 import TinyEditor from '@/components/TinyEditor'
 import { getGoodsDetail, addGoods } from '@/api/business/goods'
 import { goodsCategoryItems } from '@/api/business/category'
+import { getSupplierList } from '@/api/business/supplier'
 import { goodsTagItems } from '@/api/business/tag'
 import { publicFileGetUrl } from "@/api/common"
 import { accDiv, accMul } from '@/utils/util'
+import AddSupplier from "../supplier/components/addSupplier";
 export default {
   components: {
     TinyEditor,
     WangEditor,
     Upload,
-    Spec
+    Spec,
+    AddSupplier
   },
   data() {
     return {
       IMG_URL: publicFileGetUrl,
       id: this.$route.query.id,
       goodsCategoryItemsList: [],
+      SupplierList: [],
       goodsTagItemsList: [],
       addData: {
         multiSku: 0,
         description: ''
       },
+      createShow:false,
       rules: {
         title: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
         picUrl: [{ required: true, message: '请上传商品图片', trigger: 'change' }],
         categoryId: [{ required: true, message: '请选择商品分类', trigger: 'change' }],
+        supplerId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
         exchangeShow: [{ required: true, message: '请选择是否支持盲豆兑换', trigger: 'change' }],
         multiSku: [{ required: true, message: '请选择SKU类型', trigger: 'change' }],
         value: [
@@ -215,14 +249,15 @@ export default {
   },
   created() {
     this.getGoodsCategoryItems()
+    this.getSupplierItems()
     this.getGoodsTagItems()
     if (this.id) {
       getGoodsDetail(this.id).then(res => {
-        const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, tagIds } = res.data
+        const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, supplerId, shoppingLink, tagIds } = res.data
         this.addData = {
           value: accDiv(value, 100),
           cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
-          goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
+          goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, supplerId, shoppingLink, tagIds
         }
         if(description) {
           this.$refs.editor.setContent(description)
@@ -241,6 +276,19 @@ export default {
         this.goodsCategoryItemsList = res && res.data
       })
     },
+    //获取供应商
+    getSupplierItems(){
+      getSupplierList({name:""}).then(res => {
+        this.SupplierList = res && res.rows
+      })
+    },
+    handleAdd() {
+      this.createShow = true;
+    },
+    close(){
+      this.createShow = false;
+      this.getSupplierItems()
+    },
     getGoodsTagItems(){
       goodsTagItems({}).then(res => {
         this.goodsTagItemsList = res && res.data

+ 15 - 5
src/views/business/ticket/components/GoodsAdd.vue

@@ -13,9 +13,16 @@
           placeholder="请输入商品名称"
           clearable
           size="small"
-          style="width: 240px"
+          style="width: 220px"
           @keyup.enter.native="getGoodsList()"
         />
+        <div style="margin-left: 20px">商品价格:</div>
+<!--        <el-input v-model="minValue" placeholder="最低价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getList()" />-->
+        <el-input style="width: 220px" v-model="queryParams.minValue" placeholder="最低价格" clearable @keyup.enter.native="getGoodsList()"/>
+        <div style="width: 20px;text-align: center">-</div>
+<!--        <el-input v-model="maxValue" placeholder="最高价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getList()" />-->
+        <el-input style="width: 220px" v-model="queryParams.maxValue" placeholder="最高价格" clearable @keyup.enter.native="getGoodsList()"/>
+
         <div class="ge"></div>
         <el-button
           type="primary"
@@ -80,6 +87,7 @@
 <script>
 import { publicFileGetUrl } from "@/api/common";
 import { getGoodsList } from "@/api/business/goods";
+import { accMul } from '@/utils/util'
 export default {
   name: "GoodsAdd",
   props: {
@@ -92,6 +100,8 @@ export default {
     return {
       loading: false,
       goodsTitle: "", // 商品名称
+      queryParams:{},
+
       goodsList: [], // 商品列表
       goodsTotal: 0, // 商品总数
       selectGoodsList: [], // 选中商品
@@ -114,7 +124,7 @@ export default {
           "&pageSize=" +
           this.pageParams.pageSize +
           "&",
-        { title: this.goodsTitle, status: "on" }
+        { title: this.goodsTitle,  status: "on", minValue: accMul(this.queryParams.minValue, 100), maxValue: accMul(this.queryParams.maxValue, 100),}
       ).then((res) => {
         this.goodsList = res.rows.map((item) => {
           return {
@@ -158,7 +168,7 @@ export default {
   line-height: 32px;
   margin-bottom: 20px;
   .ge {
-    width: 40px;
+    width: 20px;
   }
 }
 .dialog-btn {
@@ -167,7 +177,7 @@ export default {
   justify-content: flex-end;
   padding: 40px 0 0;
   .ge {
-    width: 40px;
+    width: 20px;
   }
 }
-</style>
+</style>