| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <template>
- <view class="content-box">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- title="不合格品处置"
- background-color="#157A2C"
- color="#fff"
- @clickLeft="back"
- ></uni-nav-bar>
- <view class="top-wrapper">
- <uni-section>
- <uni-easyinput
- prefixIcon="search"
- style="width: 430rpx"
- v-model="searchFrom.keyWord"
- placeholder="请输入"
- >
- </uni-easyinput>
- </uni-section>
- <button class="search_btn" @click="doSearch">搜索</button>
- <!-- <button class="search_btn" @click="addMaterial">新增</button> -->
- </view>
- <view class="list_box">
- <u-list
- @scrolltolower="scrolltolower"
- key="list"
- :preLoadScreen="page * 10"
- >
- <u-list-item v-for="(item, index) in dataList" :key="index">
- <!-- <itemCard :item="item"></itemCard> -->
- <view class="card_box" @click="handleDetail">
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">编码:</view>
- <view>{{ item.unqualifiedProductsCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">工单编号:</view>
- <view>{{ item.workOrderCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">批次号:</view>
- <view>{{ item.batchNo }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">来源编码:</view>
- <view>{{ item.sourceCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">物品编码:</view>
- <view>{{ item.categoryCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">物品名称:</view>
- <view>{{ item.categoryName }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce50 rx-sc">
- <view class="lable">型号:</view>
- <view>{{ item.modelType }}</view>
- </view>
- <view class="item_one perce50 rx-sc">
- <view class="lable">规格:</view>
- <view> {{ item.specification }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce50 rx-sc">
- <view class="lable">牌号:</view>
- <view>{{ item.brandNum }}</view>
- </view>
- <view class="item_one perce50 rx-sc">
- <view class="lable">数量:</view>
- <view class="text">
- {{ item.quantity }}{{ item.measureUnit }}</view
- >
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce50 rx-sc">
- <view class="lable">质检类型:</view>
- <view class="text">{{ getQuality(item) }}</view>
- </view>
- <view class="item_one perce50 rx-sc">
- <view class="lable">状态:</view>
- <view> {{ getDispose(item) }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">处置时间:</view>
- <view>{{ item.disposeTime }}</view>
- </view>
- </view>
- </view>
- </u-list-item>
- <u-list-item v-if="dataList.length === 0">
- <view style="margin-top: 20vh">
- <u-empty iconSize="150" textSize="32" text="暂无不良品"> </u-empty>
- </view>
- </u-list-item>
- </u-list>
- </view>
- </view>
- </template>
- <script>
- import { getList } from "@/api/pda/nonconforming.js";
- import { getByCode } from "@/api/pda/common.js";
- import itemCard from "../components/itemCard.vue";
- let [isEnd] = [false];
- export default {
- components: {
- itemCard,
- },
- data() {
- return {
- searchFrom: {
- keyWord: "",
- },
- page: 1,
- size: 10,
- dataList: [],
- qualityList: [],
- disposeList: [],
- };
- },
- onLoad(option) {
- // this.produceFn();
- },
- onShow() {
- this.getDisposeList("dispose_status");
- this.getQualityList("inspection_plan_type");
- this.getList();
- },
- created() {
- // this.getByCodeFn();
- },
- methods: {
- async getList() {
- let params = {
- pageNum: this.page,
- size: this.size,
- ...this.searchFrom,
- };
- isEnd = false;
- const res = await getList(params);
- if (params.pageNum === 1) {
- this.dataList = [];
- }
- this.dataList.push(...res.list);
- isEnd = this.dataList.length >= res.count;
- },
- produceFn() {
- this.getList();
- },
- scrolltolower() {
- if (isEnd) return;
- this.page++;
- this.getList();
- },
- doSearch() {
- this.getList();
- },
- addMaterial() {},
- handleDetail() {},
- async getDisposeList(code) {
- let res = await getByCode(code);
- if (res.length != 0) {
- let list = res.map((item) => {
- let key = Object.keys(item)[0];
- return { value: Number(key), label: item[key] };
- });
- this.disposeList = list;
- }
- },
- async getQualityList(code) {
- let res = await getByCode(code);
- if (res.length != 0) {
- let list = res.map((item) => {
- let key = Object.keys(item)[0];
- return { value: Number(key), label: item[key] };
- });
- this.qualityList = list;
- }
- },
- getDispose(item) {
- const data = this.disposeList.find((it) => it.value == item.status);
- return data ? data.label : "";
- },
- getQuality(item) {
- const data = this.qualityList.find((it) => it.value == item.qualityType);
- return data ? data.label : "";
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .content-box {
- height: 100vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- background-color: $page-bg;
- }
- .top-wrapper {
- background-color: #fff;
- display: flex;
- width: 750rpx;
- height: 88rpx;
- padding: 16rpx 32rpx;
- align-items: center;
- gap: 16rpx;
- /deep/.uni-section {
- margin-top: 0px;
- }
- /deep/.uni-section-header {
- padding: 0px;
- }
- .search_btn {
- width: 110rpx;
- height: 60rpx;
- line-height: 60rpx;
- padding: 0 10rpx;
- background: $theme-color;
- font-size: 24rpx;
- color: #fff;
- margin: 0;
- margin-left: 16rpx;
- }
- .menu_icon {
- width: 44rpx;
- height: 44rpx;
- margin-left: 14rpx;
- }
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 16rpx 0;
- .u-list {
- height: 100% !important;
- }
- .card_box {
- width: 750rpx;
- padding: 16rpx 32rpx;
- box-sizing: border-box;
- border-bottom: 2rpx solid #e1e1e1;
- .item_box {
- margin-top: 10rpx;
- .round {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 50%;
- background: $theme-color;
- color: #fff;
- text-align: center;
- font-size: 20rpx;
- }
- .orderId {
- color: #000;
- font-family: PingFang HK;
- font-size: 28rpx;
- font-style: normal;
- font-weight: 600;
- margin-left: 16rpx;
- }
- .item_one {
- width: 100%;
- font-size: 26rpx;
- font-style: normal;
- font-weight: 400;
- line-height: 38rpx;
- word-wrap: break-word;
- .text {
- color: #157a2c;
- }
- }
- .item-right {
- flex: 1;
- }
- .gylx {
- color: $theme-color;
- }
- .perce50 {
- width: 50%;
- }
- .perce100 {
- width: 100%;
- }
- }
- }
- }
- </style>
|