浏览代码

feat:pda流程、复核任务、货物录入

maliang 3 周之前
父节点
当前提交
519c6175d4

+ 12 - 0
common/request/apis/aduit.js

@@ -0,0 +1,12 @@
+//复核任务列表
+export const reviewTaskList = (params, config = { custom: { auth: true } }) => {
+  return uni.$u.http.post(
+    `/pda/reviewTaskList?currentPage=${params.currentPage}&pageSize=${params.pageSize}`,
+    params,
+    config
+  );
+};
+//设置复核任务状态
+export const setReviewTask = (params, config = { custom: { auth: true } }) => {
+  return uni.$u.http.post(`/pda/setReviewTask`, params, config);
+};

+ 12 - 0
common/request/apis/goodsEnter.js

@@ -0,0 +1,12 @@
+//货物录入列表
+export const goodsInputList = (params, config = { custom: { auth: true } }) => {
+  return uni.$u.http.post(
+    `/pda/goodsInputList?currentPage=${params.currentPage}&pageSize=${params.pageSize}`,
+    params,
+    config
+  );
+};
+//货物信息录入保存
+export const goodsSave = (params, config = { custom: { auth: true } }) => {
+  return uni.$u.http.post(`/pda/goodsSave`, params, config);
+};

+ 3 - 1
common/request/apis/index.js

