瀏覽代碼

no message

linwenxin 7 月之前
父節點
當前提交
4a441365ec
共有 2 個文件被更改,包括 12 次插入118 次删除
  1. 4 69
      src/packageMaterial/pages/newSale/index.vue
  2. 8 49
      src/packageMaterial/pages/newSale/product.vue

+ 4 - 69
src/packageMaterial/pages/newSale/index.vue

@@ -2,15 +2,6 @@
   <!-- #ifdef H5 -->
   <zj-page-layout :hasFooter="true">
     <view class="form-container">
-      <view class="item" v-if="type == 'P'" @tap="isShowCategoryDialog = true">
-        <view class="label"><text>*</text>产品大类</view>
-        <view class="picker">
-          <text class="value" v-if="category">{{ category.name }}</text>
-          <text class="placeholder" v-else>请选择</text>
-          <text class="iconfont icon-jinru"></text>
-        </view>
-      </view>
-      <u-gap height="10" bgColor="#F7F8FF"></u-gap>
       <view class="item">
         <view class="label"><text>*</text>客户电话</view>
         <u--input :maxlength="11" placeholder="请输入" border="none" inputAlign="right" v-model="userMobile"></u--input>
@@ -105,32 +96,6 @@
     </template>
 
     <zjDialogPicker
-      ref="brandDialog"
-      :isShow="isShowBrandDialog"
-      :multiple="false"
-      :styleType="2"
-      :title="'品牌'"
-      :list="brandList"
-      :keyName="'brandName'"
-      @cancel="isShowBrandDialog = false"
-      @confirm="confirmBrandDialog"
-    >
-    </zjDialogPicker>
-
-    <zjDialogPicker
-      ref="categoryDialog"
-      :isShow="isShowCategoryDialog"
-      :multiple="false"
-      :styleType="2"
-      :title="'产品大类'"
-      :list="categoryList"
-      :keyName="'name'"
-      @cancel="isShowCategoryDialog = false"
-      @confirm="confirmCategoryDialog"
-    >
-    </zjDialogPicker>
-
-    <zjDialogPicker
       ref="websitDialog"
       :isShow="isShowWebsitDialog"
       :multiple="false"
@@ -189,13 +154,9 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
      this.type = type;
      this.hasOid = oid.length > 0;
      uni.setNavigationBarTitle({
-      title: type == 'M' ? '辅材收款' : '配件收款'
+      title: '配件收款'
      })
-     this.getBrandList();
      this.getWebsitList();
