Jelajahi Sumber

feat:二期修改

maliang 5 hari lalu
induk
melakukan
159dd2ae82

+ 133 - 117
App.vue

@@ -1,126 +1,142 @@
 <script>
-	var main, receiver, filter;
-	var _codeQueryTag = false;
+var main, receiver, filter;
+var _codeQueryTag = false;
 export default {
-	onLaunch(options) {
-		// #ifdef APP-PLUS
-		// 重置app更新信息
-		uni.setStorageSync('update', false);
-		uni.setStorageSync('downloadApkParams', null);
-		console.log('onLaunch')
-		// 检测客户端更新
-		this.$store.dispatch('update/update', 0)
-		// 初始化蓝牙
-		this.$store.dispatch('ble/initBle')
-		// #endif
-	},
-	onShow() {
-		// #ifdef APP-PLUS
-		this.initScan();
-		this.startScan();
-		this.setBROADCAST()
-		this.setBROADCASTACTION()
-		// #endif
-		// getApp().globalData.uploadUrl = this.$UPLOAD_URL
-		// getApp().globalData.img_url = this.$IMG_URL
-	},
-	onHide() {
-		this.stopScan();
-	},
-	// 应用退出,断开连接
-	onExit(){
-		// #ifdef APP-PLUS
-		this.$store.dispatch('ble/closeBluetooth')
-		// #endif
-	},
-	// globalData: {
-	// 	uploadUrl: '',
-	// 	img_url: ''
-	// },
-	methods: {
-		setBROADCAST() {
-			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
-			var Intent = plus.android.importClass("android.content.Intent");
-			var intent2 = new Intent("com.android.scanner.service_settings");
-			intent2.putExtra("barcode_send_mode", "BROADCAST");
-			main2.sendBroadcast(intent2);
-		},
-		setBROADCASTACTION() {
-			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
-			var Intent = plus.android.importClass("android.content.Intent");
-			var intent2 = new Intent("com.android.scanner.service_settings");
-			intent2.putExtra("action_barcode_broadcast", "com.pdapengyue.scan");
-			main2.sendBroadcast(intent2);
-		},
-		// 监听设备按键
-		key() {
-			plus.key.addEventListener('keydown', event => {
-				console.log("按键:" + event.keyCode);
-			});
-		},
-		// 点击触发激光扫码
-		ScanCode() {
-			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
-			var Intent = plus.android.importClass("android.content.Intent");
-			var intent2 = new Intent("com.scan.onStartScan");
-			main2.sendBroadcast(intent2);
-		},
-		initScan() {
-			var vendor = plus.device.vendor; // 获取设备制造商
-			console.log("厂商:"+vendor);
-			let _this = this;
-			main = plus.android.runtimeMainActivity(); //获取activity  
-			var IntentFilter = plus.android.importClass('android.content.IntentFilter');
-			filter = new IntentFilter();
-			filter.addAction("com.pdapengyue.scan"); // 换你的广播动作  
-			receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
-				onReceive: function(context, intent) {
-					plus.android.importClass(intent);
-					let data = intent.getStringExtra("pdapengyuescannerdata"); // 换你的广播标签  
-					// console.log("条码信息:" + data)
-					uni.$emit('scanFinish',uni.$u.trim(data))
-					// uni.showModal({
-					// 	title: '收到条码信息',
-					// 	content: '' + data,
-					// 	success: function(res) {
-					// 		if (res.confirm) {
-					// 			// 执行确认后的操作
-					// 		} else {
-					// 			// 执行取消后的操作
-					// 		}
-					// 	}
-					// })
-					_this.queryCode(code);
-				}
-			});
-		},
-		startScan() {
-			main.registerReceiver(receiver, filter);
-		
-		},
-		stopScan() {
-			main.unregisterReceiver(receiver);
-		},
-		queryCode(code) {
-			//防重复  
-			if (_codeQueryTag) return false;
-			_codeQueryTag = true;
-			setTimeout(function() {
-				_codeQueryTag = false;
-			}, 150);
-			var id = code
-			uni.$emit('scancodedate', {
-				code: id
-			})
-		}
-	}
-}
+  onLaunch(options) {
+    // #ifdef APP-PLUS
+    // 重置app更新信息
+    uni.setStorageSync("update", false);
+    uni.setStorageSync("downloadApkParams", null);
+    console.log("onLaunch");
+    // 检测客户端更新
+    this.$store.dispatch("update/update", 0);
+    // 初始化蓝牙
+    this.$store.dispatch("ble/initBle");
+    // #endif
+  },
+  onShow() {
+    // #ifdef APP-PLUS
+    this.initScan();
+    this.startScan();
+    this.setBROADCAST();
+    this.setBROADCASTACTION();
+    // #endif
+    // getApp().globalData.uploadUrl = this.$UPLOAD_URL
+    // getApp().globalData.img_url = this.$IMG_URL
+  },
+  onHide() {
+    this.stopScan();
+  },
+  // 应用退出,断开连接
+  onExit() {
+    // #ifdef APP-PLUS
+    this.$store.dispatch("ble/closeBluetooth");
+    // #endif
+  },
+  // globalData: {
+  // 	uploadUrl: '',
+  // 	img_url: ''
+  // },
+  methods: {
+    setBROADCAST() {
+      var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+      var Intent = plus.android.importClass("android.content.Intent");
+      var intent2 = new Intent("com.android.scanner.service_settings");
+      intent2.putExtra("barcode_send_mode", "BROADCAST");
+      main2.sendBroadcast(intent2);
+    },
+    setBROADCASTACTION() {
+      var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+      var Intent = plus.android.importClass("android.content.Intent");
+      var intent2 = new Intent("com.android.scanner.service_settings");
+      intent2.putExtra("action_barcode_broadcast", "com.pdapengyue.scan");
+      main2.sendBroadcast(intent2);
+    },
+    // 监听设备按键
+    key() {
+      plus.key.addEventListener("keydown", (event) => {
+        console.log("按键:" + event.keyCode);
+      });
+    },
+    // 点击触发激光扫码
+    ScanCode() {
+      var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+      var Intent = plus.android.importClass("android.content.Intent");
+      var intent2 = new Intent("com.scan.onStartScan");
+      main2.sendBroadcast(intent2);
+    },
+    initScan() {
+      var vendor = plus.device.vendor; // 获取设备制造商
+      console.log("厂商:" + vendor);
+      let _this = this;
+      main = plus.android.runtimeMainActivity(); //获取activity
+      var IntentFilter = plus.android.importClass(
+        "android.content.IntentFilter"
+      );
+      filter = new IntentFilter();
+      filter.addAction("com.pdapengyue.scan"); // 换你的广播动作
+      receiver = plus.android.implements(
+        "io.dcloud.feature.internal.reflect.BroadcastReceiver",
+        {
+          onReceive: function (context, intent) {
+            plus.android.importClass(intent);
+            let data = intent.getStringExtra("pdapengyuescannerdata"); // 换你的广播标签
+            // console.log("条码信息:" + data)
+            uni.$emit("scanFinish", uni.$u.trim(data));
+            // uni.showModal({
+            // 	title: '收到条码信息',
+            // 	content: '' + data,
+            // 	success: function(res) {
+            // 		if (res.confirm) {
+            // 			// 执行确认后的操作
+            // 		} else {
+            // 			// 执行取消后的操作
+            // 		}
+            // 	}
+            // })
+            _this.queryCode(code);
+          },
+        }
+      );
+    },
+    startScan() {
+      main.registerReceiver(receiver, filter);
+    },
+    stopScan() {
+      main.unregisterReceiver(receiver);
+    },
+    queryCode(code) {
+      //防重复
+      if (_codeQueryTag) return false;
+      _codeQueryTag = true;
+      setTimeout(function () {
+        _codeQueryTag = false;
+      }, 150);
+      var id = code;
+      uni.$emit("scancodedate", {
+        code: id,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss">
 /*每个页面公共css */
-@import '@/uni_modules/uview-ui/index.scss';
+@import "@/uni_modules/uview-ui/index.scss";
 /* #ifndef APP-NVUE */
-@import '@/common/css/public.scss';
+@import "@/common/css/public.scss";
 /* #endif */
+.depot-label {
+  display: flex;
+  align-items: center;
+  .name {
+    color: rgba(51, 51, 51, 1);
+    text-align: center;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 600;
+    margin-right: 10rpx;
+  }
+}
 </style>

+ 37 - 9
common/request/apis/purchase.js

@@ -1,17 +1,45 @@
 // 采购入库
-export const purchaseInventory = (params, config = {custom: { auth: true }}) => uni.$u.http.post(`/pda/purchaseInventory?currentPage=${params.currentPage}&pageSize=${params.pageSize}`, params, config)
+export const purchaseInventory = (
+  params,
+  config = { custom: { auth: true } }
+) =>
+  uni.$u.http.post(
+    `/pda/purchaseInventory?currentPage=${params.currentPage}&pageSize=${params.pageSize}`,
+    params,
+    config
+  );
 // 订单明细
-export const orderDetail = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderDetail/${urlparams}`, config)
+export const orderDetail = (urlparams, config = { custom: { auth: true } }) =>
+  uni.$u.http.get(`/pda/orderDetail/${urlparams}`, config);
 // 订单明细上部
-export const orderInfo = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderInfo/${urlparams}`, config)
+export const orderInfo = (urlparams, config = { custom: { auth: true } }) =>
+  uni.$u.http.get(`/pda/orderInfo/${urlparams}`, config);
 // 订单操作、去入库/去拣货
-export const orderStartHandle = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderStartHandle/${urlparams}`, config)
+export const orderStartHandle = (
+  urlparams,
+  config = { custom: { auth: true } }
+) => uni.$u.http.get(`/pda/orderStartHandle/${urlparams}`, config);
 // 	商品详情
-export const materialDetail = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/materialDetail/${urlparams}`, config)
+export const materialDetail = (
+  urlparams,
+  config = { custom: { auth: true } }
+) => uni.$u.http.get(`/pda/materialDetail/${urlparams}`, config);
 // 商品库存详情
-export const materialDepotDetail = (urlparams,data, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/materialDepotDetail/${urlparams.type}/${urlparams.materialId}`, {data,config})
+export const materialDepotDetail = (
+  urlparams,
+  data,
+  config = { custom: { auth: true } }
+) =>
+  uni.$u.http.get(
+    `/pda/materialDepotDetail/${urlparams.type}/${urlparams.materialId}/${urlparams.depotId}`,
+    { data, config }
+  );
 // 商品入库
-export const orderSubmit = (params, config = {custom: { auth: true }}) => uni.$u.http.post(`/pda/orderSubmit`, params, config)
+export const orderSubmit = (params, config = { custom: { auth: true } }) =>
+  uni.$u.http.post(`/pda/orderSubmit`, params, config);
 // 仓库下拉框
-export const depotSpinnerList = (urlparams,data, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/depotSpinnerList`, {data,config})
-	
+export const depotSpinnerList = (
+  urlparams,
+  data,
+  config = { custom: { auth: true } }
+) => uni.$u.http.get(`/pda/depotSpinnerList`, { data, config });

+ 388 - 309
pages/goods/detail.vue

@@ -1,316 +1,395 @@
 <template>
-	<view class="detail-page">
-		<u-navbar height="40px" :title="navTitle" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
-			placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="info-box">
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>货物名称</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.materialName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>货物条码</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.barCode}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>货物图片</text>
-					</view>
-					<view class="info-line-value ss-p-y-24">
-						<u-image :src="goodsInfo.imgNameArr && goodsInfo.imgNameArr.length > 0 ?goodsInfo.imgNameArr[0] : ''" width="120rpx" height="120rpx"></u-image>
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>规格</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.materialStandard || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>批次号</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.batchNumber || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>生产日期</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.productionDate || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>库存</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.inventory ? (goodsInfo.inventory * 1).toFixed(0) : '0'}}{{goodsInfo.commodityUnit || ''}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>库位</text>
-					</view>
-					<view class="info-line-value">
-						{{goodsInfo.position || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>创建时间</text>
-					</view>
-					<view class="info-line-value">
-					{{goodsInfo.createTime}}
-					</view>
-				</view>
-			</view>
-			<view class="crk-box" @click="getMaterialDepotDetail(),crkShow = true">
-				<u-image src="@/static/image/cgrk-icon.png" width="48rpx" height="48rpx"></u-image>
-				<view class="crk-msg">
-					<view class="crk-msg-name">出入库明细</view>
-					<view>查看最近的出入库记录</view>
-				</view>
-				<u-icon name="arrow-right" color="rgba(173, 181, 189, 0.50)" size="14"></u-icon>
-			</view>
-		</view>
-		<!-- 出入库明细 -->
-		<u-popup :show="crkShow" @close="crkShow = false" round="18" closeable :closeOnClickOverlay="false">
-			<view class="crk-cont">
-				<view class="crk-cont-title">出入库明细</view>
-				<view class="crk-cont-tab">
-					<view class="tab-item" :class="currentCrkId == item.id ? 'tab-item-active' : ''" v-for="(item,i) in crkList" :key="i" @click="tabClick(item)">
-						{{item.name}}
-					</view>
-				</view>
-				<scroll-view scroll-y class="scroll-y">
-					<view class="crk-item" v-for="(item,i) in cukList" :key="item">
-						<view class="crk-item-title">{{item.materialName}}</view>
-						<!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
-						<view class="crk-item-line">货物规格:{{item.materialStandard}}</view>
-						<view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}时间:{{item.warehousingTime || '-'}}</view>
-						<view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}数量:{{(item.actualQuantityInStorage * 1).toFixed(0) || 0}}{{item.commodityUnit || ''}}</view>
-						<view class="img-box">
-							<image v-if="currentCrkId == 'out'" src="@/static/image/yck-img.png" width="132rpx" height="132rpx"></image>
-							<image v-if="currentCrkId == 'in'" src="@/static/image/yrk-img.png" width="132rpx" height="132rpx"></image>
-						</view>
-					</view>
-					<u-empty mode="data" text="暂无内容" marginTop="60" icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png" v-if="cukList.length == 0"></u-empty>
-					<u-divider text="仅展示最近10条记录" v-if="cukList.length > 0" :dashed="true"></u-divider>
-					<view style="height: 40rpx;"></view>
-				</scroll-view>
-			
-			</view>
-		</u-popup>
-	</view>
+  <view class="detail-page">
+    <u-navbar
+      height="40px"
+      :title="navTitle"
+      bgColor="#0256FF"
+      :titleStyle="{ color: '#fff' }"
+      leftIconColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="info-box">
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>货物名称</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.materialName }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>货物条码</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.barCode }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>货物图片</text>
+          </view>
+          <view class="info-line-value ss-p-y-24">
+            <u-image
+              :src="
+                goodsInfo.imgNameArr && goodsInfo.imgNameArr.length > 0
+                  ? goodsInfo.imgNameArr[0]
+                  : ''
+              "
+              width="120rpx"
+              height="120rpx"
+            ></u-image>
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>规格</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.materialStandard || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>批次号</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.batchNumber || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>生产日期</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.productionDate || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>库存</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.inventory ? (goodsInfo.inventory * 1).toFixed(0) : "0"
+            }}{{ goodsInfo.commodityUnit || "" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>库位</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.position || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>创建时间</text>
+          </view>
+          <view class="info-line-value">
+            {{ goodsInfo.createTime }}
+          </view>
+        </view>
+      </view>
+      <view class="crk-box" @click="getMaterialDepotDetail(), (crkShow = true)">
+        <u-image
+          src="@/static/image/cgrk-icon.png"
+          width="48rpx"
+          height="48rpx"
+        ></u-image>
+        <view class="crk-msg">
+          <view class="crk-msg-name">出入库明细</view>
+          <view>查看最近的出入库记录</view>
+        </view>
+        <u-icon
+          name="arrow-right"
+          color="rgba(173, 181, 189, 0.50)"
+          size="14"
+        ></u-icon>
+      </view>
+    </view>
+    <!-- 出入库明细 -->
+    <u-popup
+      :show="crkShow"
+      @close="crkShow = false"
+      round="18"
+      closeable
+      :closeOnClickOverlay="false"
+    >
+      <view class="crk-cont">
+        <view class="crk-cont-title">出入库明细</view>
+        <view class="crk-cont-tab">
+          <view
+            class="tab-item"
+            :class="currentCrkId == item.id ? 'tab-item-active' : ''"
+            v-for="(item, i) in crkList"
+            :key="i"
+            @click="tabClick(item)"
+          >
+            {{ item.name }}
+          </view>
+        </view>
+        <scroll-view scroll-y class="scroll-y">
+          <view class="crk-item" v-for="(item, i) in cukList" :key="item">
+            <view class="crk-item-title">{{ item.materialName }}</view>
+            <!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
+            <view class="crk-item-line"
+              >货物规格:{{ item.materialStandard }}</view
+            >
+            <view class="crk-item-line"
+              >{{ currentCrkId == "out" ? "出库" : "入库" }}时间:{{
+                item.warehousingTime || "-"
+              }}</view
+            >
+            <view class="crk-item-line"
+              >{{ currentCrkId == "out" ? "出库" : "入库" }}数量:{{
+                (item.actualQuantityInStorage * 1).toFixed(0) || 0
+              }}{{ item.commodityUnit || "" }}</view
+            >
+            <view class="img-box">
+              <image
+                v-if="currentCrkId == 'out'"
+                src="@/static/image/yck-img.png"
+                width="132rpx"
+                height="132rpx"
+              ></image>
+              <image
+                v-if="currentCrkId == 'in'"
+                src="@/static/image/yrk-img.png"
+                width="132rpx"
+                height="132rpx"
+              ></image>
+            </view>
+          </view>
+          <u-empty
+            mode="data"
+            text="暂无内容"
+            marginTop="60"
+            icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
+            v-if="cukList.length == 0"
+          ></u-empty>
+          <u-divider
+            text="仅展示最近10条记录"
+            v-if="cukList.length > 0"
+            :dashed="true"
+          ></u-divider>
+          <view style="height: 40rpx"></view>
+        </scroll-view>
+      </view>
+    </u-popup>
+  </view>
 </template>
 
 <script>
-	import {materialDetail, materialDepotDetail} from '@/common/request/apis/purchase'
-	export default{
-		data() {
-			return {
-				navTitle:'哇哈哈AD盖',
-				goodsId:0,//单据id
-				// materialId:0,//商品id
-				crkShow: false,
-				currentCrkId:'out',
-				crkList:[
-					{
-						name:'出库',
-						id:'out'
-					},
-					{
-						name:'入库',
-						id:'in'
-					}
-				],
-				goodsInfo:{},
-				cukList:[],
-			}
-		},
-		onLoad(e) {
-			this.navTitle = e.name ? decodeURIComponent(e.name) : ''
-			this.goodsId = e.id
-			// this.materialId = e.materialId
-			this.getMaterialDetail()
-		},
-		methods:{
-			tabClick(item) {
-				console.log('tabClick=====',item)
-				this.currentCrkId = item.id
-				this.getMaterialDepotDetail()
-			},
-			getMaterialDetail() {
-				materialDetail(this.goodsId)
-				.then(res=>{
-					if(res.code == 200) {
-						console.log(res.data,'data---------')
-						if(res.data.imgName && res.data.imgName.length >0) {
-							res.data.imgNameArr = res.data.imgName.split(",")
-						}else {
-							res.data.imgNameArr = []
-						}
-						this.goodsInfo = res.data
-					}
-				})
-			},
-			getMaterialDepotDetail() {
-				uni.showLoading()
-				let urlParams = {
-					type:this.currentCrkId,
-					materialId:this.goodsInfo.materialId,
-				}
-				let data = {pageNum:1,pageSize:10}
-				materialDepotDetail(urlParams,data)
-				.then(res=>{
-					if(res.code == 200) {
-						this.cukList = res.data.rows
-					}
-					uni.hideLoading()
-				})
-				.catch(err=>{
-					uni.hideLoading()
-				})
-			}
-		}
-	}
+import {
+  materialDetail,
+  materialDepotDetail,
+} from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+
+export default {
+  data() {
+    return {
+      navTitle: "哇哈哈AD盖",
+      goodsId: 0, //单据id
+      // materialId:0,//商品id
+      crkShow: false,
+      currentCrkId: "out",
+      crkList: [
+        {
+          name: "出库",
+          id: "out",
+        },
+        {
+          name: "入库",
+          id: "in",
+        },
+      ],
+      goodsInfo: {},
+      cukList: [],
+    };
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
+  onLoad(e) {
+    this.navTitle = e.name ? decodeURIComponent(e.name) : "";
+    this.goodsId = e.id;
+    // this.materialId = e.materialId
+    this.getMaterialDetail();
+  },
+  methods: {
+    tabClick(item) {
+      console.log("tabClick=====", item);
+      this.currentCrkId = item.id;
+      this.getMaterialDepotDetail();
+    },
+    getMaterialDetail() {
+      materialDetail(`${this.goodsId}/${this.curDepotId}`).then((res) => {
+        if (res.code == 200) {
+          console.log(res.data, "data---------");
+          if (res.data.imgName && res.data.imgName.length > 0) {
+            res.data.imgNameArr = res.data.imgName.split(",");
+          } else {
+            res.data.imgNameArr = [];
+          }
+          this.goodsInfo = res.data;
+        }
+      });
+    },
+    getMaterialDepotDetail() {
+      uni.showLoading();
+      let urlParams = {
+        type: this.currentCrkId,
+        materialId: this.goodsInfo.materialId,
+        depotId: this.curDepotId,
+      };
+      let data = { pageNum: 1, pageSize: 10 };
+      materialDepotDetail(urlParams, data)
+        .then((res) => {
+          if (res.code == 200) {
+            this.cukList = res.data.rows;
+          }
+          uni.hideLoading();
+        })
+        .catch((err) => {
+          uni.hideLoading();
+        });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.detail-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		padding: 24rpx;
-		.container_main {
-			.info-box {
-				background-color: #fff;
-				border-radius: 16rpx 16rpx 0 0;
-				padding: 24rpx;
-			
-				.info-line {
-					border-bottom: 1px solid #F4F4F4;
-					min-height: 92rpx;
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
-			
-					&-label {
-						width: 162rpx;
-					}
-			
-					.must-box {
-						color: #FF3B1D;
-					}
-				}
-			}
-			
-			.crk-box {
-				border-radius: 16rpx;
-				background: #FFF;
-				padding: 32rpx 24rpx;
-				margin-top: 24rpx;
-				display: flex;
-				align-items: center;
-				.crk-msg {
-					flex: 1;
-					margin-left: 24rpx;
-					color: #666;
-					font-size: 28rpx;
-					font-weight: 400;
-					.crk-msg-name {
-						color: #333;
-						font-size: 32rpx;
-						font-weight: bold;
-					}
-				}
-			}
-		}
-		
-		.crk-cont {
-			height: 75vh;
-			&-title {
-				height: 80rpx;
-				line-height: 80rpx;
-				text-align: center;
-				color: #1F1F39;
-				font-size: 36rpx;
-				font-weight: bold;
-			}
-			&-tab {
-				height: 100rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				.tab-item {
-					width: 160rpx;
-					height: 56rpx;
-					border-radius: 40rpx;
-					border: 1px solid rgba(173, 181, 189, 0.50);
-					color: #666;
-					text-align: center;
-					font-size: 28rpx;
-					font-weight: 500;
-					line-height: 56rpx;
-					margin-right: 24rpx;
-				}
-				.tab-item-active {
-					background: #0256FF;
-					border: 1px solid #0256FF;
-					color: #FFF;
-				}
-			}
-			.scroll-y {
-				height: calc(75vh - 80rpx - 100rpx);
-				padding: 0 24rpx;
-				.crk-item {
-					border-radius: 16rpx;
-					background: #F6F8FA;
-					padding: 24rpx;
-					font-family: "PingFang SC";
-					margin-bottom: 24rpx;
-					position: relative;
-					&-title {
-						color: #000;
-						font-size: 28rpx;
-						font-weight: 500;
-						margin-bottom: 16rpx;
-					}
-					&-line {
-						color: #666;
-						font-size: 28rpx;
-						font-weight: 400;
-						margin-bottom: 8rpx;
-					}
-				
-					.img-box {
-						position: absolute;
-						top: 24rpx;
-						right: 24rpx;
-						
-						image{
-							width: 132rpx;
-							height: 132rpx;
-						}
-					}
-				}
-			}
-		}
-	}
-</style>
+.detail-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  padding: 24rpx;
+  .container_main {
+    .info-box {
+      background-color: #fff;
+      border-radius: 16rpx 16rpx 0 0;
+      padding: 24rpx;
+
+      .info-line {
+        border-bottom: 1px solid #f4f4f4;
+        min-height: 92rpx;
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
+
+        &-label {
+          width: 162rpx;
+        }
+
+        .must-box {
+          color: #ff3b1d;
+        }
+      }
+    }
+
+    .crk-box {
+      border-radius: 16rpx;
+      background: #fff;
+      padding: 32rpx 24rpx;
+      margin-top: 24rpx;
+      display: flex;
+      align-items: center;
+      .crk-msg {
+        flex: 1;
+        margin-left: 24rpx;
+        color: #666;
+        font-size: 28rpx;
+        font-weight: 400;
+        .crk-msg-name {
+          color: #333;
+          font-size: 32rpx;
+          font-weight: bold;
+        }
+      }
+    }
+  }
+
+  .crk-cont {
+    height: 75vh;
+    &-title {
+      height: 80rpx;
+      line-height: 80rpx;
+      text-align: center;
+      color: #1f1f39;
+      font-size: 36rpx;
+      font-weight: bold;
+    }
+    &-tab {
+      height: 100rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      .tab-item {
+        width: 160rpx;
+        height: 56rpx;
+        border-radius: 40rpx;
+        border: 1px solid rgba(173, 181, 189, 0.5);
+        color: #666;
+        text-align: center;
+        font-size: 28rpx;
+        font-weight: 500;
+        line-height: 56rpx;
+        margin-right: 24rpx;
+      }
+      .tab-item-active {
+        background: #0256ff;
+        border: 1px solid #0256ff;
+        color: #fff;
+      }
+    }
+    .scroll-y {
+      height: calc(75vh - 80rpx - 100rpx);
+      padding: 0 24rpx;
+      .crk-item {
+        border-radius: 16rpx;
+        background: #f6f8fa;
+        padding: 24rpx;
+        font-family: "PingFang SC";
+        margin-bottom: 24rpx;
+        position: relative;
+        &-title {
+          color: #000;
+          font-size: 28rpx;
+          font-weight: 500;
+          margin-bottom: 16rpx;
+        }
+        &-line {
+          color: #666;
+          font-size: 28rpx;
+          font-weight: 400;
+          margin-bottom: 8rpx;
+        }
+
+        .img-box {
+          position: absolute;
+          top: 24rpx;
+          right: 24rpx;
+
+          image {
+            width: 132rpx;
+            height: 132rpx;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 419 - 307
pages/index/index.vue

@@ -1,316 +1,428 @@
 <template>
-	<view class="container_box">
-		<u-navbar height="40px" title=" " bgColor="transparent">
-			<view class="u-nav-slot btn-left" slot="left" @click="meunClick">
-				<image src="@/static/image/home/bulletpoint.png" mode=""></image>
-			</view>
-			<view class="u-nav-slot btn-right" slot="right" @click="noticeClick">
-				<image src="@/static/image/home/notice-icon.png" mode=""></image>
-				<u-badge type="error" :isDot="true" :show="noticeShow" :absolute="true" :offset="[-2,1]"></u-badge>
-			</view>
-		</u-navbar>
-		<view class="container_main">
-			<view class="header-box">
-				<view class="user-content-box">
-					<view class="user-info-box">
-						<image src="@/static/image/home/avatar.png" mode=""></image>
-						<view class="user-info-content">
-							<view class="user-name">
-								{{userInfo.username}}
-							</view>	
-							<view class="user-phone">
-								{{userInfo.phonenum}}
-							</view>
-						</view>
-					</view>
-					<view class="user-txt">
-						您的移动仓库管家
-					</view>
-				</view>
-				<image src="@/static/image/home/home-top-img.png" class="header-bg" mode=""></image>
-			</view>
-			<view class="container_cont">
-				<view class="operate-item" v-for="(item,i) in operateList" :key="i" @click="operateClick(item)">
-					<view class="operate-img">
-						<image :src="item.src" mode=""></image>
-						<u-badge type="error" absolute max="99" :value="item.num" :offset="[-5,-5]"></u-badge>
-					</view>
-					<view class="operate-text">{{item.text}}</view>
-				</view>
-			</view>
-		</view>
-		<!-- 菜单弹框 -->
-		<use-pop :userInfo="userInfo" v-model="meunShow" @close="meunShow = false"></use-pop>
-	
-		<!-- 今日任务有未读 -->
-		<u-popup :show="showUpdatePop" :closeOnClickOverlay="false" :safeAreaInsetBottom="false" mode="center" :round="16"  @close="state.taskNumShow = false">
-			<view class="reason-box">
-				<image class="icon-img" src="https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-img.png" mode=""></image>
-				<view class="reason-box-title">象力WMS邀请你升级至新版本</view>
-				<view class="btn-box">
-					<button class="reset-button cancel-btn" @click="updateShow = false">稍后再说</button>
-					<button class="reset-button confirm-btn" @click="toUpdate">下载更新</button>
-				</view>
-			</view>
-		</u-popup>
-	</view>
+  <view class="container_box">
+    <u-navbar height="40px" bgColor="transparent">
+      <view class="u-nav-slot btn-left" slot="left" @click="meunClick">
+        <image src="@/static/image/home/bulletpoint.png" mode=""></image>
+      </view>
+      <view slot="center" class="depot-label" @click="stashClick">
+        <view class="name">{{ cangName }}</view>
+        <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+      </view>
+      <view class="u-nav-slot btn-right" slot="right" @click="noticeClick">
+        <image src="@/static/image/home/notice-icon.png" mode=""></image>
+        <u-badge
+          type="error"
+          :isDot="true"
+          :show="noticeShow"
+          :absolute="true"
+          :offset="[-2, 1]"
+        ></u-badge>
+      </view>
+    </u-navbar>
+    <view class="container_main">
+      <view class="header-box">
+        <view class="user-content-box">
+          <view class="user-info-box">
+            <image src="@/static/image/home/avatar.png" mode=""></image>
+            <view class="user-info-content">
+              <view class="user-name">
+                {{ userInfo.username }}
+              </view>
+              <view class="user-phone">
+                {{ userInfo.phonenum }}
+              </view>
+            </view>
+          </view>
+          <view class="user-txt"> 您的移动仓库管家 </view>
+        </view>
+        <image
+          src="@/static/image/home/home-top-img.png"
+          class="header-bg"
+          mode=""
+        ></image>
+      </view>
+      <view class="container_cont">
+        <view
+          class="operate-item"
+          v-for="(item, i) in operateList"
+          :key="i"
+          @click="operateClick(item)"
+        >
+          <view class="operate-img">
+            <image :src="item.src" mode=""></image>
+            <u-badge
+              type="error"
+              absolute
+              max="99"
+              :value="item.num"
+              :offset="[-5, -5]"
+            ></u-badge>
+          </view>
+          <view class="operate-text">{{ item.text }}</view>
+        </view>
+      </view>
+    </view>
+    <!-- 菜单弹框 -->
+    <use-pop
+      :userInfo="userInfo"
+      v-model="meunShow"
+      @close="meunShow = false"
+    ></use-pop>
+
+    <!-- 版本更新 -->
+    <u-popup
+      :show="showUpdatePop"
+      :closeOnClickOverlay="false"
+      :safeAreaInsetBottom="false"
+      mode="center"
+      :round="16"
+    >
+      <view class="reason-box">
+        <image
+          class="icon-img"
+          src="https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-img.png"
+          mode=""
+        ></image>
+        <view class="reason-box-title">象力WMS邀请你升级至新版本</view>
+        <view class="btn-box">
+          <button class="reset-button cancel-btn" @click="updateShow = false">
+            稍后再说
+          </button>
+          <button class="reset-button confirm-btn" @click="toUpdate">
+            下载更新
+          </button>
+        </view>
+      </view>
+    </u-popup>
+    <!-- 中心仓弹窗 -->
+    <u-picker
+      :show="stashShow"
+      keyName="label"
+      :defaultIndex="defaultIndex"
+      :columns="stashColumns"
+      @confirm="pickerConfirm"
+      @cancel="stashShow = false"
+    ></u-picker>
+  </view>
 </template>
 
 <script>
-	import usePop from './components/use-pop.vue'
-	import { downloadApkWithJsonPost } from '@/common/utils/app-update.js' 
-	// const Base64 = require('js-base64').Base64
-	import {
-		mapGetters
-	} from 'vuex'
-	export default {
-		components:{
-			usePop
-		},
-		data() {
-			return {
-				operateList:[
-					{
-						src:require('@/static/image/home/icon-jhrw.png'),
-						text:'拣货任务',
-						num:0,
-						url:'/pages/picking-task/index'
-					},
-					{
-						src:require('@/static/image/home/icon-cgrk.png'),
-						text:'采购入库',
-						num:0,
-						url:'/pages/purchase/index'
-					},
-					{
-						src:require('@/static/image/home/icon-chcx.png'),
-						text:'存货查询',
-						num:0,
-						url:'/pages/inventory-inquiry/index'
-					},
-					{
-						src:require('@/static/image/home/icon-pdrw.png'),
-						text:'盘点任务',
-						num:0,
-						url:'/pages/inventory-task/index'
-					}
-				],
-				meunShow:false,
-				noticeShow:true,
-				updateShow:true
-			}
-		},
-		onLoad() {
-			// JSON.parse(Base64.decode(that.$Route.query.classData))
-		},
-		onShow() {
-			// if(this.$store.state.update.update) {
-			// 	console.log('需要更新')
-			// 	this.updateShow = true
-			// }
-			if(!this.isLogin) {
-				uni.$u.toast("请先登录!");
-				setTimeout(()=>{
-					uni.redirectTo({
-						url:'/pages/login/login'
-					})
-				},1500)
-			}
-		},
-		computed: {
-			...mapGetters(['isLogin','userInfo']),
-			showUpdatePop(){
-				return this.$store.state.update.update&&this.updateShow
-			}
-		},
-		watch: {
-		},
-		methods: {
-			toUpdate() {
-				const params = this.$store.state.update.downloadApkParams
-				const url = this.$BASE_URL + '/pda/downloadApk'
-				console.log(url,'url')
-				console.log('params=======',params)
-				downloadApkWithJsonPost(url, params)
-			},
-			meunClick() {
-				if(!this.isLogin) {
-					uni.$u.toast("请先登录!");
-					setTimeout(()=>{
-						uni.redirectTo({
-							url:'/pages/login/login'
-						})
-					},1500)
-				}else{
-					this.meunShow = true
-				}
-			},
-			operateClick(item) {
-				uni.navigateTo({
-					url:item.url
-				})
-			},
-			noticeClick() {
-				uni.navigateTo({
-					url:'/pages/index/notice-page'
-				})
-			}
-		}
-	}
+import usePop from "./components/use-pop.vue";
+import { downloadApkWithJsonPost } from "@/common/utils/app-update.js";
+import { depotSpinnerList } from "@/common/request/apis/purchase";
+// const Base64 = require('js-base64').Base64
+import { mapGetters } from "vuex";
+export default {
+  components: {
+    usePop,
+  },
+  data() {
+    return {
+      operateList: [
+        {
+          src: require("@/static/image/home/icon-jhrw.png"),
+          text: "拣货任务",
+          num: 0,
+          url: "/pages/picking-task/index",
+        },
+        {
+          src: require("@/static/image/home/icon-cgrk.png"),
+          text: "采购入库",
+          num: 0,
+          url: "/pages/purchase/index",
+        },
+        {
+          src: require("@/static/image/home/icon-chcx.png"),
+          text: "存货查询",
+          num: 0,
+          url: "/pages/inventory-inquiry/index",
+        },
+        {
+          src: require("@/static/image/home/icon-pdrw.png"),
+          text: "盘点任务",
+          num: 0,
+          url: "/pages/inventory-task/index",
+        },
+        {
+          src: require("@/static/image/home/icon-fhrw.png"),
+          text: "复核任务",
+          num: 0,
+          url: "/pages/inventory-task/index",
+        },
+        {
+          src: require("@/static/image/home/icon-hwlr.png"),
+          text: "货物录入",
+          num: 0,
+          url: "/pages/inventory-task/index",
+        },
+      ],
+      meunShow: false,
+      noticeShow: true,
+      updateShow: true,
+      // 选择仓库
+      stashShow: false,
+      cangName: "",
+      stashColumns: [],
+      defaultIndex: [],
+    };
+  },
+  onLoad() {
+    // JSON.parse(Base64.decode(that.$Route.query.classData))
+    this.getDepotSpinnerList();
+  },
+  onShow() {
+    if (!this.isLogin) {
+      uni.$u.toast("请先登录!");
+      setTimeout(() => {
+        uni.redirectTo({
+          url: "/pages/login/login",
+        });
+      }, 1500);
+    }
+  },
+  computed: {
+    ...mapGetters(["isLogin", "userInfo"]),
+    showUpdatePop() {
+      return this.$store.state.update.update && this.updateShow;
+    },
+  },
+  methods: {
+    toUpdate() {
+      const params = this.$store.state.update.downloadApkParams;
+      const url = this.$BASE_URL + "/pda/downloadApk";
+      console.log(url, "url");
+      console.log("params=======", params);
+      downloadApkWithJsonPost(url, params);
+    },
+    meunClick() {
+      if (!this.isLogin) {
+        uni.$u.toast("请先登录!");
+        setTimeout(() => {
+          uni.redirectTo({
+            url: "/pages/login/login",
+          });
+        }, 1500);
+      } else {
+        this.meunShow = true;
+      }
+    },
+    operateClick(item) {
+      uni.navigateTo({
+        url: item.url,
+      });
+    },
+    noticeClick() {
+      uni.navigateTo({
+        url: "/pages/index/notice-page",
+      });
+    },
+    // 仓库
+    getDepotSpinnerList() {
+      depotSpinnerList().then((res) => {
+        if (res.code == 200) {
+          console.log(1111, res);
+          this.stashColumns = [res.data];
+          this.cangName = res.data[0].label;
+          this.$store.commit("setcangName", this.cangName);
+          this.$store.commit("setDepotInfo", {
+            depotName: res.data[0].label,
+            id: res.data[0].value,
+          });
+        }
+      });
+    },
+    pickerConfirm(val) {
+      console.log("pickerConfirm======", val);
+      this.cangName = val.value[0].label;
+      this.stashShow = false;
+      this.$store.commit("setcangName", val.value[0].label);
+      this.$store.commit("setDepotInfo", {
+        depotName: val.value[0].label,
+        id: val.value[0].value,
+      });
+    },
+    stashClick() {
+      this.defaultIndex = this.getDefaultIndex(
+        this.cangName,
+        this.stashColumns
+      );
+      this.stashShow = true;
+    },
+    // 获取picker默认index
+    getDefaultIndex(val, list) {
+      let arr = [];
+      let index = list[0].findIndex((item) => item.label == val);
+      arr = [index];
+      return arr;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.btn-left {
-		image {
-			width: 48rpx;
-			height: 48rpx;
-		}
-	}
-	.btn-right {
-		position: relative;
-		image {
-			width: 40rpx;
-			height: 44rpx;
-		}
-	}
+.btn-center {
+  display: flex;
+  align-items: center;
+  .cang-name {
+    color: rgba(51, 51, 51, 1);
+    text-align: center;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 600;
+    margin-right: 10rpx;
+  }
+}
+.btn-left {
+  image {
+    width: 48rpx;
+    height: 48rpx;
+  }
+}
+.btn-right {
+  position: relative;
+  image {
+    width: 40rpx;
+    height: 44rpx;
+  }
+}
+
+.container_box {
+  .container_main {
+    .header-box {
+      position: relative;
+      height: 375rpx;
+
+      .header-bg {
+        width: 100%;
+        height: 375rpx;
+      }
+    }
+    .user-content-box {
+      position: absolute;
+      bottom: 32rpx;
+      left: 32rpx;
+      z-index: 99;
+
+      .user-info-box {
+        display: flex;
+
+        image {
+          width: 80rpx;
+          height: 80rpx;
+          margin-right: 20rpx;
+        }
+
+        .user-name {
+          font-family: PingFang SC;
+          font-weight: 500;
+          font-size: 32rpx;
+          color: #0f1828;
+        }
+
+        .user-phone {
+          font-family: PingFang SC;
+          font-weight: 400;
+          font-size: 24rpx;
+          color: #666666;
+        }
+      }
 
-	.container_box {
-		.container_main {
-			.header-box {
-				position: relative;
-				height: 375rpx;
-				
-				.header-bg {
-					width: 100%;
-					height: 375rpx;
-				}
-			}
-			.user-content-box {
-				position: absolute;
-				bottom: 32rpx;
-				left: 32rpx;
-				z-index: 99;
-				
-				.user-info-box{
-					display: flex;
-					
-					image{
-						width: 80rpx;
-						height: 80rpx;
-						margin-right: 20rpx;
-					}
-					
-					.user-name{
-						font-family: PingFang SC;
-						font-weight: 500;
-						font-size: 32rpx;
-						color: #0F1828;
-					}	
-					
-					.user-phone{
-						font-family: PingFang SC;
-						font-weight: 400;
-						font-size: 24rpx;
-						color: #666666;
-					}
-				}
-				
-				.user-txt{
-					margin-top: 20rpx;
-					width: 350rpx;
-					height: 44rpx;
-					padding: 0 26rpx;
-					border-radius: 64rpx;
-					background: linear-gradient(90deg, #5CC4E8 0%, #0256FF 100%);
-					font-family: PingFang SC;
-					font-weight: 500;
-					font-size: 24rpx;
-					letter-spacing: 2;
-					text-align-last: justify;
-					line-height: 44rpx;
-					color: #FFFFFF;
-				}
-			}
-		}
-		.container_cont {
-			padding: 32rpx;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			flex-wrap: wrap;
-			.operate-item {
-				width: 326rpx;
-				height: 262rpx;
-				border-radius: 16rpx;
-				background: #FFF;
-				display: flex;
-				flex-direction: column;
-				align-items: center;
-				justify-content: center;
-				margin-bottom: 32rpx;
-				.operate-img {
-					position: relative;
-					image {
-						width: 128rpx;
-						height: 128rpx;
-					}
-				}
-				.operate-text {
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 32rpx;
-					font-weight: 500;
-					margin-top: 20rpx;
-				}
-			}
-		}
+      .user-txt {
+        margin-top: 20rpx;
+        width: 350rpx;
+        height: 44rpx;
+        padding: 0 26rpx;
+        border-radius: 64rpx;
+        background: linear-gradient(90deg, #5cc4e8 0%, #0256ff 100%);
+        font-family: PingFang SC;
+        font-weight: 500;
+        font-size: 24rpx;
+        letter-spacing: 2;
+        text-align-last: justify;
+        line-height: 44rpx;
+        color: #ffffff;
+      }
+    }
+  }
+  .container_cont {
+    padding: 32rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    .operate-item {
+      width: 326rpx;
+      height: 262rpx;
+      border-radius: 16rpx;
+      background: #fff;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 32rpx;
+      .operate-img {
+        position: relative;
+        image {
+          width: 128rpx;
+          height: 128rpx;
+        }
+      }
+      .operate-text {
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 32rpx;
+        font-weight: 500;
+        margin-top: 20rpx;
+      }
+    }
+  }
+}
 
-	}
-	
-	.reason-box {
-		width: 700rpx;
-		background: url('https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png') no-repeat;
-		background-size: 100% 100%;
-		padding: 0 60rpx 46rpx;
-		box-sizing: border-box;
-		.icon-img {
-			width: 200rpx;
-			height: 200rpx;
-			border-radius: 50%;
-			position: absolute;
-			top: -100rpx;
-			left: 50%;
-			transform: translateX(-50%);
-		}
-		.reason-box-title {
-			padding-top: 150rpx;
-			color: #1D212A;
-			font-family: "PingFang SC";
-			font-size: 32rpx;
-			font-weight: bold;
-			text-align: center;
-		}
-		.btn-box {
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			margin-top: 60rpx;
-			.cancel-btn,
-			.confirm-btn {
-				width: 244rpx;
-				height: 80rpx;
-				border-radius: 16rpx;
-				font-size: 32rpx;
-			}
-			.cancel-btn {
-				border: 1px solid #BFC8DB;
-				color: #86909C;
-			}
-			.confirm-btn {
-				background: #0256FF;
-				color: #FFF;
-				font-weight: 500;
-			}
-		}
-	}
-</style>
+.reason-box {
+  width: 700rpx;
+  background: url("https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png")
+    no-repeat;
+  background-size: 100% 100%;
+  padding: 0 60rpx 46rpx;
+  box-sizing: border-box;
+  .icon-img {
+    width: 200rpx;
+    height: 200rpx;
+    border-radius: 50%;
+    position: absolute;
+    top: -100rpx;
+    left: 50%;
+    transform: translateX(-50%);
+  }
+  .reason-box-title {
+    padding-top: 150rpx;
+    color: #1d212a;
+    font-family: "PingFang SC";
+    font-size: 32rpx;
+    font-weight: bold;
+    text-align: center;
+  }
+  .btn-box {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-top: 60rpx;
+    .cancel-btn,
+    .confirm-btn {
+      width: 244rpx;
+      height: 80rpx;
+      border-radius: 16rpx;
+      font-size: 32rpx;
+    }
+    .cancel-btn {
+      border: 1px solid #bfc8db;
+      color: #86909c;
+    }
+    .confirm-btn {
+      background: #0256ff;
+      color: #fff;
+      font-weight: 500;
+    }
+  }
+}
+</style>

+ 0 - 4
pages/inventory-inquiry/components/good-item.vue

@@ -17,10 +17,6 @@
           <view class="item-label">规格</view>
           <view class="item-value">{{ item.materialStandard || "-" }}</view>
         </view>
-       <!-- <view class="good-cont-item">
-          <view class="item-label">批次号</view>
-          <view class="item-value">{{ item.batchNumber || "-" }}</view>
-        </view> -->
         <view class="good-cont-item" @click.stop="calendarClick">
           <view class="item-label">生产日期</view>
           <view class="item-value">{{

+ 17 - 77
pages/inventory-inquiry/index.vue

@@ -7,9 +7,8 @@
       autoBack
       placeholder
     >
-      <view class="u-nav-slot btn-right" slot="right" @click="stashClick">
-        <view class="cang-name">{{ cangName }}</view>
-        <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+      <view class="u-nav-slot depot-label" slot="right">
+        <view class="name">{{ curDepotName }}</view>
       </view>
     </u-navbar>
     <view class="container_main">
@@ -106,15 +105,6 @@
       @confirm="pickerConfirm"
       @cancel="typeShow = false"
     ></u-picker>
-    <!-- 中心仓弹窗 -->
-    <u-picker
-      :show="stashShow"
-      keyName="label"
-      :defaultIndex="defaultIndex2"
-      :columns="stashColumns"
-      @confirm="pickerConfirm2"
-      @cancel="stashShow = false"
-    ></u-picker>
   </view>
 </template>
 
@@ -125,8 +115,9 @@ import {
   inventoryPositionTree,
   materialCategoryTree,
 } from "@/common/request/apis/inventoryInquiry";
-import { depotSpinnerList } from "@/common/request/apis/purchase";
 import goodItem from "./components/good-item.vue";
+import { mapGetters } from "vuex";
+
 export default {
   components: {
     goodItem,
@@ -176,15 +167,18 @@ export default {
         categoryId: "",
         position: "",
         keyword: "",
-        depotId: "",
       },
-      // 中心仓
-      stashShow: false,
-      cangName: "",
-      stashColumns: [],
-      defaultIndex2: [],
     };
   },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
   mounted() {
     let systemInfo = uni.getSystemInfoSync();
     let statusBarHeight = systemInfo.statusBarHeight;
@@ -204,7 +198,8 @@ export default {
     // let statusBarHeight = systemInfo.statusBarHeight;
     // this.offsetTop = statusBarHeight + 40
     this.getMaterialCategoryTree();
-    this.getDepotSpinnerList();
+    this.getTreeData();
+    this.loadData();
   },
   onShow() {
     uni.$on("scanFinish", (data) => {
@@ -219,29 +214,13 @@ export default {
     uni.$off("scanFinish");
   },
   methods: {
-    getDepotSpinnerList() {
-      depotSpinnerList().then((res) => {
-        if (res.code == 200) {
-          this.stashColumns = [res.data];
-          this.cangName = res.data[0].label;
-          this.queryParams.depotId = res.data[0].value;
-          this.$store.commit("setcangName", this.cangName);
-          this.$store.commit("setDepotInfo", {
-            depotName: res.data[0].label,
-            id: res.data[0].value,
-          });
-          this.loadData();
-          this.getTreeData();
-        }
-      });
-    },
     scanCode() {
       this.$scan.scanCode();
     },
     async getTreeData() {
       try {
         const res = await inventoryPositionTree({
-          depotId: this.queryParams.depotId,
+          depotId: this.curDepotId,
         });
         console.log("res=====", res);
         this.treeData = res.data;
@@ -281,6 +260,7 @@ export default {
         const pageSize = this.pageSize;
         const params = {
           ...this.queryParams,
+          depotId: this.curDepotId,
           currentPage,
           pageSize,
         };
@@ -342,51 +322,11 @@ export default {
       }
       this.typeShow = false;
     },
-    stashClick() {
-      this.defaultIndex2 = this.getDefaultIndex(
-        this.cangName,
-        this.stashColumns
-      );
-      this.stashShow = true;
-    },
-    pickerConfirm2(val) {
-      console.log("pickerConfirm2======", val);
-      this.cangName = val.value[0].label;
-      this.queryParams.depotId = val.value[0].value;
-      this.stashShow = false;
-      this.$store.commit("setcangName", this.cangName);
-      this.$store.commit("setDepotInfo", {
-        depotName: val.value[0].label,
-        id: val.value[0].value,
-      });
-      this.queryParams.position = "";
-      this.getTreeData();
-      this.onRefresh();
-    },
-    // 获取picker默认index
-    getDefaultIndex(val, list) {
-      let arr = [];
-      let index = list[0].findIndex((item) => item.label == val);
-      arr = [index];
-      return arr;
-    },
   },
 };
 </script>
 
 <style lang="scss" scoped>
-.btn-right {
-  display: flex;
-  align-items: center;
-  .cang-name {
-    color: #0256ff;
-    text-align: center;
-    font-family: "PingFang SC";
-    font-size: 28rpx;
-    font-weight: 600;
-    margin-right: 10rpx;
-  }
-}
 .inventory-page {
   min-height: 100vh;
   background: #f0f6fb;

+ 9 - 11
pages/inventory-task/components/categoryPopup.vue

@@ -6,7 +6,7 @@
     @open="open"
     :round="10"
     :closeOnClickOverlay="false"
-		:safeAreaInsetBottom="false"
+    :safeAreaInsetBottom="false"
     width="580rpx"
   >
     <view class="location-edit-popup">
@@ -68,9 +68,7 @@
           >确认</u-button
         >
       </view>
-			<view class="tips-box">
-				*修改库位后,经过erp后台审核后方可生效
-			</view>
+      <view class="tips-box"> *修改库位后,经过erp后台审核后方可生效 </view>
     </view>
   </u-popup>
 </template>
@@ -182,12 +180,12 @@ export default {
       }
     }
   }
-	
-	.tips-box {
-		color: #BFC8DB;
-		font-size: 24rpx;
-		font-weight: 400;
-		margin-top: 24rpx;
-	}
+
+  .tips-box {
+    color: #bfc8db;
+    font-size: 24rpx;
+    font-weight: 400;
+    margin-top: 24rpx;
+  }
 }
 </style>

+ 23 - 22
pages/inventory-task/components/check-item.vue

@@ -9,47 +9,48 @@
         <view :class="['tips-box', curTaskStatusInfo.className]">{{
           curTaskStatusInfo.name
         }}</view>
-        <!-- <view class="tips-box tips-green">已盘点</view>
-				<view class="tips-box tips-hui">已取消</view>
-				<view class="tips-box tips-yellow">盘点中</view> -->
       </view>
     </view>
     <view class="cont-box" @click="toDetail">
       <view class="cont-item">
         <view class="item-label">盘点仓库</view>
-        <view class="item-val">{{ info.depotName || '-' }}</view>
+        <view class="item-val">{{ info.depotName || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">创建人</view>
-        <view class="item-val">{{ info.createName || '-' }}</view>
+        <view class="item-val">{{ info.createName || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">盘点负责人</view>
-        <view class="item-val">{{ info.creatorName || '-' }}</view>
+        <view class="item-val">{{ info.creatorName || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">货物种类</view>
-        <view class="item-val">{{ info.categoryCount || '-' }}</view>
+        <view class="item-val">{{ info.categoryCount || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">货物总量</view>
-        <view class="item-val">{{ info.materialCount || '-' }}</view>
+        <view class="item-val">{{ info.materialCount || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">库位范围</view>
-        <view class="item-val">{{ info.positionRange || '-' }}</view>
+        <view class="item-val">{{ info.positionRange || "-" }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">创建时间</view>
-        <view class="item-val">{{ info.createTime ? $u.timeFormat(info.createTime, 'yyyy-mm-dd') : '-' }}</view>
+        <view class="item-val">{{
+          info.createTime ? $u.timeFormat(info.createTime, "yyyy-mm-dd") : "-"
+        }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">盘点时间</view>
-        <view class="item-val">{{$u.timeFormat(info.operTime, 'yyyy-mm-dd')}}</view>
+        <view class="item-val">{{
+          $u.timeFormat(info.operTime, "yyyy-mm-dd")
+        }}</view>
       </view>
       <view class="cont-item">
         <view class="item-label">盘点人</view>
-        <view class="item-val">{{ info.operName || '-' }}</view>
+        <view class="item-val">{{ info.operName || "-" }}</view>
       </view>
     </view>
 
@@ -121,15 +122,15 @@ export default {
       };
       this.$emit("btnClick", params);
     },
-		toDetail() {
-			let text = ''
-			if(this.status === 3 || this.status === 4) {
-				text = '详情'
-			}else if (this.status === 1 || this.status === 2) {
-				text = '去盘点'
-			}
-			this.handleCick(text)
-		}
+    toDetail() {
+      let text = "";
+      if (this.status === 3 || this.status === 4) {
+        text = "详情";
+      } else if (this.status === 1 || this.status === 2) {
+        text = "去盘点";
+      }
+      this.handleCick(text);
+    },
   },
 };
 </script>
@@ -212,7 +213,7 @@ export default {
       background: #0256ff;
       font-size: 32rpx;
       border-radius: 8rpx;
-			margin-right: 20rpx;
+      margin-right: 20rpx;
     }
   }
 }

+ 11 - 5
pages/inventory-task/components/inventoryFilterPopup.vue

@@ -304,6 +304,12 @@ export default {
       return this.locationTree[this.currentLocationIndex]?.children || [];
     },
     ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
   },
   watch: {
     taskId: {
@@ -314,11 +320,6 @@ export default {
             console.log("creatorSpinnerList=======", res);
             this.userOptions = res.data;
           });
-          //库存
-          inventoryPositionTree({ depotId: this.depotInfo.id }).then((res) => {
-            console.log("res=====", res);
-            this.locationTree = res.data;
-          });
         }
       },
       immediate: true,
@@ -341,6 +342,11 @@ export default {
         console.log("getMaterialCategoryTree=======", res);
         this.categoryTree = res;
       });
+      //库存
+      inventoryPositionTree({ depotId: this.curDepotId }).then((res) => {
+        console.log("res=====", res);
+        this.locationTree = res.data;
+      });
     },
     // 标签切换
     tabChange({ index }) {

+ 14 - 72
pages/inventory-task/index.vue

@@ -1,9 +1,8 @@
 <template>
   <view class="check-page">
     <u-navbar height="40px" title="盘点" bgColor="#fff" autoBack placeholder>
-      <view class="u-nav-slot btn-right" slot="right" @click="stashClick">
-        <view class="cang-name">{{ cangName }}</view>
-        <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+      <view class="u-nav-slot depot-label" slot="right" @click="stashClick">
+        <view class="name">{{ curDepotName }}</view>
       </view>
     </u-navbar>
     <view class="container_main">
@@ -65,15 +64,6 @@
       @confirm="submit"
       :content="actionPop.errorText"
     ></error-pop>
-    <!-- 中心仓弹窗 -->
-    <u-picker
-      :show="stashShow"
-      keyName="label"
-      :defaultIndex="defaultIndex2"
-      :columns="stashColumns"
-      @confirm="pickerConfirm2"
-      @cancel="stashShow = false"
-    ></u-picker>
   </view>
 </template>
 
@@ -88,7 +78,7 @@ import {
   taskStocktakingDetail,
 } from "@/common/request/apis/inventoryTask";
 import { taskStatusList } from "../inventory-task/utils/index.js";
-import { depotSpinnerList } from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
 
 export default {
   components: {
@@ -102,7 +92,6 @@ export default {
       query: {
         number: "",
         status: "",
-        depotId: "",
       },
       currentPage: 1,
       pageSize: 10,
@@ -119,18 +108,23 @@ export default {
       startTaskId: null,
       toStock: false, //是否跳转盘点
       // 中心仓
-      stashShow: false,
       cangName: "",
-      stashColumns: [],
-      defaultIndex2: [],
     };
   },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
   onLoad() {
     let systemInfo = uni.getSystemInfoSync();
     let statusBarHeight = systemInfo.statusBarHeight;
     this.offsetTop = statusBarHeight + 40;
-    // 初始化数据
-    this.getDepotSpinnerList();
+    this.loadData();
   },
   onShow() {
     if (this.startTaskId) {
@@ -148,21 +142,6 @@ export default {
     this.onLoadMore();
   },
   methods: {
-    getDepotSpinnerList() {
-      depotSpinnerList().then((res) => {
-        if (res.code == 200) {
-          this.stashColumns = [res.data];
-          this.cangName = res.data[0].label;
-          this.query.depotId = res.data[0].value;
-          this.$store.commit("setcangName", this.cangName);
-          this.$store.commit("setDepotInfo", {
-            depotName: res.data[0].label,
-            id: res.data[0].value,
-          });
-          this.loadData();
-        }
-      });
-    },
     async onRefresh() {
       try {
         await this.loadData(true);
@@ -193,6 +172,7 @@ export default {
           currentPage,
           pageSize,
           ...this.query,
+          depotId: this.curDepotId,
         };
         console.log("params=====", params);
         const res = await taskStocktakingList(params);
@@ -285,49 +265,11 @@ export default {
         }
       }
     },
-    stashClick() {
-      this.defaultIndex2 = this.getDefaultIndex(
-        this.cangName,
-        this.stashColumns
-      );
-      this.stashShow = true;
-    },
-    pickerConfirm2(val) {
-      console.log("pickerConfirm2======", val);
-      this.cangName = val.value[0].label;
-      this.query.depotId = val.value[0].value;
-      this.stashShow = false;
-      this.$store.commit("setcangName", this.cangName);
-      this.$store.commit("setDepotInfo", {
-        depotName: val.value[0].label,
-        id: val.value[0].value,
-      });
-      this.onRefresh();
-    },
-    // 获取picker默认index
-    getDefaultIndex(val, list) {
-      let arr = [];
-      let index = list[0].findIndex((item) => item.label == val);
-      arr = [index];
-      return arr;
-    },
   },
 };
 </script>
 
 <style lang="scss" scoped>
-.btn-right {
-  display: flex;
-  align-items: center;
-  .cang-name {
-    color: #0256ff;
-    text-align: center;
-    font-family: "PingFang SC";
-    font-size: 28rpx;
-    font-weight: 600;
-    margin-right: 10rpx;
-  }
-}
 .check-page {
   min-height: 100vh;
   background-color: #f0f6fb;

+ 616 - 553
pages/picking-task/delivery.vue

@@ -1,591 +1,654 @@
 <template>
-	<view class="deliver-page">
-		<u-navbar height="40px" title="货物出库" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
-			placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="info-box" :class="isUnfold ? '':'min-height'">
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>发出仓库</text>
-					</view>
-					<view class="info-line-value">
-						{{cangName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>客户</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.supplierName || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库类型</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.subType || '-'}}
-					</view>
-				</view>
-				<view class="info-line" v-if="orderInfo.submitTime">
-					<view class="info-line-label">
-						<text>出库日期</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.submitTime || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>配送地址</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.receiverAddress || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>上传凭证</text>
-					</view>
-					<view class="info-line-value ss-p-y-24">
-						<upload-image v-model="voucherPicture" width="196rpx" height="196rpx"></upload-image>
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>备注信息</text>
-					</view>
-					<view class="info-line-value">
-						<u-input v-model="orderInfo.mark" placeholder="请输入备注信息" border="none"></u-input>
-					</view>
-				</view>
-			</view>
-			<view class="btn-box">
-				<view class="btn-cont" @click="isUnfold = !isUnfold">
-					<text>{{isUnfold ? '收起' : '展开'}}</text>
-					<u-icon :name="isUnfold?'arrow-up':'arrow-down'"></u-icon>
-				</view>
-			</view>
+  <view class="deliver-page">
+    <u-navbar
+      height="40px"
+      title="货物出库"
+      bgColor="#0256FF"
+      :titleStyle="{ color: '#fff' }"
+      leftIconColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="info-box" :class="isUnfold ? '' : 'min-height'">
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>发出仓库</text>
+          </view>
+          <view class="info-line-value">
+            {{ depotInfo ? depotInfo.depotName : "" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>客户</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.supplierName || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库类型</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.subType || "-" }}
+          </view>
+        </view>
+        <view class="info-line" v-if="orderInfo.submitTime">
+          <view class="info-line-label">
+            <text>出库日期</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.submitTime || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>配送地址</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.receiverAddress || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>上传凭证</text>
+          </view>
+          <view class="info-line-value ss-p-y-24">
+            <upload-image
+              v-model="voucherPicture"
+              width="196rpx"
+              height="196rpx"
+            ></upload-image>
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>备注信息</text>
+          </view>
+          <view class="info-line-value">
+            <u-input
+              v-model="orderInfo.mark"
+              placeholder="请输入备注信息"
+              border="none"
+            ></u-input>
+          </view>
+        </view>
+      </view>
+      <view class="btn-box">
+        <view class="btn-cont" @click="isUnfold = !isUnfold">
+          <text>{{ isUnfold ? "收起" : "展开" }}</text>
+          <u-icon :name="isUnfold ? 'arrow-up' : 'arrow-down'"></u-icon>
+        </view>
+      </view>
 
-			<view class="scan-box">
-				<view class="scan-box-l" @click="scanCode">
-					<u-image width="120rpx" height="120rpx" src="@/static/image/zidong-saoma-img.png"></u-image>
-					<view class="tips-text">扫描快速识别货物</view>
-					<view class="tips-text2">
-						<u-icon name="checkmark-circle-fill" color="#0256FF"></u-icon>
-						<text>连续扫描</text>
-					</view>
-				</view>
-				<!-- <view class="scan-box-r" @click="manualClick">
+      <view class="scan-box">
+        <view class="scan-box-l" @click="scanCode">
+          <u-image
+            width="120rpx"
+            height="120rpx"
+            src="@/static/image/zidong-saoma-img.png"
+          ></u-image>
+          <view class="tips-text">扫描快速识别货物</view>
+          <view class="tips-text2">
+            <u-icon name="checkmark-circle-fill" color="#0256FF"></u-icon>
+            <text>连续扫描</text>
+          </view>
+        </view>
+        <!-- <view class="scan-box-r" @click="manualClick">
 					<u-image width="120rpx" height="120rpx" src="@/static/image/shoudong-saoma-img.png"></u-image>
 					<view class="tips-text">手动选择</view>
 				</view> -->
-			</view>
-			<!-- 货物清单 -->
-			<view class="cargo-list">
-				<view class="cargo-list-title">
-					<view>出库货物清单</view>
-					<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
-				</view>
-				<block v-for="(item,i) in goodsList" :key="i">
-					<good-item :item="item" @toDetail="toDetail" :show-print="true" @print="(e) => handlePrint(e.id,'2',status)">
-						<view class="num-box" @click.stop="">
-							<view class="num-box-text">已确认出库数量</view>
-							<u-number-box v-model="item.materialNumber" min="0" :inputWidth="56" :max="item.inventory">
-								<!-- <view slot="minus" class="minus">
+      </view>
+      <!-- 货物清单 -->
+      <view class="cargo-list">
+        <view class="cargo-list-title">
+          <view>出库货物清单</view>
+          <view class="cargo-list-title-tips">(轻触货物查看详情)</view>
+        </view>
+        <block v-for="(item, i) in goodsList" :key="i">
+          <good-item
+            :item="item"
+            @toDetail="toDetail"
+            :show-print="true"
+            @print="(e) => handlePrint(e.id, '2', status)"
+          >
+            <view class="num-box" @click.stop="">
+              <view class="num-box-text">已确认出库数量</view>
+              <u-number-box
+                v-model="item.materialNumber"
+                min="0"
+                :inputWidth="56"
+                :max="item.inventory"
+              >
+                <!-- <view slot="minus" class="minus">
 									<u-icon name="minus" color="#0256FF" size="12"></u-icon>
 								</view>
 								<text slot="input" class="input">{{item.materialNumber}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view> -->
-							</u-number-box>
-						</view>
-					</good-item>
-				</block>
-			</view>
-		</view>
-		
-		<view class="footer-box">
-			<view class="footer-box-l">
-				<view>货物种类:{{speciesNum}}种</view>
-				<view>货物总数:{{orderGoodsNum}}件</view>
-			</view>
-			<button class="submitBtn" @tap="submitClick">
-			  提交
-			</button>
-		</view>
-		<error-pop v-model="errorShow" @close="errorShow = false" @confirm="confirm" :content="popText.errorText"></error-pop>
-		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.successText"></success-pop>
-		<!-- 扫码之后弹窗 -->
-		<scaned-pop v-if="scanedShow" v-model="scanedShow" :scanNum="scanNum" :max="scanMaxNum" @close="scanedShow = false" @confirm="scanConfirm"></scaned-pop>
-		
-		<goods-pop v-model="goodsShow" @close="goodsShow = false"></goods-pop>
-		<!-- 打印条码弹框 -->
-		<print-pop :show.sync="blePrintPop.show" :info="blePrintPop.data" @confirm="startPrint"></print-pop>
-		<!-- 选择蓝牙设备弹框 -->
-		<ble-pop :show.sync="bleSelectPop.show" :list="discoveredDevices" @close="closeBleSelectPop" @refresh="refreshBleDevice" @selectItem="handleSelectBle"></ble-pop>
+              </u-number-box>
+            </view>
+          </good-item>
+        </block>
+      </view>
+    </view>
 
-    <ble-tip-pop v-model="bleErrorTipPop.show" :is-center="true" @confirm="bleErrorTipConfirm" :content="bleErrorTipPop.content" :extraText="bleErrorTipPop.extraText"> </ble-tip-pop>
-	</view>
+    <view class="footer-box">
+      <view class="footer-box-l">
+        <view>货物种类:{{ speciesNum }}种</view>
+        <view>货物总数:{{ orderGoodsNum }}件</view>
+      </view>
+      <button class="submitBtn" @tap="submitClick">提交</button>
+    </view>
+    <error-pop
+      v-model="errorShow"
+      @close="errorShow = false"
+      @confirm="confirm"
+      :content="popText.errorText"
+    ></error-pop>
+    <success-pop
+      v-model="successShow"
+      @close="successShow = false"
+      @backClick="backClick"
+      :content="popText.successText"
+    ></success-pop>
+    <!-- 扫码之后弹窗 -->
+    <scaned-pop
+      v-if="scanedShow"
+      v-model="scanedShow"
+      :scanNum="scanNum"
+      :max="scanMaxNum"
+      @close="scanedShow = false"
+      @confirm="scanConfirm"
+    ></scaned-pop>
+
+    <goods-pop v-model="goodsShow" @close="goodsShow = false"></goods-pop>
+    <!-- 打印条码弹框 -->
+    <print-pop
+      :show.sync="blePrintPop.show"
+      :info="blePrintPop.data"
+      @confirm="startPrint"
+    ></print-pop>
+    <!-- 选择蓝牙设备弹框 -->
+    <ble-pop
+      :show.sync="bleSelectPop.show"
+      :list="discoveredDevices"
+      @close="closeBleSelectPop"
+      @refresh="refreshBleDevice"
+      @selectItem="handleSelectBle"
+    ></ble-pop>
+
+    <ble-tip-pop
+      v-model="bleErrorTipPop.show"
+      :is-center="true"
+      @confirm="bleErrorTipConfirm"
+      :content="bleErrorTipPop.content"
+      :extraText="bleErrorTipPop.extraText"
+    >
+    </ble-tip-pop>
+  </view>
 </template>
 
 <script>
-	import goodItem from '@/components/good-item/good-item.vue'
-	import errorPop from '@/components/error-pop/error-pop.vue'
-	import successPop from '@/components/success-pop/success-pop.vue'
-	import scanedPop from '@/components/scaned-pop/scaned-pop.vue'
-	import goodsPop from '@/components/goods-pop/goods-pop.vue'
-	import {orderDetail, orderInfo, orderSubmit} from '@/common/request/apis/purchase'
-	import {mapGetters} from 'vuex'
-	import blePrintMixin from '@/common/mixins/blePrintMixin.js'
-	export default {
-		mixins: [blePrintMixin],
-		components: {
-			goodItem,
-			errorPop,
-			successPop,
-			scanedPop,
-			goodsPop,
-		},
-		data() {
-			return {
-				popText:{
-					errorText:'实际出库数量与应出库数量有差异,是否确认提交?',
-					successText:'出库成功!'
-				},
-				goodsShow:false,
-				scanedShow:false,
-				errorShow:false,
-				successShow:false,
-				value:0,
-				isUnfold: true, //是否展开
-				info: {
-					mark: '',
-					url: ''
-				},
-				goodsList: [],
-				orderInfo:{},
-				id:'',
-				calendarShow:false,
-				value1: '',
-				maxDate:Number(new Date()),
-				chooseGoodsInfo:{},
-				voucherPicture:'',
-				scanIndex:-1,
-				scanNum:1,
-				scanMaxNum: 0,
-				status: null
-			}
-		},
-		onLoad(e) {
-			this.id = e.id
-			this.status = e.status
-			this.getOrderDetail(e.id)
-			this.getOrderInfo(e.id)
-		},
-		computed: {
-			...mapGetters(['cangName']),
-			speciesNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					num = this.goodsList.length
-				}
-				return num
-			},
-			// 手动输入的数量
-			goodsNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					this.goodsList.forEach(item=>{
-						num+=item.materialNumber
-					})
-				}
-				return num
-			},
-			// 订单返回的数量
-			orderGoodsNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					this.goodsList.forEach(item=>{
-						num+=item.operNumber
-					})
-				}
-				return num
-			}
-		},
-		onShow() {
-			uni.$on('scanFinish',(data)=>{
-				if(this.goodsList.length == 0)return uni.$u.toast("该货物不属于该任务")
-				let index = this.goodsList.findIndex(item=>item.barCode == data)
-				if(index == -1) return uni.$u.toast("该货物不属于该任务");
-				this.scanIndex = index
-				this.scanNum = this.goodsList[index].materialNumber
-				this.scanMaxNum = this.goodsList[index].inventory
-				this.scanedShow = true
-			})
-		},
-		onHide() {
-			uni.$off('scanFinish')
-		},
-		onUnload() {
-			uni.$off('scanFinish')
-		},
-		methods:{
-			scanCode() {
-				this.$scan.scanCode()
-			},
-			calendarConfirm(val) {
-				this.goodsList.forEach(item=>{
-					if(item.id == this.chooseGoodsInfo.id) {
-						item.productionDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
-					}
-				})
-				this.calendarShow = false
-			},
-			calendarCole() {
-				this.calendarShow = false
-			},
-			calendarClick(item) {
-				console.log(item.productionDate,'item.productionDate')
-				this.chooseGoodsInfo = item
-				if(item.productionDate) {
-					this.value1 = Number(new Date(item.productionDate))
-				}else {
-					this.value1 = Number(new Date())
-				}
-				this.calendarShow = true
-			},
-			getOrderInfo(id) {
-				orderInfo(id)
-				.then(res=>{
-					if(res.code == 200) {
-						this.orderInfo = res.data
-						console.log('this.orderInfo====',this.orderInfo)
-					}
-				})
-			},
-			getOrderDetail(id) {
-				orderDetail(id)
-				.then(res=>{
-					if(res.code == 200) {
-						res.data.rows.forEach(item=>{
-							if(item.imgName && item.imgName.length >0) {
-								item.imgNameArr = item.imgName.split(",")
-							}else {
-								item.imgNameArr = []
-							}
-							item.materialNumber = 0
-						})
-						this.goodsList = res.data.rows
-					  console.log('goodsList==========',this.goodsList )
-					}
-				})
-			},
-			submitClick() {
-				let num = 0
-				console.log('this.goodsList=====',this.goodsList)
-				this.goodsList.forEach(item=>{
-					if(item.materialNumber * 1 != item.operNumber ) {
-						num ++
-					}
-				})
-				console.log('num=====',num)
-				if(num>0) {
-					return this.errorShow = true
-				}
-				console.log('111111=====',1111)
-				this.toOrderSubmit()
-			},
-			toOrderSubmit() {
-				console.log('this.goodsList=====',this.goodsList)
-				let materials = this.goodsList.map(item=> {
-					return {
-						barCode:item.barCode,
-						materialNumber:item.materialNumber,
-						productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
-					}
-				})
-				let params = {
-					id:this.id,
-					materials:materials,
-					voucherPicture:this.voucherPicture || '',
-					remark:this.orderInfo.mark || ''
-				}
-				console.log('orderSubmit========params====',params)
-				orderSubmit(params)
-				.then(res=>{
-					console.log('orderSubmit============res=====',res)
-					if(res.code == 200) {
-						if(this.errorShow){
-							this.errorShow = false
-						}
-						this.successShow = true
-					}else{
-						uni.showToast({
-							icon: 'error',
-							mask: true,
-							title: res.msg||'服务错误'								
-						})
-					}
-				})
-			},
-			confirm() {
-				this.toOrderSubmit()
-				this.errorShow = false
-			},
-			backClick() {
-				uni.setStorageSync('orderRefresh',true)
-				uni.navigateBack()
-			},
-			// 扫码确认
-			scanConfirm(val) {
-				this.goodsList[this.scanIndex].materialNumber = Number(val)
-				this.scanedShow = false
-			},
-			manualClick() {
-				this.goodsShow = true
-			},
-			toDetail(val) {
-				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
-				})
-			},
-		}
-	}
+import goodItem from "@/components/good-item/good-item.vue";
+import errorPop from "@/components/error-pop/error-pop.vue";
+import successPop from "@/components/success-pop/success-pop.vue";
+import scanedPop from "@/components/scaned-pop/scaned-pop.vue";
+import goodsPop from "@/components/goods-pop/goods-pop.vue";
+import {
+  orderDetail,
+  orderInfo,
+  orderSubmit,
+} from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+export default {
+  mixins: [blePrintMixin],
+  components: {
+    goodItem,
+    errorPop,
+    successPop,
+    scanedPop,
+    goodsPop,
+  },
+  data() {
+    return {
+      popText: {
+        errorText: "实际出库数量与应出库数量有差异,是否确认提交?",
+        successText: "出库成功!",
+      },
+      goodsShow: false,
+      scanedShow: false,
+      errorShow: false,
+      successShow: false,
+      value: 0,
+      isUnfold: true, //是否展开
+      info: {
+        mark: "",
+        url: "",
+      },
+      goodsList: [],
+      orderInfo: {},
+      id: "",
+      calendarShow: false,
+      value1: "",
+      maxDate: Number(new Date()),
+      chooseGoodsInfo: {},
+      voucherPicture: "",
+      scanIndex: -1,
+      scanNum: 1,
+      scanMaxNum: 0,
+      status: null,
+    };
+  },
+  onLoad(e) {
+    this.id = e.id;
+    this.status = e.status;
+    this.getOrderDetail(e.id);
+    this.getOrderInfo(e.id);
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    speciesNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        num = this.goodsList.length;
+      }
+      return num;
+    },
+    // 手动输入的数量
+    goodsNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        this.goodsList.forEach((item) => {
+          num += item.materialNumber;
+        });
+      }
+      return num;
+    },
+    // 订单返回的数量
+    orderGoodsNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        this.goodsList.forEach((item) => {
+          num += item.operNumber;
+        });
+      }
+      return num;
+    },
+  },
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      if (this.goodsList.length == 0) return uni.$u.toast("该货物不属于该任务");
+      let index = this.goodsList.findIndex((item) => item.barCode == data);
+      if (index == -1) return uni.$u.toast("该货物不属于该任务");
+      this.scanIndex = index;
+      this.scanNum = this.goodsList[index].materialNumber;
+      this.scanMaxNum = this.goodsList[index].inventory;
+      this.scanedShow = true;
+    });
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
+  },
+  methods: {
+    scanCode() {
+      this.$scan.scanCode();
+    },
+    calendarConfirm(val) {
+      this.goodsList.forEach((item) => {
+        if (item.id == this.chooseGoodsInfo.id) {
+          item.productionDate = this.$u.timeFormat(val.value, "yyyy-mm-dd");
+        }
+      });
+      this.calendarShow = false;
+    },
+    calendarCole() {
+      this.calendarShow = false;
+    },
+    calendarClick(item) {
+      console.log(item.productionDate, "item.productionDate");
+      this.chooseGoodsInfo = item;
+      if (item.productionDate) {
+        this.value1 = Number(new Date(item.productionDate));
+      } else {
+        this.value1 = Number(new Date());
+      }
+      this.calendarShow = true;
+    },
+    getOrderInfo(id) {
+      orderInfo(id).then((res) => {
+        if (res.code == 200) {
+          this.orderInfo = res.data;
+          console.log("this.orderInfo====", this.orderInfo);
+        }
+      });
+    },
+    getOrderDetail(id) {
+      orderDetail(id).then((res) => {
+        if (res.code == 200) {
+          res.data.rows.forEach((item) => {
+            if (item.imgName && item.imgName.length > 0) {
+              item.imgNameArr = item.imgName.split(",");
+            } else {
+              item.imgNameArr = [];
+            }
+            item.materialNumber = 0;
+          });
+          this.goodsList = res.data.rows;
+          console.log("goodsList==========", this.goodsList);
+        }
+      });
+    },
+    submitClick() {
+      let num = 0;
+      console.log("this.goodsList=====", this.goodsList);
+      this.goodsList.forEach((item) => {
+        if (item.materialNumber * 1 != item.operNumber) {
+          num++;
+        }
+      });
+      console.log("num=====", num);
+      if (num > 0) {
+        return (this.errorShow = true);
+      }
+      console.log("111111=====", 1111);
+      this.toOrderSubmit();
+    },
+    toOrderSubmit() {
+      console.log("this.goodsList=====", this.goodsList);
+      let materials = this.goodsList.map((item) => {
+        return {
+          barCode: item.barCode,
+          materialNumber: item.materialNumber,
+          productionDate: item.productionDate
+            ? this.$u.timeFormat(item.productionDate, "yyyy-mm-dd")
+            : "",
+        };
+      });
+      let params = {
+        id: this.id,
+        materials: materials,
+        voucherPicture: this.voucherPicture || "",
+        remark: this.orderInfo.mark || "",
+      };
+      console.log("orderSubmit========params====", params);
+      orderSubmit(params).then((res) => {
+        console.log("orderSubmit============res=====", res);
+        if (res.code == 200) {
+          if (this.errorShow) {
+            this.errorShow = false;
+          }
+          this.successShow = true;
+        } else {
+          uni.showToast({
+            icon: "error",
+            mask: true,
+            title: res.msg || "服务错误",
+          });
+        }
+      });
+    },
+    confirm() {
+      this.toOrderSubmit();
+      this.errorShow = false;
+    },
+    backClick() {
+      uni.setStorageSync("orderRefresh", true);
+      uni.navigateBack();
+    },
+    // 扫码确认
+    scanConfirm(val) {
+      this.goodsList[this.scanIndex].materialNumber = Number(val);
+      this.scanedShow = false;
+    },
+    manualClick() {
+      this.goodsShow = true;
+    },
+    toDetail(val) {
+      uni.navigateTo({
+        url: `/pages/goods/detail?id=${val.id}&name=${val.materialName}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.deliver-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		padding-bottom: 130rpx;
+.deliver-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  padding-bottom: 130rpx;
+
+  .container_main {
+    padding: 24rpx;
 
-		.container_main {
-			padding: 24rpx;
+    .info-box {
+      background-color: #fff;
+      border-radius: 16rpx 16rpx 0 0;
+      padding: 24rpx 24rpx 0 24rpx;
 
-			.info-box {
-				background-color: #fff;
-				border-radius: 16rpx 16rpx 0 0;
-				padding: 24rpx 24rpx 0 24rpx;
+      .info-line {
+        border-bottom: 1px solid #f4f4f4;
+        min-height: 92rpx;
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.info-line {
-					border-bottom: 1px solid #F4F4F4;
-					min-height: 92rpx;
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        &-label {
+          width: 162rpx;
+        }
 
-					&-label {
-						width: 162rpx;
-					}
+        .must-box {
+          color: #ff3b1d;
+        }
+      }
+    }
 
-					.must-box {
-						color: #FF3B1D;
-					}
-				}
-			}
+    .min-height {
+      height: 300rpx;
+      overflow: hidden;
+    }
 
-			.min-height {
-				height: 300rpx;
-				overflow: hidden;
-			}
+    .btn-box {
+      height: 112rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #fff;
+      border-radius: 0 0 16rpx 16rpx;
 
-			.btn-box {
-				height: 112rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				background-color: #fff;
-				border-radius: 0 0 16rpx 16rpx;
+      .btn-cont {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 154rpx;
+        height: 56rpx;
+        border-radius: 120rpx;
+        border: 1px solid #d9d9d9;
+        color: #666;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
 
-				.btn-cont {
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					width: 154rpx;
-					height: 56rpx;
-					border-radius: 120rpx;
-					border: 1px solid #D9D9D9;
-					color: #666;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-				}
-			}
+    .scan-box {
+      margin-top: 24rpx;
+      padding: 24rpx 0;
+      border-radius: 16rpx;
+      background: #fff;
+      display: flex;
 
-			.scan-box {
-				margin-top: 24rpx;
-				padding: 24rpx 0;
-				border-radius: 16rpx;
-				background: #FFF;
-				display: flex;
+      .tips-text {
+        color: #333;
+        font-size: 28rpx;
+        font-weight: 400;
+        line-height: 48rpx;
+      }
 
-				.tips-text {
-					color: #333;
-					font-size: 28rpx;
-					font-weight: 400;
-					line-height: 48rpx;
-				}
+      .tips-text2 {
+        color: #0256ff;
+        font-size: 24rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.tips-text2 {
-					color: #0256FF;
-					font-size: 24rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        .radio-box {
+          width: 32rpx;
+          height: 32rpx;
+          border-radius: 50%;
+          border: 1px solid #d9d9d9;
+          margin-right: 16rpx;
+        }
+      }
 
-					.radio-box {
-						width: 32rpx;
-						height: 32rpx;
-						border-radius: 50%;
-						border: 1px solid #D9D9D9;
-						margin-right: 16rpx;
-					}
-				}
+      .scan-box-l {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        position: relative;
 
-				.scan-box-l {
-					width: 100%;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					position: relative;
+        &::after {
+          content: "";
+          display: block;
+          width: 1px;
+          height: 138rpx;
+          background-color: #f4f4f4;
+          position: absolute;
+          top: 50%;
+          right: 0;
+          transform: translateY(-50%);
+        }
+      }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 1px;
-						height: 138rpx;
-						background-color: #F4F4F4;
-						position: absolute;
-						top: 50%;
-						right: 0;
-						transform: translateY(-50%);
-					}
-				}
+      .scan-box-r {
+        width: 50%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+    }
 
-				.scan-box-r {
-					width: 50%;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-				}
-			}
+    .cargo-list {
+      padding: 24rpx 0;
+      background-color: #fff;
+      margin-top: 24rpx;
+      border-radius: 16rpx;
 
-			.cargo-list {
-				padding: 24rpx 0;
-				background-color: #fff;
-				margin-top: 24rpx;
-				border-radius: 16rpx;
+      .cargo-list-title {
+        font-family: "PingFang SC";
+        font-size: 32rpx;
+        font-style: normal;
+        font-weight: bold;
+        display: flex;
+        align-items: center;
+        position: relative;
+        padding-left: 50rpx;
 
-				.cargo-list-title {
-					font-family: "PingFang SC";
-					font-size: 32rpx;
-					font-style: normal;
-					font-weight: bold;
-					display: flex;
-					align-items: center;
-					position: relative;
-					padding-left: 50rpx;
+        &::after {
+          content: "";
+          display: block;
+          width: 6rpx;
+          height: 30rpx;
+          border-radius: 100px;
+          background: #0256ff;
+          position: absolute;
+          top: 50%;
+          left: 24rpx;
+          transform: translateY(-50%);
+        }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 6rpx;
-						height: 30rpx;
-						border-radius: 100px;
-						background: #0256FF;
-						position: absolute;
-						top: 50%;
-						left: 24rpx;
-						transform: translateY(-50%);
-					}
+        .cargo-list-title-tips {
+          color: #0256ff;
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+      }
 
-					.cargo-list-title-tips {
-						color: #0256FF;
-						font-size: 24rpx;
-						font-weight: 400;
-					}
-				}
+      .num-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0 48rpx 0 26rpx;
+        .num-box-text {
+          color: #666;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+        }
+        .input {
+          width: 112rpx;
+          text-align: center;
+          border-bottom: 1px solid #0256ff;
+          margin: 0 8rpx;
+        }
+        .minus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          border: 1px solid #0256ff;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+        .plus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          background-color: #0256ff;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 
-				.num-box {
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					padding: 0 48rpx 0 26rpx;
-					.num-box-text {
-						color: #666;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-					}
-					.input {
-						width: 112rpx;
-						text-align: center;
-						border-bottom: 1px solid #0256FF;
-						margin: 0 8rpx;
-					}
-					.minus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						border: 1px solid #0256FF;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-					.plus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						background-color: #0256FF;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-				}
-			}
-		}
-		
-		.footer-box {
-			background-color: #fff;
-			height: 126rpx;
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			right: 0;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 0 40rpx 0 60rpx;
-			.footer-box-l {
-				color: #666;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-			}
-			.submitBtn {
-				width: 362rpx;
-				height: 76rpx;
-				border-radius: 16rpx;
-				background: #0256FF;
-				color: #FFF;
-				font-size: 28rpx;
-				font-weight: 500;
-				margin: 0;
-			}
-		}
-		
-	}
-</style>
+  .footer-box {
+    background-color: #fff;
+    height: 126rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 40rpx 0 60rpx;
+    .footer-box-l {
+      color: #666;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    .submitBtn {
+      width: 362rpx;
+      height: 76rpx;
+      border-radius: 16rpx;
+      background: #0256ff;
+      color: #fff;
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 0;
+    }
+  }
+}
+</style>

+ 374 - 349
pages/picking-task/detail.vue

@@ -1,376 +1,401 @@
 <template>
-	<view class="deliver-page">
-		<u-navbar height="40px" title="拣货任务详情" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
-			placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="info-box" :class="isUnfold ? '':'min-height'">
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库单号</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.number}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>发出仓库</text>
-					</view>
-					<view class="info-line-value">
-						{{cangName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库数量</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.goodsQuantity}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库种类</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.goodsTypeCount}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>制单日期</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.createTime}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>制单人</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.createName || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库类型</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.subType}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库人</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.operName || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>备注信息</text>
-					</view>
-					<view class="info-line-value">
-							{{orderInfo.remark || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>出库时间</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.submitTime}}
-					</view>
-				</view>
-				
-				
-			</view>
-			<view class="btn-box">
-				<view class="btn-cont" @click="isUnfold = !isUnfold">
-					<text>{{isUnfold ? '收起' : '展开'}}</text>
-					<u-icon :name="isUnfold?'arrow-up':'arrow-down'"></u-icon>
-				</view>
-			</view>
+  <view class="deliver-page">
+    <u-navbar
+      height="40px"
+      title="拣货任务详情"
+      bgColor="#0256FF"
+      :titleStyle="{ color: '#fff' }"
+      leftIconColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="info-box" :class="isUnfold ? '' : 'min-height'">
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库单号</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.number }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>发出仓库</text>
+          </view>
+          <view class="info-line-value">
+            {{ depotInfo ? depotInfo.depotName : "" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库数量</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.goodsQuantity }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库种类</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.goodsTypeCount }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>制单日期</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.createTime }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>制单人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.createName || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库类型</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.subType }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.operName || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>备注信息</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.remark || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>出库时间</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.submitTime }}
+          </view>
+        </view>
+      </view>
+      <view class="btn-box">
+        <view class="btn-cont" @click="isUnfold = !isUnfold">
+          <text>{{ isUnfold ? "收起" : "展开" }}</text>
+          <u-icon :name="isUnfold ? 'arrow-up' : 'arrow-down'"></u-icon>
+        </view>
+      </view>
 
-			<!-- 货物清单 -->
-			<view class="cargo-list">
-				<view class="cargo-list-title">
-					<view>出库货物清单</view>
-					<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
-				</view>
-				<block v-for="(item,i) in goodsList" :key="i">
-					<good-item :item="item" @toDetail="toDetail" :show-print="true" @print="(e) => handlePrint(e.id,'2',status)">
-						<view class="num-box">
-							<view class="num-box-text">已确认出库数量</view>
-							<u-number-box v-model="item.actualQuantityInStorage" disabled  min="0" :inputWidth="56" :max="item.inventory">
-								<!-- <view slot="minus" class="minus">
+      <!-- 货物清单 -->
+      <view class="cargo-list">
+        <view class="cargo-list-title">
+          <view>出库货物清单</view>
+          <view class="cargo-list-title-tips">(轻触货物查看详情)</view>
+        </view>
+        <block v-for="(item, i) in goodsList" :key="i">
+          <good-item
+            :item="item"
+            @toDetail="toDetail"
+            :show-print="true"
+            @print="(e) => handlePrint(e.id, '2', status)"
+          >
+            <view class="num-box">
+              <view class="num-box-text">已确认出库数量</view>
+              <u-number-box
+                v-model="item.actualQuantityInStorage"
+                disabled
+                min="0"
+                :inputWidth="56"
+                :max="item.inventory"
+              >
+                <!-- <view slot="minus" class="minus">
 									<u-icon name="minus" color="#DADADA" size="12"></u-icon>
 								</view>
 								<text slot="input" class="input">{{(item.actualQuantityInStorage * 1).toFixed(0) || 0}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view> -->
-							</u-number-box>
-						</view>
-					</good-item>
-				</block>
-			</view>
-		</view>
-		<!-- 打印条码弹框 -->
-		<print-pop :show.sync="blePrintPop.show" :info="blePrintPop.data" @confirm="startPrint"></print-pop>
-		<!-- 选择蓝牙设备弹框 -->
-		<ble-pop :show.sync="bleSelectPop.show" :list="discoveredDevices" @close="closeBleSelectPop" @refresh="refreshBleDevice" @selectItem="handleSelectBle"></ble-pop>
-		
-		<ble-tip-pop v-model="bleErrorTipPop.show" :is-center="true" @confirm="bleErrorTipConfirm" :content="bleErrorTipPop.content" :extraText="bleErrorTipPop.extraText"> </ble-tip-pop>
-	</view>
+              </u-number-box>
+            </view>
+          </good-item>
+        </block>
+      </view>
+    </view>
+    <!-- 打印条码弹框 -->
+    <print-pop
+      :show.sync="blePrintPop.show"
+      :info="blePrintPop.data"
+      @confirm="startPrint"
+    ></print-pop>
+    <!-- 选择蓝牙设备弹框 -->
+    <ble-pop
+      :show.sync="bleSelectPop.show"
+      :list="discoveredDevices"
+      @close="closeBleSelectPop"
+      @refresh="refreshBleDevice"
+      @selectItem="handleSelectBle"
+    ></ble-pop>
+
+    <ble-tip-pop
+      v-model="bleErrorTipPop.show"
+      :is-center="true"
+      @confirm="bleErrorTipConfirm"
+      :content="bleErrorTipPop.content"
+      :extraText="bleErrorTipPop.extraText"
+    >
+    </ble-tip-pop>
+  </view>
 </template>
 
 <script>
-	import goodItem from '@/components/good-item/good-item.vue'
-	import {orderDetail, orderInfo} from '@/common/request/apis/purchase'
-	import {mapGetters} from 'vuex'
-	import blePrintMixin from '@/common/mixins/blePrintMixin.js'
-	export default {
-		mixins: [blePrintMixin],
-		components: {
-			goodItem,
-		},
-		data() {
-			return {
-				errorShow:false,
-				successShow:false,
-				isUnfold: true, //是否展开
-				orderInfo: {},
-				goodsList: [],
-				status: null
-			}
-		},
-		onLoad(e) {
-			this.status = e.status
-			this.getOrderInfo(e.id)
-			this.getOrderDetail(e.id)
-		},
-		computed:{
-			...mapGetters(['cangName'])
-		},
-		methods:{
-		getOrderInfo(id) {
-			orderInfo(id)
-			.then(res=>{
-				if(res.code == 200) {
-					this.orderInfo = res.data
-				}
-			})
-		},
-		getOrderDetail(id) {
-			orderDetail(id)
-			.then(res=>{
-				if(res.code == 200) {
-					res.data.rows.forEach(item=>{
-						if(item.imgName && item.imgName.length >0) {
-							item.imgNameArr = item.imgName.split(",")
-						}else {
-							item.imgNameArr = []
-						}
-						item.materialNumber = 0
-					})
-					this.goodsList = res.data.rows
-				}
-			})
-		},
-			submitClick() {
-				
-			},
-			confirm() {
-				this.errorShow = false
-			},
-			backClick() {
-				
-			},
-			// 扫码确认
-			scanConfirm() {
-				
-			},
-			manualClick() {
-				this.goodsShow = true
-			},
-			toDetail(val) {
-				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`
-				})
-			}
-		}
-	}
+import goodItem from "@/components/good-item/good-item.vue";
+import { orderDetail, orderInfo } from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+
+export default {
+  mixins: [blePrintMixin],
+  components: {
+    goodItem,
+  },
+  data() {
+    return {
+      errorShow: false,
+      successShow: false,
+      isUnfold: true, //是否展开
+      orderInfo: {},
+      goodsList: [],
+      status: null,
+    };
+  },
+  onLoad(e) {
+    this.status = e.status;
+    this.getOrderInfo(e.id);
+    this.getOrderDetail(e.id);
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+  },
+  methods: {
+    getOrderInfo(id) {
+      orderInfo(id).then((res) => {
+        if (res.code == 200) {
+          this.orderInfo = res.data;
+        }
+      });
+    },
+    getOrderDetail(id) {
+      orderDetail(id).then((res) => {
+        if (res.code == 200) {
+          res.data.rows.forEach((item) => {
+            if (item.imgName && item.imgName.length > 0) {
+              item.imgNameArr = item.imgName.split(",");
+            } else {
+              item.imgNameArr = [];
+            }
+            item.materialNumber = 0;
+          });
+          this.goodsList = res.data.rows;
+        }
+      });
+    },
+    submitClick() {},
+    confirm() {
+      this.errorShow = false;
+    },
+    backClick() {},
+    // 扫码确认
+    scanConfirm() {},
+    manualClick() {
+      this.goodsShow = true;
+    },
+    toDetail(val) {
+      uni.navigateTo({
+        url: `/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.deliver-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		padding-bottom: 130rpx;
+.deliver-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  padding-bottom: 130rpx;
+
+  .container_main {
+    padding: 24rpx;
 
-		.container_main {
-			padding: 24rpx;
+    .info-box {
+      background-color: #fff;
+      border-radius: 16rpx 16rpx 0 0;
+      padding: 24rpx 24rpx 0 24rpx;
 
-			.info-box {
-				background-color: #fff;
-				border-radius: 16rpx 16rpx 0 0;
-				padding: 24rpx 24rpx 0 24rpx;
+      .info-line {
+        border-bottom: 1px solid #f4f4f4;
+        min-height: 92rpx;
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.info-line {
-					border-bottom: 1px solid #F4F4F4;
-					min-height: 92rpx;
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        &-label {
+          width: 162rpx;
+        }
 
-					&-label {
-						width: 162rpx;
-					}
+        .must-box {
+          color: #ff3b1d;
+        }
+      }
+    }
 
-					.must-box {
-						color: #FF3B1D;
-					}
-				}
-			}
+    .min-height {
+      height: 300rpx;
+      overflow: hidden;
+    }
 
-			.min-height {
-				height: 300rpx;
-				overflow: hidden;
-			}
+    .btn-box {
+      height: 112rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #fff;
+      border-radius: 0 0 16rpx 16rpx;
 
-			.btn-box {
-				height: 112rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				background-color: #fff;
-				border-radius: 0 0 16rpx 16rpx;
+      .btn-cont {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 154rpx;
+        height: 56rpx;
+        border-radius: 120rpx;
+        border: 1px solid #d9d9d9;
+        color: #666;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
 
-				.btn-cont {
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					width: 154rpx;
-					height: 56rpx;
-					border-radius: 120rpx;
-					border: 1px solid #D9D9D9;
-					color: #666;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-				}
-			}
+    .cargo-list {
+      padding: 24rpx 0;
+      background-color: #fff;
+      margin-top: 24rpx;
+      border-radius: 16rpx;
 
-			.cargo-list {
-				padding: 24rpx 0;
-				background-color: #fff;
-				margin-top: 24rpx;
-				border-radius: 16rpx;
+      .cargo-list-title {
+        font-family: "PingFang SC";
+        font-size: 32rpx;
+        font-style: normal;
+        font-weight: bold;
+        display: flex;
+        align-items: center;
+        position: relative;
+        padding-left: 50rpx;
 
-				.cargo-list-title {
-					font-family: "PingFang SC";
-					font-size: 32rpx;
-					font-style: normal;
-					font-weight: bold;
-					display: flex;
-					align-items: center;
-					position: relative;
-					padding-left: 50rpx;
+        &::after {
+          content: "";
+          display: block;
+          width: 6rpx;
+          height: 30rpx;
+          border-radius: 100px;
+          background: #0256ff;
+          position: absolute;
+          top: 50%;
+          left: 24rpx;
+          transform: translateY(-50%);
+        }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 6rpx;
-						height: 30rpx;
-						border-radius: 100px;
-						background: #0256FF;
-						position: absolute;
-						top: 50%;
-						left: 24rpx;
-						transform: translateY(-50%);
-					}
+        .cargo-list-title-tips {
+          color: #0256ff;
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+      }
 
-					.cargo-list-title-tips {
-						color: #0256FF;
-						font-size: 24rpx;
-						font-weight: 400;
-					}
-				}
+      .num-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0 48rpx 0 26rpx;
+        .num-box-text {
+          color: #666;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+        }
+        .input {
+          width: 112rpx;
+          text-align: center;
+          border-bottom: 1px solid #dadada;
+          margin: 0 8rpx;
+        }
+        .minus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          border: 1px solid #dadada;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+        .plus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          background-color: #dadada;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 
-				.num-box {
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					padding: 0 48rpx 0 26rpx;
-					.num-box-text {
-						color: #666;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-					}
-					.input {
-						width: 112rpx;
-						text-align: center;
-						border-bottom: 1px solid #DADADA;
-						margin: 0 8rpx;
-					}
-					.minus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						border: 1px solid #DADADA;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-					.plus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						background-color: #DADADA;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-				}
-			}
-		}
-		
-		.footer-box {
-			background-color: #fff;
-			height: 126rpx;
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			right: 0;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 0 40rpx 0 60rpx;
-			.footer-box-l {
-				color: #666;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-			}
-			.submitBtn {
-				width: 362rpx;
-				height: 76rpx;
-				border-radius: 16rpx;
-				background: #0256FF;
-				color: #FFF;
-				font-size: 28rpx;
-				font-weight: 500;
-				margin: 0;
-			}
-		}
-	}
-	
-</style>
+  .footer-box {
+    background-color: #fff;
+    height: 126rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 40rpx 0 60rpx;
+    .footer-box-l {
+      color: #666;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    .submitBtn {
+      width: 362rpx;
+      height: 76rpx;
+      border-radius: 16rpx;
+      background: #0256ff;
+      color: #fff;
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 0;
+    }
+  }
+}
+</style>

+ 339 - 317
pages/picking-task/index.vue

@@ -1,324 +1,346 @@
 <template>
-	<view class="picking-task-page">
-		<u-navbar height="40px" title="拣货任务" bgColor="#F0F6FB" autoBack placeholder>
-			<view class="u-nav-slot btn-right" slot="right" @click="stashClick">
-				<view class="cang-name">{{cangName}}</view>
-				<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-			</view>
-		</u-navbar>
-		<view class="container_main">
-			<u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
-				<view class="search-box">
-					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick" @clear="searchClick"></u-search>
-					<view class="flex_box" @click="scanCode">
-						<view class="scan-text">扫描单据二维码</view>
-						<view class="scan-icon">
-							<image src="@/static/image/scan-icon.png" mode=""></image>
-						</view>
-					</view>
-				</view>
-				<view class="type-box flex_box">
-					<view class="type-item" @click="tabClick(1)">
-						<view class="type-val">{{type1}}</view>
-						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-					</view>
-					<view class="type-item" @click="tabClick(2)">
-						<view class="type-val">{{type2}}</view>
-						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-					</view>
-				</view>
-			</u-sticky>
-			<view class="task-cont">
-				<block v-for="(item,i) in taskList" :key="i">
-					<task-item :item="item" @toStorage="toStorage" @toDetail="toDetail" :key="`${item.id}-${item.status}`"></task-item>
-				</block>
-				<u-loadmore v-if="taskList.length > 0" :status="status" />
-				<u-empty mode="data" text="暂无内容" marginTop="60" icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png" v-if="taskList.length == 0"></u-empty>
-			</view>
-		</view>
-		<!-- 中心仓弹窗 -->
-		<u-picker :show="stashShow" keyName="label" :defaultIndex="defaultIndex" :columns="stashColumns" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
-		<!-- 状态 -->
-		<u-picker :show="statusShow" keyName="label" :defaultIndex="defaultIndex2" :columns="statusColumns" @confirm="statusConfirm" @cancel="statusShow= false"></u-picker>
-		<!-- 月份 -->
-		<u-picker :show="dateShow" :defaultIndex="defaultIndex3" :columns="dateColumns" @confirm="dateConfirm" @cancel="dateShow= false"></u-picker>
-		
-	</view>
+  <view class="picking-task-page">
+    <u-navbar
+      height="40px"
+      title="拣货任务"
+      bgColor="#F0F6FB"
+      autoBack
+      placeholder
+    >
+      <view class="u-nav-slot depot-label" slot="right">
+        <view class="name">{{ curDepotName }}</view>
+      </view>
+    </u-navbar>
+    <view class="container_main">
+      <u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
+        <view class="search-box">
+          <u-search
+            placeholder="请输入单据编号"
+            bgColor="#fff"
+            shape="square"
+            v-model="params.number"
+            :showAction="false"
+            @search="searchClick"
+            @clear="searchClick"
+          ></u-search>
+          <view class="flex_box" @click="scanCode">
+            <view class="scan-text">扫描单据二维码</view>
+            <view class="scan-icon">
+              <image src="@/static/image/scan-icon.png" mode=""></image>
+            </view>
+          </view>
+        </view>
+        <view class="type-box flex_box">
+          <view class="type-item" @click="tabClick(1)">
+            <view class="type-val">{{ type1 }}</view>
+            <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+          </view>
+          <view class="type-item" @click="tabClick(2)">
+            <view class="type-val">{{ type2 }}</view>
+            <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+          </view>
+        </view>
+      </u-sticky>
+      <view class="task-cont">
+        <block v-for="(item, i) in taskList" :key="i">
+          <task-item
+            :item="item"
+            @toStorage="toStorage"
+            @toDetail="toDetail"
+            :key="`${item.id}-${item.status}`"
+          ></task-item>
+        </block>
+        <u-loadmore v-if="taskList.length > 0" :status="status" />
+        <u-empty
+          mode="data"
+          text="暂无内容"
+          marginTop="60"
+          icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
+          v-if="taskList.length == 0"
+        ></u-empty>
+      </view>
+    </view>
+    <!-- 状态 -->
+    <u-picker
+      :show="statusShow"
+      keyName="label"
+      :defaultIndex="defaultIndex2"
+      :columns="statusColumns"
+      @confirm="statusConfirm"
+      @cancel="statusShow = false"
+    ></u-picker>
+    <!-- 月份 -->
+    <u-picker
+      :show="dateShow"
+      :defaultIndex="defaultIndex3"
+      :columns="dateColumns"
+      @confirm="dateConfirm"
+      @cancel="dateShow = false"
+    ></u-picker>
+  </view>
 </template>
 
 <script>
-	var main, receiver, filter;
-	var _codeQueryTag = false;
-	import taskItem from './components/task-item.vue'
-	import {saleOrder} from '@/common/request/apis/picking'
-	import {orderStartHandle, depotSpinnerList} from '@/common/request/apis/purchase'
-	export default{
-		components:{
-			taskItem
-		},
-		data() {
-			return {
-				offsetTop:0,
-				cangName:'',
-				type1:'全部',
-				type2:'月份',
-				stashShow:false,
-				statusShow:false,
-				dateShow:false,
-				stashColumns:[],
-				statusColumns:[
-					[{
-						label:'全部',
-						id:''
-					},{
-						label:'待拣货',
-						id:'1'
-					},{
-						label:'拣货中',
-						id:'4'
-					},{
-						label:'已拣货',
-						id:'2'
-					}]
-				],
-				dateColumns:[
-					['全年','一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
-				],
-				defaultIndex:[],
-				defaultIndex2:[],
-				defaultIndex3:[],
-				taskList:[],
-				params:{
-					beginTime:'',
-					endTime:'',
-					number:'',
-					status:'',
-					currentPage:1,
-					pageSize:10
-				},
-				status:'loadmore',
-				lastPage:1,
-			}
-		},
-		onLoad() {
-			let systemInfo = uni.getSystemInfoSync();
-			let statusBarHeight = systemInfo.statusBarHeight;
-			this.offsetTop = statusBarHeight + 40
-			this.init()
-			this.getDepotSpinnerList()
-		},
-		onHide() {
-			uni.$off('scanFinish')
-		},
-		onUnload() {
-			uni.$off('scanFinish')
-		},
-		onReachBottom() {
-			if(this.params.currentPage < this.lastPage) {
-				this.params.currentPage ++
-				this.getSaleOrder()
-			}
-		},
-		onShow() {
-			uni.$on('scanFinish',(data)=>{
-				this.params.number = data
-				this.init()
-			})
-			if(uni.getStorageSync('orderRefresh')) {
-				this.init()
-				uni.removeStorageSync('orderRefresh')
-			}
-		},
-		methods:{
-			getDepotSpinnerList() {
-				depotSpinnerList()
-				.then(res=>{
-					if(res.code == 200) {
-						this.stashColumns = [res.data]
-						this.cangName = res.data[0].label
-						this.$store.commit('setcangName', this.cangName)
-						this.$store.commit("setDepotInfo", {
-							depotName: res.data[0].label,
-							id: res.data[0].value,
-						});
-					}
-				})
-			},
-			scanCode() {
-				this.$scan.scanCode()
-			},
-			init() {
-				uni.showLoading()
-				this.params.currentPage = 1
-				this.taskList = []
-				this.getSaleOrder()
-			},
-			searchClick() {
-				this.init()
-			},
-			tabClick(type) {
-				if(type == 1) {
-					this.defaultIndex = this.getDefaultIndex(this.type1,this.statusColumns)
-					this.statusShow = true
-				}else {
-					this.defaultIndex = this.getDefaultIndex(this.type2,this.dateColumns)
-					this.dateShow = true
-				}
-			},
-			getSaleOrder() {
-				saleOrder(this.params)
-				.then(res=>{
-					if(res.code == 200) {
-						this.status = 'loading';
-						this.lastPage =  Math.ceil(res.data.total * 1 / this.params.pageSize)
-						if(this.params.currentPage < this.lastPage) {
-							this.status = 'loadmore'
-						}else {
-							this.status = 'nomore'
-						}
-						this.taskList =[...this.taskList,...res.data.rows];
-						console.log('taskList========',res.data.rows)
-					}
-					uni.hideLoading()
-				})
-				.catch(err=>{
-					uni.hideLoading()
-				})
-			},
-			stashClick() {
-				this.defaultIndex = this.getDefaultIndex(this.cangName,this.stashColumns)
-				this.stashShow = true
-			},
-			pickerConfirm(val) {
-				this.cangName = val.value[0].label
-				this.stashShow = false
-				this.$store.commit('setcangName', this.cangName)
-				this.$store.commit("setDepotInfo", {
-					depotName: val.value[0].label,
-					id: val.value[0].value,
-				});
-			},
-			statusConfirm(val) {
-				this.type1 = val.value[0].label
-				this.params.status = val.value[0].id
-				this.statusShow = false
-				this.init()
-			},
-			dateConfirm(val) {
-				this.type2 = val.value[0]
-				this.dateShow = false
-				let month = val.indexs[0]
-				this.getLastDayOfMonth(month)
-				this.init()
-			},
-			// 获取开始时间、结束时间
-			getLastDayOfMonth(month) {
-				let year = new Date().getFullYear()
-				if(month !=0) {
-					let monthStart = new Date(year, month, 0).getDate();
-					this.params.beginTime = `${year}-${month}-01`
-					this.params.endTime = `${year}-${month}-${monthStart}`
-				}else {
-					this.params.beginTime = ''
-					this.params.endTime = ''
-				}
-			},
-			// 获取picker默认index
-			getDefaultIndex(val,list) {
-				let arr = []
-				let index = list[0].findIndex(item=>item.label == val)
-				arr = [index]
-				return arr
-			},
-			// 点击操作
-			toOrderStartHandle(id) {
-				orderStartHandle(id)
-				.then(res=>{
-					if(res.code == 200) {
-						uni.navigateTo({
-							url:`/pages/picking-task/delivery?id=${id}`
-						})
-					}
-				})
-			},
-			// 出库
-			toStorage(val) {
-				this.toOrderStartHandle(val.id)
-			},
-			toDetail(val) {
-				console.log(val,'val')
-				uni.navigateTo({
-					url:`/pages/picking-task/detail?id=${val.id}`
-				})
-			}
-		}
-	}
+import taskItem from "./components/task-item.vue";
+import { saleOrder } from "@/common/request/apis/picking";
+import { orderStartHandle } from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+
+export default {
+  components: {
+    taskItem,
+  },
+  data() {
+    return {
+      offsetTop: 0,
+      type1: "全部",
+      type2: "月份",
+      statusShow: false,
+      dateShow: false,
+      statusColumns: [
+        [
+          {
+            label: "全部",
+            id: "",
+          },
+          {
+            label: "待拣货",
+            id: "1",
+          },
+          {
+            label: "拣货中",
+            id: "4",
+          },
+          {
+            label: "已拣货",
+            id: "2",
+          },
+        ],
+      ],
+      dateColumns: [
+        [
+          "全年",
+          "一月",
+          "二月",
+          "三月",
+          "四月",
+          "五月",
+          "六月",
+          "七月",
+          "八月",
+          "九月",
+          "十月",
+          "十一月",
+          "十二月",
+        ],
+      ],
+      defaultIndex2: [],
+      defaultIndex3: [],
+      taskList: [],
+      params: {
+        beginTime: "",
+        endTime: "",
+        number: "",
+        status: "",
+        currentPage: 1,
+        pageSize: 10,
+      },
+      status: "loadmore",
+      lastPage: 1,
+    };
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
+  onLoad() {
+    let systemInfo = uni.getSystemInfoSync();
+    let statusBarHeight = systemInfo.statusBarHeight;
+    this.offsetTop = statusBarHeight + 40;
+    this.init();
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
+  },
+  onReachBottom() {
+    if (this.params.currentPage < this.lastPage) {
+      this.params.currentPage++;
+      this.getSaleOrder();
+    }
+  },
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      this.params.number = data;
+      this.init();
+    });
+    if (uni.getStorageSync("orderRefresh")) {
+      this.init();
+      uni.removeStorageSync("orderRefresh");
+    }
+  },
+  methods: {
+    scanCode() {
+      this.$scan.scanCode();
+    },
+    init() {
+      uni.showLoading();
+      this.params.currentPage = 1;
+      this.taskList = [];
+      this.getSaleOrder();
+    },
+    searchClick() {
+      this.init();
+    },
+    tabClick(type) {
+      switch (type) {
+        case 1:
+          this.statusShow = true;
+          break;
+        case 2:
+          this.dateShow = true;
+          break;
+        default:
+          break;
+      }
+    },
+    getSaleOrder() {
+      saleOrder({ ...this.params, depotId: this.curDepotId })
+        .then((res) => {
+          if (res.code == 200) {
+            this.status = "loading";
+            this.lastPage = Math.ceil(
+              (res.data.total * 1) / this.params.pageSize
+            );
+            if (this.params.currentPage < this.lastPage) {
+              this.status = "loadmore";
+            } else {
+              this.status = "nomore";
+            }
+            this.taskList = [...this.taskList, ...res.data.rows];
+            console.log("taskList========", res.data.rows);
+          }
+          uni.hideLoading();
+        })
+        .catch((err) => {
+          uni.hideLoading();
+        });
+    },
+    statusConfirm(val) {
+      this.type1 = val.value[0].label;
+      this.params.status = val.value[0].id;
+      this.statusShow = false;
+      this.init();
+    },
+    dateConfirm(val) {
+      this.type2 = val.value[0];
+      this.dateShow = false;
+      let month = val.indexs[0];
+      this.getLastDayOfMonth(month);
+      this.init();
+    },
+    // 获取开始时间、结束时间
+    getLastDayOfMonth(month) {
+      let year = new Date().getFullYear();
+      if (month != 0) {
+        let monthStart = new Date(year, month, 0).getDate();
+        this.params.beginTime = `${year}-${month}-01`;
+        this.params.endTime = `${year}-${month}-${monthStart}`;
+      } else {
+        this.params.beginTime = "";
+        this.params.endTime = "";
+      }
+    },
+    // 获取picker默认index
+    getDefaultIndex(val, list) {
+      let arr = [];
+      let index = list[0].findIndex((item) => item.label == val);
+      arr = [index];
+      return arr;
+    },
+    // 点击操作
+    toOrderStartHandle(id) {
+      orderStartHandle(id).then((res) => {
+        if (res.code == 200) {
+          uni.navigateTo({
+            url: `/pages/picking-task/delivery?id=${id}`,
+          });
+        }
+      });
+    },
+    // 出库
+    toStorage(val) {
+      this.toOrderStartHandle(val.id);
+    },
+    toDetail(val) {
+      console.log(val, "val");
+      uni.navigateTo({
+        url: `/pages/picking-task/detail?id=${val.id}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.btn-right {
-		display: flex;
-		align-items: center;
-		.cang-name {
-			color: #0256FF;
-			text-align: center;
-			font-family: "PingFang SC";
-			font-size: 28rpx;
-			font-weight: 600;
-			margin-right: 10rpx;
-		}
-	}
-	.picking-task-page {
-		min-height: 100vh;
-		background: #F0F6FB;
-		.container_main {
-			.search-box {
-				display: flex;
-				align-items: center;
-				padding: 0 32rpx;
-				.scan-text {
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 24rpx;
-					font-weight: 400;
-					margin-right: 20rpx;
-					margin-left: 30rpx;
-				}
-				.scan-icon {
-					width: 36rpx;
-					height: 36rpx;
-					background-color: #fff;
-					border-radius: 50%;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					image {
-						width: 24rpx;
-						height: 24rpx;
-					}
-				}
-			}
-		
-			.type-box {
-				.type-item {
-					width: 50%;
-					height: 88rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					.type-val {
-						color: #000;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-						margin-right: 10rpx;
-					}
-				}
-			}
-			
-			.task-cont {
-				padding: 0 24rpx;
-			}
-		}
-	}
-</style>
+.picking-task-page {
+  min-height: 100vh;
+  background: #f0f6fb;
+  .container_main {
+    .search-box {
+      display: flex;
+      align-items: center;
+      padding: 0 32rpx;
+      .scan-text {
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 24rpx;
+        font-weight: 400;
+        margin-right: 20rpx;
+        margin-left: 30rpx;
+      }
+      .scan-icon {
+        width: 36rpx;
+        height: 36rpx;
+        background-color: #fff;
+        border-radius: 50%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        image {
+          width: 24rpx;
+          height: 24rpx;
+        }
+      }
+    }
+
+    .type-box {
+      .type-item {
+        width: 50%;
+        height: 88rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        .type-val {
+          color: #000;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+          margin-right: 10rpx;
+        }
+      }
+    }
+
+    .task-cont {
+      padding: 0 24rpx;
+    }
+  }
+}
+</style>

+ 380 - 357
pages/purchase/detail.vue

@@ -1,384 +1,407 @@
 <template>
-	<view class="deliver-page">
-		<u-navbar height="40px" title="采购订单详情" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
-			placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="info-box" :class="isUnfold ? '':'min-height'">
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库单号</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.number}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>收入仓库</text>
-					</view>
-					<view class="info-line-value">
-						{{cangName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>供应商</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.supplierName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库数量</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.goodsQuantity}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库种类</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.goodsTypeCount}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>制单日期</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.createTime}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>制单人</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.createName || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库类型</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.subType}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库人</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.operName || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>备注信息</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.remark || '-'}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库时间</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.operTime}}
-					</view>
-				</view>
-				
-				
-			</view>
-			<view class="btn-box">
-				<view class="btn-cont" @click="isUnfold = !isUnfold">
-					<text>{{isUnfold ? '收起' : '展开'}}</text>
-					<u-icon :name="isUnfold?'arrow-up':'arrow-down'"></u-icon>
-				</view>
-			</view>
+  <view class="deliver-page">
+    <u-navbar
+      height="40px"
+      title="采购订单详情"
+      bgColor="#0256FF"
+      :titleStyle="{ color: '#fff' }"
+      leftIconColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="info-box" :class="isUnfold ? '' : 'min-height'">
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库单号</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.number }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>收入仓库</text>
+          </view>
+          <view class="info-line-value">
+            {{ depotInfo ? depotInfo.depotName : "" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>供应商</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.supplierName }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库数量</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.goodsQuantity }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库种类</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.goodsTypeCount }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>制单日期</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.createTime }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>制单人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.createName || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库类型</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.subType }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.operName || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>备注信息</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.remark || "-" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库时间</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.operTime }}
+          </view>
+        </view>
+      </view>
+      <view class="btn-box">
+        <view class="btn-cont" @click="isUnfold = !isUnfold">
+          <text>{{ isUnfold ? "收起" : "展开" }}</text>
+          <u-icon :name="isUnfold ? 'arrow-up' : 'arrow-down'"></u-icon>
+        </view>
+      </view>
 
-			<!-- 货物清单 -->
-			<view class="cargo-list">
-				<view class="cargo-list-title">
-					<view>入库货物清单</view>
-					<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
-				</view>
-				<block v-for="(item,i) in goodsList" :key="i">
-					<good-item :item="item" @toDetail="toDetail" :show-print="true" @print="(e) => handlePrint(e.id,'1',status)">
-						<view class="num-box">
-							<view class="num-box-text">已确认入库数量</view>
-							<u-number-box v-model="item.actualQuantityInStorage" disabled :inputWidth="56">
-								<!-- <view slot="minus" class="minus">
+      <!-- 货物清单 -->
+      <view class="cargo-list">
+        <view class="cargo-list-title">
+          <view>入库货物清单</view>
+          <view class="cargo-list-title-tips">(轻触货物查看详情)</view>
+        </view>
+        <block v-for="(item, i) in goodsList" :key="i">
+          <good-item
+            :item="item"
+            @toDetail="toDetail"
+            :show-print="true"
+            @print="(e) => handlePrint(e.id, '1', status)"
+          >
+            <view class="num-box">
+              <view class="num-box-text">已确认入库数量</view>
+              <u-number-box
+                v-model="item.actualQuantityInStorage"
+                disabled
+                :inputWidth="56"
+              >
+                <!-- <view slot="minus" class="minus">
 									<u-icon name="minus" color="#DADADA" size="12"></u-icon>
 								</view>
 								<text slot="input" class="input">{{item.actualQuantityInStorage ? (item.actualQuantityInStorage*1).toFixed(0) : 0}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view> -->
-							</u-number-box>
-						</view>
-					</good-item>
-				</block>
-			</view>
-		</view>
-		<!-- 打印条码弹框 -->
-		<print-pop :show.sync="blePrintPop.show" :info="blePrintPop.data" @confirm="startPrint"></print-pop>
-		<!-- 选择蓝牙设备弹框 -->
-		<ble-pop :show.sync="bleSelectPop.show" :list="discoveredDevices" @close="closeBleSelectPop" @refresh="refreshBleDevice" @selectItem="handleSelectBle"></ble-pop>
-		
-		<ble-tip-pop v-model="bleErrorTipPop.show" :is-center="true" @confirm="bleErrorTipConfirm" :content="bleErrorTipPop.content" :extraText="bleErrorTipPop.extraText"> </ble-tip-pop>
-	</view>
+              </u-number-box>
+            </view>
+          </good-item>
+        </block>
+      </view>
+    </view>
+    <!-- 打印条码弹框 -->
+    <print-pop
+      :show.sync="blePrintPop.show"
+      :info="blePrintPop.data"
+      @confirm="startPrint"
+    ></print-pop>
+    <!-- 选择蓝牙设备弹框 -->
+    <ble-pop
+      :show.sync="bleSelectPop.show"
+      :list="discoveredDevices"
+      @close="closeBleSelectPop"
+      @refresh="refreshBleDevice"
+      @selectItem="handleSelectBle"
+    ></ble-pop>
+
+    <ble-tip-pop
+      v-model="bleErrorTipPop.show"
+      :is-center="true"
+      @confirm="bleErrorTipConfirm"
+      :content="bleErrorTipPop.content"
+      :extraText="bleErrorTipPop.extraText"
+    >
+    </ble-tip-pop>
+  </view>
 </template>
 
 <script>
-	import goodItem from '@/components/good-item/good-item.vue'
-	import {orderDetail, orderInfo} from '@/common/request/apis/purchase'
-	import {mapGetters} from 'vuex'
-	import blePrintMixin from '@/common/mixins/blePrintMixin.js'
-	export default {
-		mixins: [blePrintMixin],
-		components: {
-			goodItem,
-		},
-		data() {
-			return {
-				errorShow:false,
-				successShow:false,
-				value:0,
-				isUnfold: true, //是否展开
-				orderInfo: {},
-				goodsList: [],
-				status: null
-			}
-		},
-		onLoad(e) {
-			this.status = e.status
-			this.getOrderInfo(e.id)
-			this.getOrderDetail(e.id)
-		},
-		computed:{
-			...mapGetters(['cangName']),
-		},
-		methods:{
-			getOrderInfo(id) {
-				orderInfo(id)
-				.then(res=>{
-					if(res.code == 200) {
-						this.orderInfo = res.data
-					}
-				})
-			},
-			getOrderDetail(id) {
-				orderDetail(id)
-				.then(res=>{
-					if(res.code == 200) {
-						res.data.rows.forEach(item=>{
-							if(item.imgName && item.imgName.length >0) {
-								item.imgNameArr = item.imgName.split(",")
-							}else {
-								item.imgNameArr = []
-							}
-						})
-						this.goodsList = res.data.rows
-						console.log('this.goodsList==========',this.goodsList)
-					}
-				})
-			},
-			submitClick() {
-				
-			},
-			confirm() {
-				this.errorShow = false
-			},
-			backClick() {
-				
-			},
-			// 扫码确认
-			scanConfirm() {
-				
-			},
-			manualClick() {
-				this.goodsShow = true
-			},
-			toDetail(val) {
-				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`
-				})
-			}
-		}
-	}
+import goodItem from "@/components/good-item/good-item.vue";
+import { orderDetail, orderInfo } from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+export default {
+  mixins: [blePrintMixin],
+  components: {
+    goodItem,
+  },
+  data() {
+    return {
+      errorShow: false,
+      successShow: false,
+      value: 0,
+      isUnfold: true, //是否展开
+      orderInfo: {},
+      goodsList: [],
+      status: null,
+    };
+  },
+  onLoad(e) {
+    this.status = e.status;
+    this.getOrderInfo(e.id);
+    this.getOrderDetail(e.id);
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+  },
+  methods: {
+    getOrderInfo(id) {
+      orderInfo(id).then((res) => {
+        if (res.code == 200) {
+          this.orderInfo = res.data;
+        }
+      });
+    },
+    getOrderDetail(id) {
+      orderDetail(id).then((res) => {
+        if (res.code == 200) {
+          res.data.rows.forEach((item) => {
+            if (item.imgName && item.imgName.length > 0) {
+              item.imgNameArr = item.imgName.split(",");
+            } else {
+              item.imgNameArr = [];
+            }
+          });
+          this.goodsList = res.data.rows;
+          console.log("this.goodsList==========", this.goodsList);
+        }
+      });
+    },
+    submitClick() {},
+    confirm() {
+      this.errorShow = false;
+    },
+    backClick() {},
+    // 扫码确认
+    scanConfirm() {},
+    manualClick() {
+      this.goodsShow = true;
+    },
+    toDetail(val) {
+      uni.navigateTo({
+        url: `/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.deliver-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		padding-bottom: 130rpx;
+.deliver-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  padding-bottom: 130rpx;
+
+  .container_main {
+    padding: 24rpx;
 
-		.container_main {
-			padding: 24rpx;
+    .info-box {
+      background-color: #fff;
+      border-radius: 16rpx 16rpx 0 0;
+      padding: 24rpx 24rpx 0 24rpx;
 
-			.info-box {
-				background-color: #fff;
-				border-radius: 16rpx 16rpx 0 0;
-				padding: 24rpx 24rpx 0 24rpx;
+      .info-line {
+        border-bottom: 1px solid #f4f4f4;
+        min-height: 92rpx;
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.info-line {
-					border-bottom: 1px solid #F4F4F4;
-					min-height: 92rpx;
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        &-label {
+          width: 162rpx;
+        }
 
-					&-label {
-						width: 162rpx;
-					}
+        .must-box {
+          color: #ff3b1d;
+        }
+      }
+    }
 
-					.must-box {
-						color: #FF3B1D;
-					}
-				}
-			}
+    .min-height {
+      height: 300rpx;
+      overflow: hidden;
+    }
 
-			.min-height {
-				height: 300rpx;
-				overflow: hidden;
-			}
+    .btn-box {
+      height: 112rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #fff;
+      border-radius: 0 0 16rpx 16rpx;
 
-			.btn-box {
-				height: 112rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				background-color: #fff;
-				border-radius: 0 0 16rpx 16rpx;
+      .btn-cont {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 154rpx;
+        height: 56rpx;
+        border-radius: 120rpx;
+        border: 1px solid #d9d9d9;
+        color: #666;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
 
-				.btn-cont {
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					width: 154rpx;
-					height: 56rpx;
-					border-radius: 120rpx;
-					border: 1px solid #D9D9D9;
-					color: #666;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-				}
-			}
+    .cargo-list {
+      padding: 24rpx 0;
+      background-color: #fff;
+      margin-top: 24rpx;
+      border-radius: 16rpx;
 
-			.cargo-list {
-				padding: 24rpx 0;
-				background-color: #fff;
-				margin-top: 24rpx;
-				border-radius: 16rpx;
+      .cargo-list-title {
+        font-family: "PingFang SC";
+        font-size: 32rpx;
+        font-style: normal;
+        font-weight: bold;
+        display: flex;
+        align-items: center;
+        position: relative;
+        padding-left: 50rpx;
 
-				.cargo-list-title {
-					font-family: "PingFang SC";
-					font-size: 32rpx;
-					font-style: normal;
-					font-weight: bold;
-					display: flex;
-					align-items: center;
-					position: relative;
-					padding-left: 50rpx;
+        &::after {
+          content: "";
+          display: block;
+          width: 6rpx;
+          height: 30rpx;
+          border-radius: 100px;
+          background: #0256ff;
+          position: absolute;
+          top: 50%;
+          left: 24rpx;
+          transform: translateY(-50%);
+        }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 6rpx;
-						height: 30rpx;
-						border-radius: 100px;
-						background: #0256FF;
-						position: absolute;
-						top: 50%;
-						left: 24rpx;
-						transform: translateY(-50%);
-					}
+        .cargo-list-title-tips {
+          color: #0256ff;
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+      }
 
-					.cargo-list-title-tips {
-						color: #0256FF;
-						font-size: 24rpx;
-						font-weight: 400;
-					}
-				}
+      .num-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0 48rpx 0 26rpx;
+        .num-box-text {
+          color: #666;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+        }
+        .input {
+          width: 112rpx;
+          text-align: center;
+          border-bottom: 1px solid #dadada;
+          margin: 0 8rpx;
+        }
+        .minus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          border: 1px solid #dadada;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+        .plus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          background-color: #dadada;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 
-				.num-box {
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					padding: 0 48rpx 0 26rpx;
-					.num-box-text {
-						color: #666;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-					}
-					.input {
-						width: 112rpx;
-						text-align: center;
-						border-bottom: 1px solid #DADADA;
-						margin: 0 8rpx;
-					}
-					.minus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						border: 1px solid #DADADA;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-					.plus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						background-color: #DADADA;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-				}
-			}
-		}
-		
-		.footer-box {
-			background-color: #fff;
-			height: 126rpx;
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			right: 0;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 0 40rpx 0 60rpx;
-			.footer-box-l {
-				color: #666;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-			}
-			.submitBtn {
-				width: 362rpx;
-				height: 76rpx;
-				border-radius: 16rpx;
-				background: #0256FF;
-				color: #FFF;
-				font-size: 28rpx;
-				font-weight: 500;
-				margin: 0;
-			}
-		}
-	}
-</style>
+  .footer-box {
+    background-color: #fff;
+    height: 126rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 40rpx 0 60rpx;
+    .footer-box-l {
+      color: #666;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    .submitBtn {
+      width: 362rpx;
+      height: 76rpx;
+      border-radius: 16rpx;
+      background: #0256ff;
+      color: #fff;
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 0;
+    }
+  }
+}
+</style>

+ 334 - 317
pages/purchase/index.vue

@@ -1,324 +1,341 @@
 <template>
-	<view class="picking-task-page">
-		<u-navbar height="40px" title="采购入库" bgColor="#F0F6FB" autoBack placeholder>
-			<view class="u-nav-slot btn-right" slot="right" @click="stashClick">
-				<view class="cang-name">{{cangName}}</view>
-				<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-			</view>
-		</u-navbar>
-		<view class="container_main">
-			<u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
-				<view class="search-box">
-					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick" @clear="searchClick"></u-search>
-					<view class="flex_box" @click="scanCode">
-						<view class="scan-text">扫描单据二维码</view>
-						<view class="scan-icon">
-							<image src="@/static/image/scan-icon.png" mode=""></image>
-						</view>
-					</view>
-				</view>
-				<view class="type-box flex_box">
-					<view class="type-item" @click="tabClick(1)">
-						<view class="type-val">{{type1}}</view>
-						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-					</view>
-					<view class="type-item" @click="tabClick(2)">
-						<view class="type-val">{{type2}}</view>
-						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
-					</view>
-				</view>
-			</u-sticky>
-			<view class="task-cont">
-				<block v-for="(item,i) in taskList" :key="`${item.id}-${item.status}`">
-					<task-item :item="item" @toStorage="toStorage" @toDetail="toDetail" type="caigou"></task-item>
-				</block>
-				<u-loadmore v-if="taskList.length > 0" :status="status" />
-				<u-empty mode="data" text="暂无内容" marginTop="60" icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png" v-if="taskList.length == 0"></u-empty>
-			</view>
-		</view>
-		<!-- 中心仓弹窗 -->
-		<u-picker :show="stashShow" keyName="label" :defaultIndex="defaultIndex" :columns="stashColumns" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
-		<!-- 状态 -->
-		<u-picker :show="statusShow" keyName="label" :defaultIndex="defaultIndex2" :columns="statusColumns" @confirm="statusConfirm" @cancel="statusShow= false"></u-picker>
-		<!-- 月份 -->
-		<u-picker :show="dateShow" :defaultIndex="defaultIndex3" :columns="dateColumns" @confirm="dateConfirm" @cancel="dateShow= false"></u-picker>
-		
-	</view>
+  <view class="picking-task-page">
+    <u-navbar
+      height="40px"
+      title="采购入库"
+      bgColor="#F0F6FB"
+      autoBack
+      placeholder
+    >
+      <view class="u-nav-slot depot-label" slot="right">
+        <view class="name">{{ curDepotName }}</view>
+      </view>
+    </u-navbar>
+    <view class="container_main">
+      <u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
+        <view class="search-box">
+          <u-search
+            placeholder="请输入单据编号"
+            bgColor="#fff"
+            shape="square"
+            v-model="params.number"
+            :showAction="false"
+            @search="searchClick"
+            @clear="searchClick"
+          ></u-search>
+          <view class="flex_box" @click="scanCode">
+            <view class="scan-text">扫描单据二维码</view>
+            <view class="scan-icon">
+              <image src="@/static/image/scan-icon.png" mode=""></image>
+            </view>
+          </view>
+        </view>
+        <view class="type-box flex_box">
+          <view class="type-item" @click="tabClick(1)">
+            <view class="type-val">{{ type1 }}</view>
+            <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+          </view>
+          <view class="type-item" @click="tabClick(2)">
+            <view class="type-val">{{ type2 }}</view>
+            <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
+          </view>
+        </view>
+      </u-sticky>
+      <view class="task-cont">
+        <block v-for="(item, i) in taskList" :key="`${item.id}-${item.status}`">
+          <task-item
+            :item="item"
+            @toStorage="toStorage"
+            @toDetail="toDetail"
+            type="caigou"
+          ></task-item>
+        </block>
+        <u-loadmore v-if="taskList.length > 0" :status="status" />
+        <u-empty
+          mode="data"
+          text="暂无内容"
+          marginTop="60"
+          icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
+          v-if="taskList.length == 0"
+        ></u-empty>
+      </view>
+    </view>
+    <!-- 状态 -->
+    <u-picker
+      :show="statusShow"
+      keyName="label"
+      :defaultIndex="defaultIndex2"
+      :columns="statusColumns"
+      @confirm="statusConfirm"
+      @cancel="statusShow = false"
+    ></u-picker>
+    <!-- 月份 -->
+    <u-picker
+      :show="dateShow"
+      :defaultIndex="defaultIndex3"
+      :columns="dateColumns"
+      @confirm="dateConfirm"
+      @cancel="dateShow = false"
+    ></u-picker>
+  </view>
 </template>
 
 <script>
-	import taskItem from '@/components/task-item/task-item.vue'
-	import {purchaseInventory, orderStartHandle, depotSpinnerList} from '@/common/request/apis/purchase'
-	export default{
-		components:{
-			taskItem
-		},
-		data() {
-			return {
-				offsetTop:0,
-				cangName:'',
-				searchKey:'',
-				type1:'全部',
-				type2:'月份',
-				stashShow:false,
-				stashShow:false,
-				statusShow:false,
-				dateShow:false,
-				stashColumns:[],
-				statusColumns:[
-					[{
-						label:'全部',
-						id:''
-					},{
-						label:'待入库',
-						id:'1'
-					},{
-						label:'入库中',
-						id:'4'
-					},{
-						label:'已入库',
-						id:'2'
-					}]
-				],
-				dateColumns:[
-					['全年','一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
-				],
-				defaultIndex:[],
-				defaultIndex2:[],
-				defaultIndex3:[],
-				taskList:[],
-				params:{
-					beginTime:'',
-					endTime:'',
-					number:'',
-					status:'',
-					currentPage:1,
-					pageSize:10
-				},
-				status:'loadmore',
-				lastPage:1,
-			}
-		},
-		onLoad() {
-			let systemInfo = uni.getSystemInfoSync();
-			let statusBarHeight = systemInfo.statusBarHeight;
-			this.offsetTop = statusBarHeight + 40
-			this.init()
-			this.getDepotSpinnerList()
-		},
-		onShow() {
-			uni.$on('scanFinish',(data)=>{
-				this.params.number = data
-				this.init()
-			})
-			if(uni.getStorageSync('orderRefresh')) {
-				this.init()
-				uni.removeStorageSync('orderRefresh')
-			}
-		},
-		onHide() {
-			uni.$off('scanFinish')
-		},
-		onUnload() {
-			uni.$off('scanFinish')
-		},
-		onReachBottom() {
-			if(this.params.currentPage < this.lastPage) {
-				this.params.currentPage ++
-				this.getPurchaseInventory()
-			}
-		},	
-		methods:{
-			getDepotSpinnerList() {
-				depotSpinnerList()
-				.then(res=>{
-					if(res.code == 200) {
-						this.stashColumns = [res.data]
-						this.cangName = res.data[0].label
-						this.$store.commit('setcangName', this.cangName)
-						this.$store.commit("setDepotInfo", {
-							depotName: res.data[0].label,
-							id: res.data[0].value,
-						});
-					}
-				})
-			},
-			scanCode() {
-				this.$scan.scanCode()
-			},
-			init() {
-				uni.showLoading()
-				this.params.currentPage = 1
-				this.taskList = []
-				this.getPurchaseInventory()
-			},
-			searchClick() {
-				this.init()
-			},
-			// 点击操作
-			toOrderStartHandle(id,status) {
-				orderStartHandle(id)
-				.then(res=>{
-					if(res.code == 200) {
-						uni.navigateTo({
-							url:`/pages/purchase/put-storage?id=${id}&status=${status}`
-						})
-					}
-				})
-			},
-			tabClick(type) {
-				if(type == 1) {
-					this.defaultIndex = this.getDefaultIndex(this.type1,this.statusColumns)
-					this.statusShow = true
-				}else {
-					this.defaultIndex = this.getDefaultIndex(this.type2,this.dateColumns)
-					this.dateShow = true
-				}
-			},
-			getPurchaseInventory() {
-				console.log('getPurchaseInventory======',this.params)
-				purchaseInventory(this.params)
-				.then(res=>{
-					if(res.code == 200) {
-						this.status = 'loading';
-						this.lastPage =  Math.ceil(res.data.total * 1 / this.params.pageSize)
-						if(this.params.currentPage < this.lastPage) {
-							this.status = 'loadmore'
-						}else {
-							this.status = 'nomore'
-						}
-						this.taskList =[...this.taskList,...res.data.rows];
-						console.log('this.taskList=======',this.taskList)
-					}
-					uni.hideLoading()
-				})
-				.catch(err=>{
-					uni.hideLoading()
-				})
-			},
-			stashClick() {
-				this.defaultIndex = this.getDefaultIndex(this.cangName,this.stashColumns)
-				this.stashShow = true
-			},
-			pickerConfirm(val) {
-				this.cangName = val.value[0].label
-				this.stashShow = false
-				this.$store.commit('setcangName', this.cangName)
-				this.$store.commit("setDepotInfo", {
-					depotName: val.value[0].label,
-					id: val.value[0].value,
-				});
-			},
-			statusConfirm(val) {
-				this.type1 = val.value[0].label
-				this.params.status = val.value[0].id
-				this.statusShow = false
-				this.init()
-			},
-			dateConfirm(val) {
-				this.type2 = val.value[0]
-				this.dateShow = false
-				let month = val.indexs[0]
-				this.getLastDayOfMonth(month)
-				this.init()
-			},
-			// 获取开始时间、结束时间
-			getLastDayOfMonth(month) {
-				let year = new Date().getFullYear()
-				if(month !=0) {
-					let monthStart = new Date(year, month, 0).getDate();
-					this.params.beginTime = `${year}-${month}-01`
-					this.params.endTime = `${year}-${month}-${monthStart}`
-				}else {
-					this.params.beginTime = ''
-					this.params.endTime = ''
-				}
-				
-			},
-			// 获取picker默认index
-			getDefaultIndex(val,list) {
-				let arr = []
-				let index = list[0].findIndex(item=>item.label == val)
-				arr = [index]
-				return arr
-			},
-			// 入库
-			toStorage(val) {
-				this.toOrderStartHandle(val.id,val.status)
-			},
-			toDetail(val) {
-				uni.navigateTo({
-					url:`/pages/purchase/detail?id=${val.id}&status=${val.status}`
-				})
-			}
-		}
-	}
+import taskItem from "@/components/task-item/task-item.vue";
+import {
+  purchaseInventory,
+  orderStartHandle,
+} from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+
+export default {
+  components: {
+    taskItem,
+  },
+  data() {
+    return {
+      offsetTop: 0,
+      type1: "全部",
+      type2: "月份",
+      statusShow: false,
+      dateShow: false,
+      statusColumns: [
+        [
+          {
+            label: "全部",
+            id: "",
+          },
+          {
+            label: "待入库",
+            id: "1",
+          },
+          {
+            label: "入库中",
+            id: "4",
+          },
+          {
+            label: "已入库",
+            id: "2",
+          },
+        ],
+      ],
+      dateColumns: [
+        [
+          "全年",
+          "一月",
+          "二月",
+          "三月",
+          "四月",
+          "五月",
+          "六月",
+          "七月",
+          "八月",
+          "九月",
+          "十月",
+          "十一月",
+          "十二月",
+        ],
+      ],
+      defaultIndex2: [],
+      defaultIndex3: [],
+      taskList: [],
+      params: {
+        beginTime: "",
+        endTime: "",
+        number: "",
+        status: "",
+        currentPage: 1,
+        pageSize: 10,
+      },
+      status: "loadmore",
+      lastPage: 1,
+    };
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
+  onLoad() {
+    let systemInfo = uni.getSystemInfoSync();
+    let statusBarHeight = systemInfo.statusBarHeight;
+    this.offsetTop = statusBarHeight + 40;
+    this.init();
+  },
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      this.params.number = data;
+      this.init();
+    });
+    if (uni.getStorageSync("orderRefresh")) {
+      this.init();
+      uni.removeStorageSync("orderRefresh");
+    }
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
+  },
+  onReachBottom() {
+    if (this.params.currentPage < this.lastPage) {
+      this.params.currentPage++;
+      this.getPurchaseInventory();
+    }
+  },
+  methods: {
+    scanCode() {
+      this.$scan.scanCode();
+    },
+    init() {
+      uni.showLoading();
+      this.params.currentPage = 1;
+      this.taskList = [];
+      this.getPurchaseInventory();
+    },
+    searchClick() {
+      this.init();
+    },
+    // 点击操作
+    toOrderStartHandle(id, status) {
+      orderStartHandle(id).then((res) => {
+        if (res.code == 200) {
+          uni.navigateTo({
+            url: `/pages/purchase/put-storage?id=${id}&status=${status}`,
+          });
+        }
+      });
+    },
+    tabClick(type) {
+      switch (type) {
+        case 1:
+          this.statusShow = true;
+          break;
+        case 2:
+          this.dateShow = true;
+          break;
+        default:
+          break;
+      }
+    },
+    getPurchaseInventory() {
+      console.log("getPurchaseInventory======", this.params);
+      purchaseInventory({ ...this.params, depotId: this.curDepotId })
+        .then((res) => {
+          if (res.code == 200) {
+            this.status = "loading";
+            this.lastPage = Math.ceil(
+              (res.data.total * 1) / this.params.pageSize
+            );
+            if (this.params.currentPage < this.lastPage) {
+              this.status = "loadmore";
+            } else {
+              this.status = "nomore";
+            }
+            this.taskList = [...this.taskList, ...res.data.rows];
+            console.log("this.taskList=======", this.taskList);
+          }
+          uni.hideLoading();
+        })
+        .catch((err) => {
+          uni.hideLoading();
+        });
+    },
+    statusConfirm(val) {
+      this.type1 = val.value[0].label;
+      this.params.status = val.value[0].id;
+      this.statusShow = false;
+      this.init();
+    },
+    dateConfirm(val) {
+      this.type2 = val.value[0];
+      this.dateShow = false;
+      let month = val.indexs[0];
+      this.getLastDayOfMonth(month);
+      this.init();
+    },
+    // 获取开始时间、结束时间
+    getLastDayOfMonth(month) {
+      let year = new Date().getFullYear();
+      if (month != 0) {
+        let monthStart = new Date(year, month, 0).getDate();
+        this.params.beginTime = `${year}-${month}-01`;
+        this.params.endTime = `${year}-${month}-${monthStart}`;
+      } else {
+        this.params.beginTime = "";
+        this.params.endTime = "";
+      }
+    },
+    // 入库
+    toStorage(val) {
+      this.toOrderStartHandle(val.id, val.status);
+    },
+    toDetail(val) {
+      uni.navigateTo({
+        url: `/pages/purchase/detail?id=${val.id}&status=${val.status}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.btn-right {
-		display: flex;
-		align-items: center;
-		.cang-name {
-			color: #0256FF;
-			text-align: center;
-			font-family: "PingFang SC";
-			font-size: 28rpx;
-			font-weight: 600;
-			margin-right: 10rpx;
-		}
-	}
-	.picking-task-page {
-		min-height: 100vh;
-		background: #F0F6FB;
-		.container_main {
-			.search-box {
-				display: flex;
-				align-items: center;
-				padding: 0 32rpx;
-				.scan-text {
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 24rpx;
-					font-weight: 400;
-					margin-right: 20rpx;
-					margin-left: 30rpx;
-				}
-				.scan-icon {
-					width: 36rpx;
-					height: 36rpx;
-					background-color: #fff;
-					border-radius: 50%;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					image {
-						width: 24rpx;
-						height: 24rpx;
-					}
-				}
-			}
-		
-			.type-box {
-				.type-item {
-					width: 50%;
-					height: 88rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					.type-val {
-						color: #000;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-						margin-right: 10rpx;
-					}
-				}
-			}
-			
-			.task-cont {
-				padding: 0 24rpx;
-			}
-		}
-	}
-</style>
+.picking-task-page {
+  min-height: 100vh;
+  background: #f0f6fb;
+  .container_main {
+    .search-box {
+      display: flex;
+      align-items: center;
+      padding: 0 32rpx;
+      .scan-text {
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 24rpx;
+        font-weight: 400;
+        margin-right: 20rpx;
+        margin-left: 30rpx;
+      }
+      .scan-icon {
+        width: 36rpx;
+        height: 36rpx;
+        background-color: #fff;
+        border-radius: 50%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        image {
+          width: 24rpx;
+          height: 24rpx;
+        }
+      }
+    }
+
+    .type-box {
+      .type-item {
+        width: 50%;
+        height: 88rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        .type-val {
+          color: #000;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+          margin-right: 10rpx;
+        }
+      }
+    }
+
+    .task-cont {
+      padding: 0 24rpx;
+    }
+  }
+}
+</style>

+ 606 - 540
pages/purchase/put-storage.vue

@@ -1,577 +1,643 @@
 <template>
-	<view class="deliver-page">
-		<u-navbar height="40px" title="采购入库" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
-			placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="info-box" :class="isUnfold ? '':'min-height'">
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>收入仓库</text>
-					</view>
-					<view class="info-line-value">
-						{{cangName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>供应商</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.supplierName}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库类型</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.subType}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>入库日期</text>
-					</view>
-					<view class="info-line-value">
-						{{orderInfo.operTime}}
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>上传凭证</text>
-					</view>
-					<view class="info-line-value ss-p-y-24">
-						<upload-image v-model="voucherPicture" width="196rpx" height="196rpx"></upload-image>
-					</view>
-				</view>
-				<view class="info-line">
-					<view class="info-line-label">
-						<text>备注信息</text>
-					</view>
-					<view class="info-line-value">
-						<u-input v-model="orderInfo.mark" placeholder="请输入备注信息" border="none"></u-input>
-					</view>
-				</view>
-			</view>
-			<view class="btn-box">
-				<view class="btn-cont" @click="isUnfold = !isUnfold">
-					<text>{{isUnfold ? '收起' : '展开'}}</text>
-					<u-icon :name="isUnfold?'arrow-up':'arrow-down'"></u-icon>
-				</view>
-			</view>
+  <view class="deliver-page">
+    <u-navbar
+      height="40px"
+      title="采购入库"
+      bgColor="#0256FF"
+      :titleStyle="{ color: '#fff' }"
+      leftIconColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="info-box" :class="isUnfold ? '' : 'min-height'">
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>收入仓库</text>
+          </view>
+          <view class="info-line-value">
+            {{ depotInfo ? cangName.depotName : "" }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>供应商</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.supplierName }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库类型</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.subType }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>入库日期</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.operTime }}
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>上传凭证</text>
+          </view>
+          <view class="info-line-value ss-p-y-24">
+            <upload-image
+              v-model="voucherPicture"
+              width="196rpx"
+              height="196rpx"
+            ></upload-image>
+          </view>
+        </view>
+        <view class="info-line">
+          <view class="info-line-label">
+            <text>备注信息</text>
+          </view>
+          <view class="info-line-value">
+            <u-input
+              v-model="orderInfo.mark"
+              placeholder="请输入备注信息"
+              border="none"
+            ></u-input>
+          </view>
+        </view>
+      </view>
+      <view class="btn-box">
+        <view class="btn-cont" @click="isUnfold = !isUnfold">
+          <text>{{ isUnfold ? "收起" : "展开" }}</text>
+          <u-icon :name="isUnfold ? 'arrow-up' : 'arrow-down'"></u-icon>
+        </view>
+      </view>
 
-			<view class="scan-box">
-				<view class="scan-box-l" @click="scanCode">
-					<u-image width="120rpx" height="120rpx" src="@/static/image/zidong-saoma-img.png"></u-image>
-					<view class="tips-text">扫描快速识别货物</view>
-					<view class="tips-text2">
-						<u-icon name="checkmark-circle-fill" color="#0256FF"></u-icon>
-						<text>连续扫描</text>
-					</view>
-				</view>
-				<!-- <view class="scan-box-r" @click="manualClick">
+      <view class="scan-box">
+        <view class="scan-box-l" @click="scanCode">
+          <u-image
+            width="120rpx"
+            height="120rpx"
+            src="@/static/image/zidong-saoma-img.png"
+          ></u-image>
+          <view class="tips-text">扫描快速识别货物</view>
+          <view class="tips-text2">
+            <u-icon name="checkmark-circle-fill" color="#0256FF"></u-icon>
+            <text>连续扫描</text>
+          </view>
+        </view>
+        <!-- <view class="scan-box-r" @click="manualClick">
 					<u-image width="120rpx" height="120rpx" src="@/static/image/shoudong-saoma-img.png"></u-image>
 					<view class="tips-text">手动选择</view>
 				</view> -->
-			</view>
-			<!-- 货物清单 -->
-			<view class="cargo-list">
-				<view class="cargo-list-title">
-					<view>入库货物清单</view>
-					<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
-				</view>
-				<block v-for="(item,i) in goodsList" :key="i">
-					<good-item :item="item" @toDetail="toDetail" @calendarClick="calendarClick" :show-print="true" @print="(e) => handlePrint(e.id,'1',status)">
-						<view class="num-box">
-							<view class="num-box-text">已确认入库数量</view>
-							<u-number-box v-model="item.materialNumber" min="0" :inputWidth="56">
-								<!-- <view slot="minus" class="minus">
+      </view>
+      <!-- 货物清单 -->
+      <view class="cargo-list">
+        <view class="cargo-list-title">
+          <view>入库货物清单</view>
+          <view class="cargo-list-title-tips">(轻触货物查看详情)</view>
+        </view>
+        <block v-for="(item, i) in goodsList" :key="i">
+          <good-item
+            :item="item"
+            @toDetail="toDetail"
+            @calendarClick="calendarClick"
+            :show-print="true"
+            @print="(e) => handlePrint(e.id, '1', status)"
+          >
+            <view class="num-box">
+              <view class="num-box-text">已确认入库数量</view>
+              <u-number-box
+                v-model="item.materialNumber"
+                min="0"
+                :inputWidth="56"
+              >
+                <!-- <view slot="minus" class="minus">
 									<u-icon name="minus" color="#0256FF" size="12"></u-icon>
 								</view>
 								<text slot="input" class="input">{{item.materialNumber}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view> -->
-							</u-number-box>
-						</view>
-					</good-item>
-				</block>
-			</view>
-		</view>
-		
-		<view class="footer-box">
-			<view class="footer-box-l">
-				<view>货物种类:{{speciesNum}}种</view>
-				<view>货物总数:{{orderGoodsNum}}件</view>
-			</view>
-			<button class="submitBtn" @tap="submitClick">
-			  提交
-			</button>
-		</view>
-		<error-pop v-model="errorShow" @close="errorShow = false" @confirm="confirm" :content="popText.errorText"></error-pop>
-		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.successText"></success-pop>
-		<!-- 扫码之后弹窗 -->
-		<scaned-pop v-if="scanedShow" v-model="scanedShow" :scanNum="scanNum" @close="scanedShow = false" @confirm="scanConfirm"></scaned-pop>
-		
-		<goods-pop v-model="goodsShow" @close="goodsShow = false" type="caigou"></goods-pop>
-		
-		<u-datetime-picker
-			:show="calendarShow"
-			v-model="value1"
-			:maxDate="maxDate"
-			mode="date"
-			:closeOnClickOverlay="true"
-			@confirm="calendarConfirm"
-			@cancel="calendarShow = false"
-		></u-datetime-picker>
-		
-		<!-- 打印条码弹框 -->
-		<print-pop :show.sync="blePrintPop.show" :info="blePrintPop.data" @confirm="startPrint"></print-pop>
-		<!-- 选择蓝牙设备弹框 -->
-		<ble-pop :show.sync="bleSelectPop.show" :list="discoveredDevices" @close="closeBleSelectPop" @refresh="refreshBleDevice" @selectItem="handleSelectBle"></ble-pop>
-		
-		<ble-tip-pop v-model="bleErrorTipPop.show" :is-center="true" @confirm="bleErrorTipConfirm" :content="bleErrorTipPop.content" :extraText="bleErrorTipPop.extraText"> </ble-tip-pop>
-	</view>
+              </u-number-box>
+            </view>
+          </good-item>
+        </block>
+      </view>
+    </view>
+
+    <view class="footer-box">
+      <view class="footer-box-l">
+        <view>货物种类:{{ speciesNum }}种</view>
+        <view>货物总数:{{ orderGoodsNum }}件</view>
+      </view>
+      <button class="submitBtn" @tap="submitClick">提交</button>
+    </view>
+    <error-pop
+      v-model="errorShow"
+      @close="errorShow = false"
+      @confirm="confirm"
+      :content="popText.errorText"
+    ></error-pop>
+    <success-pop
+      v-model="successShow"
+      @close="successShow = false"
+      @backClick="backClick"
+      :content="popText.successText"
+    ></success-pop>
+    <!-- 扫码之后弹窗 -->
+    <scaned-pop
+      v-if="scanedShow"
+      v-model="scanedShow"
+      :scanNum="scanNum"
+      @close="scanedShow = false"
+      @confirm="scanConfirm"
+    ></scaned-pop>
+
+    <goods-pop
+      v-model="goodsShow"
+      @close="goodsShow = false"
+      type="caigou"
+    ></goods-pop>
+
+    <u-datetime-picker
+      :show="calendarShow"
+      v-model="value1"
+      :maxDate="maxDate"
+      mode="date"
+      :closeOnClickOverlay="true"
+      @confirm="calendarConfirm"
+      @cancel="calendarShow = false"
+    ></u-datetime-picker>
+
+    <!-- 打印条码弹框 -->
+    <print-pop
+      :show.sync="blePrintPop.show"
+      :info="blePrintPop.data"
+      @confirm="startPrint"
+    ></print-pop>
+    <!-- 选择蓝牙设备弹框 -->
+    <ble-pop
+      :show.sync="bleSelectPop.show"
+      :list="discoveredDevices"
+      @close="closeBleSelectPop"
+      @refresh="refreshBleDevice"
+      @selectItem="handleSelectBle"
+    ></ble-pop>
+
+    <ble-tip-pop
+      v-model="bleErrorTipPop.show"
+      :is-center="true"
+      @confirm="bleErrorTipConfirm"
+      :content="bleErrorTipPop.content"
+      :extraText="bleErrorTipPop.extraText"
+    >
+    </ble-tip-pop>
+  </view>
 </template>
 
 <script>
-	import goodItem from '@/components/good-item/good-item.vue'
-	import errorPop from '@/components/error-pop/error-pop.vue'
-	import successPop from '@/components/success-pop/success-pop.vue'
-	import scanedPop from '@/components/scaned-pop/scaned-pop.vue'
-	import goodsPop from '@/components/goods-pop/goods-pop.vue'
-	import {orderDetail, orderInfo, orderSubmit} from '@/common/request/apis/purchase'
-	import {mapGetters} from 'vuex'
-	import blePrintMixin from '@/common/mixins/blePrintMixin.js'
-	export default {
-		mixins: [blePrintMixin],
-		components: {
-			goodItem,
-			errorPop,
-			successPop,
-			scanedPop,
-			goodsPop
-		},
-		data() {
-			return {
-				popText:{
-					errorText:'实际入库数量与应入库数量有差异,是否确认提交?',
-					successText:'入库成功!'
-				},
-				goodsShow:false,
-				scanedShow:false,
-				errorShow:false,
-				successShow:false,
-				value:0,
-				isUnfold: true, //是否展开
-				info: {
-					mark: '',
-					url: ''
-				},
-				goodsList: [],
-				orderInfo:{},
-				id:'',
-				calendarShow:false,
-				value1: '',
-				maxDate:Number(new Date()),
-				chooseGoodsInfo:{},
-				voucherPicture:'',
-				scanIndex:-1,
-				scanNum:1,
-				status:null
-			}
-		},
-		onLoad(e) {
-			
-			this.id = e.id
-			this.status = e.status
-			this.getOrderDetail(e.id)
-			this.getOrderInfo(e.id)
-		},
-		onShow() {
-			uni.$on('scanFinish',(data)=>{
-				if(this.goodsList.length == 0) return uni.$u.toast("该货物不属于该任务");
-				let index = this.goodsList.findIndex(item=>item.barCode == data)
-				if(index == -1) return uni.$u.toast("该货物不属于该任务");
-				this.scanIndex = index
-				this.scanNum = this.goodsList[index].materialNumber
-				this.scanedShow = true
-			})
-		},
-		onHide() {
-			uni.$off('scanFinish')
-		},
-		onUnload() {
-			uni.$off('scanFinish')
-		},
-		computed: {
-			...mapGetters(['cangName']),
-			speciesNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					num = this.goodsList.length
-				}
-				return num
-			},
-			// 手动输入的数量
-			goodsNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					this.goodsList.forEach(item=>{
-						num+=item.materialNumber
-					})
-				}
-				return num
-			},
-			// 订单返回的数量
-			orderGoodsNum() {
-				let num = 0
-				if(this.goodsList.length == 0 || !this.goodsList) {
-					num = 0
-				}else {
-					this.goodsList.forEach(item=>{
-						num+=item.operNumber
-					})
-				}
-				return num
-			}
-		},
-		methods:{
-			scanCode() {
-				this.$scan.scanCode()
-			},
-			calendarConfirm(val) {
-				this.goodsList.forEach(item=>{
-					if(item.id == this.chooseGoodsInfo.id) {
-						item.productionDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
-					}
-				})
-				this.calendarShow = false
-			},
-			calendarCole() {
-				this.calendarShow = false
-			},
-			calendarClick(item) {
-				this.chooseGoodsInfo = item
-				if(item.productionDate) {
-					this.value1 = Number(new Date(item.productionDate))
-				}else {
-					this.value1 = Number(new Date())
-				}
-				this.calendarShow = true
-			},
-			getOrderInfo(id) {
-				orderInfo(id)
-				.then(res=>{
-					if(res.code == 200) {
-						this.orderInfo = res.data
-					}
-				})
-			},
-			getOrderDetail(id) {
-				orderDetail(id)
-				.then(res=>{
-					if(res.code == 200) {
-						res.data.rows.forEach(item=>{
-							item.materialNumber = 0
-							if(item.imgName && item.imgName.length >0) {
-								item.imgNameArr = item.imgName.split(",")
-							}else {
-								item.imgNameArr = []
-							}
-						})
-						this.goodsList = res.data.rows
-					}
-				})
-			},
-			submitClick() {
-				let num = 0
-				this.goodsList.forEach(item=>{
-					if(item.materialNumber * 1 != item.operNumber ) {
-						num ++
-					}
-				})
-				if(num>0) {
-					return this.errorShow = true
-				}
-				this.toOrderSubmit()
-			},
-			toOrderSubmit() {
-				let materials = this.goodsList.map(item=> {
-					return {
-						barCode:item.barCode,
-						materialNumber:item.materialNumber,
-						productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
-					}
-				})
-				let params = {
-					id:this.id,
-					materials:materials,
-					voucherPicture:this.voucherPicture || '',
-					remark:this.orderInfo.mark || ''
-				}
-				orderSubmit(params)
-				.then(res=>{
-					if(res.code == 200) {
-						if(this.errorShow){
-							this.errorShow = false
-						}
-						this.successShow = true
-					}
-				})
-			},
-			confirm() {
-				this.toOrderSubmit()
-				this.errorShow = false
-			},
-			backClick() {
-				uni.setStorageSync('orderRefresh',true)
-				uni.navigateBack()
-			},
-			// 扫码确认
-			scanConfirm(val) {
-				this.goodsList[this.scanIndex].materialNumber = Number(val)
-				this.scanedShow = false
-			},
-			manualClick() {
-				// this.goodsShow = true
-			},
-			toDetail(val) {
-				uni.navigateTo({
-					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
-				})
-			}
-		}
-	}
+import goodItem from "@/components/good-item/good-item.vue";
+import errorPop from "@/components/error-pop/error-pop.vue";
+import successPop from "@/components/success-pop/success-pop.vue";
+import scanedPop from "@/components/scaned-pop/scaned-pop.vue";
+import goodsPop from "@/components/goods-pop/goods-pop.vue";
+import {
+  orderDetail,
+  orderInfo,
+  orderSubmit,
+} from "@/common/request/apis/purchase";
+import { mapGetters } from "vuex";
+import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+export default {
+  mixins: [blePrintMixin],
+  components: {
+    goodItem,
+    errorPop,
+    successPop,
+    scanedPop,
+    goodsPop,
+  },
+  data() {
+    return {
+      popText: {
+        errorText: "实际入库数量与应入库数量有差异,是否确认提交?",
+        successText: "入库成功!",
+      },
+      goodsShow: false,
+      scanedShow: false,
+      errorShow: false,
+      successShow: false,
+      value: 0,
+      isUnfold: true, //是否展开
+      info: {
+        mark: "",
+        url: "",
+      },
+      goodsList: [],
+      orderInfo: {},
+      id: "",
+      calendarShow: false,
+      value1: "",
+      maxDate: Number(new Date()),
+      chooseGoodsInfo: {},
+      voucherPicture: "",
+      scanIndex: -1,
+      scanNum: 1,
+      status: null,
+    };
+  },
+  onLoad(e) {
+    this.id = e.id;
+    this.status = e.status;
+    this.getOrderDetail(e.id);
+    this.getOrderInfo(e.id);
+  },
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      if (this.goodsList.length == 0) return uni.$u.toast("该货物不属于该任务");
+      let index = this.goodsList.findIndex((item) => item.barCode == data);
+      if (index == -1) return uni.$u.toast("该货物不属于该任务");
+      this.scanIndex = index;
+      this.scanNum = this.goodsList[index].materialNumber;
+      this.scanedShow = true;
+    });
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    speciesNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        num = this.goodsList.length;
+      }
+      return num;
+    },
+    // 手动输入的数量
+    goodsNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        this.goodsList.forEach((item) => {
+          num += item.materialNumber;
+        });
+      }
+      return num;
+    },
+    // 订单返回的数量
+    orderGoodsNum() {
+      let num = 0;
+      if (this.goodsList.length == 0 || !this.goodsList) {
+        num = 0;
+      } else {
+        this.goodsList.forEach((item) => {
+          num += item.operNumber;
+        });
+      }
+      return num;
+    },
+  },
+  methods: {
+    scanCode() {
+      this.$scan.scanCode();
+    },
+    calendarConfirm(val) {
+      this.goodsList.forEach((item) => {
+        if (item.id == this.chooseGoodsInfo.id) {
+          item.productionDate = this.$u.timeFormat(val.value, "yyyy-mm-dd");
+        }
+      });
+      this.calendarShow = false;
+    },
+    calendarCole() {
+      this.calendarShow = false;
+    },
+    calendarClick(item) {
+      this.chooseGoodsInfo = item;
+      if (item.productionDate) {
+        this.value1 = Number(new Date(item.productionDate));
+      } else {
+        this.value1 = Number(new Date());
+      }
+      this.calendarShow = true;
+    },
+    getOrderInfo(id) {
+      orderInfo(id).then((res) => {
+        if (res.code == 200) {
+          this.orderInfo = res.data;
+        }
+      });
+    },
+    getOrderDetail(id) {
+      orderDetail(id).then((res) => {
+        if (res.code == 200) {
+          res.data.rows.forEach((item) => {
+            item.materialNumber = 0;
+            if (item.imgName && item.imgName.length > 0) {
+              item.imgNameArr = item.imgName.split(",");
+            } else {
+              item.imgNameArr = [];
+            }
+          });
+          this.goodsList = res.data.rows;
+        }
+      });
+    },
+    submitClick() {
+      let num = 0;
+      this.goodsList.forEach((item) => {
+        if (item.materialNumber * 1 != item.operNumber) {
+          num++;
+        }
+      });
+      if (num > 0) {
+        return (this.errorShow = true);
+      }
+      this.toOrderSubmit();
+    },
+    toOrderSubmit() {
+      let materials = this.goodsList.map((item) => {
+        return {
+          barCode: item.barCode,
+          materialNumber: item.materialNumber,
+          productionDate: item.productionDate
+            ? this.$u.timeFormat(item.productionDate, "yyyy-mm-dd")
+            : "",
+        };
+      });
+      let params = {
+        id: this.id,
+        materials: materials,
+        voucherPicture: this.voucherPicture || "",
+        remark: this.orderInfo.mark || "",
+      };
+      orderSubmit(params).then((res) => {
+        if (res.code == 200) {
+          if (this.errorShow) {
+            this.errorShow = false;
+          }
+          this.successShow = true;
+        }
+      });
+    },
+    confirm() {
+      this.toOrderSubmit();
+      this.errorShow = false;
+    },
+    backClick() {
+      uni.setStorageSync("orderRefresh", true);
+      uni.navigateBack();
+    },
+    // 扫码确认
+    scanConfirm(val) {
+      this.goodsList[this.scanIndex].materialNumber = Number(val);
+      this.scanedShow = false;
+    },
+    manualClick() {
+      // this.goodsShow = true
+    },
+    toDetail(val) {
+      uni.navigateTo({
+        url: `/pages/goods/detail?id=${val.id}&name=${val.materialName}`,
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.deliver-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		padding-bottom: 130rpx;
+.deliver-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  padding-bottom: 130rpx;
+
+  .container_main {
+    padding: 24rpx;
 
-		.container_main {
-			padding: 24rpx;
+    .info-box {
+      background-color: #fff;
+      border-radius: 16rpx 16rpx 0 0;
+      padding: 24rpx 24rpx 0 24rpx;
 
-			.info-box {
-				background-color: #fff;
-				border-radius: 16rpx 16rpx 0 0;
-				padding: 24rpx 24rpx 0 24rpx;
+      .info-line {
+        border-bottom: 1px solid #f4f4f4;
+        min-height: 92rpx;
+        color: #333;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.info-line {
-					border-bottom: 1px solid #F4F4F4;
-					min-height: 92rpx;
-					color: #333;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        &-label {
+          width: 162rpx;
+        }
 
-					&-label {
-						width: 162rpx;
-					}
+        .must-box {
+          color: #ff3b1d;
+        }
+      }
+    }
 
-					.must-box {
-						color: #FF3B1D;
-					}
-				}
-			}
+    .min-height {
+      height: 300rpx;
+      overflow: hidden;
+    }
 
-			.min-height {
-				height: 300rpx;
-				overflow: hidden;
-			}
+    .btn-box {
+      height: 112rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #fff;
+      border-radius: 0 0 16rpx 16rpx;
 
-			.btn-box {
-				height: 112rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				background-color: #fff;
-				border-radius: 0 0 16rpx 16rpx;
+      .btn-cont {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 154rpx;
+        height: 56rpx;
+        border-radius: 120rpx;
+        border: 1px solid #d9d9d9;
+        color: #666;
+        font-family: "PingFang SC";
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
 
-				.btn-cont {
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					width: 154rpx;
-					height: 56rpx;
-					border-radius: 120rpx;
-					border: 1px solid #D9D9D9;
-					color: #666;
-					font-family: "PingFang SC";
-					font-size: 28rpx;
-					font-weight: 400;
-				}
-			}
+    .scan-box {
+      margin-top: 24rpx;
+      padding: 24rpx 0;
+      border-radius: 16rpx;
+      background: #fff;
+      display: flex;
 
-			.scan-box {
-				margin-top: 24rpx;
-				padding: 24rpx 0;
-				border-radius: 16rpx;
-				background: #FFF;
-				display: flex;
+      .tips-text {
+        color: #333;
+        font-size: 28rpx;
+        font-weight: 400;
+        line-height: 48rpx;
+      }
 
-				.tips-text {
-					color: #333;
-					font-size: 28rpx;
-					font-weight: 400;
-					line-height: 48rpx;
-				}
+      .tips-text2 {
+        color: #0256ff;
+        font-size: 24rpx;
+        font-weight: 400;
+        display: flex;
+        align-items: center;
 
-				.tips-text2 {
-					color: #0256FF;
-					font-size: 24rpx;
-					font-weight: 400;
-					display: flex;
-					align-items: center;
+        .radio-box {
+          width: 32rpx;
+          height: 32rpx;
+          border-radius: 50%;
+          border: 1px solid #d9d9d9;
+          margin-right: 16rpx;
+        }
+      }
 
-					.radio-box {
-						width: 32rpx;
-						height: 32rpx;
-						border-radius: 50%;
-						border: 1px solid #D9D9D9;
-						margin-right: 16rpx;
-					}
-				}
+      .scan-box-l {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        position: relative;
 
-				.scan-box-l {
-					width: 100%;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					position: relative;
+        &::after {
+          content: "";
+          display: block;
+          width: 1px;
+          height: 138rpx;
+          background-color: #f4f4f4;
+          position: absolute;
+          top: 50%;
+          right: 0;
+          transform: translateY(-50%);
+        }
+      }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 1px;
-						height: 138rpx;
-						background-color: #F4F4F4;
-						position: absolute;
-						top: 50%;
-						right: 0;
-						transform: translateY(-50%);
-					}
-				}
+      .scan-box-r {
+        width: 50%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+    }
 
-				.scan-box-r {
-					width: 50%;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-				}
-			}
+    .cargo-list {
+      padding: 24rpx 0;
+      background-color: #fff;
+      margin-top: 24rpx;
+      border-radius: 16rpx;
 
-			.cargo-list {
-				padding: 24rpx 0;
-				background-color: #fff;
-				margin-top: 24rpx;
-				border-radius: 16rpx;
+      .cargo-list-title {
+        font-family: "PingFang SC";
+        font-size: 32rpx;
+        font-style: normal;
+        font-weight: bold;
+        display: flex;
+        align-items: center;
+        position: relative;
+        padding-left: 50rpx;
 
-				.cargo-list-title {
-					font-family: "PingFang SC";
-					font-size: 32rpx;
-					font-style: normal;
-					font-weight: bold;
-					display: flex;
-					align-items: center;
-					position: relative;
-					padding-left: 50rpx;
+        &::after {
+          content: "";
+          display: block;
+          width: 6rpx;
+          height: 30rpx;
+          border-radius: 100px;
+          background: #0256ff;
+          position: absolute;
+          top: 50%;
+          left: 24rpx;
+          transform: translateY(-50%);
+        }
 
-					&::after {
-						content: '';
-						display: block;
-						width: 6rpx;
-						height: 30rpx;
-						border-radius: 100px;
-						background: #0256FF;
-						position: absolute;
-						top: 50%;
-						left: 24rpx;
-						transform: translateY(-50%);
-					}
+        .cargo-list-title-tips {
+          color: #0256ff;
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+      }
 
-					.cargo-list-title-tips {
-						color: #0256FF;
-						font-size: 24rpx;
-						font-weight: 400;
-					}
-				}
+      .num-box {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0 48rpx 0 26rpx;
+        .num-box-text {
+          color: #666;
+          font-family: "PingFang SC";
+          font-size: 28rpx;
+          font-weight: 400;
+        }
+        .input {
+          width: 112rpx;
+          text-align: center;
+          border-bottom: 1px solid #0256ff;
+          margin: 0 8rpx;
+        }
+        .minus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          border: 1px solid #0256ff;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+        .plus {
+          width: 40rpx;
+          height: 40rpx;
+          border-radius: 8rpx;
+          background-color: #0256ff;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 
-				.num-box {
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					padding: 0 48rpx 0 26rpx;
-					.num-box-text {
-						color: #666;
-						font-family: "PingFang SC";
-						font-size: 28rpx;
-						font-weight: 400;
-					}
-					.input {
-						width: 112rpx;
-						text-align: center;
-						border-bottom: 1px solid #0256FF;
-						margin: 0 8rpx;
-					}
-					.minus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						border: 1px solid #0256FF;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-					.plus {
-						width: 40rpx;
-						height: 40rpx;
-						border-radius: 8rpx;
-						background-color: #0256FF;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-					}
-				}
-			}
-		}
-		
-		.footer-box {
-			background-color: #fff;
-			height: 126rpx;
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			right: 0;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 0 40rpx 0 60rpx;
-			.footer-box-l {
-				color: #666;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-			}
-			.submitBtn {
-				width: 362rpx;
-				height: 76rpx;
-				border-radius: 16rpx;
-				background: #0256FF;
-				color: #FFF;
-				font-size: 28rpx;
-				font-weight: 500;
-				margin: 0;
-			}
-		}
-	}
-</style>
+  .footer-box {
+    background-color: #fff;
+    height: 126rpx;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 40rpx 0 60rpx;
+    .footer-box-l {
+      color: #666;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    .submitBtn {
+      width: 362rpx;
+      height: 76rpx;
+      border-radius: 16rpx;
+      background: #0256ff;
+      color: #fff;
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 0;
+    }
+  }
+}
+</style>

TEMPAT SAMPAH
static/image/home/icon-fhrw.png


TEMPAT SAMPAH
static/image/home/icon-hwlr.png