@@ -7,4 +7,6 @@ export const selectVersion = (params, config) => uni.$u.http.get(`/pda/selectVer
 // 下载apk包
 export const downloadApk = (params, config = {custom: { auth: false }}) => uni.$u.http.post(`/pda/downloadApk`, params, config)
 
-
+// 获取用户消息列表
+export const getMsgList = (params, config = { custom: { auth: true } }) =>
+  uni.$u.http.get(`/pda/getMsgList`, { params, config });

+ 4 - 0
common/request/apis/purchase.js

@@ -43,3 +43,7 @@ export const depotSpinnerList = (
   data,
   config = { custom: { auth: true } }
 ) => uni.$u.http.get(`/pda/depotSpinnerList`, { data, config });
+
+// 根据upc获取sku
+export const getSkuByUpc = (data, config = { custom: { auth: true } }) =>
+  uni.$u.http.get(`/pda/getSkuByUpc`, { data, config });

+ 21 - 2
pages/audit-task/components/reject-pop.vue → components/audit-reject/audit-reject.vue

@@ -20,8 +20,15 @@
         labelPosition="top"
         labelWidth="100%"
         :borderBottom="false"
+        ref="uForm"
+        :rules="rules"
       >
-        <u-form-item label="请输入驳回原因" prop="reason" :borderBottom="false">
+        <u-form-item
+          label="请输入驳回原因"
+          required
+          prop="reason"
+          :borderBottom="false"
+        >
           <u--textarea
             v-model="formData.reason"
             placeholder="请输入"
@@ -80,11 +87,23 @@ export default {
     close() {
       this.$emit("update:show", false);
     },
+    open() {
+      this.formData = {
+        reason: "",
+      };
+    },
     onCancel() {
       this.close();
       this.$emit("cancel");
     },
-    onConfirm() {},
+    onConfirm() {
+      this.$refs.uForm
+        .validate()
+        .then((res) => {
+          this.$emit("ok", this.formData.reason);
+        })
+        .catch((errors) => {});
+    },
   },
 };
 </script>

+ 8 - 3
components/good-card/good-card.vue

@@ -56,7 +56,7 @@ export default {
     },
     goodDesTitle: {
       type: String,
-      default: "条形码",
+      default: "SKU",
     },
     // 货物额外信息
     goodDesValue: {
@@ -90,12 +90,14 @@ export default {
     display: flex;
     align-items: center;
     padding: 0 24rpx;
+    position: relative;
 
     &-name-box {
       display: flex;
     }
     &-name {
-      width: 520rpx;
+      flex: 1;
+      max-width: 520rpx;
       overflow: hidden;
       white-space: nowrap;
       text-overflow: ellipsis;
@@ -106,7 +108,7 @@ export default {
       margin-bottom: 16rpx;
 
       &.has-status {
-        width: 400rpx;
+        padding-right: 140rpx;
       }
     }
     &-txm {
@@ -114,8 +116,11 @@ export default {
       font-family: "PingFang SC";
       font-size: 28rpx;
       font-weight: 400;
+      word-break: break-all;
     }
     .good-status {
+      position: absolute;
+      right: 20rpx;
       width: 120rpx;
       height: 44rpx;
       border-radius: 8rpx;

+ 1 - 1
components/good-item/good-item.vue

@@ -10,7 +10,7 @@
           ></u-image>
           <view class="ss-m-l-16">
             <view class="good-msg-name">{{ item.materialName }}</view>
-            <view class="good-msg-txm">条形码:{{ item.barCode }}</view>
+            <view class="good-msg-txm">SKU:{{ item.sku }}</view>
           </view>
         </view>
         <view class="good-cont">

+ 128 - 0
components/task-card/task-card.vue

@@ -0,0 +1,128 @@
+<template>
+  <view class="task-card">
+    <view class="task-card-flex">
+      <view
+        v-for="(col, index) in _columns"
+        class="task-col"
+        :key="index"
+        :style="getColStyle(col)"
+        @click.stop="handleClickField(col.key)"
+      >
+        <view class="task-col-label" :style="getColLabelStyle(col)"
+          >{{ col.title }}:</view
+        >
+        <view class="task-col-value" :style="getColValueStyle(col)">{{
+          getFieldValue(col)
+        }}</view>
+      </view>
+    </view>
+    <view class="task-card-right-top" v-if="$slots.rightTop">
+      <slot name="rightTop"></slot>
+    </view>
+    <u-divider></u-divider>
+    <!-- 操作区域 -->
+    <slot name="action"></slot>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    /**
+     * title: 标题
+     * key: key值
+     * formatter: 格式化函数
+     * isShow: 显/隐函数
+     * span: 列, 12|24
+     */
+    columns: {
+      type: Array,
+      default: () => [],
+    },
+    formData: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  computed: {
+    _columns() {
+      return this.columns.filter((col) => {
+        if (col.isShow && col.isShow instanceof Function) {
+          return col.isShow(col.key, { ...this.formData }, col);
+        }
+        return true;
+      });
+    },
+  },
+  data() {
+    return {};
+  },
+  methods: {
+    /**
+     * 点击事件
+     * @param {String} key 字段名
+     */
+    handleClickField(key) {
+      this.$emit("handleClickField", key, { ...this.formData });
+    },
+    getColStyle(col) {
+      if (col.span) {
+        return { width: `${(col.span / 24) * 100}%` };
+      }
+      return { width: "100%" };
+    },
+    getColLabelStyle(col) {
+      return col.titleStyle || {};
+    },
+    getColValueStyle(col) {
+      return col.valueStyle || {};
+    },
+    getFieldValue(col) {
+      const formData = { ...this.formData };
+      if (col.formatter && col.formatter instanceof Function) {
+        return col.formatter(col.key, formData, col);
+      }
+      return formData[col.key] || "-";
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.task-card {
+  width: 100%;
+  background-color: #fff;
+  border-radius: 16rpx;
+  padding: 24rpx 24rpx 0;
+  margin-bottom: 24rpx;
+  position: relative;
+
+  .task-card-right-top {
+    position: absolute;
+    right: 24rpx;
+    top: 36rpx;
+  }
+
+  .task-card-flex {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+  }
+
+  .task-col {
+    display: flex;
+    align-items: center;
+    color: #666;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 400;
+    margin-top: 16rpx;
+
+    &-value {
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+  }
+}
+</style>

+ 183 - 169
components/task-item/task-item.vue

@@ -1,176 +1,190 @@
 <template>
-	<view class="task-item">
-		<view @click="detailClick">
-			<view class="task-head">
-				<view class="sn-box">单据编号:{{item.number}}</view>
-				<view v-if="type == 'caigou'">
-					<view class="tips tips-red" v-if="item.status == 1">待入库</view>
-					<view class="tips tips-greed" v-if="item.status == 2">已入库</view>
-					<view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
-				</view>
-				<view v-else>
-					<view class="tips tips-red" v-if="item.status == 1">待拣货</view>
-					<view class="tips tips-greed" v-if="item.status == 2">已拣货</view>
-					<view class="tips tips-yellow" v-if="item.status == 4">拣货中</view>
-				</view>
-			</view>
-			<view class="task-line" v-if="type == 'caigou'">
-				<view>供应商:</view>
-				<view>{{item.supplierName}}</view>
-			</view>
-			<view class="task-line" v-else>
-			<view>客户名称:</view>
-			<view>{{item.supplierName}}</view>
-			</view>
-			<view class="task-line">
-				<view>单据日期:</view>
-				<view>{{item.createTime}}</view>
-			</view>
-			<view class="task-line">
-				<view class="task-line2">
-					<view>货物总数:</view>
-					<view class="task-num">{{item.goodsQuantity}}件</view>
-				</view>
-				<view class="task-line2">
-					<view>货物种类:</view>
-					<view class="task-num">{{item.goodsTypeCount || 0}}种</view>
-				</view>
-			</view>
-		</view>
-		<view class="task-bottom">
-			<view v-if="type == 'caigou'">
-				<view class="btn btn-1" v-if="item.status == 1 || item.status == 4" @click="toStorage">去入库</view>
-				<view class="btn btn-2" v-else @click="toDetail">详情</view>
-			</view>
-			<view v-else>
-				<view class="btn btn-1" v-if="item.status == 1 || item.status == 4" @click="toStorage">去出库</view>
-				<view class="btn btn-2" v-else @click="toDetail">详情</view>
-			</view>
-		</view>
-	</view>
+  <view class="task-item">
+    <view @click="detailClick">
+      <view class="task-head">
+        <view class="sn-box">单据编号:{{ item.number }}</view>
+        <view v-if="type == 'caigou'">
+          <view class="tips tips-red" v-if="item.status == 1">待入库</view>
+          <view class="tips tips-red" v-if="item.status == 6">待复核</view>
+          <view class="tips tips-red" v-if="item.status == 7">复核驳回</view>
+          <view class="tips tips-greed" v-if="item.status == 3">部分入库</view>
+          <view class="tips tips-greed" v-if="item.status == 2">已入库</view>
+          <view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
+        </view>
+        <view v-else>
+          <view class="tips tips-red" v-if="item.status == 1">待拣货</view>
+          <view class="tips tips-red" v-if="item.status == 6">待复核</view>
+          <view class="tips tips-red" v-if="item.status == 7">复核驳回</view>
+          <view class="tips tips-greed" v-if="item.status == 3">部分拣货</view>
+          <view class="tips tips-greed" v-if="item.status == 2">已拣货</view>
+          <view class="tips tips-yellow" v-if="item.status == 4">拣货中</view>
+        </view>
+      </view>
+      <view class="task-line" v-if="type == 'caigou'">
+        <view>供应商:</view>
+        <view>{{ item.supplierName }}</view>
+      </view>
+      <view class="task-line" v-else>
+        <view>客户名称:</view>
+        <view>{{ item.supplierName }}</view>
+      </view>
+      <view class="task-line">
+        <view>单据日期:</view>
+        <view>{{ item.createTime }}</view>
+      </view>
+      <view class="task-line">
+        <view class="task-line2">
+          <view>货物总数:</view>
+          <view class="task-num">{{ item.goodsQuantity }}件</view>
+        </view>
+        <view class="task-line2">
+          <view>货物种类:</view>
+          <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
+        </view>
+      </view>
+    </view>
+    <view class="task-bottom">
+      <view v-if="type == 'caigou'">
+        <view
+          class="btn btn-1"
+          v-if="item.status == 1 || item.status == 4 || item.status == 7"
+          @click="toStorage"
+          >去入库</view
+        >
+        <view class="btn btn-2" v-else @click="toDetail">详情</view>
+      </view>
+      <view v-else>
+        <view
+          class="btn btn-1"
+          v-if="item.status == 1 || item.status == 4 || item.status == 7"
+          @click="toStorage"
+          >去出库</view
+        >
+        <view class="btn btn-2" v-else @click="toDetail">详情</view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default{
-		props:{
-			item:{
-				type:Object,
-				default:()=>{}
-			},
-			type: {
-				type:String,
-				default:''
-			}
-		},
-		data() {
-			return{
-				
-			}
-		},
-		methods:{
-			toStorage() {
-				this.$emit('toStorage',this.item)
-			},
-			toDetail() {
-				this.$emit('toDetail',this.item)
-			},
-			detailClick() {
-				if(this.item.status == 1 || this.item.status == 4) {
-					this.toStorage()
-				}else {
-					this.toDetail()
-				}
-			}
-		}
-	}
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => {},
+    },
+    type: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {};
+  },
+  methods: {
+    toStorage() {
+      this.$emit("toStorage", this.item);
+    },
+    toDetail() {
+      this.$emit("toDetail", this.item);
+    },
+    detailClick() {
+      if (this.item.status == 1 || this.item.status == 4) {
+        this.toStorage();
+      } else {
+        this.toDetail();
+      }
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.task-item {
-		width: 100%;
-		background-color: #fff;
-		border-radius: 16rpx;
-		padding: 24rpx 24rpx 0;
-		margin-bottom: 24rpx;
-		.task-head {
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			.sn-box {
-				color: #333;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 500;
-			}
-			.tips {
-				font-family: "PingFang SC";
-				font-size: 22rpx;
-				font-weight: 400;
-				width: 120rpx;
-				height: 44rpx;
-				border-radius: 8rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-			}
-			.tips-red {
-				color: #FF3B1D;
-				background: rgba(255, 59, 29, 0.20);
-			}
-			.tips-greed {
-				color: #00B97B;
-				background: rgba(0, 185, 123, 0.20);
-			}
-			.tips-yellow {
-				color: #F57701;
-				background: rgba(245, 151, 1, 0.20);
-			}
-		}
-	
-		.task-line {
-			display: flex;
-			align-items: center;
-			color: #666;
-			font-family: "PingFang SC";
-			font-size: 28rpx;
-			font-weight: 400;
-			margin-top: 16rpx;
-		}
-		.task-line2 {
-			width: 50%;
-			display: flex;
-			align-items: center;
-			.task-num {
-				color: #0256FF;;
-			}
-		}
-	
-		.task-bottom {
-			border-top: 1px solid #F0F0F0;
-			margin-top: 32rpx;
-			height: 104rpx;
-			display: flex;
-			align-items: center;
-			justify-content: flex-end;
-			.btn {
-				width: 144rpx;
-				height: 56rpx;
-				border-radius: 8rpx;
-				font-size: 28rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				font-family: "PingFang SC";
-			}
-			.btn-1 {
-				background: #0256FF;
-				color: #FFF;
-			}
-			.btn-2 {
-				border: 1px solid #0256FF;
-				background: rgba(2, 86, 255, 0.20);
-				color: #0256FF;
-			}
-		}
-	}
-</style>
+.task-item {
+  width: 100%;
+  background-color: #fff;
+  border-radius: 16rpx;
+  padding: 24rpx 24rpx 0;
+  margin-bottom: 24rpx;
+  .task-head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    .sn-box {
+      color: #333;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 500;
+    }
+    .tips {
+      font-family: "PingFang SC";
+      font-size: 22rpx;
+      font-weight: 400;
+      width: 120rpx;
+      height: 44rpx;
+      border-radius: 8rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .tips-red {
+      color: #ff3b1d;
+      background: rgba(255, 59, 29, 0.2);
+    }
+    .tips-greed {
+      color: #00b97b;
+      background: rgba(0, 185, 123, 0.2);
+    }
+    .tips-yellow {
+      color: #f57701;
+      background: rgba(245, 151, 1, 0.2);
+    }
+  }
+
+  .task-line {
+    display: flex;
+    align-items: center;
+    color: #666;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 400;
+    margin-top: 16rpx;
+  }
+  .task-line2 {
+    width: 50%;
+    display: flex;
+    align-items: center;
+    .task-num {
+      color: #0256ff;
+    }
+  }
+
+  .task-bottom {
+    border-top: 1px solid #f0f0f0;
+    margin-top: 32rpx;
+    height: 104rpx;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    .btn {
+      width: 144rpx;
+      height: 56rpx;
+      border-radius: 8rpx;
+      font-size: 28rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-family: "PingFang SC";
+    }
+    .btn-1 {
+      background: #0256ff;
+      color: #fff;
+    }
+    .btn-2 {
+      border: 1px solid #0256ff;
+      background: rgba(2, 86, 255, 0.2);
+      color: #0256ff;
+    }
+  }
+}
+</style>

+ 12 - 8
pages.json

@@ -47,7 +47,12 @@
     {
       "path": "pages/index/notice-page",
       "style": {
-        "navigationBarTitleText": ""
+        "navigationBarTitleText": "",
+        "enablePullDownRefresh": true,
+        "onReachBottomDistance": 50,
+        "app-plus": {
+          "bounce": "none"
+        }
       }
     },
     {
@@ -128,13 +133,12 @@
     {
       "path": "pages/audit-task/index",
       "style": {
-        "navigationBarTitleText": ""
-      }
-    },
-    {
-      "path": "pages/audit-task/go-audit",
-      "style": {
-        "navigationBarTitleText": ""
+        "navigationBarTitleText": "",
+        "enablePullDownRefresh": true,
+        "onReachBottomDistance": 50,
+        "app-plus": {
+          "bounce": "none"
+        }
       }
     }
   ],

+ 0 - 189
pages/audit-task/components/task-item.vue

@@ -1,189 +0,0 @@
-<template>
-  <view class="task-item">
-    <view @click="detailClick">
-      <view class="task-head">
-        <view class="sn-box">单据编号:{{ item.number }}</view>
-        <view>
-          <view class="tips tips-red" v-if="item.status == 1">待审核</view>
-          <view class="tips tips-greed" v-if="item.status == 2">已入库</view>
-          <view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
-        </view>
-      </view>
-      <view class="task-line">
-        <view>客户名称:</view>
-        <view>{{ item.supplierName }}</view>
-      </view>
-      <view class="task-line">
-        <view>单据日期:</view>
-        <view>{{ item.createTime }}</view>
-      </view>
-      <view class="task-line">
-        <view class="task-line2">
-          <view>类别:</view>
-          <view>采购入库</view>
-        </view>
-        <view class="task-line2">
-          <view>入库人:</view>
-          <view>张三</view>
-        </view>
-        <!-- <view class="task-line2">
-          <view>出库人:</view>
-          <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
-        </view> -->
-      </view>
-      <view class="task-line">
-        <view class="task-line2">
-          <view>货物总数:</view>
-          <view class="task-num">{{ item.goodsQuantity }}件</view>
-        </view>
-        <view class="task-line2">
-          <view>货物种类:</view>
-          <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
-        </view>
-      </view>
-    </view>
-    <view class="action-box">
-      <view class="task-line" style="font-size: 24rpx; margin: 0">
-        <view>入库时间:</view>
-        <view>2021-11-21 00:00:03</view>
-      </view>
-      <view class="task-bottom">
-        <view
-          class="btn btn-1"
-          v-if="item.status == 1 || item.status == 4"
-          @click="toAudit"
-          >去审核</view
-        >
-        <view class="btn btn-2" v-else @click="toDetail">详情</view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  props: {
-    item: {
-      type: Object,
-      default: () => {},
-    },
-    type: {
-      type: String,
-      default: "",
-    },
-  },
-  data() {
-    return {};
-  },
-  methods: {
-    toAudit() {
-      this.$emit("toAudit", this.item);
-    },
-    toDetail() {
-      this.$emit("toDetail", this.item);
-    },
-    detailClick() {
-      if (this.item.status == 1 || this.item.status == 4) {
-        this.toAudit();
-      } else {
-        this.toDetail();
-      }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.task-item {
-  width: 100%;
-  background-color: #fff;
-  border-radius: 16rpx;
-  padding: 24rpx 24rpx 0;
-  margin-bottom: 24rpx;
-  .task-head {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    .sn-box {
-      color: #333;
-      font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 500;
-    }
-    .tips {
-      font-family: "PingFang SC";
-      font-size: 22rpx;
-      font-weight: 400;
-      width: 120rpx;
-      height: 44rpx;
-      border-radius: 8rpx;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-    }
-    .tips-red {
-      color: #ff3b1d;
-      background: rgba(255, 59, 29, 0.2);
-    }
-    .tips-greed {
-      color: #00b97b;
-      background: rgba(0, 185, 123, 0.2);
-    }
-    .tips-yellow {
-      color: #f57701;
-      background: rgba(245, 151, 1, 0.2);
-    }
-  }
-
-  .task-line {
-    display: flex;
-    align-items: center;
-    color: #666;
-    font-family: "PingFang SC";
-    font-size: 28rpx;
-    font-weight: 400;
-    margin-top: 16rpx;
-  }
-  .task-line2 {
-    width: 50%;
-    display: flex;
-    align-items: center;
-    .task-num {
-      color: #0256ff;
-    }
-  }
-
-  .action-box {
-    margin-top: 32rpx;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-  }
-  .task-bottom {
-    border-top: 1px solid #f0f0f0;
-    height: 104rpx;
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-    .btn {
-      width: 144rpx;
-      height: 56rpx;
-      border-radius: 8rpx;
-      font-size: 28rpx;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      font-family: "PingFang SC";
-    }
-    .btn-1 {
-      background: #0256ff;
-      color: #fff;
-    }
-    .btn-2 {
-      border: 1px solid #0256ff;
-      background: rgba(2, 86, 255, 0.2);
-      color: #0256ff;
-    }
-  }
-}
-</style>

+ 0 - 411
pages/audit-task/go-audit.vue

@@ -1,411 +0,0 @@
-<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">
-            {{ 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"
-              >
-              </u-number-box>
-            </view>
-          </good-item>
-        </block>
-      </view>
-    </view>
-    <view class="footer-box">
-      <u-button class="cancelBtn" @tap="showReject = true">驳回</u-button>
-      <u-button class="submitBtn">复核通过</u-button>
-    </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>
-    <rejectPop :show.sync="showReject" />
-  </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";
-import rejectPop from "./components/reject-pop.vue";
-export default {
-  mixins: [blePrintMixin],
-  components: {
-    goodItem,
-    rejectPop,
-  },
-  data() {
-    return {
-      errorShow: false,
-      successShow: false,
-      value: 0,
-      isUnfold: true, //是否展开
-      orderInfo: {},
-      goodsList: [],
-      status: null,
-
-      showReject: false,
-    };
-  },
-  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;
-
-  .container_main {
-    padding: 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;
-
-        &-label {
-          width: 162rpx;
-        }
-
-        .must-box {
-          color: #ff3b1d;
-        }
-      }
-    }
-
-    .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-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-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%);
-        }
-
-        .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;
-        }
-      }
-    }
-  }
-
-  .footer-box {
-    background-color: #fff;
-    height: 176rpx;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    .cancelBtn {
-      width: 244rpx;
-      height: 80rpx;
-      border-radius: 16rpx;
-      color: #666;
-      font-family: "PingFang SC";
-      font-size: 32rpx;
-      font-weight: 500;
-      margin-right: 20rpx;
-    }
-    .submitBtn {
-      width: 244rpx;
-      height: 80rpx;
-      border-radius: 16rpx;
-      background: #0256ff;
-      color: #fff;
-      font-size: 32rpx;
-      font-weight: 500;
-    }
-  }
-}
-</style>

+ 284 - 97
pages/audit-task/index.vue

@@ -18,7 +18,7 @@
             placeholder="请输入单据编号"
             bgColor="#fff"
             shape="square"
-            v-model="params.number"
+            v-model="query.number"
             :showAction="false"
             @search="searchClick"
             @clear="searchClick"
@@ -42,21 +42,70 @@
         </view>
       </u-sticky>
       <view class="task-cont">
-        <block v-for="(item, i) in taskList" :key="`${item.id}-${item.status}`">
-          <task-item
-            :item="item"
-            @toAudit="toAudit"
-            @toDetail="toDetail"
-            type="caigou"
-          ></task-item>
+        <block v-for="(item, i) in list" :key="`${item.id}-${item.status}`">
+          <task-card
+            :columns="taskColumns"
+            :formData="item"
+            @handleClickField="handleClickField"
+          >
+            <!-- 状态 -->
+            <view slot="rightTop">
+              <u-tag
+                v-if="item.status == 6"
+                text="待复核"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="rgba(255, 59, 29, 1)"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 2"
+                text="复核通过"
+                plain
+                borderColor="rgba(0, 185, 123, 0.2)"
+                color="rgba(0, 185, 123, 1)"
+                bgColor="rgba(0, 185, 123, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 7"
+                text="复核驳回"
+                plain
+                borderColor="rgba(225, 51, 15, 1)"
+                color="rgba(255, 255, 255, 1)"
+                bgColor="rgba(225, 51, 15, 1)"
+              ></u-tag>
+            </view>
+            <!-- 操作栏 -->
+            <view slot="action" class="action-box">
+              <view class="action-left-box">
+                <text v-if="item.type == '采购订单'"
+                  >入库时间: {{ item.operTime }}</text
+                >
+                <text v-if="item.type == '销售订单'"
+                  >出库时间: {{ item.operTime }}</text
+                >
+              </view>
+              <view class="task-bottom">
+                <view
+                  class="btn btn-1"
+                  @click="toAudit(item)"
+                  v-if="item.status == 6"
+                  >去复核</view
+                >
+                <view class="btn btn-2" @click="toDetail(item)" v-else
+                  >详情</view
+                >
+              </view>
+            </view>
+          </task-card>
         </block>
-        <u-loadmore v-if="taskList.length > 0" :status="status" />
+        <u-loadmore v-if="list.length > 0" :status="loadStatus" />
         <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"
+          v-if="list.length == 0"
         ></u-empty>
       </view>
     </view>
@@ -81,16 +130,13 @@
 </template>
 
 <script>
-import taskItem from "./components/task-item.vue";
-import {
-  purchaseInventory,
-  orderStartHandle,
-} from "@/common/request/apis/purchase";
+import taskCard from "@/components/task-card/task-card.vue";
 import { mapGetters } from "vuex";
+import { reviewTaskList } from "@/common/request/apis/aduit.js";
 
 export default {
   components: {
-    taskItem,
+    taskCard,
   },
   data() {
     return {
@@ -106,16 +152,16 @@ export default {
             id: "",
           },
           {
-            label: "待入库",
-            id: "1",
+            label: "待复核",
+            id: 6,
           },
           {
-            label: "入库中",
-            id: "4",
+            label: "复核通过",
+            id: 2,
           },
           {
-            label: "已入库",
-            id: "2",
+            label: "复核驳回",
+            id: 7,
           },
         ],
       ],
@@ -138,27 +184,88 @@ export default {
       ],
       defaultIndex2: [],
       defaultIndex3: [],
-      taskList: [
+
+      taskColumns: [
+        {
+          title: "单据编号",
+          key: "number",
+          titleStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+          valueStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+        },
+        {
+          title: "供应商名称",
+          key: "supplierName",
+          isShow(key, formData, col) {
+            return formData.type == "采购订单";
+          },
+        },
+        {
+          title: "客户名称",
+          key: "supplierName",
+          isShow(key, formData, col) {
+            return formData.type == "销售订单";
+          },
+        },
+        {
+          title: "单据日期",
+          key: "createTime",
+        },
+        {
+          title: "类别",
+          key: "type",
+          span: 12,
+        },
         {
-          number: "CGDD00000000692",
-          status: "1",
-          id: "1",
-          supplierName: "快马阳光便利店",
-          createTime: "2021-11-21 00:00:03",
-          goodsQuantity: "55",
-          goodsTypeCount: "5",
+          title: "入库人",
+          key: "operName",
+          span: 12,
+          isShow(key, formData, col) {
+            return formData.type == "采购订单";
+          },
+        },
+        {
+          title: "出库人",
+          key: "operName",
+          span: 12,
+          isShow(key, formData, col) {
+            return formData.type == "销售订单";
+          },
+        },
+        {
+          title: "货物总数",
+          key: "goodsQuantity",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
+        },
+        {
+          title: "货物种类",
+          key: "goodsTypeCount",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
         },
       ],
-      params: {
+      list: [],
+      currentPage: 1,
+      pageSize: 10,
+      query: {
         beginTime: "",
         endTime: "",
         number: "",
         status: "",
-        currentPage: 1,
-        pageSize: 10,
       },
-      status: "loadmore",
-      lastPage: 1,
+      loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
     };
   },
   computed: {
@@ -174,16 +281,16 @@ export default {
     let systemInfo = uni.getSystemInfoSync();
     let statusBarHeight = systemInfo.statusBarHeight;
     this.offsetTop = statusBarHeight + 40;
-    // this.init();
+    this.loadData();
   },
   onShow() {
     uni.$on("scanFinish", (data) => {
-      this.params.number = data;
-      this.init();
+      this.query.number = data;
+      this.loadData(true);
     });
-    if (uni.getStorageSync("orderRefresh")) {
-      this.init();
-      uni.removeStorageSync("orderRefresh");
+    if (uni.getStorageSync("auditTaskRefresh")) {
+      this.loadData(true);
+      uni.removeStorageSync("auditTaskRefresh");
     }
   },
   onHide() {
@@ -192,34 +299,65 @@ export default {
   onUnload() {
     uni.$off("scanFinish");
   },
+  onPullDownRefresh() {
+    // 下拉刷新
+    this.onRefresh();
+  },
   onReachBottom() {
-    if (this.params.currentPage < this.lastPage) {
-      this.params.currentPage++;
-      this.getPurchaseInventory();
-    }
+    // 触底加载更多
+    this.onLoadMore();
   },
   methods: {
     scanCode() {
       this.$scan.scanCode();
     },
-    init() {
-      uni.showLoading();
-      this.params.currentPage = 1;
-      this.taskList = [];
-      this.getPurchaseInventory();
+    async onLoadMore() {
+      if (this.loadStatus !== "loadmore") return;
+      this.loadStatus = "loading";
+      try {
+        await this.loadData();
+      } catch (e) {
+        this.loadStatus = "loadmore";
+      }
     },
-    searchClick() {
-      this.init();
+    async onRefresh() {
+      try {
+        await this.loadData(true);
+      } finally {
+        uni.stopPullDownRefresh();
+      }
     },
-    // 点击操作
-    toOrderStartHandle(id, status) {
-      orderStartHandle(id).then((res) => {
-        if (res.code == 200) {
-          uni.navigateTo({
-            url: `/pages/purchase/put-storage?id=${id}&status=${status}`,
-          });
+    async loadData(isRefresh = false) {
+      if (isRefresh) {
+        this.currentPage = 1;
+        this.list = [];
+      }
+
+      try {
+        this.loadStatus = "loading";
+        const currentPage = this.currentPage;
+        const pageSize = this.pageSize;
+        const params = {
+          currentPage,
+          pageSize,
+          ...this.query,
+          depotId: this.curDepotId,
+        };
+        console.log("params=====", params);
+        const res = await reviewTaskList(params);
+        const { rows, total } = res.data;
+        console.log("res====", res);
+        this.list = [...this.list, ...rows];
+        if (currentPage * pageSize < Number(total)) {
+          this.currentPage++;
+          this.loadStatus = "loadmore";
+        } else {
+          this.loadStatus = "nomore";
         }
-      });
+      } catch (error) {}
+    },
+    searchClick() {
+      this.loadData(true);
     },
     tabClick(type) {
       switch (type) {
@@ -233,65 +371,70 @@ export 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.query.status = val.value[0].id;
       this.statusShow = false;
-      this.init();
+      this.loadData(true);
     },
     dateConfirm(val) {
       this.type2 = val.value[0];
       this.dateShow = false;
       let month = val.indexs[0];
       this.getLastDayOfMonth(month);
-      this.init();
+      this.loadData(true);
     },
     // 获取开始时间、结束时间
     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}`;
+        this.query.beginTime = `${year}-${month}-01`;
+        this.query.endTime = `${year}-${month}-${monthStart}`;
       } else {
-        this.params.beginTime = "";
-        this.params.endTime = "";
+        this.query.beginTime = "";
+        this.query.endTime = "";
       }
     },
