| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641 |
- <template>
- <view>
- <u-popup :show="show" :mode='mode' :closeOnClickOverlay='false'>
- <view class="card_box">
- <view class="item_box rx-bc">
- <view class="item_one rx-sc">
- <view class="lable">委外名称:</view>
- <view style="color: #157A2C">{{ outObj.name }}</view>
- </view>
- </view>
- <view class="item_box rx-bc">
-
- <view class="item_one perce50 rx-sc">
- <view class="lable">委外类型:</view>
- <view style="color: #157A2C">{{ outObj.type == 4 ? '带料委外' : '无料委外' }}</view>
- </view>
-
- <view class="item_one perce50 rx-sc">
- <view class="lable">直接入库:</view>
- <view style="color: #157A2C">{{ outObj.isInWarehouse == 1 ? '是' : '否' }}</view>
- </view>
- </view>
-
-
- </view>
- <u-tabs :list="tabList" @click="handTab" lineWidth="30" lineColor="#157A2C" :activeStyle="{
- color: '#157A2C',
- }" :inactiveStyle="{
- color: '#303133',
-
- }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
- </u-tabs>
- <view class="box_list">
- <u-list @scrolltolower="scrolltolower" class="z_list">
- <view v-if="actTab == '物品清单'">
- <view class="rx-bc" v-if="outObj.isStraight != 1 && clientEnvironmentId != 2">
- <view style="margin-left: 24rpx">
- <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>勾选:<text style="color: #157A2C">{{ checkListLen || 0 }}个</text> </view>
- </view>
- <checkbox-group v-for="(item, index) in pickOutInList" :key="index"
- @change="e => selectVal(e, item, index)" v-if="clientEnvironmentId != 2">
- <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="outObj.isStraight == 1"
- :checked="item.checked" />
- </view>
- <view class="listBox-con">
- <view class="listBox-top rx-bc">
- <view> {{ item.name }}</view>
- <view class="code">
- {{ item.rootCategoryLevelId == 4 ? item.codeNumber : 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 class="items"
- v-if='(item.rootCategoryLevelId == 1 && item.isConsumable == 1) && item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 4 '>
- <text>可用库存</text>{{ item.availableCountBase }} {{item.unit}}
- </view>
- <view class="items"
- v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
- <text>刻码</text>{{item.extInfo.engrave }}
- </view>
- <view class="items"
- v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
- <text>物料代号</text>{{item.extInfo.materielCode }}
- </view>
- <view class="items"
- v-if='([1,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
- <text>客户代号</text>{{item.extInfo.clientCode }}
- </view>
- </view>
- </view>
- </label>
- </checkbox-group>
- </view>
- <view v-if="actTab == '带料清单'">
- <view class="title_box rx-bc">
- <view></view>
- <view class="right_box rx-ec">
- <u-button type="success" size="small" class="u-reset-button" @click="addPicking(2)"
- text="添加"></u-button>
- </view>
- </view>
- <view v-for="(item, index) in bomMaterialList" :key="index">
- <label class="listBox rx-bs">
- <view class="listBox-sel">
- <view class="round">{{index + 1}}</view>
- </view>
- <view class="listBox-con">
- <view class="listBox-bottom rx">
- <view class="items">
- <text>名称</text>{{ item.name }}
- </view>
- <view class="items">
- <text>编码</text>{{ item.code }}
- </view>
- <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 class="items" v-if="item.isDemandQuantity && clientEnvironmentId != 2">
- <text>数量</text>{{ item.count * ( checkListLen || 1 ) }}
- </view>
- <view class="items content_num" v-if="!item.isDemandQuantity && clientEnvironmentId != 2">
- <text>数量</text> <input style="8px !important"
- v-model="item.demandQuantity"></input>
- </view>
-
- <view class="items" v-if="item.isDemandQuantity && clientEnvironmentId == 2">
- <text>数量</text>{{ item.count * ( outObj.formedNumLast || 1 ) }}
- </view>
- <view class="items content_num" v-if="!item.isDemandQuantity && clientEnvironmentId == 2">
- <text>数量</text> <input style="8rpx !important"
- v-model="item.demandQuantity"></input>
- </view>
- </view>
- </view>
- </label>
- </view>
- </view>
- <view v-if="actTab == '产出清单'">
- <view class="title_box rx-bc">
- <view></view>
- <view class="right_box rx-ec">
- <u-button type="success" size="small" class="u-reset-button" @click="addPicking(3)"
- text="添加"></u-button>
- </view>
- </view>
- <view v-for="(item, index) in standardOutputList" :key="index">
- <label class="listBox rx-bs">
- <view class="listBox-sel">
- <view class="round">{{index + 1}}</view>
- </view>
- <view class="listBox-con">
- <view class="listBox-bottom rx">
- <view class="items">
- <text>名称</text>{{ item.name }}
- </view>
- <view class="items">
- <text>编码</text>{{ item.code }}
- </view>
- <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 class="items content_num">
- <text>数量</text> <input style="8rpx !important"
- v-model="item.demandQuantity"></input>
- </view>
- </view>
- </view>
- </label>
- </view>
- </view>
- </u-list>
- <view class="operate_box rx-bc">
- <u-button size="small" class="u-reset-button" @click="close">
- 取消
- </u-button>
- <u-button type="success" size="small" class="u-reset-button" @click="handOK">
- 提交
- </u-button>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- checkOutsourceMaterial,
- applyoutsourceSave
- } from '@/api/pda/workOrder.js'
- import {
- tableHeader
- } from '../common.js'
- import {
- EventBus
- } from '@/utils/eventBus.js'
- export default {
- data() {
- return {
- mode: 'center',
- show: false,
- topHight: 20 || 20,
- outObj: {},
- tabList: [{
- name: '物品清单'
- },
- {
- name: '带料清单'
- },
- {
- name: '产出清单'
- }
- ],
- actTab: '物品清单',
- bomMaterialList: [],
- pickOutInList: [],
- materialList: [],
- standardOutputList: [],
- isFirstTask: null,
- clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
- .clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
- seletedAll: false, //全选状态
- checkListLen: 0
- }
- },
- created() {
- EventBus.$on('outEvent', this.handleEvent);
- },
- computed: {
- },
- methods: {
- open(obj) {
- this.outObj = obj
- this.actTab = '物品清单',
- this.outsourceMaterialFn()
- this.show = true
- },
- outsourceMaterialFn() {
- let param = {
- taskId: this.outObj.taskId,
- taskIds: this.outObj.taskIds,
- workOrderId: this.outObj.workOrderId
- }
- checkOutsourceMaterial(param).then(res => {
- if (this.clientEnvironmentId == 3 && res.isFirstTask == 1) {
- this.pickOutInList = [...res.pickOutInList, ...res.materialList]
- } else {
- this.pickOutInList = res.pickOutInList
- }
- this.bomMaterialList = res.bomMaterialList.map((m) => {
- return {
- ...m,
- isDemandQuantity: true
- }
- })
- this.standardOutputList = res.standardOutputList
- this.$forceUpdate()
- })
- },
- handTab(item) {
- this.actTab = item.name
- },
- close() {
- this.show = false
- },
- handleEvent({
- message
- }) {
- if (message.pid == 3) {
- this.standardOutputList = message.memoList
- } else {
- if (message.pid == 2) {
- this.bomMaterialList = message.memoList
- }
- }
- },
- tableH(type) {
- return tableHeader(type)
- },
- //勾选
- selectVal(e, val, index) {
- this.pickOutInList[index].checked = !this.pickOutInList[index].checked
- this.checkListLen = this.pickOutInList.filter(f => f.checked == true).length
- },
- _seletedAll() {
- if (!this.seletedAll) {
- this.seletedAll = true
- this.pickOutInList.map(item => {
- this.$set(item, 'checked', true)
- })
- } else {
- this.seletedAll = false
- this.pickOutInList.map(item => {
- this.$set(item, 'checked', false)
- })
- }
- this.checkListLen = this.pickOutInList.filter(f => f.checked == true).length
- },
- scrolltolower() {},
- addPicking(id) {
- const storageKey = Date.now() + "";
- let arr = null
- if (id == 3) {
- arr = [{
- standardOutputList: this.standardOutputList,
- }]
- } else {
- arr = [{
- bomMaterialList: this.bomMaterialList,
- }]
- }
- uni.setStorageSync(storageKey, arr);
- uni.navigateTo({
- url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,23,9]`
- })
- },
- handOK() {
- let param = {
- ...this.outObj,
- isRelease: 0,
- bomMaterialList: this.bomMaterialList,
- pickOutInList: this.pickOutInList.filter(f => f.checked == true),
- materialList: this.materialList,
- standardOutputList: this.standardOutputList,
- }
- applyoutsourceSave(param).then(res => {
- uni.showToast({
- title: "提交成功",
- icon: "none"
- })
- this.$emit('close', true)
- this.checkListLen = 0
- this.close()
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .z_list {
- max-height: 860rpx;
- padding: 10rpx;
- box-sizing: border-box;
- }
- .box_list {
- min-height: 100rpx;
- width: 96vw;
- /deep/ .baseForm {
- padding: 0 20rpx;
- }
- }
- .operate_box {
- padding: 10rpx 32rpx;
- /deep/ .u-button {
- width: 40%;
- }
- }
- /deep/ .u-tabs__wrapper__nav {
- background: #f5f5f5 !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-sel {
- margin-top: 10rpx;
- margin-right: 8rpx;
- .round {
- width: 32rpx;
- height: 32rpx;
- line-height: 32rpx;
- text-align: center;
- border-radius: 50%;
- background: $theme-color;
- font-size: 24rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- }
- .round {
- width: 32rpx;
- height: 32rpx;
- line-height: 32rpx;
- text-align: center;
- border-radius: 50%;
- background: $theme-color;
- font-size: 24rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- .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;
- }
- }
- }
- }
- .card_box {
- width: 92vw;
- padding: 16rpx 32rpx;
- box-sizing: border-box;
- border-bottom: 2rpx solid #E1E1E1;
- .item_box {
- margin-top: 10rpx;
- .item_one {
- width: 100%;
- font-size: 26rpx;
- font-style: normal;
- font-weight: 400;
- line-height: 38rpx;
- word-wrap: break-word;
- }
- .gylx {
- color: $theme-color;
- }
- .perce50 {
- width: 50%;
- }
- }
- }
- .content_num {
- display: flex;
- align-items: center;
- padding: 0 4rpx;
- /deep/ .uni-input-input {
- border: 2rpx solid #F0F8F2;
- background: #F0F8F2;
- color: $theme-color;
- }
- }
- </style>
|