Commit 0bf7a62a authored by 张海景's avatar 张海景

update:修改选择打印模板

parent 5cce97f6
...@@ -155,10 +155,10 @@ const install = (Vue, vm) => { ...@@ -155,10 +155,10 @@ const install = (Vue, vm) => {
config.adminPath + '/mobile/pro/taskissue/getReserveIssueList', config.adminPath + '/mobile/pro/taskissue/getReserveIssueList',
params params
), ),
//人员绑定打印机 //人员绑定打印机
getUserPrint:(params = {}) => getUserPrint: (params = {}) =>
vm.$u.get(config.adminPath + '/system/printerConfig/userList', params), vm.$u.get(config.adminPath + '/system/printerConfig/userList', params),
addUserPrint:(params = {}) => addUserPrint: (params = {}) =>
vm.$u.postJson(config.adminPath + '/system/print', params), vm.$u.postJson(config.adminPath + '/system/print', params),
//投料验证 //投料验证
...@@ -257,7 +257,10 @@ const install = (Vue, vm) => { ...@@ -257,7 +257,10 @@ const install = (Vue, vm) => {
vm.$u.get(config.adminPath + '/mes/pro/workorder/list', params), vm.$u.get(config.adminPath + '/mes/pro/workorder/list', params),
//查看生产工单 //查看生产工单
getWorkorderWithSizeAndDirective: (params = {}) => getWorkorderWithSizeAndDirective: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/pro/workorder/listWithSizeAndDirective', params), vm.$u.get(
config.adminPath + '/mes/pro/workorder/listWithSizeAndDirective',
params
),
logout: (params = {}) => logout: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/login/logout', params), vm.$u.get(config.adminPath + '/mobile/login/logout', params),
...@@ -282,7 +285,8 @@ const install = (Vue, vm) => { ...@@ -282,7 +285,8 @@ const install = (Vue, vm) => {
vm.$u.post('/account/getRegValidCode', params), vm.$u.post('/account/getRegValidCode', params),
saveRegByValidCode: (params = {}) => saveRegByValidCode: (params = {}) =>
vm.$u.post('/account/saveRegByValidCode', params), vm.$u.post('/account/saveRegByValidCode', params),
getPrintTemplateList: (params = {}) =>
vm.$u.get(config.adminPath + '/ureportM/list' , params),
// APP公共服务 // APP公共服务
upgradeCheck: () => upgradeCheck: () =>
vm.$u.post('/app/upgrade/check', { vm.$u.post('/app/upgrade/check', {
......
<template>
<view class="dmodel-table">
<zb-table ref="zbTable" rowKey="id"
:columns="tableColumn" :data="tableData" :stripe="true"
@toggleRowSelection="toggleRowSelection">
<template slot="slot" slot-scope="scope">
<dict-tag
:options="dict.type.sys_report_type"
:value="scope.row.reportType"
/>
</template>
</zb-table>
</view>
</template>
<script>
export default {
dicts: ["sys_report_type"],
props: {
data: {
type: Object,
default: () => {}
}
},
data() {
return {
tableData: [],
tableSelectData: [],
tableColumn: [{
type: 'radio',
width: 80
},
{
name: 'name',
label: '模版名称',
width: 160,
},
{
type: 'slot',
name: 'reportType',
label: '模版类型',
width: 200,
},
{
name: 'remark',
label: '备注',
width: 100,
}
],
}
},
// computed: {
// tableData() {
// return this.data || []
// }
// },
mounted() {
this.getList()
// this.data.workstationName
},
methods: {
async getList() {
let params = {
pageNum: 1,
pageSize: 10000,
reportType: 'package_label'
}
const res = await this.$u.api.getPrintTemplateList(params)
console.log(res, 'res')
if (res.code == 200) {
this.tableData=res.rows.map(item => {
return {
...item,
workstationName: this.data.workstationName
}
})
}
},
toggleRowSelection(checked, arr) {
console.log(arr, 'arrs')
this.tableSelectData = arr
},
}
}
</script>
<style scoped>
.dmodel-table {
height: 500rpx;
margin-top: 20rpx;
padding: 0 20rpx;
}
.search{
display: flex;
margin-bottom:20rpx;
align-items: center;
.u-search{
width: 400rpx !important;
margin-right:20rpx !important;
}
}
</style>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<!--查看图片查询的生产工单--> <!--查看图片查询的生产工单-->
<u-modal <u-modal
title="生产报工" title="生产报工"
@confirm="feedback()" @confirm="handleSubmitfeedback"
show-cancel-button show-cancel-button
: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="open" v-model="open"
...@@ -188,29 +188,49 @@ ...@@ -188,29 +188,49 @@
</u-col> </u-col>
</u-row> </u-row>
<view v-if="feedback.isLastProcess"> <view v-if="feedback.isLastProcess">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="工单指令" prop="workorderSoDirectiveId"> <u-form-item label="工单指令" prop="workorderSoDirectiveId">
<uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select> <uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="工单SIZE" prop="workorderSoSizeItemId"> <u-form-item label="工单SIZE" prop="workorderSoSizeItemId">
<uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select> <uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="净重(KG)" prop="netWeight"> <u-form-item label="净重(KG)" prop="netWeight">
<u-number-box :min="0" :positive-integer="false" :input-width="190" v-model="feedback.netWeight"></u-number-box> <u-number-box :min="0" :positive-integer="false" :input-width="190" v-model="feedback.netWeight"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> <u-col span="6">
<u-form-item label="打印模板" prop="printTemplate">
<u-input v-model="feedback.printTemplate" disabled placeholder="请选择打印模板"></u-input>
<u-button
@tap="getPrintTemplate(feedback)"
type="success"
size="mini"
>选择打印模板</u-button>
</u-form-item>
</u-col>
</u-row>
</view> </view>
</u-form> </u-form>
</view> </view>
</u-modal> </u-modal>
<u-modal
title="选择打印模板"
@confirm="handleSubmitPrintTemplate"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="printTemplateVisible"
width="1300rpx"
>
<print-template ref="printTemplateRef" :data="printTemplateData" />
</u-modal>
<u-modal <u-modal
title="刀模版上下机" title="刀模版上下机"
...@@ -236,17 +256,17 @@ ...@@ -236,17 +256,17 @@
</u-form> --> </u-form> -->
<dModelList :data="dModelData" @action="upDownGetList"/> <dModelList :data="dModelData" @action="upDownGetList"/>
</u-modal> </u-modal>
<!-- //生产报工报工人员 --> <!-- //生产报工报工人员 -->
<u-modal <u-modal
title="报工人员" title="报工人员"
@confirm="userDetermine()" @confirm="userDetermine()"
show-cancel-button show-cancel-button
: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" /> <userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" />
</u-modal> </u-modal>
<u-modal <u-modal
title="暂停原因" title="暂停原因"
@confirm="stopReasonSubmit()" @confirm="stopReasonSubmit()"
...@@ -630,6 +650,7 @@ ...@@ -630,6 +650,7 @@
import SearchInput from '@/components/ScanInput/index.vue'; 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 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 {
...@@ -637,7 +658,8 @@ export default { ...@@ -637,7 +658,8 @@ export default {
components: { components: {
SearchInput, SearchInput,
dModelList, dModelList,
userPersonnel, userPersonnel,
printTemplate,
UButton UButton
}, },
data() { data() {
...@@ -942,15 +964,15 @@ export default { ...@@ -942,15 +964,15 @@ export default {
applyNum: null, applyNum: null,
workorderCode: null workorderCode: null
}, },
materialReturnProcessItemData: { materialReturnProcessItemData: {
itemName: null, itemName: null,
itemCode: null, itemCode: null,
applyNum: null, applyNum: null,
workorderCode: null workorderCode: null
}, },
printTemplateData: null,
printTemplateVisible: false,
userTempVisible: false, userTempVisible: false,
materialReturnFormVisible: false, materialReturnFormVisible: false,
materialReturnSelected: {}, materialReturnSelected: {},
tableDetailColumn: [ tableDetailColumn: [
...@@ -1270,7 +1292,7 @@ userTempVisible: false, ...@@ -1270,7 +1292,7 @@ userTempVisible: false,
const items = row.workorderList.find((item) => item.workorderId === id); const items = row.workorderList.find((item) => item.workorderId === id);
row.workorderCode = items.workorderCode; row.workorderCode = items.workorderCode;
row.printName = items.workorderCode; row.printName = items.workorderCode;
row.printContents =row.arrangeCode+row.workorderCode row.printContents =row.arrangeCode+row.workorderCode
row.sizeList = row.sizeData[id]; row.sizeList = row.sizeData[id];
row.directiveList = row.directiveData[id]; row.directiveList = row.directiveData[id];
row.packByDirective = items.packByDirective; row.packByDirective = items.packByDirective;
...@@ -1504,6 +1526,14 @@ userTempVisible: false, ...@@ -1504,6 +1526,14 @@ userTempVisible: false,
quantityChanged() { quantityChanged() {
this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify; this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify;
}, },
getPrintTemplate(row) {
this.printTemplateData = row
this.printTemplateVisible = true
},
handleSubmitPrintTemplate() {
this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name
this.printTemplateVisible = false
},
doFeedback() { doFeedback() {
// this.reset(); // this.reset();
this.feedbackForms = []; this.feedbackForms = [];
...@@ -1519,7 +1549,7 @@ userTempVisible: false, ...@@ -1519,7 +1549,7 @@ userTempVisible: false,
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
feedbackChannel: 'PAD', feedbackChannel: 'PAD',
quantity: item.quantity, quantity: item.quantity,
quantityQualify: defQualify,//默认为排产数量-合格数-不合格数 quantityQualify: Number(defQualify),//默认为排产数量-合格数-不合格数
quantityUnqualify: 0, quantityUnqualify: 0,
printName: '', printName: '',
lastProcess: item.isLastProcess==1,//未工序 lastProcess: item.isLastProcess==1,//未工序
...@@ -1528,15 +1558,16 @@ userTempVisible: false, ...@@ -1528,15 +1558,16 @@ userTempVisible: false,
workorderCode: null, workorderCode: null,
workorderSoDirectiveId: '', workorderSoDirectiveId: '',
workorderSoSizeItemId: '', workorderSoSizeItemId: '',
netWeight: '', netWeight: 0,
workorderList: [], workorderList: [],
workorderOption: [], workorderOption: [],
directiveList:[], directiveList:[],
sizeList:[], sizeList:[],
directiveData: {}, directiveData: {},
sizeData: {}, sizeData: {},
printContents: item.arrangeCode, printContents: item.arrangeCode,
whether: '', whether: '',
printTemplate: ''
}; };
this.getWorkorderWithSizeAndDirective(feedback); this.getWorkorderWithSizeAndDirective(feedback);
this.feedbackForms.push(feedback); this.feedbackForms.push(feedback);
...@@ -1575,7 +1606,7 @@ userTempVisible: false, ...@@ -1575,7 +1606,7 @@ userTempVisible: false,
cancel() { cancel() {
this.open = false; this.open = false;
}, },
feedback() { handleSubmitfeedback() {
this.open = true; this.open = true;
this.feedbackForms.forEach((item) => { this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) { if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
......
...@@ -79,85 +79,92 @@ ...@@ -79,85 +79,92 @@
:style=" `height: calc(100% - ${showSummary?80:40}px)`"> :style=" `height: calc(100% - ${showSummary?80:40}px)`">
<view class="zb-table-fixed"> <view class="zb-table-fixed">
<view class="zb-table-tbody"> <view class="zb-table-tbody">
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'', isTrClassStyle&&isTrClassStyle(item,index)? 'trbg': '']" <radio-group @change="handleRadio">
@click.stop="rowClick(item,index)" <view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'', isTrClassStyle&&isTrClassStyle(item,index)? 'trbg': '']"
v-for="(item,index) in transData" :key="item.key"> @click.stop="rowClick(item,index)"
<view v-for="(item,index) in transData" :key="item.key">
:style="[{ <view
width:`${ite.width?ite.width:'100'}px`, :style="[{
flex:i===transColumns.length-1?1:'none', width:`${ite.width?ite.width:'100'}px`,
minWidth:`${ite.width?ite.width:'100'}px`, flex:i===transColumns.length-1?1:'none',
borderRight:`${border?'1px solid #e8e8e8':''}`, minWidth:`${ite.width?ite.width:'100'}px`,
textAlign:ite.align||'left', borderRight:`${border?'1px solid #e8e8e8':''}`,
},cellStyle&&getCellStyle(item,ite,index,i)]" textAlign:ite.align||'left',
@click="cellClick(item,index,ite)" },cellStyle&&getCellStyle(item,ite,index,i)]"
:class="['item-td',stripe?(index % 2) != 0?'odd':'even':'']" @click="cellClick(item,index,ite)"
v-for="(ite,i) in transColumns" :key="i"> :class="['item-td',stripe?(index % 2) != 0?'odd':'even':'']"
<template v-if="ite.type==='operation'"> v-for="(ite,i) in transColumns" :key="i">
<view style="display: flex;align-items: center;height: 100%"> <template v-if="ite.type==='operation'">
<view <view style="display: flex;align-items: center;height: 100%">
v-for="ren,ind in permission(item,ite.renders,index)" <view
:key="ind" v-for="ren,ind in permission(item,ite.renders,index)"
@click.stop="$emit(ren.func,item,index)" :key="ind"
:style="{ @click.stop="$emit(ren.func,item,index)"
display:'flex', :style="{
alignItems: 'center', display:'flex',
marginRight:ite.renders.length>1?'8px':'0' alignItems: 'center',
}"> marginRight:ite.renders.length>1?'8px':'0'
<template v-if="ren.type==='custom'"> }">
<view :class="ren.class||''" style="cursor: pointer"> <template v-if="ren.type==='custom'">
{{ ren.name }} <view :class="ren.class||''" style="cursor: pointer">
</view> {{ ren.name }}
</template> </view>
<template v-else> </template>
<button <template v-else>
:class="ren.class||''" <button
:type="ren.type||'primary'" :size="ren.size||'mini'">{{ ren.name }} :class="ren.class||''"
</button> :type="ren.type||'primary'" :size="ren.size||'mini'">{{ ren.name }}
</button>
</template>
</view>
</view>
</template>
<template v-else-if="ite.type==='selection'">
<view class="checkbox-item">
<tableCheckbox @checkboxSelected="(e)=>checkboxSelected(e,item)" :cellData="item"
:checked="item.checked"/>
</view>
</template>
<template v-else-if="ite.type==='radio'">
<view class="checkbox-item">
<radio :value="item[rowKey]+ ''"/>
</view>
</template>
<template v-else-if="ite.type==='index'">
{{ index + 1 }}
</template>
<template v-else-if="ite.type==='img'">
<view class="checkbox-item">
<template v-if="item[ite.name]">
<image
@click.stop="previewImage(item,item[ite.name],iImage)"
v-for="iImageTem,iImage in imgs(item[ite.name])"
:show-menu-by-longpress="false"
:key="iImage"
:src="iImageTem" style="width: 40px;height:30px; " mode="aspectFit"></image>
</template> </template>
<text v-else>{{ ite.emptyString }}</text>
</view> </view>
</view> </template>
</template> <template v-else-if="ite.cellFun">
<template v-else-if="ite.type==='selection'"> <view @click.stop="ite.cellFun(item,index)" class="cellfunction">
<view class="checkbox-item"> <text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text>
<tableCheckbox @checkboxSelected="(e)=>checkboxSelected(e,item)" :cellData="item" </view>
:checked="item.checked"/> </template>
</view> <template v-else-if="ite.type === 'slot'">
</template> <!-- 插槽的使用示例
<template v-else-if="ite.type==='index'"> <template slot="slot" slot-scope="scope">
{{ index + 1 }} {{ scope.row }}
</template> </template> -->
<template v-else-if="ite.type==='img'"> <slot name="slot" :row="item" :index="index"></slot>
<view class="checkbox-item"> </template>
<template v-if="item[ite.name]"> <template v-else>
<image <!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
@click.stop="previewImage(item,item[ite.name],iImage)" {{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}
v-for="iImageTem,iImage in imgs(item[ite.name])" </template>
:show-menu-by-longpress="false" </view>
:key="iImage"
:src="iImageTem" style="width: 40px;height:30px; " mode="aspectFit"></image>
</template>
<text v-else>{{ ite.emptyString }}</text>
</view>
</template>
<template v-else-if="ite.cellFun">
<view @click.stop="ite.cellFun(item,index)" class="cellfunction">
<text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text>
</view>
</template>
<template v-else-if="ite.type === 'slot'">
<!-- 插槽的使用示例
<template slot="slot" slot-scope="scope">
{{ scope.row }}
</template> -->
<slot name="slot" :row="item" :index="index"></slot>
</template>
<template v-else>
<!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}
</template>
</view> </view>
</view> </radio-group>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -843,6 +850,12 @@ export default { ...@@ -843,6 +850,12 @@ export default {
this.$emit('toggleRowSelection', true, this.selectArr) this.$emit('toggleRowSelection', true, this.selectArr)
} }
}, },
handleRadio(event) {
const items = this.data.find(v => v[this.rowKey] == event.target.value)
this.selectArr = []
this.selectArr[0] = items
this.$emit('toggleRowSelection', true, this.selectArr)
},
rowClick(row, index) { rowClick(row, index) {
this.isDisable = true this.isDisable = true
setTimeout(() => { setTimeout(() => {
......
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