|
@@ -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>
|