| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835 |
- <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">
- <view class="searchBox rx-bc">
- <zxz-uni-data-select
- :localdata="taskList"
- v-model="formData.taskId"
- dataValue="id"
- format="{name}"
- dataKey="name"
- filterable
- placeholder="请选择工序"
- @change="doSearch"
- ></zxz-uni-data-select>
- <u-button
- @click="doSearch"
- type="success"
- size="small"
- class="u-reset-button"
- text="搜索"
- >
- </u-button>
- </view>
- </view>
- <view class="list_box">
- <u-list
- @scrolltolower="scrolltolower"
- key="list"
- :preLoadScreen="page * 10"
- >
- <u-list-item v-for="(item, index) in list" :key="index">
- <!-- <view class="card_box" @click="handleDetail">
- <view class="item_box rx-bc">
- <view class="round">{{ index + 1 }}</view>
- <view class="item_one perce100 rx-sc">
- <view class="lable"></view>
- <view class="text">{{ item.code }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">工单编码:</view>
- <view class="text">{{ item.workOrderCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">物品编码:</view>
- <view class="text">{{ item.categoryCode }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">物品名称:</view>
- <view class="text"> {{ item.categoryName }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce50 rx-sc">
- <view class="lable">不合格/合格数量:</view>
- <view class="text">
- {{ item.notFormedNum || 0 }} / {{ item.formedNum || 0 }}</view
- >
- </view>
- <view class="item_one perce50 rx-sc">
- <view class="lable">工序:</view>
- <view class="text"> {{ item.taskName }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce50 rx-sc">
- <view class="lable">重量:</view>
- <view class="text">
- {{ item.weight || 0 }} / {{ item.weightUnit }}</view
- >
- </view>
- <view class="item_one perce50 rx-sc">
- <view class="lable">回收人:</view>
- <view class="text"> {{ item.executorName }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
- <view class="item_one perce100 rx-sc">
- <view class="lable">创建时间:</view>
- <view> {{ item.createTime }}</view>
- </view>
- </view>
- </view> -->
- <view class="card_box" @click="handleDetail(item)">
- <view class="header rx-sc">
- <view class="round">{{ index + 1 }}</view>
- <view class="orderId">{{ item.code }}</view>
- </view>
- <view class="row">
- <view class="label">回收单号</view>
- <view class="value">{{ item.code }}</view>
- </view>
- <view class="row">
- <view class="label">工单编码</view>
- <view class="value">{{ item.workOrderCode }}</view>
- </view>
- <view class="row">
- <view class="label">物品名称</view>
- <view class="value"> {{ item.categoryName }}</view>
- </view>
- <view class="row">
- <view class="label">物品编码</view>
- <view class="value">{{ item.categoryCode }} </view>
- </view>
- <view class="row">
- <view class="label">工序</view>
- <view class="value">{{ item.taskName }}</view>
- </view>
- <view class="row">
- <view class="label">回收人</view>
- <view class="value">{{ item.executorName }}</view>
- </view>
- <view class="row">
- <view class="label">不合格/合格数量</view>
- <view class="value"
- >{{ item.notFormedNum || 0 }} / {{ item.formedNum || 0 }}
- </view>
- </view>
- <view class="row">
- <view class="label">重量</view>
- <view class="value"
- >{{ item.weight || 0 }} / {{ item.weightUnit }}</view
- >
- </view>
- <view class="row">
- <view class="label">创建时间</view>
- <view class="value">{{ item.createTime }}</view>
- </view>
- </view>
- </u-list-item>
- <!--
- <checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
- <label class="listBox rx-bs">
- <view class="listBox-sel">
- <checkbox
- v-if='item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1)'
- :value="item.code" color="#fff" :disabled="item.disabled" :checked="item.checked" />
- </view>
- <view class="listBox-con">
- <view class="listBox-top rx-bc">
- <view>工单编号:</view>
- <view class="code">{{ item.code}}</view>
- </view>
- <view class="listBox-bottom rx">
- <view class="items">
- <text>工艺路线</text>{{ item.produceRoutingName }}
- </view>
- <view class="items">
- <text>名称</text>{{ item.productName }}
- </view>
- <view class="items">
- <text>生产数量</text>{{ item.formingNum }}{{item.unit}}
- </view>
- <view class="items">
- <text>生产重量</text>{{item.formingWeight}} {{item.weightUnit}}
- </view>
- </view>
- </view>
- </label>
- </checkbox-group> -->
- <view v-if="list.length == 0" style="margin-top: 20vh">
- <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
- </view>
- </u-list>
- </view>
- <!-- <view class="bottom-wrapper rx-bc">
- <view>
- <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
- <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
- </checkbox>
- </view>
- <view>
- <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen"
- @click="handleSelect">
- <view> 选择( {{ checkListLen }} ) </view>
- </u-button>
- </view>
- </view> -->
- <!-- <SearchPopup mode="center" v-if='searchShow'>
- <template v-slot:list>
- <u-list @scrolltolower="scrolltolower" class="wl_list">
- <view class="recycleTitle">副产品列表</view>
- <view class="pop_list" v-for="(item, index) in memoList" :key="index">
- <view class="work_box rx-bc">
- <view>工单编号:</view>
- <view class="code">{{item.code}}</view>
- </view>
- <view class="recycleList rx" v-for="(it,idx) in item.recycleList" :key="'RECY' + idx">
- <view class="items">
- <text>副产品{{idx+1}}</text>{{ it.categoryName }}
- </view>
- <view class="items">
- <text>编号</text>{{ it.categoryCode }}
- </view>
- </view>
- </view>
- <view class="recycleTitle mt40">副产品处置</view>
- <view class="content_table" v-for="(item, index) in recyclell" :key="'ll' +index">
- <view class="item rx-sc">
- <view class="rx ww55 ">
- <view class="lable rx-cc">副产品</view>
- <view class="content ">{{item.categoryName}}</view>
- </view>
- <view class="rx ww45">
- <view class="lable rx-cc ww80">编号</view>
- <view class="content ">
- {{item.categoryCode}}
- </view>
- </view>
- </view>
-
- <view class="item rx-sc">
- <view class="rx ww55 ">
- <view class="lable rx-cc">处置</view>
- <view class="content content_num">
- <zxz-uni-data-select :localdata="warehouseList" v-model="item.warehouseId"
- dataValue='id' format='{name}' dataKey="name" filterable
- :clear='false'></zxz-uni-data-select>
-
- </view>
- </view>
-
- <view class="rx ww45">
- <view class="lable rx-cc ww80">数量</view>
- <view class="content content_num">
- <input class="uni-input" v-model="item.quantity" type="digit"></input>
- <view class="unit">{{item.weightUnit}}</view>
- </view>
- </view>
- </view>
- </view>
- </u-list>
- </template>
- <template v-slot:operate>
- <view class="operate_box rx-bc">
- <u-button size="small" class="u-reset-button" @click="searchCancel">
- 取消
- </u-button>
- <u-button type="success" size="small" class="u-reset-button" @click="handSave">
- 确定
- </u-button>
- </view>
- </template>
- </SearchPopup> -->
- </view>
- </template>
- <script>
- import { tableHeader } from "../../common.js";
- import {
- treeByPid,
- listWorkOrderByTaskId,
- getWarehouseList,
- disposeorder,
- } from "@/api/pda/workOrder.js";
- import { getPage } from "@/api/pda/byProductRecovery.js";
- import { producetaskList } from "@/api/common.js";
- import SearchPopup from "../../components/searchPopup.vue";
- let [isEnd] = [false];
- export default {
- components: {
- SearchPopup,
- },
- data() {
- return {
- list: [],
- page: 1,
- size: 10,
- seletedAll: false, //全选状态
- memoList: [],
- recyclell: [],
- formData: {
- taskId: "",
- },
- taskList: [],
- warehouseList: [],
- searchShow: false,
- };
- },
- //选择的列表长度
- computed: {
- checkListLen() {
- return this.memoList.length;
- },
- },
- onLoad(option) {
- this.getProducetask();
- this.getWarehouseFn();
- this.getList();
- },
- onUnload() {},
- methods: {
- _seletedAll() {
- if (!this.seletedAll) {
- this.seletedAll = true;
- this.list.map((item) => {
- this.$set(item, "checked", true);
- const idx = this.memoList.findIndex((itm) => itm.id === item.id);
- if (idx === -1) {
- this.memoList.push(item);
- }
- });
- } else {
- this.seletedAll = false;
- this.list.map((item) => {
- this.$set(item, "checked", false);
- const idx = this.memoList.findIndex((itm) => itm.id === item.id);
- if (idx > -1) {
- this.memoList.splice(idx, 1);
- }
- });
- }
- },
- doSearch() {
- this.list = [];
- this.getList();
- },
- scrolltolower() {
- if (isEnd) return;
- this.page++;
- this.getList();
- },
- async getList() {
- let param = {
- pageNum: this.page,
- size: this.size,
- taskId: this.formData.taskId,
- };
- // await getPage(param).then((res) => {
- // // this.list = res.list;
- // this.list.push(...res.list);
- // });
- const res = await getPage(param);
- this.list.push(...res.list);
- isEnd = this.list.length >= res.count;
- // listWorkOrderByTaskId(param).then(res => {
- // this.list = res.list
- // })
- },
- //勾选
- selectVal(e, val, index) {
- console.log(val);
- if (val.rootCategoryLevelId == 11 && val.status == 1) {
- return false;
- }
- this.list[index].checked = !this.list[index].checked;
- this.seletedAll = !this.list.some((item) => !item.checked);
- const idx = this.memoList.findIndex(
- (item) => item.id === this.list[index].id
- );
- if (this.list[index].checked) {
- if (idx === -1) {
- this.memoList.push(this.list[index]);
- }
- } else {
- if (idx > -1) {
- this.memoList.splice(idx, 1);
- }
- }
- },
- searchCancel() {
- this.list = [];
- this.page = 1;
- this.getList();
- this.searchShow = false;
- },
- handleSelect() {
- let arr = [];
- this.recyclell = [];
- this.memoList.forEach((e) => {
- e.recycleList.forEach((f) => {
- arr.push(f);
- });
- });
- this.recyclell = Array.from(
- new Set(arr.map((item) => JSON.stringify(item)))
- ).map((item) => JSON.parse(item));
- this.searchShow = true;
- },
- handSave() {
- let param = {
- taskId: this.formData.taskId,
- recyclell: this.recyclell,
- memoList: this.memoList,
- };
- disposeorder(param).then((res) => {
- console.log(res);
- this.searchShow = false;
- });
- },
- handleDetail() {},
- async getProducetask() {
- await producetaskList().then((res) => {
- this.taskList = res;
- });
- },
- async getWarehouseFn() {
- await getWarehouseList().then((res) => {
- this.warehouseList = res;
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .content-box {
- height: 100vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- background-color: $page-bg;
- }
- .searchBox {
- background-color: #dedede;
- height: 90rpx;
- padding: 0 20rpx;
- .mt20 {
- margin-top: 20rpx;
- }
- /deep/ .uni-select {
- height: 70rpx;
- width: 520rpx;
- background: #fff !important;
- padding-left: 10rpx;
- border-radius: 5rpx;
- margin-right: 20rpx;
- }
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 6rpx 0;
- .u-list {
- height: 100% !important;
- }
- .card_box {
- width: 686rpx;
- margin: 0 auto 24rpx;
- background: #fff;
- border-radius: 18rpx;
- padding: 26rpx 30rpx;
- box-shadow: 0 6rpx 28rpx rgba(0, 0, 0, 0.06);
- box-sizing: border-box;
- transition: transform 0.15s ease-out;
- .header {
- margin-bottom: 18rpx;
- .round {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 50%;
- background: $theme-color;
- color: #fff;
- text-align: center;
- font-size: 22rpx;
- }
- .orderId {
- margin-left: 14rpx;
- font-size: 28rpx;
- font-weight: 600;
- color: #333;
- }
- }
- &:active {
- transform: scale(0.96);
- }
- .row {
- display: flex;
- justify-content: space-between;
- margin-bottom: 12rpx;
- font-size: 26rpx;
- color: #333;
- .label {
- color: #888;
- min-width: 160rpx;
- font-weight: 400;
- }
- .value {
- flex: 1;
- font-weight: 500;
- text-align: right;
- word-break: break-all;
- }
- }
- .tag-row {
- display: flex;
- gap: 16rpx;
- margin: 14rpx 0;
- .tag {
- font-size: 22rpx;
- padding: 6rpx 18rpx;
- border-radius: 32rpx;
- line-height: 1;
- font-weight: 500;
- }
- .green {
- background: #e8f6ec;
- color: #157a2c;
- }
- .blue {
- background: #eaf3ff;
- color: #2a68ff;
- }
- }
- .time {
- font-size: 24rpx;
- color: #999;
- margin-top: 8rpx;
- text-align: right;
- }
- }
- }
- .bottom-wrapper {
- height: 80rpx;
- background: #fff;
- padding: 0 32rpx;
- /deep/ .uni-checkbox-input-checked {
- background-color: $theme-color !important;
- border-color: $theme-color !important;
- }
- }
- .listBox {
- margin-top: 8rpx;
- padding: 8rpx 24rpx;
- background: #fff;
- /deep/ .uni-checkbox-input-checked {
- background-color: $theme-color !important;
- border-color: $theme-color !important;
- }
- .listBox-con {
- width: 650rpx;
- font-weight: 400;
- }
- .listBox-top {
- margin-top: 6rpx;
- color: #090a0a;
- font-size: 28rpx;
- font-style: normal;
- font-weight: 800;
- }
- }
- .listBox-bottom,
- .recycleList {
- color: #090a0a;
- font-size: 24rpx;
- font-style: normal;
- flex-wrap: wrap;
- .items {
- width: calc(50% - 1px);
- border-left: 1rpx solid #e3e5e5;
- border-right: 1rpx solid #e3e5e5;
- border-bottom: 1rpx solid #e3e5e5;
- box-sizing: border-box;
- word-break: break-all;
- text {
- display: inline-block;
- background: #f7f9fa;
- padding: 8rpx 10rpx;
- color: #157a2c;
- }
- &:nth-child(1),
- &:nth-child(2) {
- border-top: 1rpx solid #e3e5e5;
- margin-top: 8rpx;
- }
- }
- }
- .wl_list {
- width: 720rpx;
- max-height: 75vh;
- .operate_box {
- margin: 20rpx;
- }
- .recycleTitle {
- margin-top: 12rpx;
- font-size: 28rpx;
- line-height: 24rpx;
- border-left: 6rpx solid #157a2c;
- padding-left: 16rpx;
- color: #157a2c;
- margin-left: 16rpx;
- }
- .mt40 {
- margin-top: 40rpx;
- }
- .pop_list {
- padding: 12rpx 16rpx;
- border-bottom: 2rpx solid #157a2c;
- .work_box {
- color: #090a0a;
- font-size: 28rpx;
- font-style: normal;
- font-weight: 800;
- }
- .recycleList {
- .lable {
- width: 32rpx;
- height: 32rpx;
- line-height: 32rpx;
- text-align: center;
- border-radius: 50%;
- background: #157a2c;
- font-size: 20rpx;
- color: #fff;
- margin-right: 40rpx;
- }
- }
- .it_name {
- width: 350rpx;
- font-size: 24rpx;
- }
- .it_code {
- font-size: 24rpx;
- }
- }
- }
- .content_table {
- width: 700rpx;
- margin: auto;
- margin-top: 20rpx;
- border: 2rpx solid $border-color;
- .item {
- display: flex;
- border-bottom: 2rpx solid $border-color;
- .lable {
- width: 100rpx;
- text-align: center;
- background-color: #f7f9fa;
- font-size: 22rpx;
- border-right: 2rpx solid $border-color;
- flex-shrink: 0;
- }
- .ww80 {
- width: 60rpx;
- }
- .content {
- width: 518rpx;
- min-height: 64rpx;
- font-size: 24rpx;
- line-height: 28rpx;
- font-style: normal;
- font-weight: 400;
- padding: 18rpx 8rpx;
- box-sizing: border-box;
- word-wrap: break-word;
- flex-grow: 1 !important;
- }
- .content_num {
- display: flex;
- align-items: center;
- padding: 0 4rpx;
- /deep/ .uni-input-input {
- border: 2rpx solid #f0f8f2;
- background: #f0f8f2;
- color: $theme-color;
- }
- .unit {
- width: 90rpx;
- text-align: center;
- font-size: 24rpx;
- color: #404446;
- }
- }
- .pd4 {
- padding: 4rpx 8rpx;
- }
- &:last-child {
- border-bottom: none;
- }
- }
- .ww55 {
- width: 55%;
- }
- .ww45 {
- width: 45%;
- }
- }
- </style>
|