Commit 6524426e authored by 何远江's avatar 何远江

添加刀模版上架功能

parents bc5b57e2 97db4688
...@@ -149,6 +149,16 @@ const install = (Vue, vm) => { ...@@ -149,6 +149,16 @@ const install = (Vue, vm) => {
enable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/enable', params), enable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/enable', params),
delete: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/delete', params), delete: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/delete', params),
}, },
// 刀模版相关
dModel: {
// 获取领用单
getToolsByProcessIdAndArrangeCode: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolRequestUse/getToolsByProcessIdAndArrangeCode', params),
// 获取上下机记录
getRecordsByProcessIdAndArrangeCode: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolMachinesRecord/getRecordsByProcessIdAndArrangeCode', params),
// 新增
tmToolMachines: (params = {}) => vm.$u.postJson(config.adminPath + '/tm/tmToolMachines', params),
tmToolMachinesRecord: (params = {}) => vm.$u.putJson(config.adminPath + '/tm/tmToolMachinesRecord', params)
}
}; };
......
<template>
<view class="dmodel-table">
<u-button type="primary" size="mini" @click="commonClick('1')">上机</u-button>
<u-button style="margin-left: 20rpx;" type="success" size="mini" @click="commonClick('2')">下机</u-button>
<zb-table :columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection"
@toggleRowSelection="toggleRowSelection">
</zb-table>
</view>
</template>
<script>
export default {
props: {
data: {
type: Array,
default: () => []
}
},
data() {
return {
tableSelectData: [],
tableColumn: [{
type: 'selection',
width: 35
},
{
name: 'typeName',
label: '状态',
width: 80,
},
{
name: 'toolCode',
label: '工装夹具sn码',
width: 140,
},
{
name: 'toolName',
label: '工装夹具名称',
width: 140,
},
{
name: 'itemName',
label: '物料名称',
width: 140,
},
{
name: 'upDate',
label: '上机时间',
width: 140,
},
{
name: 'downDate',
label: '下机时间',
width: 140,
},
],
}
},
computed: {
tableData() {
return this.data || []
}
},
methods: {
async commonClick(type) {
if (this.tableSelectData.length == 0) {
return this.$u.toast('请选择一条数据!')
}
// 判断选中的类型是否一致
if (this.tableSelectData.length > 1) {
let flag = false
for (let i = 1; i < this.tableSelectData.length; i++) {
const pre = this.tableSelectData[i - 1]
const cur = this.tableSelectData[i]
flag = cur.type == pre.type
if (!flag) {
break;
}
}
if (!flag) {
return this.$u.toast('请选择状态相同的数据')
}
}
const params = {
toolMachinesRecordIdList: this.tableSelectData.map(v => v.toolMachinesRecordId),
type
}
const {code} = await this.$u.api.dModel.tmToolMachinesRecord(params)
if (code == 200) {
this.$emit('action')
}
},
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
}
}
</script>
<style scoped>
.dmodel-table {
height: 500rpx;
margin-top: 20rpx;
padding: 0 20rpx;
}
</style>
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
<view class="prod-body-left-task"> <view class="prod-body-left-task">
<zb-table :columns="tableColumn" :stripe="true" @rowClick="rowClick" <zb-table :columns="tableColumn" :stripe="true" @rowClick="rowClick"
@numclik = "numclik"
@toggleRowSelection="toggleRowSelection" @toggleAllSelection="toggleAllSelection" :border="true" @toggleRowSelection="toggleRowSelection" @toggleAllSelection="toggleAllSelection" :border="true"
:data="tableData"></zb-table> :data="tableData"></zb-table>
</view> </view>
...@@ -228,17 +229,8 @@ ...@@ -228,17 +229,8 @@
</u-col> </u-col>
</u-row> </u-row>
</u-form> </u-form>
<view> <dModelList :data="dModelData" @action="upDownGetList" />
扫描结果
<uni-card>
<view class="uni-card__content">
<view class="uni-card__content-title">刀模信息</view>
<view class="uni-card__content-extra">刀模编号:{{ knifeTempInfo.knifeTemplateCode }}</view>
<view class="uni-card__content-extra">刀模名称:{{ knifeTempInfo.knifeTemplateName }}</view>
<view class="uni-card__content-extra">刀模规格:{{ knifeTempInfo.knifeTemplateSpec }}</view>
</view>
</uni-card>
</view>
</u-modal> </u-modal>
...@@ -262,10 +254,10 @@ ...@@ -262,10 +254,10 @@
<script> <script>
import SearchInput from "@/components/ScanInput/index.vue"; import SearchInput from "@/components/ScanInput/index.vue";
import dModelList from './components/dModelList.vue'
export default { export default {
name: "ProdReport", name: "ProdReport",
components: {SearchInput}, components: {SearchInput, dModelList},
data() { data() {
return { return {
screenHeight: 768, screenHeight: 768,
...@@ -367,18 +359,40 @@ export default { ...@@ -367,18 +359,40 @@ export default {
type: 'selection', type: 'selection',
width: 35 width: 35
}, },
{
name: 'arrangeCode',
label: '编排单号',
width: 140,
func:"numclik"
},
{ {
name: 'startTime', name: 'startTime',
label: '计划开始时间', label: '计划开始时间',
width: 140, width: 140,
func:"numclik"
}, },
{
name: 'endTime',
label: '计划结束时间',
width: 140,
},
{
name: 'quantity',
label: '待加工数量',
width: 140,
},
{ {
name: 'status', name: 'status',
label: '订单状态', label: '状态',
filters: { filters: {
'START': '生产中', // 'START': '生产中',
'PAUSE': '暂停', // 'PAUSE': '暂停',
'NORMARL': '未开始' // 'NORMARL': '未开始'
'PREPARE': '未开工',
'BEGINNING': '已开工',
'PAUSE': '暂停',
'ERROR_STOP': '异常停工',
'FINISH': '完工'
}, },
width: 60, width: 60,
align: "center" align: "center"
...@@ -398,15 +412,15 @@ export default { ...@@ -398,15 +412,15 @@ export default {
label: '生产单号', label: '生产单号',
width: 120, width: 120,
}, },
{ // {
name: 'itemCode', // name: 'itemCode',
label: '物料编号', // label: '物料编号',
width: 110, // width: 110,
}, // },
{ // {
name: 'itemName', // name: 'itemName',
label: '物料名称' // label: '物料名称'
}, // },
{ {
name: 'processName', name: 'processName',
label: '工序', label: '工序',
...@@ -437,6 +451,7 @@ export default { ...@@ -437,6 +451,7 @@ export default {
align: "center" align: "center"
}, },
], ],
dModelData: [],
tableSelectData: [], tableSelectData: [],
feedbackForms: [], feedbackForms: [],
materialUsageRecordList: [], materialUsageRecordList: [],
...@@ -472,6 +487,9 @@ export default { ...@@ -472,6 +487,9 @@ export default {
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
methods: { methods: {
numclik(...arg){
console.log('99999999', arg)
},
changeWorkstation() { changeWorkstation() {
uni.$emit('changeWorkstation'); uni.$emit('changeWorkstation');
}, },
...@@ -516,20 +534,61 @@ export default { ...@@ -516,20 +534,61 @@ export default {
} }
}, },
async knifeTempShow() { async knifeTempShow() {
// this.knifeTempSearch.knifeTempCode = ''; if (this.tableSelectData.length > 1) {
// this.knifeTempSearch.locationCode = ''; return
console.log(this.tableSelectData, 'selectData'); }
return
const params = { const params = {
arrangeCode: '', arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: '' processId: this.tableSelectData[0].processId
} }
await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params) const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
// 如果有数据
if (records?.data && records.data.length) {
this.dModelData = records.data
this.knifeTempVisible = true
return
}
this.addDModelRecord(params)
this.knifeTempVisible = true
}, },
async upDownGetList() {
const params = {
arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: this.tableSelectData[0].processId
}
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data
},
// 新增刀模版上下机记录
async addDModelRecord(params) {
const {data} = await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params)
if (data?.length) {
const [selectData] = this.tableSelectData
const ps = {
toolMachinesCode: '',
arrangeCode: selectData.arrangeCode,
workunitId: selectData.workunitId,
processId: selectData.processId,
workorderId: selectData.workorderId,
toolRequestUseId: data[0].toolRequestUseId,
toolMachinesRecordList: data.map(v => {
return {
toolRequestUseItemId: v.toolRequestUseItemId,
type: 3,
upDate: '',
downDate: ''
}
})
}
// 新增
const data2 = await this.$u.api.dModel.tmToolMachines(ps)
if (data2.code == 200) {
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data || []
this.knifeTempVisible = true
}
}
},
rowClick(row, index) { rowClick(row, index) {
this.curTaskInfo = row; this.curTaskInfo = row;
......
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