-     if(type == 'P') {
-       this.getCategoryList();
-     }
      if(this.hasOid) {
        this.$api.post('/pg/order/base/detail', {
          orderBaseId: oid,
@@ -255,20 +216,6 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
       this.rpMaterialOrderItemList.splice(index, 1)
     },
 
-     getBrandList() {
-       this.$api.post('/pay/getBrand')
-       .then(res => {
-         this.brandList = res.data;
-       })
-     },
-
-     getCategoryList() {
-       this.$api.post('/pay/getCategoryList')
-       .then(res => {
-         this.categoryList = res.data;
-       })
-     },
-
      getWebsitList() {
        this.$api.get('/user/apply/websit')
        .then(res => {
@@ -276,29 +223,17 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
        })
      },
 
-     confirmBrandDialog(e) {
-       this.brand = this.brandList[e[0]];
-       this.isShowBrandDialog = false;
-     },
-
-     confirmCategoryDialog(e) {
-       this.category = this.categoryList[e[0]];
-       this.isShowCategoryDialog = false;
-     },
-
      confirmWebsitDialog(e) {
        this.websit = this.websitList[e[0]];
        this.isShowWebsitDialog = false;
      },
 
     toChooseProduct(index) {
-      if(this.type == 'P' && !this.category) return this.$toast('请选择产品大类');
       if(!this.websit) return this.$toast('请选择所属网点');
       if(!this.userMobile) return this.$toast('请输入客户电话');
       if(!(/^1[3456789]\d{9}$/.test(this.userMobile)) || this.userMobile.length != 11) return this.$toast('请填写正确的客户电话');
-      console.log(this.websit)
       this.$navToPage({
-        url: `/packageMaterial/pages/newSale/product?dijiIndex=${index}&type=${this.type}&categoryId=${this.type=='P'?this.category.categoryId:''}&categoryName=${this.type=='P'?this.category.name:''}&userMobile=${this.userMobile}&orderNo=${this.orderNo}&partsWebsitId=${this.websit.partsWebsitId}&websitId=${this.websit.websitId}&websitName=${this.websit.name}&wbId=${this.wbId||''}&wbIsAllFee=${this.wbIsAllFee||''}&wbPayType=${this.wbPayType||''}`
+        url: `/packageMaterial/pages/newSale/product?dijiIndex=${index}&type=${this.type}&categoryId=${this.type=='P'?this?.category?.categoryId:''}&categoryName=${this.type=='P'?this?.category?.name:''}&userMobile=${this.userMobile}&orderNo=${this.orderNo}&partsWebsitId=${this.websit.partsWebsitId}&websitId=${this.websit.websitId}&websitName=${this.websit.name}&wbId=${this.wbId||''}&wbIsAllFee=${this.wbIsAllFee||''}&wbPayType=${this.wbPayType||''}`
       })
     },
 
@@ -306,8 +241,8 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
       if(this.rpMaterialOrderItemList.length < 1) return this.$toast('请选择');
       this.$setStorage('materialSaleDataZhiFu', {
         type: this.type,
-        categoryId: this.type == 'P' ? this.category.categoryId : '',
-        categoryName: this.type == 'P' ? this.category.name : '',
+        categoryId: this.type == 'P' ? this?.category?.categoryId : '',
+        categoryName: this.type == 'P' ? this?.category?.name : '',
         salesType: 'OUT',
         brandId: null,
         brandName: null,

+ 8 - 49
src/packageMaterial/pages/newSale/product.vue

@@ -16,16 +16,6 @@
     </template>
 
     <view class="main-container">
-      <view class="left-list" v-if="type == 'M'">
-        <block v-for="(item, index) in leftList" :key="index">
-          <view
-            class="item ellipsis"
-            :class="leftCurrent == item.categoryId ? 'current' : ''"
-            @tap="changeLeft(item.categoryId)"
-            >{{ item.categoryName }}</view
-          >
-        </block>
-      </view>
       <view class="right-list">
         <scroll-view scroll-y style="height: 100%">
           <view class="item" v-for="(item, index) in rightList" :key="index" @click="selectId = item.goodsCode">
@@ -88,7 +78,6 @@ export default {
       wbPayType: null, // 维保工单费用支付方式
       keyword: '',
       leftList: [],
-      leftCurrent: 0,
       rightList: [],
       loadStatus: 0,
       cartList: [],
@@ -112,13 +101,9 @@ export default {
     this.wbIsAllFee = wbIsAllFee;
     this.wbPayType = wbPayType;
     uni.setNavigationBarTitle({
-     title: type == 'M' ? '选择辅材' : '选择配件'
+     title: '选择配件'
     })
-    if(type === 'M') {
-      this.getLeftList();
-    }else {
-      this.getRightList();
-    }
+    this.getRightList();
   },
 
   computed: {
@@ -131,36 +116,16 @@ export default {
   },
 
   methods: {
-    // 获取左侧分类
-    getLeftList() {
-    	this.$api.post('/pay/websitCategoryList', {
-        pageNum: 1,
-        pageSize: -1,
-      }).then(res => {
-    		this.leftList = res.data.records;
-    		this.leftCurrent = res.data.records.length > 0 ? res.data.records[0].categoryId : 0;
-    		this.getRightList();
-    	})
-    },
-
     // 获取右侧产品
     getRightList() {
     	this.loadStatus = 1;
       let url = '', params = {};
-      if(this.type === 'M') {
-        url = '/pay/chargeList';
-        params = {
-          categoryId: this.leftCurrent,
-          orderId: this.orderNo,
-        }
-      }else {
-        url = '/app/parts/stock/exist/worker/stock/list';
-        params = {
-          partsAttr: "NEW",
-          identity: this.userInfo.idCard,
-          partsWebsitId: this.partsWebsitId,
-          websitId: this.websitId,
-        }
+      url = '/app/parts/stock/exist/worker/stock/list';
+      params = {
+        partsAttr: "NEW",
+        identity: this.userInfo.idCard,
+        partsWebsitId: this.partsWebsitId,
+        websitId: this.websitId,
       }
 
     	this.$api.post(url, {
@@ -204,12 +169,6 @@ export default {
     	})
     },
 
-    // 切换一级菜单
-    changeLeft(pid) {
-    	this.leftCurrent = pid;
-    	this.getRightList();
-    },
-
     // 搜索
     searchData() {
       this.getRightList();