+    handleClickField(key, itemData) {
+      console.log("key===", key);
+      console.log("itemData===", itemData);
+      this.toDetail(itemData);
+    },
     // 审核
     toAudit(val) {
-      uni.navigateTo({
-        url: `/pages/audit-task/go-audit?id=${val.id}&status=${val.status}`,
-      });
-      // this.toOrderStartHandle(val.id, val.status);
+      const type = val.type;
+      switch (type) {
+        case "采购订单":
+          uni.navigateTo({
+            url: `/pages/purchase/detail?id=${val.id}&auditState=1`,
+          });
+          break;
+        case "销售订单":
+          uni.navigateTo({
+            url: `/pages/picking-task/detail?id=${val.id}&auditState=1`,
+          });
+          break;
+        default:
+          break;
+      }
     },
     toDetail(val) {
-      uni.navigateTo({
-        url: `/pages/purchase/detail?id=${val.id}&status=${val.status}`,
-      });
+      const type = val.type;
+      switch (type) {
+        case "采购订单":
+          uni.navigateTo({
+            url: `/pages/purchase/detail?id=${val.id}`,
+          });
+          break;
+        case "销售订单":
+          uni.navigateTo({
+            url: `/pages/picking-task/detail?id=${val.id}`,
+          });
+          break;
+        default:
+          break;
+      }
     },
   },
 };
@@ -351,4 +494,48 @@ export default {
     }
   }
 }
+
+.action-box {
+  padding-bottom: 24rpx;
+  height: 80rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  width: 100%;
+}
+
+.action-left-box {
+  display: inline-flex;
+  align-items: center;
+  color: #666;
+  font-family: "PingFang SC";
+  font-size: 24rpx;
+  font-weight: 400;
+}
+.task-bottom {
+  flex: 1;
+  display: inline-flex;
+  align-items: center;
+  justify-content: flex-end;
+  .btn {
+    width: 144rpx;
+    height: 56rpx;
+    border-radius: 8rpx;
+    font-size: 28rpx;
+    line-height: 56rpx;
+    text-align: center;
+    margin-left: 12rpx;
+    font-family: "PingFang SC";
+  }
+  .btn-1 {
+    background: #0256ff;
+    color: #fff;
+  }
+  .btn-2 {
+    border: 1px solid #0256ff;
+    background: rgba(2, 86, 255, 0.2);
+    color: #0256ff;
+  }
+}
 </style>

+ 86 - 34
pages/goods-enter/addGood.vue

@@ -18,12 +18,14 @@
         labelPosition="left"
         :model="form"
         :rules="rules"
+        ref="uForm"
         labelWidth="90"
       >
         <u-form-item
           label="货物条码"
           prop="barCode"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
           <u-input v-model="form.barCode" border="none" placeholder="请输入">
@@ -38,24 +40,26 @@
         </u-form-item>
         <u-form-item
           label="货物名称"
-          prop="materialName"
+          prop="name"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
           <u-input
-            v-model="form.materialName"
+            v-model="form.name"
             border="none"
             placeholder="请输入"
           ></u-input>
         </u-form-item>
         <u-form-item
           label="规格"
-          prop="materialStandard"
+          prop="standard"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
           <u-input
-            v-model="form.materialStandard"
+            v-model="form.standard"
             border="none"
             placeholder="请输入"
           ></u-input>
@@ -64,6 +68,7 @@
           label="生产日期"
           prop="productionDate"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
           <view
@@ -74,30 +79,22 @@
         </u-form-item>
         <u-form-item
           label="上传图片"
-          prop="img"
+          prop="imgName"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
-          <u-upload
-            :fileList="fileList"
-            @afterRead="afterRead"
-            @delete="deletePic"
-            name="file"
-            width="120rpx"
-            height="120rpx"
-            :maxCount="2"
-          >
-            <u-image
-              src="@/static/image/upload-img.png"
-              width="120rpx"
-              height="120rpx"
-            ></u-image>
-          </u-upload>
+          <upload-image
+            v-model="form.imgName"
+            width="196rpx"
+            height="196rpx"
+          ></upload-image>
         </u-form-item>
         <u-form-item
           label="库位"
           prop="position"
           borderBottom
+          required
           customStyle="padding: 30rpx 0"
         >
           <u-input
@@ -126,20 +123,64 @@
 
 <script>
 import { mapGetters } from "vuex";
