Browse Source

no message

linwenxin 7 months ago
parent
commit
1a13329884

+ 91 - 110
src/common/utils/navPag.js

@@ -2,48 +2,30 @@
 import wx from 'weixin-js-sdk'
 // #endif
 import store from '@/store/index.js'
-import {
-  isWeixin,
-  getQueryVariable
-} from "./common.js"
-import {
-  delayPerform
-} from "js-perform-lock";
-import md5 from "md5"
-import {getUserInfo} from "./util.js"
+import { isWeixin, getQueryVariable } from './common.js'
+import { delayPerform } from 'js-perform-lock'
+import md5 from 'md5'
+import { getUserInfo } from './util.js'
 
-import {
-  goLoginPage
-} from "@/mixins/index.js"
+import { goLoginPage } from '@/mixins/index.js'
 
-import {
-  setStorage,
-  getStorage,
-  removeStorage
-} from "@/common/utils/storage.js"
+import { setStorage, getStorage, removeStorage } from '@/common/utils/storage.js'
 
-export const navToPage = (function() {
+export const navToPage = (function () {
   var gopageid = null
 
   // 需要拦截的地址
-  var blacklist = [
-    "/packageGoods/pages/order",
-    "/packageMine/pages/myWebsit",
-    "/packageMine/pages/distributorEnter"
-  ]
+  var blacklist = ['/packageGoods/pages/order', '/packageMine/pages/myWebsit', '/packageMine/pages/distributorEnter']
 
-  return async function(p, goToType = "navigateTo") {
-    var {
-      url,
-      ...data
-    } = p
+  return async function (p, goToType = 'navigateTo') {
+    var { url, ...data } = p
 
-    if(url && blacklist.find(item=>!!~url.indexOf(item))){
+    if (url && blacklist.find(item => !!~url.indexOf(item))) {
       try {
         var userinfo = await getUserInfo()
         // 补充手机号判断
 
-        if(!userinfo.mobile){
+        if (!userinfo.mobile) {
           uni[goToType]({
             url: webHref('/packageMine/pages/phone'),
             ...data
@@ -66,15 +48,15 @@ export const navToPage = (function() {
     if (isWeixin()) {
       wx.miniProgram.getEnv(res => {
         if (res.miniprogram) {
-          var i = 0;
-          (function goTo() {
+          var i = 0
+          ;(function goTo() {
             if (gopageid) {
               clearTimeout(gopageid)
             }
             i++
             if (uniWebview && uniWebview[goToType]) {
               // h5跳转小程序
-              if (getStorage('miniProgram') == "jsm_env") {
+              if (getStorage('miniProgram') == 'jsm_env') {
                 // 家盛茂小程序环境
                 uniWebview[goToType]({
                   ...(() => {
@@ -90,7 +72,7 @@ export const navToPage = (function() {
               } else {
                 // 原生小程序页面
                 var miniProgramPages = []
-                if (!!~miniProgramPages.indexOf(url.split("?")[0])) {
+                if (!!~miniProgramPages.indexOf(url.split('?')[0])) {
                   // 第三方小程序跳转我们的h5页面处理
                   uniWebview[goToType]({
                     ...(() => {
@@ -119,7 +101,7 @@ export const navToPage = (function() {
                 }
               }
             } else if (i < 10) {
-              gopageid = setTimeout(function() {
+              gopageid = setTimeout(function () {
                 gopageid = null
                 goTo()
               }, 200)
@@ -156,40 +138,42 @@ export function webViewHref(url, pam = {}, crossPagePam = {}) {
   var defaultPam = {
     ...pam,
     ...crossPagePam,
-    "x-token": (store.state.user.token),
-    openId: (store.state.user.openId),
-    userId: (store.state.user.userId),
-    mobile: (store.state.user.mobile),
-    username: (store.state.user.name),
-    useravatar: (store.state.user.avatar),
-    appId: (store.state.user.appId),
-    ...(()=>{
-      if(store.state.user.miniOpenId){
-        return{
-          miniOpenId: (store.state.user.miniOpenId),
+    'x-token': store.state.user.token,
+    openId: store.state.user.openId,
+    userId: store.state.user.userId,
+    mobile: store.state.user.mobile,
+    username: store.state.user.name,
+    useravatar: store.state.user.avatar,
+    appId: store.state.user.appId,
+    ...(() => {
+      if (store.state.user.miniOpenId) {
+        return {
+          miniOpenId: store.state.user.miniOpenId
         }
       }
       return {}
     })(),
-    ...(()=>{
-      if(store.state.user.sharerOpenId){
-        return{
-          sharerOpenId: (store.state.user.sharerOpenId),
+    ...(() => {
+      if (store.state.user.sharerOpenId) {
+        return {
+          sharerOpenId: store.state.user.sharerOpenId
         }
       }
       return {}
     })(),
     // #ifndef H5
-    miniProgram: "jsm_env",
+    miniProgram: 'jsm_env'
     // #endif
   }
 
-  var pamstr = Object.entries(defaultPam).map(item => item.join("=")).join("&");
+  var pamstr = Object.entries(defaultPam)
+    .map(item => item.join('='))
+    .join('&')
 
-  if (!!~url.indexOf("?")) {
-    return process.env.VUE_APP_HREF + url + `${pamstr?"&"+pamstr:""}`
+  if (!!~url.indexOf('?')) {
+    return process.env.VUE_APP_HREF + url + `${pamstr ? '&' + pamstr : ''}`
   } else {
-    return process.env.VUE_APP_HREF + url + `${pamstr?"?"+pamstr:""}`
+    return process.env.VUE_APP_HREF + url + `${pamstr ? '?' + pamstr : ''}`
   }
 }
 
@@ -199,74 +183,75 @@ window.navToPage = navToPage
 
 // #endif
 
-
 export function webHref(url, pam = {}, crossPagePam = {}) {
-  if(!url) {
-    return false;
+  if (!url) {
+    return undefined
   }
   var defaultPam = {
     ...pam,
     ...crossPagePam,
-    "x-token": (store.state.user.token),
-    openId: (store.state.user.openId),
-    userId: (store.state.user.userId),
-    mobile: (store.state.user.mobile),
-    username: (store.state.user.name),
-    useravatar: (store.state.user.avatar),
-    appId: (store.state.user.appId),
-    ...(()=>{
-      if(store.state.user.miniOpenId){
-        return{
-          miniOpenId: (store.state.user.miniOpenId),
+    'x-token': store.state.user.token,
+    openId: store.state.user.openId,
+    userId: store.state.user.userId,
+    mobile: store.state.user.mobile,
+    username: store.state.user.name,
+    useravatar: store.state.user.avatar,
+    appId: store.state.user.appId,
+    ...(() => {
+      if (store.state.user.miniOpenId) {
+        return {
+          miniOpenId: store.state.user.miniOpenId
         }
       }
       return {}
     })(),
-    ...(()=>{
-      if(store.state.user.sharerOpenId){
-        return{
-          sharerOpenId: (store.state.user.sharerOpenId),
+    ...(() => {
+      if (store.state.user.sharerOpenId) {
+        return {
+          sharerOpenId: store.state.user.sharerOpenId
         }
       }
       return {}
     })(),
     // #ifndef H5
-    miniProgram: "jsm_env",
+    miniProgram: 'jsm_env'
     // #endif
   }
 
-  var pamstr = Object.entries(defaultPam).map(item => item.join("=")).join("&");
+  var pamstr = Object.entries(defaultPam)
+    .map(item => item.join('='))
+    .join('&')
 
-  if (!!~url.indexOf("?")) {
-    return url + `${pamstr?"&"+pamstr:""}`
+  if (!!~url.indexOf('?')) {
+    return url + `${pamstr ? '&' + pamstr : ''}`
   } else {
-    return url + `${pamstr?"?"+pamstr:""}`
+    return url + `${pamstr ? '?' + pamstr : ''}`
   }
 }
 
-export const crossPage = (function() {
+export const crossPage = (function () {
   var funs = {}
   var tiemIdIs = {}
   var datacd = []
 
   // #ifndef H5
-  var delaydeparture = (new delayPerform(250)).refactor(function() {
+  var delaydeparture = new delayPerform(250).refactor(function () {
     var data = {}
-    datacd.map(function([name, val]) {
+    datacd.map(function ([name, val]) {
       data[name] = val
     })
-    setStorage("crossPageTs", encodeURIComponent(JSON.stringify(data)));
-    store.commit("user/setcrossPagePam", (new Date().getTime()));
-    setTimeout(function() {
-      removeStorage("crossPageTs")
+    setStorage('crossPageTs', encodeURIComponent(JSON.stringify(data)))
+    store.commit('user/setcrossPagePam', new Date().getTime())
+    setTimeout(function () {
+      removeStorage('crossPageTs')
     }, 350)
     datacd = []
-  });
+  })
   // #endif
 
   // #ifdef H5
-  var delaydepartFun = (new delayPerform(250)).refactor(function() {
-    var data = getQueryVariable("crossPageTs")
+  var delaydepartFun = new delayPerform(250).refactor(function () {
+    var data = getQueryVariable('crossPageTs')
     if (data) {
       data = JSON.parse(decodeURIComponent(data))
       Object.keys(data).map(name => {
@@ -275,29 +260,29 @@ export const crossPage = (function() {
         })
       })
     }
-  });
+  })
   // #endif
 
   // #ifdef H5
   var idss = {}
   wx.miniProgram.getEnv(res => {
     if (res.miniprogram) {
-      (function tiemID() {
-        try{
+      ;(function tiemID() {
+        try {
           Object.keys(idss).map(name => {
-            if(idss[name] && idss[name] < new Date().getTime()){
-              if(getStorage(name)){
+            if (idss[name] && idss[name] < new Date().getTime()) {
+              if (getStorage(name)) {
                 removeStorage(name)
               }
               delete idss[name]
             }
           })
-        }catch(e){
+        } catch (e) {
           //TODO handle the exception
         }
-        try{
+        try {
           Object.keys(funs).map(name => {
-            var data = getStorage(name);
+            var data = getStorage(name)
             if (data && !idss[name]) {
               Object.keys(funs[name]).map(key => {
                 funs[name][key](data)
@@ -305,7 +290,7 @@ export const crossPage = (function() {
               idss[name] = new Date().getTime() + 500
             }
           })
-        }catch(e){
+        } catch (e) {
           //TODO handle the exception
         }
         setTimeout(tiemID, 200)
@@ -339,11 +324,11 @@ export const crossPage = (function() {
       // h5在小程序环境下通过定时器传送
       wx.miniProgram.getEnv(res => {
         if (res.miniprogram) {
-          var postMessage = (window.uniWebview && window.uniWebview.postMessage) || (window.postMessage)
+          var postMessage = (window.uniWebview && window.uniWebview.postMessage) || window.postMessage
           if (postMessage) {
             postMessage({
               data: {
-                type: "crossPageTs",
+                type: 'crossPageTs',
                 name,
                 data
               }
@@ -352,8 +337,8 @@ export const crossPage = (function() {
           if (tiemIdIs[name]) {
             clearTimeout(tiemIdIs[name])
           }
-          setStorage(name, data === undefined ? true : data);
-          tiemIdIs[name] = setTimeout(function() {
+          setStorage(name, data === undefined ? true : data)
+          tiemIdIs[name] = setTimeout(function () {
             removeStorage(name)
           }, 350)
         }
@@ -373,32 +358,28 @@ export const crossPage = (function() {
     },
 
     $off(name, fun) {
-      if(fun){
+      if (fun) {
         var skey = md5(fun.toString())
         if (funs[name] && funs[name][skey]) {
           delete funs[name][skey]
         }
-      }else{
+      } else {
         delete funs[name]
       }
     },
 
     // #ifndef H5
     $listener(e) {
-      e.detail.data.map(({
-        type,
-        name,
-        data
-      }) => {
+      e.detail.data.map(({ type, name, data }) => {
         if (funs[name]) {
           Object.keys(funs[name]).map(key => {
             funs[name][key](data)
           })
         }
       })
-    },
+    }
     // #endif
-  };
+  }
 
   return funco
 })()

+ 1 - 1
src/packageAttachment/pages/applicationParts/orderPayment.vue

@@ -186,7 +186,7 @@ export default {
       this.$api
         .postJson('/app/online/save/sheet-pay-map', {
           payId: this.websitList[this.index].id,
-          sheetId: this.info.salesOrderNo
+          sheetId: this.info.salesId
         })
         .then(res => {
           if (res.data.code) {

+ 20 - 26
src/packageAttachment/pages/applyReturnOfNewPiece/index.vue

@@ -6,11 +6,11 @@
           <view class="input_module">
             <view class="input_module_as">
               <view class="input_module_as_title"> 申请人 </view>
-              <view class="input_module_as_en"> {{ form.applyStuffName }}({{ form.applyStuffNumber }}) </view>
+              <view class="input_module_as_en"> {{ form.workerName }}) </view>
             </view>
             <view class="input_module_as">
               <view class="input_module_as_title"> 所属网点 </view>
-              <view class="input_module_as_en"> {{ form.websitName }} ({{ form.websitNumber }}) </view>
+              <view class="input_module_as_en"> {{ form.websitName }} ({{ form.websitId }}) </view>
             </view>
             <view class="input_module_as">
               <view class="input_module_as_title"> *申请类别 </view>
@@ -72,13 +72,13 @@
             <view class="input_module_as">
               <view class="input_module_as_title"> 发出单位 </view>
               <view class="input_module_as_en">
-                {{ form.deliveryUnit }}
+                {{ form.receiveUnit }}
               </view>
             </view>
             <view class="input_module_as">
               <view class="input_module_as_title"> 接收单位 </view>
               <view class="input_module_as_en">
-                {{ form.receiveUnit }}
+                {{ form.deliveryUnit }}
               </view>
             </view>
             <view class="input_module_as">
@@ -133,12 +133,12 @@
                 <view class="a_combined_sc">
                   合计:<text
                     >¥{{
-                      [
-                        ...(form.itemList || []).map(item => Math.round(item.salesPrice * item.qty * 100) / 100),
+                      [...(form.itemList || []).map(item => Math.round(item.salesPrice * item.qty * 100) / 100)].reduce(
+                        (a, b) => {
+                          return a + b
+                        },
                         0
-                      ].reduce((a, b) => {
-                        return a + b
-                      })
+                      )
                     }}</text
                   >
                 </view>
@@ -163,11 +163,9 @@
           </view>
         </view>
       </zj-page-fill>
-      <bt-container>
-        <view class="btcon pv30 ph10">
-          <view class="confirm-btn" @tap.stop="toStateUrl">提交申请</view>
-        </view>
-      </bt-container>
+      <view class="bottom-container">
+        <u-button type="primary" text="提交申请" @click="toStateUrl"></u-button>
+      </view>
     </zj-page-container>
   </view>
 </template>
@@ -187,9 +185,9 @@ export default {
     }
   },
   onLoad(option) {
-    var { salesOrderNo, pushFlag, identity } = option
+    var { salesId, pushFlag, identity } = option
     this.getDetails({
-      salesOrderNo,
+      salesId,
       pushFlag,
       identity
     })
@@ -207,15 +205,13 @@ export default {
       var newRefundManageItemBeanList = (this.form.itemList || [])
         .filter(item => item.qty > 0)
         .map(item => {
-          var { qty, materialGroupId, materialGroupName, partsName, partsNumber, unitId, unitName } = item
+          var { qty, materialGroupName, partsName, partsNumber, goodsStockUnit } = item
           return {
             qty,
-            materialGroupId,
             materialGroupName,
             partsName,
             partsNumber,
-            unitId,
-            unitName
+            goodsStockUnit
           }
         })
       if (!newRefundManageItemBeanList || !newRefundManageItemBeanList.length) {
@@ -252,26 +248,24 @@ export default {
       }
       var {
         id,
-        salesOrderNo,
         applyCategory,
         applyType,
         refundMode,
         belongCompany,
         websitName,
-        websitNumber,
+        websitId,
         workerId,
         workerName,
         remark
       } = this.form
       var data = {
-        salesOrderId: id,
-        salesOrderNo,
+        salesId: id,
         applyCategory,
         applyType,
         refundMode,
         belongCompany,
         websitName,
-        websitNumber,
+        websitId,
         workerId,
         workerName,
         remark,
@@ -298,7 +292,7 @@ export default {
         .then(res => {
           if (res.data.itemList && res.data.itemList.length) {
             res.data.itemList.map(item => {
-              item.qty = item.quantity
+              item.quantity = item.qty
             })
           }
           this.form = res.data

+ 1 - 1
src/packageAttachment/pages/forwardSaleOrder/card.vue

@@ -23,7 +23,7 @@
       <view class="accessories_nfo_title"> 销售单号: </view>
       <view class="accessories_nfo_info">
         <view>
-          {{ item.salesOrderNo }}
+          {{ item.salesId }}
         </view>
       </view>
     </view>

+ 4 - 4
src/packageAttachment/pages/orderOfSales/card.vue

@@ -4,7 +4,7 @@
       <view class="accessories_nfo_title"> 申请单号: </view>
       <view class="accessories_nfo_info">
         <view>
-          {{ item.salesOrderNo }}
+          {{ item.salesId }}
         </view>
       </view>
       <view class="accessories_nfo_title colorts">
@@ -57,16 +57,16 @@ export default {
   },
   methods: {
     toUrl() {
-      var { salesOrderNo, pushFlag, identity } = this.item
+      var { id, pushFlag, identity } = this.item
       if (this.type === 'entryStock') {
         this.$navToPage({
-          url: `/packageAttachment/pages/applyReturnOfNewPiece/index?salesOrderNo=${salesOrderNo}&pushFlag=${
+          url: `/packageAttachment/pages/applyReturnOfNewPiece/index?salesId=${id}&pushFlag=${
             pushFlag || ''
           }&identity=${identity}`
         })
       } else {
         this.$navToPage({
-          url: `/packageAttachment/pages/orderOfSales/details?salesOrderNo=${salesOrderNo}&pushFlag=${
+          url: `/packageAttachment/pages/orderOfSales/details?salesId=${id}&pushFlag=${
             pushFlag || ''
           }&identity=${identity}`
         })

+ 4 - 4
src/packageAttachment/pages/orderOfSales/details.vue

@@ -46,7 +46,7 @@
               <view class="accessories_nfo_title"> 申请单号: </view>
               <view class="accessories_nfo_info">
                 <view>
-                  {{ info.salesOrderNo }}
+                  {{ info.salesId }}
                 </view>
               </view>
             </view>
@@ -244,9 +244,9 @@ export default {
     }
   },
   onLoad(option) {
-    var { salesOrderNo, pushFlag, identity } = option
+    var { salesId, pushFlag, identity } = option
     this.params = {
-      salesOrderNo,
+      salesId,
       identity
     }
     if (pushFlag) {
@@ -277,7 +277,7 @@ export default {
     confirmationDelivery() {
       this.$api
         .post('/app/worker/parts-sales/workerConfirmDelivery', {
-          salesOrderNo: this.info.salesOrderNo
+          salesId: this.info.salesId
         })
         .then(res => {
           uni.$emit('updateOrderOfSales')

+ 1 - 1
src/packageAttachment/pages/returnOfNewParts/card.vue

@@ -4,7 +4,7 @@
       <view class="accessories_nfo_title"> 购买编号: </view>
       <view class="accessories_nfo_info">
         <view>
-          {{ info.salesOrderNo }}
+          {{ info.salesId }}
         </view>
       </view>
       <view class="accessories_nfo_title colorts">

+ 5 - 5
src/packageAttachment/pages/sparePartsInventory/accessoriesItem.vue

@@ -2,15 +2,15 @@
   <view class="accessories_item" @tap.stop="toUrl">
     <view class="accessories_item_lay">
       <view class="accessories_item_title">
-        {{ item.partsName }}
+        {{ item.goodsName }}
       </view>
       <view class="accessories_item_number">
-        {{ item.partsNumber }}
+        {{ item.goodsId }}
       </view>
     </view>
     <view class="accessories_item_lay">
-      <view class="accessories_item_inventory"> 库存{{ [item.oldQty, item.newQty][type] }} </view>
-      <view class="accessories_item_unit"> 单位:{{ item.unitName }} </view>
+      <view class="accessories_item_inventory"> 库存{{ [item.oldQty, item.qty][type] }} </view>
+      <view class="accessories_item_unit"> 单位:{{ item.goodsStockUnit }} </view>
     </view>
     <view class="accessories_item_lay">
       <view class="accessories_item_amount">
@@ -40,7 +40,7 @@ export default {
       if (this.type !== '') {
         if (this.type === 0) {
           this.$navToPage({
-            url: `/packageAttachment/pages/returnOfOldParts/index?partsNumber=${this.item.partsNumber || ''}`
+            url: `/packageAttachment/pages/returnOfOldParts/index?partsNumber=${this.item.goodsId || ''}`
           })
         } else if (this.type === 1) {
           this.$navToPage({

+ 3 - 9
src/packageAttachment/pages/sparePartsInventory/index.vue

@@ -6,14 +6,8 @@
       </view>
       <view class="pv30 picker-view-bock">
         <view class="picker-view">
-          <picker
-            class="picker-select"
-            @change="bindPickerChange"
-            :value="index"
-            :range="websitList"
-            range-key="websitName"
-          >
-            <view class="picker-select-input">{{ websitList[index] ? websitList[index].websitName : '请选择' }}</view>
+          <picker class="picker-select" @change="bindPickerChange" :value="index" :range="websitList" range-key="name">
+            <view class="picker-select-input">{{ websitList[index] ? websitList[index].name : '请选择' }}</view>
           </picker>
           <image class="icon_next" src="/static/images/fittingsManagement/icon_next.png" mode="aspectFill"></image>
         </view>
@@ -38,7 +32,7 @@
                   @tap.stop="accessoriesIndex = index"
                 >
                   <view class="accessories_type_text">
-                    {{ item.value }}
+                    {{ item }}
                   </view>
                 </view>
               </zj-page-fill>

+ 2 - 2
src/packageAttachment/pages/sparePartsInventory/mixins/getData.js

@@ -24,7 +24,7 @@ export default {
       apis: {
         default: {
           getGroupUrl: '/app/parts/stock/exist/websit/group/list',
-          getStockUrl: '/app/parts/stock/exist/websit/stock/list'
+          getStockUrl: '/app/parts/stock/exist/worker/stock/list'
         },
         applicationParts: {
           getGroupUrl: '/app/parts/websit/stock/group/list',
@@ -122,7 +122,7 @@ export default {
         this.$api
           .post(this.apis[this.option.apiType || 'default'].getStockUrl, {
             ...this.accessoriesParams,
-            materialGroupId: this.accessoriesList[this.accessoriesIndex].id,
+            materialGroupId: this.accessoriesList[this.accessoriesIndex],
             partsName: this.partsName
           })
           .then(res => {

+ 123 - 42
src/packageMaterial/pages/sale/index.vue

@@ -2,14 +2,6 @@
   <!-- #ifdef H5 -->
   <zj-page-layout :hasFooter="true">
     <view class="form-container">
-      <!-- <view class="item" @tap="isShowBrandDialog = true">
-        <view class="label"><text>*</text>品牌</view>
-        <view class="picker">
-          <text class="value" v-if="brand">{{brand.brandName}}</text>
-          <text class="placeholder" v-else>请选择</text>
-          <text class="iconfont icon-jinru"></text>
-        </view>
-      </view> -->
       <view class="item" v-if="type == 'P'" @tap="isShowCategoryDialog = true">
         <view class="label"><text>*</text>产品大类</view>
         <view class="picker">
@@ -18,24 +10,10 @@
           <text class="iconfont icon-jinru"></text>
         </view>
       </view>
-      <!-- <view class="item">
-        <view class="label"><text>*</text>销售方式</view>
-        <u-radio-group v-model="salesType">
-          <u-radio shape="circle" label="外购" :name="'OUT'"></u-radio>
-          <u-radio shape="circle" label="自有仓库" :name="'OWN'"></u-radio>
-        </u-radio-group>
-      </view> -->
       <u-gap height="10" bgColor="#F7F8FF"></u-gap>
       <view class="item">
         <view class="label"><text>*</text>客户电话</view>
-        <!-- :readonly="hasOid" -->
-        <u--input
-          :maxlength="11"
-          placeholder="请输入"
-          border="none"
-          inputAlign="right"
-          v-model="userMobile"
-        ></u--input>
+        <u--input :maxlength="11" placeholder="请输入" border="none" inputAlign="right" v-model="userMobile"></u--input>
       </view>
       <view class="item">
         <view class="label">工单单号</view>
@@ -49,6 +27,65 @@
           <text class="iconfont icon-jinru"></text>
         </view>
       </view>
+      <!-- ------------------------------------ -->
+      <view v-for="(item, index) in peijianList" :key="index">
+        <u-gap height="10" bgColor="#F7F8FF"></u-gap>
+        <view class="item">
+          <view class="label" style="font-weight: bold">配件信息{{ index + 1 }}</view>
+          <view class="label" style="color: red; margin-right: 10rpx" @click="delpeijian(index)">删除</view>
+        </view>
+        <view class="item">
+          <view class="label"><text>*</text>是否质量问题</view>
+          <u--input
+            :maxlength="11"
+            placeholder="请输入"
+            border="none"
+            inputAlign="right"
+            v-model="userMobile"
+          ></u--input>
+        </view>
+        <view class="item">
+          <view class="label"><text>*</text>旧配件编号</view>
+          <u--input
+            :readonly="hasOid"
+            placeholder="请输入"
+            border="none"
+            inputAlign="right"
+            v-model="orderNo"
+          ></u--input>
+        </view>
+        <view class="item">
+          <view class="label"><text>*</text>旧配件名称</view>
+          <u--input
+            :readonly="hasOid"
+            placeholder="请输入"
+            border="none"
+            inputAlign="right"
+            v-model="orderNo"
+          ></u--input>
+        </view>
+        <view class="item" @tap="toChooseProduct(index)">
+          <view class="label"><text>*</text>新配件名称</view>
+          <view class="picker">
+            <text class="value" v-if="item">{{ item.name }}</text>
+            <text class="placeholder" v-else>选择产品</text>
+            <text class="iconfont icon-jinru"></text>
+          </view>
+        </view>
+        <view class="item">
+          <view class="label"><text>*</text>新配件编号</view>
+          <u--input
+            :readonly="hasOid"
+            placeholder="请输入"
+            border="none"
+            inputAlign="right"
+            v-model="orderNo"
+          ></u--input>
+        </view>
+      </view>
+      <u-gap height="10" bgColor="#F7F8FF"></u-gap>
+      <u-button class="btnloukong" text="添加配件" @click="addpeijian"></u-button>
+      <u-gap height="10" bgColor="#F7F8FF"></u-gap>
     </view>
 
     <template slot="footer">
@@ -57,7 +94,7 @@
           text="历史记录"
           @click="$navToPage({ url: `/packageMaterial/pages/sale/orderList?type=${type}` })"
         ></u-button>
-        <u-button type="primary" text="选择产品" @click="toChooseProduct"></u-button>
+        <u-button type="primary" text="提交" @click="submitData"></u-button>
       </view>
     </template>
 
@@ -125,7 +162,6 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
        wbId: null, // 维保工单
        wbIsAllFee: null, // 维保工单是否包含全部费用
        wbPayType: null, // 维保工单费用支付方式
-
        type: 'M',
        userMobile: '',
        orderNo: '',
@@ -139,6 +175,7 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
        websit: null,
        websitList: [],
        isShowWebsitDialog: false,
+       peijianList:[]
      }
    },
 
@@ -175,9 +212,25 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
          this.wbPayType = data.feePayMethod || '';
        })
      }
-   },
+  },
+
+  onShow() {
+    var data = this.$getStorage('materialSaleData')
+    if (data.dijiIndex !== undefined && this.peijianList[data.dijiIndex]) {
+      console.log(data)
+    }
+    this.$removeStorage('materialSaleData')
+  },
+
+  methods: {
+    addpeijian() {
+      this.peijianList.push({})
+    },
+
+    delpeijian(index) {
+      this.peijianList.splice(index, 1)
+    },
 
-   methods: {
      getBrandList() {
        this.$api.post('/pay/getBrand')
        .then(res => {
@@ -214,21 +267,40 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
        this.isShowWebsitDialog = false;
      },
 
-     toChooseProduct() {
-      //  if(!this.brand) return this.$toast('请选择品牌');
-       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('请填写正确的客户电话');
-      //  this.$navToPage({
-      //    url: `/packageMaterial/pages/sale/product?type=${this.type}&brandId=${this.brand.id}&brandName=${this.brand.brandName}&categoryId=${this.type=='P'?this.category.categoryId:''}&categoryName=${this.type=='P'?this.category.name:''}&salesType=${this.salesType}&userMobile=${this.userMobile}&orderNo=${this.orderNo}&websitId=${this.websit.websitId}&websitName=${this.websit.name}&wbId=${this.wbId||''}&wbIsAllFee=${this.wbIsAllFee||''}&wbPayType=${this.wbPayType||''}`
-      //  })
-       this.$navToPage({
-         url: `/packageMaterial/pages/sale/product?type=${this.type}&categoryId=${this.type=='P'?this.category.categoryId:''}&categoryName=${this.type=='P'?this.category.name:''}&userMobile=${this.userMobile}&orderNo=${this.orderNo}&websitId=${this.websit.websitId}&websitName=${this.websit.name}&wbId=${this.wbId||''}&wbIsAllFee=${this.wbIsAllFee||''}&wbPayType=${this.wbPayType||''}`
-       })
-     },
-   },
- }
+    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('请填写正确的客户电话');
+      this.$navToPage({
+        url: `/packageMaterial/pages/sale/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}&websitId=${this.websit.websitId}&websitName=${this.websit.name}&wbId=${this.wbId||''}&wbIsAllFee=${this.wbIsAllFee||''}&wbPayType=${this.wbPayType||''}`
+      })
+    },
+
+    submitData() {
+      if(this.peijianList.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 : '',
+        salesType: 'OUT',
+        brandId: null,
+        brandName: null,
+        websitId: this.websit.websitId,
+        websitName: this.websit.websitName,
+        userMobile: this.userMobile,
+        orderNo: this.orderNo,
+        wbId: this.wbId,
+        wbIsAllFee: this.wbIsAllFee,
+        wbPayType: this.wbPayType,
+        goodsList: this.peijianList
+      });
+      this.$navToPage({
+        url: `/packageMaterial/pages/sale/order`
+      })
+    },
+  },
+}
 
  // #endif
  // #ifndef H5
@@ -250,6 +322,15 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
   background: #ffffff;
   margin-top: 20rpx;
   border-top: 1px solid #f5f5f5;
+  .btnloukong {
+    height: 72rpx;
+    border: 2rpx solid #005ef4;
+    margin: 0;
+    background: transparent;
+    font-size: 28rpx;
+    line-height: 72rpx;
+    color: #0268fa;
+  }
   .item {
     height: 108rpx;
     border-bottom: 1px solid #f5f5f5;

+ 0 - 2
src/packageMaterial/pages/sale/order.vue

@@ -150,8 +150,6 @@ export default {
   },
 
   methods: {
-
-
     confirmPartsDialog(e) {
       this.parts = this.partsList[e[0]];
       this.isShowPartsDialog = false;

+ 24 - 119
src/packageMaterial/pages/sale/product.vue

@@ -28,37 +28,19 @@
       </view>
       <view class="right-list">
         <scroll-view scroll-y style="height: 100%">
-          <view class="item" v-for="(item, index) in rightList" :key="index">
+          <view class="item" v-for="(item, index) in rightList" :key="index" @click="selectId = item.goodsCode">
             <view class="name">{{ item.goodsName }}</view>
             <view class="text">代码:{{ item.goodsCode }}</view>
             <view class="bottom">
               <view class="price"
                 >¥{{ item.goodsAmount | priceFilter }}<text>/{{ item.goodsUnit }}</text></view
               >
-              <u-number-box
-                min="0"
-                :step="item.goodsUnit == '米' ? 1 : 1"
-                :name="item.goodsId"
-                v-model="item.num"
-                @change="changeNum"
+              <view
+                :style="`width: 50rpx; height: 50rpx; border-radius: 50%;background: ${
+                  selectId == item.goodsCode ? '#0379FF' : '#ebebeb'
+                };display: flex;justify-content: center;align-items: center;color:#fff`"
+                ><text>✔</text></view
               >
-                <view slot="minus" class="ctrl">
-                  <u-icon name="minus" color="#FFFFFF" size="12"></u-icon>
-                </view>
-                <text slot="input" class="input">
-                  <u--input
-                    :type="item.goodsUnit == '米' ? 'digit' : 'number'"
-                    placeholder="0"
-                    inputAlign="center"
-                    border="none"
-                    v-model="item.num"
-                    @blur="changeNum({ name: item.goodsId, value: item.num, unit: item.goodsUnit })"
-                  ></u--input>
-                </text>
-                <view slot="plus" class="ctrl">
-                  <u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
-                </view>
-              </u-number-box>
             </view>
           </view>
           <Loading :type="2" :loadStatus="loadStatus" :dataList="rightList" v-if="type == 'M'" />
@@ -71,59 +53,9 @@
       </view>
     </view>
 
-    <u-transition class="dialog-mark" mode="fade" :show="isShowDialog" @tap="isShowDialog = false"></u-transition>
-    <u-transition class="dialog-container" mode="slide-up" :show="isShowDialog">
-      <view class="top">
-        <view class="left">购物车</view>
-        <view class="right" @tap="clearCart"><text class="iconfont icon-shanchu"></text>清空购物车</view>
-      </view>
-      <view class="list">
-        <view class="item" v-for="(item, index) in cartList" :key="index">
-          <view class="name">{{ item.goodsName }}</view>
-          <view class="bottom">
-            <view class="price"
-              >¥{{ item.goodsAmount | priceFilter }}<text>/{{ item.goodsUnit }}</text></view
-            >
-            <u-number-box
-              :step="item.goodsUnit == '米' ? 1 : 1"
-              :min="item.goodsUnit == '米' ? 0.1 : 1"
-              :name="item.goodsId"
-              v-model="item.num"
-              @change="changeCartNum"
-              @overlimit="overlimitFun(index)"
-            >
-              <view slot="minus" class="ctrl">
-                <u-icon name="minus" color="#FFFFFF" size="12"></u-icon>
-              </view>
-              <text slot="input" class="input">
-                <u--input
-                  :type="item.goodsUnit == '米' ? 'digit' : 'number'"
-                  placeholder="0"
-                  inputAlign="center"
-                  border="none"
-                  v-model="item.num"
-                  @blur="changeCartNum({ name: item.goodsId, value: item.num, unit: item.goodsUnit })"
-                ></u--input>
-              </text>
-              <view slot="plus" class="ctrl">
-                <u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
-              </view>
-            </u-number-box>
-          </view>
-        </view>
-      </view>
-    </u-transition>
-
     <template slot="footer">
       <view class="bottom-container">
-        <view class="cart" @tap="isShowDialog = !isShowDialog">
-          <text class="iconfont icon-gouwuche1"></text>
-          <u-badge max="99" :value="totalNum" :offset="[1, 1]" absolute></u-badge>
-        </view>
-        <view class="price"><text>合计:</text>¥{{ totalPrice | priceFilter }}</view>
-        <view class="btn">
-          <u-button type="primary" text="提交" @click="submitData"></u-button>
-        </view>
+        <u-button type="primary" text="保存" @click="submitData"></u-button>
       </view>
     </template>
   </zj-page-layout>
@@ -153,36 +85,19 @@ export default {
       wbId: null, // 维保工单
       wbIsAllFee: null, // 维保工单是否包含全部费用
       wbPayType: null, // 维保工单费用支付方式
-
       keyword: '',
-		leftList: [],
-		leftCurrent: 0,
-		rightList: [],
+      leftList: [],
+      leftCurrent: 0,
+      rightList: [],
       loadStatus: 0,
-      isShowDialog: false,
-
       cartList: [],
+      selectId: "",
+      dijiIndex: 0
     }
   },
 
-  computed: {
-    totalNum() {
-      // let val = 0;
-      // this.cartList.forEach(item => {
-      //   val = val + item.num;
-      // })
-      return this.cartList.length;
-    },
-    totalPrice() {
-      let val = 0;
-      this.cartList.forEach(item => {
-        val = val + (item.num * (item.goodsAmount * 100) / 100);
-      })
-      return val;
-    },
-  },
-
-  onLoad({type, userMobile, orderNo, salesType, brandId, brandName, categoryId, categoryName, websitId, websitName, wbId, wbIsAllFee, wbPayType}) {
+  onLoad({dijiIndex, type, userMobile, orderNo, salesType, brandId, brandName, categoryId, categoryName, websitId, websitName, wbId, wbIsAllFee, wbPayType}) {
+    this.dijiIndex = dijiIndex;
     this.type = type;
     this.userMobile = userMobile;
     this.orderNo = orderNo;
@@ -346,26 +261,16 @@ export default {
     },
 
     submitData() {
-      if(this.cartList.length < 1) return this.$toast('请选择');
-      this.$setStorage('materialSaleData', {
-        type: this.type,
-        salesType: this.salesType,
-        brandId: this.brandId,
-        brandName: this.brandName,
-        categoryId: this.type == 'P' ? this.categoryId : '',
-        categoryName: this.type == 'P' ? this.categoryName : '',
-        websitId: this.websitId,
-        websitName: this.websitName,
-        userMobile: this.userMobile,
-        orderNo: this.orderNo,
-        wbId: this.wbId,
-        wbIsAllFee: this.wbIsAllFee,
-        wbPayType: this.wbPayType,
-        goodsList: this.cartList
-      });
-      this.$navToPage({
-        url: `/packageMaterial/pages/sale/order`
-      })
+
+      var data = this.rightList.find(item => item.goodsCode == this.selectId)
+      if (data) {
+        this.$setStorage('materialSaleData', {...data, dijiIndex: this.dijiIndex});
+        this.$navToPage({
+          delta: 1
+        },"navigateBack")
+      } else {
+        this.$toast('请选择');
+      }
     },
 
   },