Commit d5b050cf authored by 张海景's avatar 张海景

add:加上作业分派功能

parent 750077fb
...@@ -35,6 +35,9 @@ const install = (Vue, vm) => { ...@@ -35,6 +35,9 @@ const install = (Vue, vm) => {
config.adminPath + '/mobile/pro/process/getProcessList', config.adminPath + '/mobile/pro/process/getProcessList',
params params
), ),
//获取工作单元列表
getMesWorkunitList: (params = {}) =>
vm.$u.get(config.adminPath + '/md/workunit/list', params),
getWorkstationList: (params = {}) => getWorkstationList: (params = {}) =>
vm.$u.get( vm.$u.get(
config.adminPath + '/mobile/md/workstation/getWorkstationList', config.adminPath + '/mobile/md/workstation/getWorkstationList',
...@@ -212,9 +215,8 @@ const install = (Vue, vm) => { ...@@ -212,9 +215,8 @@ const install = (Vue, vm) => {
), ),
getWproworkOrderProcessItem: (params = {}) => getWproworkOrderProcessItem: (params = {}) =>
vm.$u.postJson( vm.$u.postJson(
config.adminPath + config.adminPath + '/pro/materialRequest/selectworkorder',
'/pro/materialRequest/selectworkorder', params
params
), ),
//退料申请 //退料申请
...@@ -287,6 +289,8 @@ const install = (Vue, vm) => { ...@@ -287,6 +289,8 @@ const install = (Vue, vm) => {
vm.$u.post('/account/saveRegByValidCode', params), vm.$u.post('/account/saveRegByValidCode', params),
getPrintTemplateList: (params = {}) => getPrintTemplateList: (params = {}) =>
vm.$u.get(config.adminPath + '/ureportM/list', params), vm.$u.get(config.adminPath + '/ureportM/list', params),
putProtaskSplit: (params = {}) =>
vm.$u.putJson(config.adminPath + '/mes/pro/protask/split', params),
// APP公共服务 // APP公共服务
upgradeCheck: () => upgradeCheck: () =>
vm.$u.post('/app/upgrade/check', { vm.$u.post('/app/upgrade/check', {
......
<template>
<view class="dmodel-table">
<view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="工作单元编码" label-width="100px" name="workunitCode">
<uni-easyinput type="text" v-model="tableParams.workunitCode" placeholder="请输入工作单元编码" />
</u-form-item>
<u-form-item label="工作单元名称" label-width="100px" name="workunitName">
<uni-easyinput type="text" v-model="tableParams.workunitName" placeholder="请输入工作单元名称" />
</u-form-item>
<u-form-item label="工作站" label-width="60px" name="workstationName">
<uni-easyinput type="text" v-model="tableParams.workstationName" placeholder="请输入工作站" />
</u-form-item>
<u-form-item>
<u-button class="btn" @click="getList" type="primary" size="medium">搜索</u-button>
</u-form-item>
</u-form>
</view>
<zb-table ref="zbTable" rowKey="workunitCode"
:columns="tableColumn" :data="tableData" :stripe="true"
@toggleRowSelection="toggleRowSelection">
</zb-table>
</view>
</template>
<script>
export default {
props: {
},
data() {
return {
tableParams: {
workunitCode: null,
workunitName: null,
workstationName: null
},
tableData: [],
tableSelectData: [],
tableColumn: [{
type: 'radio',
width: 40
},
{
name: 'workstationName',
label: '工作站名称',
width: 160,
},
{
name: 'workunitCode',
label: '工作单元编码',
width: 200,
},
{
name: 'workunitName',
label: '工作单元名称',
width: 160,
},
],
}
},
// computed: {
// tableData() {
// return this.data || []
// }
// },
mounted() {
this.getList()
// this.data.workstationName
},
methods: {
async getList() {
const res = await this.$u.api.getMesWorkunitList(this.tableParams)
console.log(res, 'res')
if (res.code == 200) {
this.tableData=res.rows
}
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
}
}
</script>
<style scoped>
.dmodel-table {
height: 500rpx;
margin-top: 20rpx;
padding: 0 20rpx;
}
.tableForm{
display: flex;
margin-bottom:20rpx;
}
.btn{
margin-left:10px;
}
</style>
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
<u-button type="primary" @click="commonClick('RecoilMaterial')">反冲料登记</u-button> <u-button type="primary" @click="commonClick('RecoilMaterial')">反冲料登记</u-button>
<u-button type="primary" @click="commonClick('MaterialRequest')">领料申请</u-button> <u-button type="primary" @click="commonClick('MaterialRequest')">领料申请</u-button>
<u-button type="primary" @click="commonClick('MaterialReturn')">退料申请</u-button> <u-button type="primary" @click="commonClick('MaterialReturn')">退料申请</u-button>
<u-button type="primary" @click="commonClick('jobAssignment')">作业分派</u-button>
<u-button type="success" @click="commonClick('StockIn')">完工入库申请</u-button> <u-button type="success" @click="commonClick('StockIn')">完工入库申请</u-button>
<u-button type="primary" @click="commonClick('ViewPpicture')">查看图片</u-button> <u-button type="primary" @click="commonClick('ViewPpicture')">查看图片</u-button>
</scroll-view> </scroll-view>
...@@ -250,7 +251,9 @@ ...@@ -250,7 +251,9 @@
v-model="printTemplateVisible" v-model="printTemplateVisible"
width="1300rpx" width="1300rpx"
> >
<print-template ref="printTemplateRef" :data="printTemplateData" /> <view class="feedback-card">
<print-template ref="printTemplateRef" :data="printTemplateData" />
</view>
</u-modal> </u-modal>
<u-modal <u-modal
...@@ -285,8 +288,10 @@ ...@@ -285,8 +288,10 @@
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }" :title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="userTempVisible" v-model="userTempVisible"
width="1300rpx" width="1300rpx"
> >
<userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" /> <view class="feedback-card">
<userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" />
</view>
</u-modal> </u-modal>
<u-modal <u-modal
title="暂停原因" title="暂停原因"
...@@ -664,6 +669,44 @@ ...@@ -664,6 +669,44 @@
</scroll-view> </scroll-view>
</view> </view>
</u-modal> </u-modal>
<u-modal
title="作业分派"
@confirm="handleSubmitJobAssignment"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="jobAssignmentVisible"
width="1200rpx"
>
<view class="feedback-card">
<u-form :mode="jobAssignmentForm" label-width="100px">
<u-form-item label="排产数量">
<u-number-box v-model="jobAssignmentForm.quantity" :long-press="false" :positive-integer="false" :size="50" :input-width="190"></u-number-box>
</u-form-item>
<u-form-item label="工作单元">
<u-input disabled v-model="jobAssignmentForm.workunitName" placeholder="选择工作单元"></u-input>
<u-button
@tap="workunitVisible = true"
type="success"
size="mini"
>选择工作单元</u-button>
</u-form-item>
</u-form>
</view>
</u-modal>
<u-modal
title="选择工作单元"
@confirm="handleSubmitWorkunit"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="workunitVisible"
width="1800rpx"
>
<view class="feedback-card" v-if="workunitVisible">
<workunitList ref="workunitRef" />
</view>
</u-modal>
</view> </view>
</template> </template>
...@@ -672,6 +715,7 @@ import SearchInput from '@/components/ScanInput/index.vue'; ...@@ -672,6 +715,7 @@ import SearchInput from '@/components/ScanInput/index.vue';
import dModelList from './components/dModelList.vue'; import dModelList from './components/dModelList.vue';
import userPersonnel from './components/userPersonnel.vue'; import userPersonnel from './components/userPersonnel.vue';
import printTemplate from './components/printTemplate.vue'; import printTemplate from './components/printTemplate.vue';
import workunitList from './components/workunitList.vue';
import UButton from '../../../uview-ui/components/u-button/u-button.vue'; import UButton from '../../../uview-ui/components/u-button/u-button.vue';
import { handleError } from "vue"; import { handleError } from "vue";
export default { export default {
...@@ -681,10 +725,17 @@ export default { ...@@ -681,10 +725,17 @@ export default {
dModelList, dModelList,
userPersonnel, userPersonnel,
printTemplate, printTemplate,
UButton UButton,
workunitList
}, },
data() { data() {
return { return {
workunitVisible: false,
jobAssignmentVisible: false,
jobAssignmentForm: {
quantity: 1,
workunitName: null
},
listTabPro: [ listTabPro: [
{ {
name: '指令列表' name: '指令列表'
...@@ -1147,11 +1198,6 @@ export default { ...@@ -1147,11 +1198,6 @@ export default {
} else { } else {
this.$u.api.changeCheckMachineTool({ this.$u.api.changeCheckMachineTool({
taskWorkunitId: item.taskWorkunitId taskWorkunitId: item.taskWorkunitId
}).then((res) => {
// console.log(res, '刀模板')
if (res.code === 500) {
this.$u.toast(res.msg)
}
}) })
this.changeStatus(item.taskId, item.taskWorkunitId,'BEGINNING',item.workunitId, false); this.changeStatus(item.taskId, item.taskWorkunitId,'BEGINNING',item.workunitId, false);
} }
...@@ -1198,6 +1244,9 @@ export default { ...@@ -1198,6 +1244,9 @@ export default {
case 'MaterialReturn': case 'MaterialReturn':
this.materialReturnShow(); this.materialReturnShow();
break; break;
case 'jobAssignment': // 作业分派
this.handleJobAssignment();
break;
case 'StockIn': case 'StockIn':
this.stockInShow(); this.stockInShow();
break; break;
...@@ -1206,6 +1255,28 @@ export default { ...@@ -1206,6 +1255,28 @@ export default {
break; break;
} }
}, },
handleJobAssignment() {
this.jobAssignmentForm = {
quantity: 1,
workunitName: null
}
this.jobAssignmentVisible = true
},
handleSubmitWorkunit() {
this.jobAssignmentForm.workunitId = this.$refs.workunitRef.tableSelectData[0].workunitId
this.jobAssignmentForm.workunitName = this.$refs.workunitRef.tableSelectData[0].workunitName
},
handleSubmitJobAssignment() {
let datas = Object.assign({}, this.tableSelectData[0])
datas.taskWorkunit = this.jobAssignmentForm
this.$u.api.putProtaskSplit(datas).then((res) => {
// console.log(res, 'res333')
if (res.code === 200) {
this.jobAssignmentVisible = false
this.getTaskList()
}
});
},
async knifeTempShow() { async knifeTempShow() {
if (this.tableSelectData.length > 1) { if (this.tableSelectData.length > 1) {
return; return;
...@@ -1361,23 +1432,23 @@ export default { ...@@ -1361,23 +1432,23 @@ export default {
}); });
}); });
}, },
stopCause() { stopCause() {
// 查询原因 // 查询原因
this.$u.api.abnormal this.$u.api.abnormal
.detail({ .detail({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
abnormalType:'WORK' abnormalType:'WORK'
}) })
.then((res) => { .then((res) => {
this.causeList = res.rows.map((item) => { this.causeList = res.rows.map((item) => {
return { return {
value: item.abnormalReason, value: item.abnormalReason,
text: item.abnormalReason text: item.abnormalReason
}; };
}); });
}); });
}, },
getWorkorderWithSizeAndDirective(item, index) { getWorkorderWithSizeAndDirective(item, index) {
this.$u.api this.$u.api
.getWorkorderWithSizeAndDirective({ .getWorkorderWithSizeAndDirective({
...@@ -1524,7 +1595,7 @@ export default { ...@@ -1524,7 +1595,7 @@ export default {
} }
}); });
}, },
changeStatus(taskId, taskWorkunitId, status,workunitId,showToast ) { changeStatus(taskId, taskWorkunitId, status,workunitId, showToast ) {
// this.form.status = status; // this.form.status = status;
this.$u.api this.$u.api
.changeStatus({ .changeStatus({
...@@ -1536,8 +1607,8 @@ export default { ...@@ -1536,8 +1607,8 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
const showToast = showToast === false? false: true let showToastData = showToast === false? false: true
if(showToast) { if(showToastData) {
this.$u.toast('变更成功'); this.$u.toast('变更成功');
} }
this.getTaskList(); this.getTaskList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment