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

update:修改选择打印模板

parent 5cce97f6
......@@ -155,10 +155,10 @@ const install = (Vue, vm) => {
config.adminPath + '/mobile/pro/taskissue/getReserveIssueList',
params
),
//人员绑定打印机
getUserPrint:(params = {}) =>
//人员绑定打印机
getUserPrint: (params = {}) =>
vm.$u.get(config.adminPath + '/system/printerConfig/userList', params),
addUserPrint:(params = {}) =>
addUserPrint: (params = {}) =>
vm.$u.postJson(config.adminPath + '/system/print', params),
//投料验证
......@@ -257,7 +257,10 @@ const install = (Vue, vm) => {
vm.$u.get(config.adminPath + '/mes/pro/workorder/list', 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 = {}) =>
vm.$u.get(config.adminPath + '/mobile/login/logout', params),
......@@ -282,7 +285,8 @@ const install = (Vue, vm) => {
vm.$u.post('/account/getRegValidCode', params),
saveRegByValidCode: (params = {}) =>
vm.$u.post('/account/saveRegByValidCode', params),
getPrintTemplateList: (params = {}) =>
vm.$u.get(config.adminPath + '/ureportM/list' , params),
// APP公共服务
upgradeCheck: () =>
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 @@
<!--查看图片查询的生产工单-->
<u-modal
title="生产报工"
@confirm="feedback()"
@confirm="handleSubmitfeedback"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="open"
......@@ -188,29 +188,49 @@
</u-col>
</u-row>
<view v-if="feedback.isLastProcess">
<u-row>
<u-col span="6">
<u-form-item label="工单指令" prop="workorderSoDirectiveId">
<uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="工单SIZE" prop="workorderSoSizeItemId">
<uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select>
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<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-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="工单指令" prop="workorderSoDirectiveId">
<uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="工单SIZE" prop="workorderSoSizeItemId">
<uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select>
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<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-form-item>
</u-col>
<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>
</u-form>
</view>
</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
title="刀模版上下机"
......@@ -236,17 +256,17 @@
</u-form> -->
<dModelList :data="dModelData" @action="upDownGetList"/>
</u-modal>
<!-- //生产报工报工人员 -->
<u-modal
title="报工人员"
@confirm="userDetermine()"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="userTempVisible"
width="1300rpx"
>
<userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" />
</u-modal>
<!-- //生产报工报工人员 -->
<u-modal
title="报工人员"
@confirm="userDetermine()"
show-cancel-button
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="userTempVisible"
width="1300rpx"
>
<userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" />
</u-modal>
<u-modal
title="暂停原因"
@confirm="stopReasonSubmit()"
......@@ -630,6 +650,7 @@
import SearchInput from '@/components/ScanInput/index.vue';
import dModelList from './components/dModelList.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 { handleError } from "vue";
export default {
......@@ -637,7 +658,8 @@ export default {
components: {
SearchInput,
dModelList,
userPersonnel,
userPersonnel,
printTemplate,
UButton
},
data() {
......@@ -942,15 +964,15 @@ export default {
applyNum: null,
workorderCode: null
},
materialReturnProcessItemData: {
itemName: null,
itemCode: null,
applyNum: null,
workorderCode: null
},
userTempVisible: false,
materialReturnProcessItemData: {
itemName: null,
itemCode: null,
applyNum: null,
workorderCode: null
},
printTemplateData: null,
printTemplateVisible: false,
userTempVisible: false,
materialReturnFormVisible: false,
materialReturnSelected: {},
tableDetailColumn: [
......@@ -1270,7 +1292,7 @@ userTempVisible: false,
const items = row.workorderList.find((item) => item.workorderId === id);
row.workorderCode = items.workorderCode;
row.printName = items.workorderCode;
row.printContents =row.arrangeCode+row.workorderCode
row.printContents =row.arrangeCode+row.workorderCode
row.sizeList = row.sizeData[id];
row.directiveList = row.directiveData[id];
row.packByDirective = items.packByDirective;
......@@ -1504,6 +1526,14 @@ userTempVisible: false,
quantityChanged() {
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() {
// this.reset();
this.feedbackForms = [];
......@@ -1519,7 +1549,7 @@ userTempVisible: false,
taskWorkunitId: item.taskWorkunitId,
feedbackChannel: 'PAD',
quantity: item.quantity,
quantityQualify: defQualify,//默认为排产数量-合格数-不合格数
quantityQualify: Number(defQualify),//默认为排产数量-合格数-不合格数
quantityUnqualify: 0,
printName: '',
lastProcess: item.isLastProcess==1,//未工序
......@@ -1528,15 +1558,16 @@ userTempVisible: false,
workorderCode: null,
workorderSoDirectiveId: '',
workorderSoSizeItemId: '',
netWeight: '',
netWeight: 0,
workorderList: [],
workorderOption: [],
directiveList:[],
sizeList:[],
directiveData: {},
sizeData: {},
printContents: item.arrangeCode,
whether: '',
printContents: item.arrangeCode,
whether: '',
printTemplate: ''
};
this.getWorkorderWithSizeAndDirective(feedback);
this.feedbackForms.push(feedback);
......@@ -1575,7 +1606,7 @@ userTempVisible: false,
cancel() {
this.open = false;
},
feedback() {
handleSubmitfeedback() {
this.open = true;
this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
......
......@@ -79,85 +79,92 @@
:style=" `height: calc(100% - ${showSummary?80:40}px)`">
<view class="zb-table-fixed">
<view class="zb-table-tbody">
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'', isTrClassStyle&&isTrClassStyle(item,index)? 'trbg': '']"
@click.stop="rowClick(item,index)"
v-for="(item,index) in transData" :key="item.key">
<view
:style="[{
width:`${ite.width?ite.width:'100'}px`,
flex:i===transColumns.length-1?1:'none',
minWidth:`${ite.width?ite.width:'100'}px`,
borderRight:`${border?'1px solid #e8e8e8':''}`,
textAlign:ite.align||'left',
},cellStyle&&getCellStyle(item,ite,index,i)]"
@click="cellClick(item,index,ite)"
:class="['item-td',stripe?(index % 2) != 0?'odd':'even':'']"
v-for="(ite,i) in transColumns" :key="i">
<template v-if="ite.type==='operation'">
<view style="display: flex;align-items: center;height: 100%">
<view
v-for="ren,ind in permission(item,ite.renders,index)"
:key="ind"
@click.stop="$emit(ren.func,item,index)"
:style="{
display:'flex',
alignItems: 'center',
marginRight:ite.renders.length>1?'8px':'0'
}">
<template v-if="ren.type==='custom'">
<view :class="ren.class||''" style="cursor: pointer">
{{ ren.name }}
</view>
</template>
<template v-else>
<button
:class="ren.class||''"
:type="ren.type||'primary'" :size="ren.size||'mini'">{{ ren.name }}
</button>
<radio-group @change="handleRadio">
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'', isTrClassStyle&&isTrClassStyle(item,index)? 'trbg': '']"
@click.stop="rowClick(item,index)"
v-for="(item,index) in transData" :key="item.key">
<view
:style="[{
width:`${ite.width?ite.width:'100'}px`,
flex:i===transColumns.length-1?1:'none',
minWidth:`${ite.width?ite.width:'100'}px`,
borderRight:`${border?'1px solid #e8e8e8':''}`,
textAlign:ite.align||'left',
},cellStyle&&getCellStyle(item,ite,index,i)]"
@click="cellClick(item,index,ite)"
:class="['item-td',stripe?(index % 2) != 0?'odd':'even':'']"
v-for="(ite,i) in transColumns" :key="i">
<template v-if="ite.type==='operation'">
<view style="display: flex;align-items: center;height: 100%">
<view
v-for="ren,ind in permission(item,ite.renders,index)"
:key="ind"
@click.stop="$emit(ren.func,item,index)"
:style="{
display:'flex',
alignItems: 'center',
marginRight:ite.renders.length>1?'8px':'0'
}">
<template v-if="ren.type==='custom'">
<view :class="ren.class||''" style="cursor: pointer">
{{ ren.name }}
</view>
</template>
<template v-else>
<button
:class="ren.class||''"
: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>
<text v-else>{{ ite.emptyString }}</text>
</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==='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>
<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>
</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>
</scroll-view>
......@@ -843,6 +850,12 @@ export default {
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) {
this.isDisable = true
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