|
|
@@ -17,9 +17,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <jobBom :item='objData' :palletList='objData.palletList'></jobBom>
|
|
|
+ <jobBom :item='objData' :palletList='objData.palletList' :notFormed='objData.notFormedList'
|
|
|
+ @penalize='penalize'></jobBom>
|
|
|
|
|
|
- <byProductBom v-if='objData.productRecycleList.length != 0 ' :list='objData.productRecycleList'>
|
|
|
+ <byProductBom v-if='objData.productRecycleList.length != 0 ' :list='objData.productRecycleList'
|
|
|
+ @penalize='penalize'>
|
|
|
</byProductBom>
|
|
|
|
|
|
<turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData'
|
|
|
@@ -31,7 +33,6 @@
|
|
|
<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList'
|
|
|
@handleScan='handleScan' :isType='true'></aridRegion>
|
|
|
|
|
|
-
|
|
|
<view class="operate_box rx-sc">
|
|
|
<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
|
|
|
</view>
|
|
|
@@ -47,17 +48,55 @@
|
|
|
</view>
|
|
|
|
|
|
|
|
|
+ <SearchPopup mode="bottom" v-if='searchShow'>
|
|
|
+ <template v-slot:list>
|
|
|
+ <view class="search_list">
|
|
|
+
|
|
|
+
|
|
|
+ <u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
|
|
|
+ <u-form-item label="仓库:" class="required-form" borderBottom prop="warehouseId">
|
|
|
+ <zxz-uni-data-select :localdata="warehouseList" v-model="formData.warehouseId"
|
|
|
+ dataValue='id' format='{name}'></zxz-uni-data-select>
|
|
|
+ </u-form-item>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </u-form>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </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="popupOk">
|
|
|
+ 确定
|
|
|
+ </u-button>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </SearchPopup>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
getByIdReport,
|
|
|
- getByCodeReport
|
|
|
+ getByCodeReport,
|
|
|
+ jobSave
|
|
|
} from '@/api/pda/jobBooking.js'
|
|
|
|
|
|
import {
|
|
|
- scanLedger
|
|
|
+ scanLedger,
|
|
|
+ getWarehouseList,
|
|
|
+
|
|
|
} from '@/api/pda/workOrder.js'
|
|
|
|
|
|
|
|
|
@@ -68,7 +107,7 @@
|
|
|
import byProductBom from '../components/byProductBom'
|
|
|
import turnoverBom from '../components/turnoverBom.vue'
|
|
|
import aridRegion from '../../feeding/components/aridRegion.vue'
|
|
|
-
|
|
|
+ import SearchPopup from '../../components/searchPopup.vue'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
@@ -79,7 +118,8 @@
|
|
|
jobBom,
|
|
|
byProductBom,
|
|
|
turnoverBom,
|
|
|
- aridRegion
|
|
|
+ aridRegion,
|
|
|
+ SearchPopup
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -92,12 +132,21 @@
|
|
|
productRecycleList: [],
|
|
|
aridRegionList: [],
|
|
|
palletList: [],
|
|
|
- workReportInfo: {
|
|
|
+ workReportInfo: {},
|
|
|
+
|
|
|
+ notFormedList: [], // 报工-不合格
|
|
|
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
|
|
|
+ searchShow: false,
|
|
|
+
|
|
|
+ warehouseList: [],
|
|
|
+ formData: {
|
|
|
+ warehouseId: ''
|
|
|
+ },
|
|
|
+ penalizeIndex: null,
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -290,14 +339,23 @@
|
|
|
formingWeight: null,
|
|
|
formedNum: null,
|
|
|
formedWeight: null,
|
|
|
+ taskId: this.taskId
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.objData.notFormedList = [{
|
|
|
notFormedNum: null,
|
|
|
notFormedWeight: null,
|
|
|
- }
|
|
|
+ weightUnit: res.weightUnit,
|
|
|
+ unit: res.unit,
|
|
|
+ warehouseId: null, // 处置 仓库id
|
|
|
+ }]
|
|
|
|
|
|
this.objData.workReportInfo.formingNum = res.formingNum
|
|
|
this.objData.workReportInfo.formingWeight = res.formingWeight
|
|
|
this.objData.workReportInfo.unit = res.unit
|
|
|
this.objData.workReportInfo.weightUnit = res.weightUnit
|
|
|
+ this.objData.workReportInfo.workOrderId = res.workOrderId
|
|
|
|
|
|
})
|
|
|
},
|
|
|
@@ -313,8 +371,111 @@
|
|
|
},
|
|
|
|
|
|
|
|
|
+ penalize(index) {
|
|
|
+ if (index || index == 0) {
|
|
|
+ this.penalizeIndex = index
|
|
|
+ this.formData.warehouseId = this.objData.productRecycleList[this.penalizeIndex].warehouseId || ''
|
|
|
+ } else {
|
|
|
+ this.penalizeIndex = null
|
|
|
+ this.formData.warehouseId = this.objData.notFormedList[0].warehouseId || ''
|
|
|
+
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ if (this.warehouseList.length == 0) {
|
|
|
+ getWarehouseList().then(res => {
|
|
|
+ this.warehouseList = res
|
|
|
+ this.searchShow = true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.searchShow = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ searchCancel() {
|
|
|
+ this.searchShow = false
|
|
|
+ },
|
|
|
+ popupOk() {
|
|
|
+ if (this.penalizeIndex == null) {
|
|
|
+ this.$set(this.objData.notFormedList[0], 'warehouseId', this.formData.warehouseId || null)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.objData.productRecycleList[this.penalizeIndex].warehouseId = this.formData.warehouseId
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.searchShow = false
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
save() {
|
|
|
- console.log(this.objData)
|
|
|
+ console.log(this.objData)
|
|
|
+ if (!this.objData.workReportInfo['formedNum'] && this.objData.workReportInfo['formedNum'] != 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入合格品数量',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.objData.workReportInfo['formedWeight'] && this.objData.workReportInfo['formedWeight'] != 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入合格品重量',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!this.objData.workReportInfo['formedWeight'] && this.objData.workReportInfo['formedWeight'] != 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入合格品重量',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.objData.notFormedList[0].notFormedNum > 0 && !this.objData.notFormedList[0].warehouseId) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请点击不合格品处置,选择仓库',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.objData.productRecycleList.length > 0) {
|
|
|
+ let bol
|
|
|
+ bol = this.objData.productRecycleList.every(e => {
|
|
|
+ return e.recycleQuantity >= 0 && e.warehouseId
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ if (!bol) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择副产品回收处置',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ jobSave(this.objData).then(res => {
|
|
|
+ if (res) {
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -369,4 +530,9 @@
|
|
|
width: 160rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .search_list {
|
|
|
+ min-height: 300rpx;
|
|
|
+ padding: 0 32rpx;
|
|
|
+ }
|
|
|
</style>
|