lijuncheng
12 months ago
9 changed files with 494 additions and 137 deletions
@ -0,0 +1,105 @@ |
|||
<template> |
|||
<uni-popup ref="popupItems"> |
|||
<com-popup @onClose="closePopup"> |
|||
<view class=""> |
|||
<view class="uni-center" style="font-size: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> |
|||
选择零件 |
|||
</view> |
|||
<u-line/> |
|||
<view style="margin: 20rpx;" v-for="(item, index) in showList" :key="index" > |
|||
<view class="" style="padding: 10rpx;" @click="selectItem(item)"> |
|||
零件: {{item.itemCode}} |
|||
</view> |
|||
<u-line/> |
|||
</view> |
|||
</view> |
|||
<view class="flex uni-center" style="width: 100%;justify-content: center;margin-top: 10rpx;margin-bottom: 10rpx;" > |
|||
<view class=""> |
|||
当前页:{{ pageCurrent }},数据总量:{{ total }}条,每页数据:{{ pageSize }} |
|||
</view> |
|||
|
|||
</view> |
|||
<view class=""> |
|||
<uni-pagination :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" /> |
|||
</view> |
|||
|
|||
|
|||
</com-popup> |
|||
</uni-popup> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
getProductionlineItem |
|||
} from '@/api/request2.js'; |
|||
import comPopup from '@/mycomponents/common/comPopup.vue' |
|||
export default { |
|||
emits: ["selectedItem"], |
|||
components: { |
|||
comPopup, |
|||
}, |
|||
props: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
showList: [], |
|||
pageCurrent:1, |
|||
pageSize:10, |
|||
total:0 |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
queryList(lineCode){ |
|||
var params = { |
|||
productionLineCode: lineCode, |
|||
pageNo: this.pageCurrent, |
|||
pageSize: this.pageSize |
|||
} |
|||
getProductionlineItem(params).then(res => { |
|||
if (res.data != null && res.data.list.length > 0) { |
|||
this.showList = res.data.list; |
|||
this.total =res.data.total; |
|||
this.$refs['popupItems'].open("center"); |
|||
} else { |
|||
//没有查询到生产线对应的零件信息 |
|||
// this.showErrorMessage('未查找到生产线【' + lineCode + '】对应的零件'); |
|||
this.$refs['popupItems'].open("center"); |
|||
} |
|||
}).catch(error => { |
|||
// this.showErrorMessage(error); |
|||
}) |
|||
}, |
|||
openPopup(items) { |
|||
this.showList = items; |
|||
this.$refs['popupItems'].open("center"); |
|||
}, |
|||
closePopup() { |
|||
this.$refs.popupItems.close() |
|||
}, |
|||
selectItem(item) { |
|||
this.$emit("selectedItem", item); |
|||
this.$refs['popupItems'].close(); |
|||
}, |
|||
change(e){ |
|||
this.pageCurrent = e.current |
|||
console.log("分页",e.current) |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.fixed-bottom { |
|||
position: fixed; |
|||
bottom: 0; |
|||
width: 100%; |
|||
text-align: center; |
|||
background-color: #fff; |
|||
padding: 10px 0; |
|||
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1); |
|||
} |
|||
</style> |
@ -0,0 +1,92 @@ |
|||
<template> |
|||
<view class=""> |
|||
|
|||
|
|||
<uni-collapse ref="collapse"> |
|||
<uni-collapse-item :open="true"> |
|||
<template v-slot:title> |
|||
<view class="" style="font-size: 32rpx;"> |
|||
<view class="" > |
|||
车间代码 : {{dataContent.workShopCode}} |
|||
</view> |
|||
<view class="" > |
|||
车间名称 : |
|||
</view> |
|||
<view class=""> |
|||
生产线代码 :{{dataContent.productionLineCode}} |
|||
</view> |
|||
<view class=""> |
|||
工位代码 :{{dataContent.workStationCode}} |
|||
</view> |
|||
</view> |
|||
|
|||
</template> |
|||
<u-line /> |
|||
<uni-swipe-action ref="swipeAction"> |
|||
<view v-for="(item, index) in dataContent.subList" :key="index"> |
|||
<uni-swipe-action-item> |
|||
<view class="" style="font-size: 32rpx;margin: 10rpx;"> |
|||
<view class=""> |
|||
物品代码 : {{item.itemCode}} |
|||
</view> |
|||
<view class=""> |
|||
物品名称 : {{item.itemName}} |
|||
</view> |
|||
|
|||
<view class="uni-flex uni-row uni-center"> |
|||
<view class=""> |
|||
数量 : {{item.qty}} 单位 : |
|||
</view> |
|||
<view class=""> |
|||
<uom :uom="item.uom"></uom> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</view> |
|||
</uni-swipe-action-item> |
|||
<u-line /> |
|||
</view> |
|||
</uni-swipe-action> |
|||
|
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
|
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import uom from '@/mycomponents/qty/uom.vue' |
|||
export default { |
|||
components: { |
|||
uom |
|||
}, |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
}, |
|||
methods: { |
|||
update(){ |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse.resize() |
|||
}); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,177 @@ |
|||
<template> |
|||
<view class="page-wraper"> |
|||
<view class="" v-if='detailSource.subList.length==0'> |
|||
<com-blank-view @goScan='goScan(true)'></com-blank-view> |
|||
</view> |
|||
<view v-else class="page-wraper"> |
|||
<view class="page-main"> |
|||
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource"> |
|||
</comIssueRequestCreator> |
|||
<button class="btn_add" @click="goScan(false)">+去添加</button> |
|||
</view> |
|||
|
|||
<div class="btn_bottom"> |
|||
<view class="" style="display: flex;flex-direction: row;"> |
|||
<view class=""> |
|||
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button> |
|||
</view> |
|||
</view> |
|||
</div> |
|||
|
|||
<com-scan-issue-pack ref="comScanIssuePack" > |
|||
</com-scan-issue-pack> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</view> |
|||
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
issueRequestSubmit, |
|||
issueRecordSubmit |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
goHome, |
|||
updateTitle, |
|||
getRemoveOption, |
|||
getISODateTime |
|||
} from '@/common/basic.js'; |
|||
|
|||
import { |
|||
getDataSource |
|||
} from '@/pages/issue/js/issue.js'; |
|||
|
|||
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|||
import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue' |
|||
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|||
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue' |
|||
|
|||
export default { |
|||
name: 'issueRequestSubmit', |
|||
components: { |
|||
comBlankView, |
|||
comIssueRequestPopup, |
|||
jobDetailPopup, |
|||
comScanIssuePack, |
|||
comMessage, |
|||
comIssueRequestCreator |
|||
}, |
|||
data() { |
|||
return { |
|||
jobContent: {}, //任务内容 |
|||
subList: [], //接口返回的任务subList |
|||
detailSource: { |
|||
subList: [] |
|||
}, //绑定在页面上的数据源 |
|||
detailOptions: [], |
|||
scanOptions: [], |
|||
requestList: [], //需求信息 |
|||
|
|||
} |
|||
}, |
|||
mounted() { |
|||
this.goScan(true) |
|||
}, |
|||
onLoad(option) { |
|||
|
|||
|
|||
}, |
|||
methods: { |
|||
goScan(editPosition) { |
|||
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition); |
|||
}, |
|||
|
|||
//确定需求信息 |
|||
requestConfirm(action, item) { |
|||
|
|||
if (this.detailSource.subList.length == 0) { |
|||
this.detailSource = { |
|||
workShopCode: item.workShopCode, |
|||
productionLineCode:item.productionLineCode, |
|||
workStationCode:item.workStationCode, |
|||
subList: [] |
|||
} |
|||
var subItem = { |
|||
productionLineCode: item.productionLineCode, |
|||
workStationCode: item.workStationCode, |
|||
itemCode: item.itemCode, |
|||
itemName: item.itemName, |
|||
qty: item.qty, |
|||
uom: item.uom |
|||
} |
|||
this.detailSource.subList.push(subItem) |
|||
} else { |
|||
var result = this.detailSource.subList.filter(res => { |
|||
if (res.itemCode == item.itemCode) { |
|||
return res |
|||
} |
|||
}) |
|||
|
|||
//没有添加数据 |
|||
if (result.length == 0) { |
|||
var subItem = { |
|||
productionLineCode: item.productionLineCode, |
|||
workStationCode: item.workStationCode, |
|||
itemCode: item.itemCode, |
|||
itemName: item.itemName, |
|||
qty: item.qty, |
|||
uom: item.uom |
|||
} |
|||
|
|||
this.detailSource.subList.push(subItem) |
|||
|
|||
} else { |
|||
//有了更新数据 |
|||
result[0].qty += item.qty |
|||
} |
|||
this.$refs.issueRequest.update() |
|||
} |
|||
}, |
|||
|
|||
|
|||
setParams() { |
|||
return this.detailSource |
|||
}, |
|||
submit() { |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
var params = this.setParams() |
|||
console.log("提交参数", JSON.stringify(params)); |
|||
// issueRequestSubmit(params).then(res => { |
|||
// uni.hideLoading() |
|||
// if (res.data) { |
|||
// this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data) |
|||
// } else { |
|||
// this.showErrorMessage("提交失败" + res.msg) |
|||
// } |
|||
// }).catch(error => { |
|||
// uni.hideLoading() |
|||
// this.showErrorMessage(error) |
|||
// }) |
|||
|
|||
}, |
|||
showCommitSuccessMessage(hint) { |
|||
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|||
uni.navigateTo({ |
|||
url: './issueRequest' |
|||
}) |
|||
}) |
|||
}, |
|||
showErrorMessage(message) { |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) {} |
|||
}); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
After Width: | Height: | Size: 655 B |
Loading…
Reference in new issue