-
+import { goodsSave } from "@/common/request/apis/goodsEnter.js";
 export default {
   data() {
     return {
       form: {
-        materialName: "",
         barCode: "",
+        name: "",
+        standard: "",
+        imgName: "",
+        position: "",
         productionDate: "",
-        unit: "",
       },
-      rules: {},
+      rules: {
+        barCode: [
+          {
+            required: true,
+            message: "请输入货物条码",
+            trigger: ["blur", "change"],
+          },
+        ],
+        name: [
+          {
+            required: true,
+            message: "请输入货物名称",
+            trigger: ["blur", "change"],
+          },
+        ],
+        standard: [
+          {
+            required: true,
+            message: "请输入规格",
+            trigger: ["blur", "change"],
+          },
+        ],
+        productionDate: [
+          {
+            required: true,
+            message: "请输入生产日期",
+            trigger: ["blur", "change"],
+          },
+        ],
+        imgName: [
+          {
+            required: true,
+            message: "请上传图片",
+            trigger: ["blur", "change"],
+          },
+        ],
+        position: [
+          {
+            required: true,
+            message: "请输入库位",
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
       showDatePicker: false,
       dateVal: "",
-      fileList: [],
     };
   },
   computed: {
@@ -170,16 +211,27 @@ export default {
       console.log("form====", this.form);
       this.showDatePicker = false;
     },
-    deletePic(e) {
-      console.log("deletePic====", e);
-      this.fileList.splice(e.index, 1);
-    },
-    afterRead(e) {
-      console.log("afterRead====", e);
-      const { file } = e;
-      this.fileList.push(file);
+    save() {
+      this.$refs.uForm
+        .validate()
+        .then(async (res) => {
+          try {
+            const params = { ...this.form, depotId: this.curDepotId };
+            const result = await goodsSave(params);
+            console.log("result====", result);
+            if (result.code === 200) {
+              uni.$u.toast(result.msg);
+              setTimeout(() => {
+                uni.navigateBack();
+              }, 1000);
+              uni.setStorageSync("goodsEnterRefresh", true);
+            } else {
+              uni.$u.toast(res.data);
+            }
+          } catch (error) {}
+        })
+        .catch((errors) => {});
     },
-    save() {},
   },
 };
 </script>

+ 61 - 72
pages/goods-enter/index.vue

@@ -21,9 +21,9 @@
               :showAction="false"
               @search="handleSearch"
               @clear="handleSearch"
-              v-model="query.number"
+              v-model="query.keyword"
             ></u-search>
-            <view class="scan-icon flex_box flex_row_center" @click="">
+            <view class="scan-icon flex_box flex_row_center" @click="scanCode">
               <image src="@/static/image/scan-icon-2.png" mode=""></image>
             </view>
           </view>
@@ -31,26 +31,20 @@
       </u-sticky>
       <view class="content-box">
         <view class="content-list" v-if="list.length > 0">
-          <view class="content-list-title">
-            <view>入库货物清单</view>
-            <view class="content-list-title-tips">(轻触货物查看详情)</view>
-          </view>
           <goodCard
             v-for="(item, i) in list"
             :key="i"
-            :goodImg="item.imgNameArr[0] || ''"
-            :goodName="item.materialName"
+            :goodImg="item.imgName ? item.imgName.split(',')[0] : ''"
+            :goodName="item.name"
             :goodDesValue="item.barCode"
-            goodDesTitle="条码"
+            goodDesTitle="货物条码"
             :columns="columns"
             :item="item"
-            @handleClickField="handleClickField"
-            @clickItem="handleClickItem"
           >
             <view slot="status">
-              <view class="dsh">待审核</view>
-              <!-- <view class="zc">正常</view>
-              <view class="ybh">已驳回</view> -->
+              <view class="dsh" v-if="item.status == 0">待审核</view>
+              <view class="zc" v-if="item.status == 1">正常</view>
+              <view class="ybh" v-if="item.status == 8">已驳回</view>
             </view>
           </goodCard>
         </view>
@@ -79,76 +73,59 @@
 </template>
 
 <script>
-import { taskStocktakingList } from "@/common/request/apis/inventoryTask";
 import { mapGetters } from "vuex";
 import goodCard from "@/components/good-card/good-card.vue";
+import { goodsInputList } from "@/common/request/apis/goodsEnter.js";
 
 export default {
   components: {
     goodCard,
   },
   data() {
+    const that = this;
     return {
       offsetTop: 0,
       query: {
-        number: "",
+        keyword: "",
       },
       currentPage: 1,
       pageSize: 10,
       loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
 
       columns: [
-        { title: "规格", key: "materialStandard" },
-        { title: "批次号", key: "patchNumber" },
-        { title: "生产日期", key: "productionDate" },
-        { title: "库位", key: "position" },
+        { title: "规格", key: "standard" },
+        // { title: "批次号", key: "patchNumber" },
         {
-          title: "库存",
-          key: "inventory",
+          title: "生产日期",
+          key: "productionDate",
           formatter: (key, formData) => {
-            const inventory = formData.inventory
-              ? (formData.inventory * 1).toFixed(0)
-              : "0";
-            return `${inventory}${formData.commodityUnit || ""}`;
+            return formData.productionDate
+              ? that.$u.timeFormat(formData.productionDate, "yyyy-mm-dd")
+              : "/";
           },
         },
-        { title: "录入时间", key: "lrDate" },
-      ],
-      list: [
-        {
-          id: 1,
-          materialName:
-            "货物名称1货物名称1货物名称1货物名称1货物名称1货物名称1",
-          imgNameArr: [
-            "https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png",
-          ],
-          barCode: "6904045405",
-          materialStandard: "500ml",
-          productionDate: "2024-10-01",
-          lrDate: "2024-10-01",
-          inventory: 10,
-          commodityUnit: "瓶",
-          position: "A-1-1",
-          status: 1,
-          patchNumber: "12345678966",
-        },
+        { title: "库位", key: "position" },
+        // {
+        //   title: "库存",
+        //   key: "inventory",
+        //   formatter: (key, formData) => {
+        //     const inventory = formData.inventory
+        //       ? (formData.inventory * 1).toFixed(0)
+        //       : "0";
+        //     return `${inventory}${formData.commodityUnit || ""}`;
+        //   },
+        // },
         {
-          id: 2,
-          materialName: "货物名称2",
-          imgNameArr: [
-            "https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png",
-          ],
-          barCode: "6904045405",
-          materialStandard: "500ml",
-          productionDate: "2024-10-01",
-          lrDate: "2024-10-02",
-          inventory: 10,
-          commodityUnit: "瓶",
-          position: "A-1-2",
-          status: 1,
-          patchNumber: "12345678966",
+          title: "录入时间",
+          key: "createTime",
+          formatter: (key, formData) => {
+            return formData.createTime
+              ? that.$u.timeFormat(formData.createTime, "yyyy-mm-dd hh:MM:ss")
+              : "/";
+          },
         },
       ],
+      list: [],
     };
   },
   computed: {
@@ -164,9 +141,24 @@ export default {
     let systemInfo = uni.getSystemInfoSync();
     let statusBarHeight = systemInfo.statusBarHeight;
     this.offsetTop = statusBarHeight + 40;
-    // this.loadData();
+    this.loadData();
+  },
+  onShow() {
+    uni.$on("scanFinish", (data) => {
+      this.query.keyword = data;
+      this.loadData(true);
+    });
+    if (uni.getStorageSync("goodsEnterRefresh")) {
+      this.loadData(true);
+      uni.removeStorageSync("goodsEnterRefresh");
+    }
+  },
+  onHide() {
+    uni.$off("scanFinish");
+  },
+  onUnload() {
+    uni.$off("scanFinish");
   },
-  onShow() {},
   onPullDownRefresh() {
     // 下拉刷新
     this.onRefresh();
@@ -176,6 +168,9 @@ export default {
     this.onLoadMore();
   },
   methods: {
+    scanCode() {
+      this.$scan.scanCode();
+    },
     async onRefresh() {
       try {
         await this.loadData(true);
@@ -209,8 +204,9 @@ export default {
           depotId: this.curDepotId,
         };
         console.log("params=====", params);
-        const res = await taskStocktakingList(params);
+        const res = await goodsInputList(params);
         const { rows, total } = res.data;
+        console.log("res====", res);
         this.list = [...this.list, ...rows];
         if (currentPage * pageSize < Number(total)) {
           this.currentPage++;
@@ -223,13 +219,6 @@ export default {
     handleSearch(value) {
       this.loadData(true);
     },
-    handleClickField(key, formData) {
-      console.log("key", key);
-      console.log("formData", formData);
-    },
-    handleClickItem(item) {
-      console.log("item", item);
-    },
     goAddGood() {
       uni.navigateTo({
         url: "/pages/goods-enter/addGood",
@@ -276,7 +265,7 @@ export default {
       }
     }
     .content-box {
-      padding: 0 24rpx;
+      padding: 0 24rpx 144rpx;
       &-val {
         border-radius: 16rpx 16rpx 0 0;
         overflow: hidden;
@@ -286,7 +275,7 @@ export default {
 }
 
 .content-list {
-  padding: 24rpx 0;
+  padding-top: 24rpx;
   background-color: #fff;
   margin-top: 24rpx;
   border-radius: 16rpx;

+ 12 - 5
pages/goods/detail.vue

@@ -25,7 +25,7 @@
             <text>货物条码</text>
           </view>
           <view class="info-line-value">
-            {{ goodsInfo.barCode }}
+            {{ goodsInfo.sku }}
           </view>
         </view>
         <view class="info-line">
@@ -133,7 +133,7 @@
           </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" v-for="(item, i) in cukList" :key="item.id">
             <view class="crk-item-title">{{ item.materialName }}</view>
             <!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
             <view class="crk-item-line"
@@ -193,7 +193,7 @@ import { mapGetters } from "vuex";
 export default {
   data() {
     return {
-      navTitle: "哇哈哈AD盖",
+      navTitle: "",
       goodsId: 0, //单据id
       // materialId:0,//商品id
       crkShow: false,
@@ -236,7 +236,7 @@ export default {
     getMaterialDetail() {
       materialDetail(`${this.goodsId}/${this.curDepotId}`).then((res) => {
         if (res.code == 200) {
-          console.log(res.data, "data---------");
+          console.log("data---------", res.data);
           if (res.data.imgName && res.data.imgName.length > 0) {
             res.data.imgNameArr = res.data.imgName.split(",");
           } else {
@@ -259,6 +259,7 @@ export default {
           if (res.code == 200) {
             this.cukList = res.data.rows;
           }
+          console.log("res====", res);
           uni.hideLoading();
         })
         .catch((err) => {
@@ -282,18 +283,24 @@ export default {
 
       .info-line {
         border-bottom: 1px solid #f4f4f4;
-        min-height: 92rpx;
+        padding: 24rpx 0;
         color: #333;
         font-family: "PingFang SC";
         font-size: 28rpx;
+        line-height: 1.5;
         font-weight: 400;
         display: flex;
         align-items: center;
 
         &-label {
+          flex: 0 0 162rpx;
           width: 162rpx;
         }
 
+        &-value {
+          word-break: break-all;
+        }
+
         .must-box {
           color: #ff3b1d;
         }

+ 117 - 100
pages/index/components/notice-item.vue

@@ -1,107 +1,124 @@
 <template>
-	<view class="notice-item">
-		<view class="item-head">
-			<view class="item-head-msg">
-				<view class="image-box">
-					<u-badge type="error" :isDot="true" :show="!item.isRead" :absolute="true" :offset="[-2,-2]"></u-badge>
-					<image :src="img" mode=""></image>
-				</view>
-				<view>{{typeText}}</view>
-			</view>
-			<view class="time-box">
-				{{$u.timeFormat(item.time, 'hh:MM:ss')}}
-			</view>
-		</view>
-		<view class="item-cont">
-			您有1条新的拣货任务(单号:{{item.sn}}),请点击查看并及时处理!
-		</view>
-		<view class="item-footer">
-			<view>查看详情</view>
-			<u-icon name="arrow-right" color="#7E838D"></u-icon>
-		</view>
-	</view>
+  <view class="notice-item">
+    <view class="item-head">
+      <view class="item-head-msg">
+        <view class="image-box">
+          <u-badge
+            type="error"
+            :isDot="true"
+            :show="!item.isRead"
+            :absolute="true"
+            :offset="[-2, -2]"
+          ></u-badge>
+          <image :src="img" mode=""></image>
+        </view>
+        <view>{{ item.type }}</view>
+      </view>
+      <view class="time-box">
+        {{ $u.timeFormat(item.time, "hh:MM:ss") }}
+      </view>
+    </view>
+    <view class="item-cont">
+      您有1条新的{{ item.type }}(单号:{{
+        item.content
+      }}),请点击查看并及时处理!
+    </view>
+    <view class="item-footer" @click="toDetail">
+      <view>查看详情</view>
+      <u-icon name="arrow-right" color="#7E838D"></u-icon>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default{
-		props:{
-			item:{
-				type:Object,
-				default:()=>{}
-			}
-		},
-		computed:{
-			img() {
-				let src = ""
-				if(this.item.type == 1) {
-					src = require('@/static/image/home/icon-cgrk.png')
-				}else if(this.item.type == 2) {
-					src = require('@/static/image/home/icon-chcx.png')
-				}
-				return src
-			},
-			typeText() {
-				let text = ""
-				if(this.item.type == 1) {
-					text = '采购入库'
-				}else if(this.item.type == 2) {
-					text = '存货查询'
-				}
-				return text
-			}
-		}
-	}
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  computed: {
+    img() {
+      const type = this.item.type;
+      let src = "";
+      switch (type) {
+        case "拣货任务":
+          src = require("@/static/image/home/icon-jhrw.png");
+          break;
+        case "采购入库":
+          src = require("@/static/image/home/icon-cgrk.png");
+          break;
+        case "盘点任务":
+          src = require("@/static/image/home/icon-pdrw.png");
+          break;
+        case "复核任务":
+          src = require("@/static/image/home/icon-fhrw.png");
+          break;
+
+        default:
+          break;
+      }
+      return src;
+    },
+  },
+  methods: {
+    toDetail() {
+      this.$emit("toDetail", { ...this.item });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.notice-item {
-		border-radius: 16px;
-		background: #FFF;
-		padding: 24rpx 24rpx 0;
-		margin-bottom: 24rpx;
-		.item-head {
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			&-msg {
-				display: flex;
-				align-items: center;
-				color: #333;
-				font-family: "PingFang SC";
-				font-size: 32rpx;
-				font-weight: bold;
-				.image-box {
-					position: relative;
-					margin-right: 24rpx;
-					image {
-						width: 48rpx;
-						height: 48rpx;
-						z-index: 2;
-					}
-					::v-deep .u-badge {
-						z-index: 3;
-					}
-				}
-			}
-		}
-	
-		.item-cont {
-			color: #666;
-			font-family: "PingFang SC";
-			font-size: 28rpx;
-			font-weight: 400;
-			padding: 17rpx 0 24rpx;
-			border-bottom: 1px solid #F4F4F4;
-		}
-		.item-footer {
-			height: 88rpx;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			color: #333;
-			font-family: "PingFang SC";
-			font-size: 28rpx;
-			font-weight: 400;
-		}
-	}
-</style>
+.notice-item {
+  border-radius: 16px;
+  background: #fff;
+  padding: 24rpx 24rpx 0;
+  margin-bottom: 24rpx;
+  .item-head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    &-msg {
+      display: flex;
+      align-items: center;
+      color: #333;
+      font-family: "PingFang SC";
+      font-size: 32rpx;
+      font-weight: bold;
+      .image-box {
+        position: relative;
+        margin-right: 24rpx;
+        image {
+          width: 48rpx;
+          height: 48rpx;
+          z-index: 2;
+        }
+        ::v-deep .u-badge {
+          z-index: 3;
+        }
+      }
+    }
+  }
+
+  .item-cont {
+    color: #666;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 400;
+    padding: 17rpx 0 24rpx;
+    border-bottom: 1px solid #f4f4f4;
+  }
+  .item-footer {
+    height: 88rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    color: #333;
+    font-family: "PingFang SC";
+    font-size: 28rpx;
+    font-weight: 400;
+  }
+}
+</style>

+ 1 - 1
pages/index/components/use-pop.vue

@@ -34,7 +34,7 @@
             <view class="use-msg-line-cont">
               <view>角色</view>
               <view class="line-value">
-                <view>{{ userInfo.position }}</view>
+                <view>{{ userInfo.roleName }}</view>
                 <!-- <u-icon name="arrow-right" color="#7E838D"></u-icon> -->
               </view>
             </view>

+ 119 - 20
pages/index/notice-page.vue

@@ -9,40 +9,136 @@
     >
     </u-navbar>
     <view class="container_main">
-      <view class="time-box"> 2025-04-03 星期四 </view>
-      <notice-item
-        v-for="(item, i) in noticeList"
-        :key="i"
-        :item="item"
-      ></notice-item>
+      <view v-for="(item, i) in list" :key="i" class="item-wrap">
+        <view class="time-box">{{ item.date }}</view>
+        <notice-item
+          v-for="child in item.msgList"
+          :key="child.id"
+          :item="child"
+          @toDetail="toDetail"
+        ></notice-item>
+      </view>
+      <!-- 加载更多 -->
+      <u-loadmore
+        v-if="list.length > 0"
+        :status="loadStatus"
+        @loadmore="onLoadMore"
+      />
+      <u-empty
+        mode="data"
+        text="暂无内容"
+        marginTop="60"
+        icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
+        v-if="list.length == 0"
+      ></u-empty>
     </view>
   </view>
 </template>
 
 <script>
 import noticeItem from "./components/notice-item.vue";
+import { getMsgList } from "@/common/request/apis/index.js";
 export default {
   components: {
     noticeItem,
   },
   data() {
     return {
-      noticeList: [
-        {
-          type: 1,
-          sn: "123654",
-          time: "",
-          isRead: false,
-        },
-        {
-          type: 2,
-          sn: "aa123654",
-          time: "",
-          isRead: true,
-        },
-      ],
+      currentPage: 1,
+      pageSize: 10,
+      loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
+      list: [],
     };
   },
+  onLoad() {
+    this.loadData();
+  },
+  onPullDownRefresh() {
+    // 下拉刷新
+    this.onRefresh();
+  },
+  onReachBottom() {
+    // 触底加载更多
+    this.onLoadMore();
+  },
+  methods: {
+    async onRefresh() {
+      try {
+        await this.loadData(true);
+      } finally {
+        uni.stopPullDownRefresh();
+      }
+    },
+    async onLoadMore() {
+      if (this.loadStatus !== "loadmore") return;
+      this.loadStatus = "loading";
+      try {
+        await this.loadData();
+      } catch (e) {
+        this.loadStatus = "loadmore";
+      }
+    },
+    async loadData(isRefresh = false) {
+      if (isRefresh) {
+        this.currentPage = 1;
+        this.list = [];
+      }
+
+      try {
+        this.loadStatus = "loading";
+        const currentPage = this.currentPage;
+        const pageSize = this.pageSize;
+        const params = {
+          currentPage,
+          pageSize,
+        };
+        console.log("params=====", params);
+        const res = await getMsgList(params);
+        const { rows, total } = res.data;
+        console.log("res====", res);
+        this.list = [...this.list, ...rows];
+        if (currentPage * pageSize < Number(total)) {
+          this.currentPage++;
+          this.loadStatus = "loadmore";
+        } else {
+          this.loadStatus = "nomore";
+        }
+      } catch (error) {}
+    },
+    toDetail(val) {
+      switch (val.type) {
+        case "拣货任务":
+          uni.navigateTo({
+            url: `/pages/picking-task/detail?id=${val.title}`,
+          });
+          break;
+        case "采购入库":
+          uni.navigateTo({
+            url: `/pages/purchase/detail?id=${val.title}`,
+          });
+          break;
+        case "盘点任务":
+          uni.navigateTo({
+            url: `/pages/inventory-task/taskDetail?id=${val.title}`,
+          });
+          break;
+        case "复核任务":
+          if (val.content.includes("CGDD")) {
+            uni.navigateTo({
+              url: `/pages/purchase/detail?id=${val.title}`,
+            });
+          } else {
+            uni.navigateTo({
+              url: `/pages/picking-task/detail?id=${val.title}`,
+            });
+          }
+          break;
+
+        default:
+          break;
+      }
+    },
+  },
 };
 </script>
 
@@ -52,6 +148,9 @@ export default {
   background-color: #f0f6fb;
   .container_main {
     padding: 32rpx 24rpx;
+    .item-wrap {
+      margin-bottom: 24rpx;
+    }
     .time-box {
       position: relative;
       color: #000;

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

@@ -1,114 +0,0 @@
-<template>
-  <view>
-    <view class="good-item" @click="toDetail">
-      <view class="good-msg">
-        <u-image
-          :src="item.imgNameArr[0] || ''"
-          width="128rpx"
-          height="128rpx"
-        ></u-image>
-        <view class="ss-m-l-16">
-          <view class="good-msg-name">{{ item.materialName }}</view>
-          <view class="good-msg-txm">条形码:{{ item.barCode }}</view>
-        </view>
-      </view>
-      <view class="good-cont">
-        <view class="good-cont-item">
-          <view class="item-label">规格</view>
-          <view class="item-value">{{ item.materialStandard || "-" }}</view>
-        </view>
-        <view class="good-cont-item" @click.stop="calendarClick">
-          <view class="item-label">生产日期</view>
-          <view class="item-value">{{
-            item.productionDate
-              ? $u.timeFormat(item.productionDate, "yyyy-mm-dd")
-              : "-"
-          }}</view>
-        </view>
-        <view class="good-cont-item">
-          <view class="item-label">库存</view>
-          <view class="item-value"
-            >{{ item.inventory ? (item.inventory * 1).toFixed(0) : "0"
-            }}{{ item.commodityUnit || "" }}</view
-          >
-        </view>
-        <view class="good-cont-item">
-          <view class="item-label">库位</view>
-          <view class="item-value">{{ item.position || "-" }}</view>
-        </view>
-      </view>
-      <slot></slot>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  props: {
-    item: {
-      type: Object,
-      default: () => {},
-    },
-  },
-  data() {
-    return {
-      calendarShow: false,
-      value1: Number(new Date()),
-      maxDate: Number(new Date()),
-    };
-  },
-  methods: {
-    toDetail() {
-      this.$emit("toDetail", this.item);
-    },
-    calendarClick() {
-      this.$emit("calendarClick", this.item);
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.good-item {
-  padding: 24rpx 0;
-  border-bottom: 4rpx solid #f0f6fb;
-  .good-msg {
-    display: flex;
-    align-items: center;
-    padding: 0 24rpx;
-    &-name {
-      color: #333;
-      font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 500;
-      margin-bottom: 16rpx;
-    }
-    &-txm {
-      color: #999;
-      font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 400;
-    }
-  }
-  .good-cont {
-    display: grid;
-    grid-template-columns: 25% 45% 30%;
-    margin-top: 16rpx;
-    padding: 0 24rpx;
-    &-item {
-      font-family: "PingFang SC";
-      font-weight: 400;
-      margin-bottom: 24rpx;
-      .item-label {
-        color: #999;
-        font-size: 24rpx;
-        margin-bottom: 16rpx;
-      }
-      .item-value {
-        color: #000;
-        font-size: 28rpx;
-      }
-    }
-  }
-}
-</style>

+ 41 - 3
pages/inventory-inquiry/index.vue

@@ -77,7 +77,19 @@
               @scrolltolower="onLoadMore"
             >
               <block v-for="(item, i) in goodsList" :key="i">
-                <good-item :item="item"></good-item>
+                <goodCard
+                  :goodImg="
+                    item.imgNameArr && item.imgNameArr[0]
+                      ? item.imgNameArr[0]
+                      : ''
+                  "
+                  :goodName="item.materialName"
+                  :goodDesValue="item.sku"
+                  goodDesTitle="SKU"
+                  :columns="columns"
+                  :item="item"
+                >
+                </goodCard>
               </block>
               <block v-if="goodsList.length == 0">
                 <u-empty
@@ -115,15 +127,17 @@ import {
   inventoryPositionTree,
   materialCategoryTree,
 } from "@/common/request/apis/inventoryInquiry";
-import goodItem from "./components/good-item.vue";
+import goodCard from "@/components/good-card/good-card.vue";
+
 import { mapGetters } from "vuex";
 
 export default {
   components: {
-    goodItem,
+    goodCard,
     leoTree,
   },
   data() {
+    const that = this;
     return {
       offsetTop: 0,
       current: 0,
@@ -162,6 +176,30 @@ export default {
       goodsList: [],
       pageSize: 10,
       currentPage: 1,
+
+      columns: [
+        { title: "规格", key: "materialStandard" },
+        {
+          title: "生产日期",
+          key: "productionDate",
+          formatter: (key, formData) => {
+            return formData.productionDate
+              ? that.$u.timeFormat(formData.productionDate, "yyyy-mm-dd")
+              : "/";
+          },
+        },
+        {
+          title: "库存",
+          key: "inventory",
+          formatter: (key, formData) => {
+            const inventory = formData.inventory
+              ? (formData.inventory * 1).toFixed(0)
+              : "0";
+            return `${inventory}${formData.commodityUnit || ""}`;
+          },
+        },
+        { title: "库位", key: "position" },
+      ],
       queryParams: {
         type: "all",
         categoryId: "",

+ 18 - 11
pages/inventory-task/detail.vue

@@ -17,19 +17,22 @@
 
     <u-sticky bgColor="#F5F6F7" :offsetTop="offsetTop">
       <!-- 基本信息 吸顶 -->
-      <view class="search-box">
-        <u-search
-          placeholder="输入货物名称/库位"
-          shape="square"
-          :showAction="false"
-          @search="onRefresh"
-          @clear="onRefresh"
-          v-model="number"
-        ></u-search>
-        <view class="scan-icon flex_box flex_row_center" @click="scanCode">
-          <image src="@/static/image/scan-icon-2.png" mode=""></image>
+      <view style="background-color: #fff">
+        <view class="search-box">
+          <u-search
+            placeholder="输入货物名称/库位"
+            shape="square"
+            :showAction="false"
+            @search="onRefresh"
+            @clear="onRefresh"
+            v-model="number"
+          ></u-search>
+          <view class="scan-icon flex_box flex_row_center" @click="scanCode">
+            <image src="@/static/image/scan-icon-2.png" mode=""></image>
+          </view>
         </view>
       </view>
+
       <view class="info-card">
         <view class="info-item page-title">
           {{ inventoryInfo.taskName }}
@@ -171,6 +174,7 @@
           <u-tag
             :text="`盘亏${item.inventory - item.newInventory}`"
             bg-color="#FF4E02"
+            borderColor="#FF4E02"
             color="#ffffff"
             class="action-btn"
             v-if="item.status === 3"
@@ -179,6 +183,7 @@
           <u-tag
             :text="`盘盈${item.newInventory - item.inventory}`"
             bg-color="#F59701"
+            borderColor="#F59701"
             color="#ffffff"
             class="action-btn"
             v-if="item.status === 2"
@@ -187,6 +192,7 @@
           <u-tag
             text="无差异"
             bg-color="#00B97B"
+            borderColor="#00B97B"
             color="#ffffff"
             class="action-btn"
             v-if="item.status === 4"
@@ -195,6 +201,7 @@
           <u-tag
             text="未盘"
             bg-color="#0256FF"
+            borderColor="#0256FF"
             color="#ffffff"
             class="action-btn"
             v-if="item.status === 1"

+ 1 - 1
pages/inventory-task/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="check-page">
     <u-navbar height="40px" title="盘点" bgColor="#fff" autoBack placeholder>
-      <view class="u-nav-slot depot-label" slot="right" @click="stashClick">
+      <view class="u-nav-slot depot-label" slot="right">
         <view class="name">{{ curDepotName }}</view>
       </view>
     </u-navbar>

+ 1 - 0
pages/login/components/account-login.vue

@@ -78,6 +78,7 @@
 						if (res.data.msgTip === 'user can login') {
 							let userInfo = {
 								token:res.data.token,
+								roleName: res.data.roleName,
 								...res.data.user
 							}
 							this.$store.dispatch('userLogin',userInfo)

+ 0 - 184
pages/picking-task/components/task-item.vue

@@ -1,184 +0,0 @@
-<template>
-  <view class="task-item">
-    <view @click="detailClick">
-      <view class="task-head">
-        <view class="sn-box">单据编号:{{ item.number }}</view>
-        <view v-if="type == 'caigou'">
-          <view class="tips tips-red" v-if="item.status == 1">待入库</view>
-          <view class="tips tips-greed" v-if="item.status == 2">已入库</view>
-          <view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
-        </view>
-        <view v-else>
-          <view class="tips tips-red" v-if="item.status == 1">待拣货</view>
-          <view class="tips tips-greed" v-if="item.status == 2">已拣货</view>
-          <view class="tips tips-yellow" v-if="item.status == 4">拣货中</view>
-        </view>
-      </view>
-      <view class="task-line" v-if="type == 'caigou'">
-        <view>供应商:</view>
-        <view>{{ item.supplierName }}</view>
-      </view>
-      <view class="task-line" v-else>
-        <view>客户名称:</view>
-        <view>{{ item.supplierName }}</view>
-      </view>
-      <view class="task-line">
-        <view>单据日期:</view>
-        <view>{{ item.operTime }}</view>
-      </view>
-      <view class="task-line">
-        <view class="task-line2">
-          <view>货物总数:</view>
-          <view class="task-num">{{ item.goodsQuantity }}件</view>
-        </view>
-        <view class="task-line2">
-          <view>货物种类:</view>
-          <view class="task-num">{{ item.goodsTypeCount || 0 }}种</view>
-        </view>
-      </view>
-    </view>
-    <view class="task-bottom">
-      <view v-if="type == 'caigou'">
-        <view
-          class="btn btn-1"
-          v-if="item.status == 1 || item.status == 4"
-          @click="toStorage"
-          >去入库</view
-        >
-        <view class="btn btn-2" v-else @click="toDetail">详情</view>
-      </view>
-      <view v-else>
-        <view
-          class="btn btn-1"
-          v-if="item.status == 1 || item.status == 4"
-          @click="toStorage"
-          >去出库</view
-        >
-        <view class="btn btn-2" v-else @click="toDetail">详情</view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  props: {
-    item: {
-      type: Object,
-      default: () => {},
-    },
-    type: {
-      type: String,
-      default: "",
-    },
-  },
-  data() {
-    return {};
-  },
-  methods: {
-    toStorage() {
-      this.$emit("toStorage", this.item);
-    },
-    toDetail() {
-      this.$emit("toDetail", this.item);
-    },
-    detailClick() {
-      if (this.item.status == 1 || this.item.status == 4) {
-        this.toStorage();
-      } else {
-        this.toDetail();
-      }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.task-item {
-  width: 100%;
-  background-color: #fff;
-  border-radius: 16rpx;
-  padding: 24rpx 24rpx 0;
-  margin-bottom: 24rpx;
-  .task-head {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    .sn-box {
-      color: #333;
-      font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 500;
-    }
-    .tips {
-      font-family: "PingFang SC";
-      font-size: 22rpx;
-      font-weight: 400;
-      width: 120rpx;
-      height: 44rpx;
-      border-radius: 8rpx;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-    }
-    .tips-red {
-      color: #ff3b1d;
-      background: rgba(255, 59, 29, 0.2);
-    }
-    .tips-greed {
-      color: #00b97b;
-      background: rgba(0, 185, 123, 0.2);
-    }
-    .tips-yellow {
-      color: #f57701;
-      background: rgba(245, 151, 1, 0.2);
-    }
-  }
-
-  .task-line {
-    display: flex;
-    align-items: center;
-    color: #666;
-    font-family: "PingFang SC";
-    font-size: 28rpx;
-    font-weight: 400;
-    margin-top: 16rpx;
-  }
-  .task-line2 {
-    width: 50%;
-    display: flex;
-    align-items: center;
-    .task-num {
-      color: #0256ff;
-    }
-  }
-
-  .task-bottom {
-    border-top: 1px solid #f0f0f0;
-    margin-top: 32rpx;
-    height: 104rpx;
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-    .btn {
-      width: 144rpx;
-      height: 56rpx;
-      border-radius: 8rpx;
-      font-size: 28rpx;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      font-family: "PingFang SC";
-    }
-    .btn-1 {
-      background: #0256ff;
-      color: #fff;
-    }
-    .btn-2 {
-      border: 1px solid #0256ff;
-      background: rgba(2, 86, 255, 0.2);
-      color: #0256ff;
-    }
-  }
-}
-</style>

+ 36 - 35
pages/picking-task/delivery.vue

@@ -119,17 +119,10 @@
               <view class="num-box-text">已确认出库数量</view>
               <u-number-box
                 v-model="item.materialNumber"
-                min="0"
+                :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>
@@ -203,9 +196,11 @@ import {
   orderDetail,
   orderInfo,
   orderSubmit,
+  getSkuByUpc,
 } from "@/common/request/apis/purchase";
 import { mapGetters } from "vuex";
 import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+
 export default {
   mixins: [blePrintMixin],
   components: {
@@ -219,7 +214,7 @@ export default {
     return {
       popText: {
         errorText: "实际出库数量与应出库数量有差异,是否确认提交?",
-        successText: "出库成功!",
+        successText: "您的拣货出库任务已提交,审核后方可生效!",
       },
       goodsShow: false,
       scanedShow: false,
@@ -247,7 +242,6 @@ export default {
   },
   onLoad(e) {
     this.id = e.id;
-    this.status = e.status;
     this.getOrderDetail(e.id);
     this.getOrderInfo(e.id);
   },
@@ -262,18 +256,6 @@ export default {
       }
       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;
@@ -288,14 +270,28 @@ export default {
     },
   },
   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;
+    uni.$on("scanFinish", async (data) => {
+      try {
+        const params = {
+          upc: data,
+        };
+        console.log("params===", params);
+        const res = await getSkuByUpc(params);
+        console.log("getSkuByUpc====", res);
+        if (res.code === 200) {
+          const sku = res.data;
+          if (this.goodsList.length == 0)
+            return uni.$u.toast("该货物不属于该任务");
+          let index = this.goodsList.findIndex((item) => item.sku == sku);
+          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;
+        } else {
+          uni.$u.toast(res.msg);
+        }
+      } catch (error) {}
     });
   },
   onHide() {
@@ -316,9 +312,6 @@ export default {
       });
       this.calendarShow = false;
     },
-    calendarCole() {
-      this.calendarShow = false;
-    },
     calendarClick(item) {
       console.log(item.productionDate, "item.productionDate");
       this.chooseGoodsInfo = item;
@@ -333,6 +326,7 @@ export default {
       orderInfo(id).then((res) => {
         if (res.code == 200) {
           this.orderInfo = res.data;
+          this.status = res.data.status;
           console.log("this.orderInfo====", this.orderInfo);
         }
       });
@@ -372,7 +366,7 @@ export default {
       console.log("this.goodsList=====", this.goodsList);
       let materials = this.goodsList.map((item) => {
         return {
-          barCode: item.barCode,
+          barCode: item.sku,
           materialNumber: item.materialNumber,
           productionDate: item.productionDate
             ? this.$u.timeFormat(item.productionDate, "yyyy-mm-dd")
@@ -384,6 +378,7 @@ export default {
         materials: materials,
         voucherPicture: this.voucherPicture || "",
         remark: this.orderInfo.mark || "",
+        number: this.orderInfo.number,
       };
       console.log("orderSubmit========params====", params);
       orderSubmit(params).then((res) => {
@@ -443,18 +438,24 @@ export default {
 
       .info-line {
         border-bottom: 1px solid #f4f4f4;
-        min-height: 92rpx;
+        padding: 24rpx 0;
         color: #333;
         font-family: "PingFang SC";
         font-size: 28rpx;
+        line-height: 1.5;
         font-weight: 400;
         display: flex;
         align-items: center;
 
         &-label {
+          flex: 0 0 162rpx;
           width: 162rpx;
         }
 
+        &-value {
+          word-break: break-all;
+        }
+
         .must-box {
           color: #ff3b1d;
         }

+ 84 - 31
pages/picking-task/detail.vue

@@ -92,6 +92,30 @@
             {{ orderInfo.submitTime }}
           </view>
         </view>
+        <view class="info-line" v-if="orderInfo.auditorName">
+          <view class="info-line-label">
+            <text>驳回人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.auditorName }}
+          </view>
+        </view>
+        <view class="info-line" v-if="orderInfo.rejectTime">
+          <view class="info-line-label">
+            <text>驳回时间</text>
+          </view>
+          <view class="info-line-value">
+            {{ $u.timeFormat(orderInfo.rejectTime, "yyyy-mm-dd hh:MM:ss") }}
+          </view>
+        </view>
+        <view class="info-line" v-if="orderInfo.reject">
+          <view class="info-line-label">
+            <text>驳回原因</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.reject }}
+          </view>
+        </view>
       </view>
       <view class="btn-box">
         <view class="btn-cont" @click="isUnfold = !isUnfold">
@@ -118,23 +142,20 @@
               <u-number-box
                 v-model="item.actualQuantityInStorage"
                 disabled
-                min="0"
+                :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>
+    <view class="footer-box" v-if="auditState == '1'">
+      <u-button class="cancelBtn" @tap="showReject = true">驳回</u-button>
+      <u-button class="submitBtn" @tap="submit('2')">复核通过</u-button>
+    </view>
     <!-- 打印条码弹框 -->
     <print-pop
       :show.sync="blePrintPop.show"
@@ -158,34 +179,38 @@
       :extraText="bleErrorTipPop.extraText"
     >
     </ble-tip-pop>
+    <auditReject :show.sync="showReject" @ok="onReject" />
   </view>
 </template>
 
 <script>
 import goodItem from "@/components/good-item/good-item.vue";
+import auditReject from "@/components/audit-reject/audit-reject.vue";
 import { orderDetail, orderInfo } from "@/common/request/apis/purchase";
 import { mapGetters } from "vuex";
 import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+import { setReviewTask } from "@/common/request/apis/aduit.js";
 
 export default {
   mixins: [blePrintMixin],
   components: {
     goodItem,
+    auditReject,
   },
   data() {
     return {
-      errorShow: false,
-      successShow: false,
       isUnfold: true, //是否展开
       orderInfo: {},
       goodsList: [],
       status: null,
+      auditState: "0",
+      showReject: false,
     };
   },
   onLoad(e) {
-    this.status = e.status;
     this.getOrderInfo(e.id);
     this.getOrderDetail(e.id);
+    this.auditState = e.auditState || "0";
   },
   computed: {
     ...mapGetters(["depotInfo"]),
@@ -195,6 +220,8 @@ export default {
       orderInfo(id).then((res) => {
         if (res.code == 200) {
           this.orderInfo = res.data;
+          this.status = res.data.status;
+          console.log("orderInfo===", res);
         }
       });
     },
@@ -209,25 +236,43 @@ export default {
             }
             item.materialNumber = 0;
           });
+          console.log("goodsList=====", res.data);
           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}`,
       });
     },
+    onReject(reject) {
+      this.submit("7", reject);
+    },
+    async submit(status, reject) {
+      try {
+        const params = {
+          id: this.orderInfo.id,
+          status,
+          number: this.orderInfo.number,
+        };
+        if (reject) {
+          params.reject = reject;
+        }
+        const result = await setReviewTask(params);
+        console.log("setReviewTask====params", params);
+        console.log("setReviewTask====result", result);
+        if (result.code === 200) {
+          uni.$u.toast(result.msg);
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 1000);
+          uni.setStorageSync("auditTaskRefresh", true);
+        } else {
+          uni.$u.toast(result.msg);
+        }
+      } catch (error) {}
+    },
   },
 };
 </script>
@@ -248,18 +293,24 @@ export default {
 
       .info-line {
         border-bottom: 1px solid #f4f4f4;
-        min-height: 92rpx;
+        padding: 24rpx 0;
         color: #333;
         font-family: "PingFang SC";
         font-size: 28rpx;
+        line-height: 1.5;
         font-weight: 400;
         display: flex;
         align-items: center;
 
         &-label {
+          flex: 0 0 162rpx;
           width: 162rpx;
         }
 
+        &-value {
+          word-break: break-all;
+        }
+
         .must-box {
           color: #ff3b1d;
         }
@@ -378,23 +429,25 @@ export default {
     right: 0;
     display: flex;
     align-items: center;
-    justify-content: space-between;
-    padding: 0 40rpx 0 60rpx;
-    .footer-box-l {
+    justify-content: center;
+    .cancelBtn {
+      width: 244rpx;
+      height: 80rpx;
+      border-radius: 16rpx;
       color: #666;
       font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 400;
+      font-size: 32rpx;
+      font-weight: 500;
+      margin-right: 20rpx;
     }
     .submitBtn {
-      width: 362rpx;
-      height: 76rpx;
+      width: 244rpx;
+      height: 80rpx;
       border-radius: 16rpx;
       background: #0256ff;
       color: #fff;
-      font-size: 28rpx;
+      font-size: 32rpx;
       font-weight: 500;
-      margin: 0;
     }
   }
 }

+ 194 - 22
pages/picking-task/index.vue

@@ -43,12 +43,83 @@
       </u-sticky>
       <view class="task-cont">
         <block v-for="(item, i) in taskList" :key="i">
-          <task-item
-            :item="item"
-            @toStorage="toStorage"
-            @toDetail="toDetail"
+          <task-card
             :key="`${item.id}-${item.status}`"
-          ></task-item>
+            :columns="taskColumns"
+            :formData="item"
+            @handleClickField="handleClickField"
+          >
+            <!-- 状态 -->
+            <view slot="rightTop">
+              <u-tag
+                v-if="item.status == 1"
+                text="待拣货"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 6"
+                text="待复核"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 7"
+                text="复核驳回"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 3"
+                text="部分拣货"
+                plain
+                borderColor="rgba(0, 185, 123, 0.2)"
+                color="#00b97b"
+                bgColor="rgba(0, 185, 123, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 2"
+                text="已拣货"
+                plain
+                borderColor="rgba(0, 185, 123, 0.2)"
+                color="#00b97b"
+                bgColor="rgba(0, 185, 123, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 4"
+                text="拣货中"
+                plain
+                borderColor="rgba(245, 151, 1, 0.2)"
+                color="#f57701"
+                bgColor="rgba(245, 151, 1, 0.2)"
+              ></u-tag>
+            </view>
+            <!-- 操作栏 -->
+            <view slot="action" class="action-box">
+              <view class="action-left-box" v-if="item.status == 7"
+                >驳回原因:{{ item.reject }}</view
+              >
+              <view class="task-bottom">
+                <view
+                  class="btn btn-1"
+                  @click="toStorage(item)"
+                  v-if="
+                    item.status == 1 || item.status == 4 || item.status == 7
+                  "
+                  >{{ item.status == 7 ? "重新出库" : "去出库" }}</view
+                >
+                <view class="btn btn-2" @click="toDetail(item)" v-else
+                  >详情</view
+                >
+              </view>
+            </view>
+          </task-card>
         </block>
         <u-loadmore v-if="taskList.length > 0" :status="status" />
         <u-empty
@@ -81,14 +152,14 @@
 </template>
 
 <script>
-import taskItem from "./components/task-item.vue";
+import taskCard from "@/components/task-card/task-card.vue";
 import { saleOrder } from "@/common/request/apis/picking";
 import { orderStartHandle } from "@/common/request/apis/purchase";
 import { mapGetters } from "vuex";
 
 export default {
   components: {
-    taskItem,
+    taskCard,
   },
   data() {
     return {
@@ -108,10 +179,22 @@ export default {
             id: "1",
           },
           {
+            label: "待复核",
+            id: "6",
+          },
+          {
+            label: "复核驳回",
+            id: "7",
+          },
+          {
             label: "拣货中",
             id: "4",
           },
           {
+            label: "部分拣货",
+            id: "3",
+          },
+          {
             label: "已拣货",
             id: "2",
           },
@@ -134,6 +217,46 @@ export default {
           "十二月",
         ],
       ],
+      taskColumns: [
+        {
+          title: "单据编号",
+          key: "number",
+          titleStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+          valueStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+        },
+        {
+          title: "客户名称",
+          key: "supplierName",
+        },
+        {
+          title: "单据日期",
+          key: "operTime",
+        },
+        {
+          title: "货物总数",
+          key: "goodsQuantity",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
+        },
+        {
+          title: "货物种类",
+          key: "goodsTypeCount",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
+        },
+      ],
       defaultIndex2: [],
       defaultIndex3: [],
       taskList: [],
@@ -258,33 +381,37 @@ export default {
         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) => {
+    // 出库
+    toStorage(val) {
+      uni.setStorageSync("orderRefresh", true);
+      orderStartHandle(val.id).then((res) => {
         if (res.code == 200) {
           uni.navigateTo({
-            url: `/pages/picking-task/delivery?id=${id}`,
+            url: `/pages/picking-task/delivery?id=${val.id}`,
           });
         }
       });
     },
-    // 出库
-    toStorage(val) {
-      this.toOrderStartHandle(val.id);
-    },
     toDetail(val) {
       console.log(val, "val");
       uni.navigateTo({
         url: `/pages/picking-task/detail?id=${val.id}`,
       });
     },
+    handleClickField(key, itemData) {
+      console.log(123333);
+      console.log("key===", key);
+      console.log("itemData===", itemData);
+      if (
+        itemData.status == 1 ||
+        itemData.status == 4 ||
+        itemData.status == 7
+      ) {
+        this.toStorage(itemData);
+      } else {
+        this.toDetail(itemData);
+      }
+    },
   },
 };
 </script>
@@ -343,4 +470,49 @@ export default {
     }
   }
 }
+.action-box {
+  padding-bottom: 24rpx;
+  height: 80rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  width: 100%;
+}
+
+.action-left-box {
+  color: #ff3b1d;
+  font-family: "PingFang SC";
+  font-size: 28rpx;
+  font-weight: 400;
+  width: 400rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.task-bottom {
+  flex: 1;
+  display: inline-flex;
+  align-items: center;
+  justify-content: flex-end;
+  .btn {
+    width: 144rpx;
+    height: 56rpx;
+    border-radius: 8rpx;
+    font-size: 28rpx;
+    line-height: 56rpx;
+    text-align: center;
+    margin-left: 12rpx;
+    font-family: "PingFang SC";
+  }
+  .btn-1 {
+    background: #0256ff;
+    color: #fff;
+  }
+  .btn-2 {
+    border: 1px solid #0256ff;
+    background: rgba(2, 86, 255, 0.2);
+    color: #0256ff;
+  }
+}
 </style>

+ 85 - 31
pages/purchase/detail.vue

@@ -100,6 +100,30 @@
             {{ orderInfo.operTime }}
           </view>
         </view>
+        <view class="info-line" v-if="orderInfo.auditorName">
+          <view class="info-line-label">
+            <text>驳回人</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.auditorName }}
+          </view>
+        </view>
+        <view class="info-line" v-if="orderInfo.rejectTime">
+          <view class="info-line-label">
+            <text>驳回时间</text>
+          </view>
+          <view class="info-line-value">
+            {{ $u.timeFormat(orderInfo.rejectTime, "yyyy-mm-dd hh:MM:ss") }}
+          </view>
+        </view>
+        <view class="info-line" v-if="orderInfo.reject">
+          <view class="info-line-label">
+            <text>驳回原因</text>
+          </view>
+          <view class="info-line-value">
+            {{ orderInfo.reject }}
+          </view>
+        </view>
       </view>
       <view class="btn-box">
         <view class="btn-cont" @click="isUnfold = !isUnfold">
@@ -125,22 +149,20 @@
               <view class="num-box-text">已确认入库数量</view>
               <u-number-box
                 v-model="item.actualQuantityInStorage"
+                :min="0"
                 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>
+    <view class="footer-box" v-if="auditState == '1'">
+      <u-button class="cancelBtn" @tap="showReject = true">驳回</u-button>
+      <u-button class="submitBtn" @tap="submit('2')">复核通过</u-button>
+    </view>
     <!-- 打印条码弹框 -->
     <print-pop
       :show.sync="blePrintPop.show"
@@ -164,34 +186,38 @@
       :extraText="bleErrorTipPop.extraText"
     >
     </ble-tip-pop>
+    <auditReject :show.sync="showReject" @ok="onReject" />
   </view>
 </template>
 
 <script>
 import goodItem from "@/components/good-item/good-item.vue";
+import auditReject from "@/components/audit-reject/audit-reject.vue";
 import { orderDetail, orderInfo } from "@/common/request/apis/purchase";
 import { mapGetters } from "vuex";
 import blePrintMixin from "@/common/mixins/blePrintMixin.js";
+import { setReviewTask } from "@/common/request/apis/aduit.js";
+
 export default {
   mixins: [blePrintMixin],
   components: {
     goodItem,
+    auditReject,
   },
   data() {
     return {
-      errorShow: false,
-      successShow: false,
-      value: 0,
       isUnfold: true, //是否展开
       orderInfo: {},
       goodsList: [],
       status: null,
+      auditState: "0",
+      showReject: false,
     };
   },
   onLoad(e) {
-    this.status = e.status;
     this.getOrderInfo(e.id);
     this.getOrderDetail(e.id);
+    this.auditState = e.auditState || "0";
   },
   computed: {
     ...mapGetters(["depotInfo"]),
@@ -201,6 +227,9 @@ export default {
       orderInfo(id).then((res) => {
         if (res.code == 200) {
           this.orderInfo = res.data;
+          this.status = res.data.status;
+          console.log("this.status=====", this.status);
+          console.log("orderInfo=====", res);
         }
       });
     },
@@ -219,21 +248,38 @@ export default {
         }
       });
     },
-    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}`,
       });
     },
+    onReject(reject) {
+      this.submit("7", reject);
+    },
+    async submit(status, reject) {
+      try {
+        const params = {
+          id: this.orderInfo.id,
+          status,
+          number: this.orderInfo.number,
+        };
+        if (reject) {
+          params.reject = reject;
+        }
+        const result = await setReviewTask(params);
+        console.log("setReviewTask====params", params);
+        console.log("setReviewTask====result", result);
+        if (result.code === 200) {
+          uni.$u.toast(result.msg);
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 1000);
+          uni.setStorageSync("auditTaskRefresh", true);
+        } else {
+          uni.$u.toast(result.msg);
+        }
+      } catch (error) {}
+    },
   },
 };
 </script>
@@ -254,18 +300,24 @@ export default {
 
       .info-line {
         border-bottom: 1px solid #f4f4f4;
-        min-height: 92rpx;
+        padding: 24rpx 0;
         color: #333;
         font-family: "PingFang SC";
         font-size: 28rpx;
+        line-height: 1.5;
         font-weight: 400;
         display: flex;
         align-items: center;
 
         &-label {
+          flex: 0 0 162rpx;
           width: 162rpx;
         }
 
+        &-value {
+          word-break: break-all;
+        }
+
         .must-box {
           color: #ff3b1d;
         }
@@ -384,23 +436,25 @@ export default {
     right: 0;
     display: flex;
     align-items: center;
-    justify-content: space-between;
-    padding: 0 40rpx 0 60rpx;
-    .footer-box-l {
+    justify-content: center;
+    .cancelBtn {
+      width: 244rpx;
+      height: 80rpx;
+      border-radius: 16rpx;
       color: #666;
       font-family: "PingFang SC";
-      font-size: 28rpx;
-      font-weight: 400;
+      font-size: 32rpx;
+      font-weight: 500;
+      margin-right: 20rpx;
     }
     .submitBtn {
-      width: 362rpx;
-      height: 76rpx;
+      width: 244rpx;
+      height: 80rpx;
       border-radius: 16rpx;
       background: #0256ff;
       color: #fff;
-      font-size: 28rpx;
+      font-size: 32rpx;
       font-weight: 500;
-      margin: 0;
     }
   }
 }

+ 198 - 20
pages/purchase/index.vue

@@ -43,12 +43,83 @@
       </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>
+          <task-card
+            :key="`${item.id}-${item.status}`"
+            :columns="taskColumns"
+            :formData="item"
+            @handleClickField="handleClickField"
+          >
+            <!-- 状态 -->
+            <view slot="rightTop">
+              <u-tag
+                v-if="item.status == 1"
+                text="待入库"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 6"
+                text="待复核"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 7"
+                text="复核驳回"
+                plain
+                borderColor="rgba(255, 59, 29, 0.2)"
+                color="#ff3b1d"
+                bgColor="rgba(255, 59, 29, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 3"
+                text="部分入库"
+                plain
+                borderColor="rgba(0, 185, 123, 0.2)"
+                color="#00b97b"
+                bgColor="rgba(0, 185, 123, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 2"
+                text="已入库"
+                plain
+                borderColor="rgba(0, 185, 123, 0.2)"
+                color="#00b97b"
+                bgColor="rgba(0, 185, 123, 0.2)"
+              ></u-tag>
+              <u-tag
+                v-if="item.status == 4"
+                text="入库中"
+                plain
+                borderColor="rgba(245, 151, 1, 0.2)"
+                color="#f57701"
+                bgColor="rgba(245, 151, 1, 0.2)"
+              ></u-tag>
+            </view>
+            <!-- 操作栏 -->
+            <view slot="action" class="action-box">
+              <view class="action-left-box" v-if="item.status == 7"
+                >驳回原因:{{ item.reject }}</view
+              >
+              <view class="task-bottom">
+                <view
+                  class="btn btn-1"
+                  @click="toStorage(item)"
+                  v-if="
+                    item.status == 1 || item.status == 4 || item.status == 7
+                  "
+                  >{{ item.status == 7 ? "重新入库" : "去入库" }}</view
+                >
+                <view class="btn btn-2" @click="toDetail(item)" v-else
+                  >详情</view
+                >
+              </view>
+            </view>
+          </task-card>
         </block>
         <u-loadmore v-if="taskList.length > 0" :status="status" />
         <u-empty
@@ -81,7 +152,7 @@
 </template>
 
 <script>
-import taskItem from "@/components/task-item/task-item.vue";
+import taskCard from "@/components/task-card/task-card.vue";
 import {
   purchaseInventory,
   orderStartHandle,
@@ -90,7 +161,7 @@ import { mapGetters } from "vuex";
 
 export default {
   components: {
-    taskItem,
+    taskCard,
   },
   data() {
     return {
@@ -110,10 +181,22 @@ export default {
             id: "1",
           },
           {
+            label: "待复核",
+            id: "6",
+          },
+          {
+            label: "复核驳回",
+            id: "7",
+          },
+          {
             label: "入库中",
             id: "4",
           },
           {
+            label: "部分入库",
+            id: "3",
+          },
+          {
             label: "已入库",
             id: "2",
           },
@@ -136,6 +219,46 @@ export default {
           "十二月",
         ],
       ],
+      taskColumns: [
+        {
+          title: "单据编号",
+          key: "number",
+          titleStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+          valueStyle: {
+            color: "#333",
+            fontSize: "28rpx",
+            fontWeight: 500,
+          },
+        },
+        {
+          title: "供应商",
+          key: "supplierName",
+        },
+        {
+          title: "单据日期",
+          key: "createTime",
+        },
+        {
+          title: "货物总数",
+          key: "goodsQuantity",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
+        },
+        {
+          title: "货物种类",
+          key: "goodsTypeCount",
+          span: 12,
+          valueStyle: {
+            color: "#0256ff",
+          },
+        },
+      ],
       defaultIndex2: [],
       defaultIndex3: [],
       taskList: [],
@@ -201,16 +324,6 @@ export default {
     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:
@@ -273,13 +386,33 @@ export default {
     },
     // 入库
     toStorage(val) {
-      this.toOrderStartHandle(val.id, val.status);
+      uni.setStorageSync("orderRefresh", true);
+      orderStartHandle(val.id).then((res) => {
+        if (res.code == 200) {
+          uni.navigateTo({
+            url: `/pages/purchase/put-storage?id=${val.id}`,
+          });
+        }
+      });
     },
     toDetail(val) {
       uni.navigateTo({
-        url: `/pages/purchase/detail?id=${val.id}&status=${val.status}`,
+        url: `/pages/purchase/detail?id=${val.id}`,
       });
     },
+    handleClickField(key, itemData) {
+      console.log("key===", key);
+      console.log("itemData===", itemData);
+      if (
+        itemData.status == 1 ||
+        itemData.status == 4 ||
+        itemData.status == 7
+      ) {
+        this.toStorage(itemData);
+      } else {
+        this.toDetail(itemData);
+      }
+    },
   },
 };
 </script>
@@ -338,4 +471,49 @@ export default {
     }
   }
 }
+.action-box {
+  padding-bottom: 24rpx;
+  height: 80rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  width: 100%;
+}
+
+.action-left-box {
+  color: #ff3b1d;
+  font-family: "PingFang SC";
+  font-size: 28rpx;
+  font-weight: 400;
+  width: 400rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.task-bottom {
+  flex: 1;
+  display: inline-flex;
+  align-items: center;
+  justify-content: flex-end;
+  .btn {
+    width: 144rpx;
+    height: 56rpx;
+    border-radius: 8rpx;
+    font-size: 28rpx;
+    line-height: 56rpx;
+    text-align: center;
+    margin-left: 12rpx;
+    font-family: "PingFang SC";
+  }
+  .btn-1 {
+    background: #0256ff;
+    color: #fff;
+  }
+  .btn-2 {
+    border: 1px solid #0256ff;
+    background: rgba(2, 86, 255, 0.2);
+    color: #0256ff;
+  }
+}
 </style>

+ 37 - 27
pages/purchase/put-storage.vue

@@ -109,7 +109,7 @@
               <view class="num-box-text">已确认入库数量</view>
               <u-number-box
                 v-model="item.materialNumber"
-                min="0"
+                :min="0"
                 :inputWidth="56"
               >
               </u-number-box>
@@ -205,6 +205,7 @@ import {
   orderDetail,
   orderInfo,
   orderSubmit,
+  getSkuByUpc,
 } from "@/common/request/apis/purchase";
 import { mapGetters } from "vuex";
 import blePrintMixin from "@/common/mixins/blePrintMixin.js";
@@ -222,7 +223,7 @@ export default {
     return {
       popText: {
         errorText: "实际入库数量与应入库数量有差异,是否确认提交?",
-        successText: "入库成功!",
+        successText: "您的采购入库任务已提交,审核后方可生效!",
       },
       goodsShow: false,
       scanedShow: false,
@@ -254,18 +255,31 @@ export default {
   },
   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;
+    uni.$on("scanFinish", async (data) => {
+      try {
+        const params = {
+          upc: data,
+        };
+        console.log("params===", params);
+        const res = await getSkuByUpc(params);
+        console.log("getSkuByUpc====", res);
+        if (res.code === 200) {
+          const sku = res.data;
+          if (this.goodsList.length == 0)
+            return uni.$u.toast("该货物不属于该任务");
+          let index = this.goodsList.findIndex((item) => item.sku == sku);
+          if (index == -1) return uni.$u.toast("该货物不属于该任务");
+          this.scanIndex = index;
+          this.scanNum = this.goodsList[index].materialNumber;
+          this.scanedShow = true;
+        } else {
+          uni.$u.toast(res.msg);
+        }
+      } catch (error) {}
     });
   },
   onHide() {
@@ -291,18 +305,6 @@ export default {
       }
       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;
@@ -328,9 +330,6 @@ export default {
       });
       this.calendarShow = false;
     },
-    calendarCole() {
-      this.calendarShow = false;
-    },
     calendarClick(item) {
       this.chooseGoodsInfo = item;
       if (item.productionDate) {
@@ -344,6 +343,8 @@ export default {
       orderInfo(id).then((res) => {
         if (res.code == 200) {
           this.orderInfo = res.data;
+          this.status = res.data.status;
+          console.log("this.orderInfo====", this.orderInfo);
         }
       });
     },
@@ -358,6 +359,8 @@ export default {
               item.imgNameArr = [];
             }
           });
+          console.log("2333333333");
+          console.log("res.data====", res.data);
           this.goodsList = res.data.rows;
         }
       });
@@ -377,7 +380,7 @@ export default {
     toOrderSubmit() {
       let materials = this.goodsList.map((item) => {
         return {
-          barCode: item.barCode,
+          barCode: item.sku,
           materialNumber: item.materialNumber,
           productionDate: item.productionDate
             ? this.$u.timeFormat(item.productionDate, "yyyy-mm-dd")
@@ -390,6 +393,7 @@ export default {
         materials: materials,
         voucherPicture: this.voucherPicture || "",
         remark: this.orderInfo.mark || "",
+        number: this.orderInfo.number,
       };
       console.log("params", params);
       orderSubmit(params).then((res) => {
@@ -459,18 +463,24 @@ export default {
 
       .info-line {
         border-bottom: 1px solid #f4f4f4;
-        min-height: 92rpx;
+        padding: 24rpx 0;
         color: #333;
         font-family: "PingFang SC";
         font-size: 28rpx;
+        line-height: 1.5;
         font-weight: 400;
         display: flex;
         align-items: center;
 
         &-label {
+          flex: 0 0 162rpx;
           width: 162rpx;
         }
 
+        &-value {
+          word-break: break-all;
+        }
+
         .must-box {
           color: #ff3b1d;
         }