| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- <template>
- <view class="content-box">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- title="出库单"
- background-color="#F7F9FA"
- color="#404446"
- @clickLeft="back"
- ></uni-nav-bar>
- <view class="top-wrapper">
- <view class="searchBox rx-bc">
- <input
- v-model="keyWord"
- placeholder="请输入关键字搜索"
- class="searchInput"
- />
- <view class="rx-sc">
- <u-button
- @click="doSearch"
- type="success"
- size="small"
- class="u-reset-button"
- text="搜索"
- >
- </u-button>
- </view>
- </view>
- </view>
- <view class="list_box">
- <u-list @scrolltolower="scrolltolower">
- <checkbox-group
- v-for="(item, index) in newList"
- :key="index"
- @change="(e) => selectVal(e, item, index)"
- >
- <label class="listBox rx-bs">
- <view class="listBox-sel">
- <checkbox
- :value="item.code"
- color="#fff"
- :disabled="item.disabled"
- :checked="item.checked"
- />
- </view>
- <view class="listBox-con">
- <view class="listBox-top rx-bc">
- <view> {{ item.name }}</view>
- <view class="code">{{ item.code }}</view>
- </view>
- <view class="listBox-bottom rx">
- <view
- v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
- :key="index"
- class="items"
- v-if="!itm.formatter"
- >
- <text>{{ itm.label }}</text
- >{{ item[itm.prop] }}
- </view>
- <view
- v-if="[1, 2, 9].includes(item.rootCategoryLevelId)"
- class="items"
- >
- <text>物料代号</text> {{ item.extInfo.materielCode }}
- </view>
- <view
- v-if="[1, 2, 9].includes(item.rootCategoryLevelId)"
- class="items"
- >
- <text>刻码</text> {{ item.extInfo.engrave }}
- </view>
- </view>
- </view>
- </label>
- </checkbox-group>
- <!-- -->
- </u-list>
- </view>
- <view class="bottom-wrapper rx-bc">
- <view> </view>
- <view>
- <u-button
- type="success"
- size="small"
- class="u-reset-button"
- @click="jumpAdd"
- >
- <view> 选择 </view>
- </u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { tableHeader } from "./single.js";
- import { feedOutInOrder } from "@/api/pda/workOrder.js";
- export default {
- data() {
- return {
- taskId: null,
- id: null,
- list: [],
- newList: [],
- memoList: [],
- storageKey: null,
- keyWord: "",
- };
- },
- onLoad(option) {
- this.id = option.id;
- if (option.taskId == "undefined") {
- this.taskId = null;
- } else {
- this.taskId = option.taskId || null;
- }
- if (option.storageKey) {
- this.storageKey = option.storageKey;
- this.memoList = [];
- let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || [];
- this.memoList = [
- ..._arr[0].modelList,
- ..._arr[0].equipmentList,
- ..._arr[0].instanceList,
- ..._arr[0].aridRegionList,
- ..._arr[0].turnover,
- ..._arr[0].palletList,
- ..._arr[0].revolvingDiskList,
- ..._arr[0].semiProductList,
- ];
- }
- this.getList();
- },
- onUnload() {
- if (this.storageKey) {
- uni.removeStorage(this.storageKey);
- }
- },
- methods: {
- scrolltolower() {},
- getList() {
- let param = {
- workOrderId: this.id,
- taskId: this.taskId,
- };
- feedOutInOrder(param).then((res) => {
- this.newList.push(
- ...res.map((i) => {
- const checked =
- this.memoList.findIndex((itm) => itm.id === i.id) > -1;
- return {
- checked,
- ...i,
- };
- })
- );
- });
- this.list = this.newList;
- },
- doSearch() {
- let _arr = [];
- _arr = this.list.filter((obj) => {
- if (
- obj.name.includes(this.keyWord) ||
- obj.code.includes(this.keyWord) ||
- (obj.extInfo && obj.extInfo.engrave.includes(this.keyWord)) ||
- (obj.extInfo && obj.extInfo.materielCode.includes(this.keyWord))
- ) {
- return true;
- } else {
- return false;
- }
- });
- this.newList = _arr;
- },
- tableH(type) {
- return tableHeader(type);
- },
- selectVal(e, val, index) {
- this.newList[index].checked = !this.newList[index].checked;
- const idx = this.memoList.findIndex(
- (item) => item.id === this.newList[index].id
- );
- if (this.newList[index].checked) {
- if (idx === -1) {
- this.memoList.push(this.newList[index]);
- }
- } else {
- if (idx > -1) {
- this.memoList.splice(idx, 1);
- }
- }
- },
- jumpAdd() {
- uni.$emit("setSelectList", this.memoList, this.id);
- uni.navigateBack();
- },
- },
- };
- </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;
- .menu_icon {
- width: 60rpx;
- height: 60rpx;
- margin-right: 20rpx;
- }
- input {
- height: 70rpx;
- width: 480rpx;
- background: #f9f9f9 !important;
- padding-left: 10rpx;
- border-radius: 5rpx;
- }
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 4rpx 0;
- .u-list {
- height: 100% !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 {
- 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;
- }
- }
- }
- }
- .bottom-wrapper {
- height: 80rpx;
- background: #fff;
- padding: 0 32rpx;
- /deep/ .uni-checkbox-input-checked {
- background-color: $theme-color !important;
- border-color: $theme-color !important;
- }
- }
- </style>
|