4 changed files with 1040 additions and 2 deletions
-
2src/views/modules/common/column.vue
-
616src/views/modules/common/com-roll-label.vue
-
405src/views/modules/yieldReport/otherReport/fqc_merge_roll.vue
-
19src/views/modules/yieldReport/otherReport/fqc_produce_report_normal.vue
@ -0,0 +1,616 @@ |
|||||
|
<template> |
||||
|
<div class="sl-el"> |
||||
|
<el-dialog ref="printLoading" :close-on-click-modal="false" :show-close="false" :close-on-press-escape="false" |
||||
|
title="标签打印" |
||||
|
:visible.sync="visible" |
||||
|
width="800px" v-drag> |
||||
|
<el-container> |
||||
|
<el-main style="width: 75%;margin-top: -20px"> |
||||
|
<el-row> |
||||
|
<el-col :span="18"> |
||||
|
<el-form @submit.native.prevent label-position="top"> |
||||
|
<el-form-item style="width: 60%" :label="'请输入卷号:'"> |
||||
|
<el-input readonly v-model="rollNos" class="input-with-select" |
||||
|
@keyup.enter.native="getBoxSoAndReportFile()"> |
||||
|
<el-button @click="getBoxSoAndReportFile()" slot="append" icon="el-icon-search"></el-button> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-col> |
||||
|
<el-col :span="6"></el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<span>请选择标签:</span> |
||||
|
<el-table |
||||
|
:data="reportFileList" |
||||
|
border |
||||
|
ref="reportFileTable" |
||||
|
highlight-current-row |
||||
|
@current-change="handleCurrentChange" |
||||
|
height="150px"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in reportColumnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<span>打印格式名称:</span> |
||||
|
<el-input type="textarea" v-model="selectReportString" readonly :rows="3"></el-input> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-tabs style="font-size: 14px" v-model="activeName" type="border-card" @tab-click="handleClick" |
||||
|
class="customer-tab"> |
||||
|
<el-tab-pane label="打印参数" name="first"> |
||||
|
<el-table |
||||
|
:data="reportParamList" |
||||
|
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName" |
||||
|
border |
||||
|
:height="height" |
||||
|
> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in printParamColumnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="item.columnHidden"> |
||||
|
<span v-if="scope.row.valuetypeDb === 'T'"> |
||||
|
<el-input v-model='scope.row[item.columnProp]'> </el-input> |
||||
|
</span> |
||||
|
<span v-if="scope.row.valuetypeDb === 'D'"> |
||||
|
<el-date-picker style="width: 100%;" |
||||
|
v-model='scope.row[item.columnProp]'> </el-date-picker> |
||||
|
</span> |
||||
|
<span v-if="scope.row.valuetypeDb === 'I'"> |
||||
|
<el-input type="number" v-model='scope.row[item.columnProp]' min="1"> </el-input> |
||||
|
</span> |
||||
|
|
||||
|
</span> |
||||
|
<span v-else>{{ scope.row[item.columnProp] }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-tab-pane> |
||||
|
|
||||
|
</el-tabs> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-main> |
||||
|
</el-container> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="bartenderPrint()">打印</el-button> |
||||
|
<el-button type="primary" @click="closeDialog()">取消</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import { |
||||
|
checkRollCustomer, |
||||
|
getRollCustomer, |
||||
|
getReportFileByCustomer, |
||||
|
getReportSubFileList, |
||||
|
getReportParameters, |
||||
|
printLabel |
||||
|
} from '@/api/print/rollPrint.js'; |
||||
|
|
||||
|
export default { |
||||
|
components: {}, |
||||
|
data() { |
||||
|
return { |
||||
|
visible: false, |
||||
|
rollNos: '', |
||||
|
activeName: 'first', |
||||
|
height: 200, |
||||
|
// 模板 |
||||
|
reportColumnList: [ |
||||
|
{ |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "reportid", |
||||
|
columnLabel: "报告编号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "Reportfile", |
||||
|
columnLabel: "报告文件名", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "Remark", |
||||
|
columnLabel: "备注", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "DefaultFlag", |
||||
|
columnLabel: "默认格式", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, |
||||
|
|
||||
|
], |
||||
|
// 打印参数 |
||||
|
printParamColumnList: [ |
||||
|
{ |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "parametername", |
||||
|
columnLabel: "参数名", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "parameterdesc", |
||||
|
columnLabel: "参数标题", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "optionvalue", |
||||
|
columnLabel: "参数值", |
||||
|
columnHidden: true, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, { |
||||
|
tableId: "common1001", |
||||
|
tableName: "common", |
||||
|
columnProp: "valuetype", |
||||
|
columnLabel: "参数类型", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
columnWidth: null, |
||||
|
format: null, |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: null, |
||||
|
columnType: null, |
||||
|
align: null |
||||
|
}, |
||||
|
|
||||
|
], |
||||
|
// 数据 |
||||
|
// 可用模板列表 |
||||
|
reportFileList: [], |
||||
|
// 选中模板列表 |
||||
|
selectReportFileList: [], |
||||
|
selectReportString: '', |
||||
|
// 数量 |
||||
|
orderInfo: { |
||||
|
userName: this.$store.state.user.name, |
||||
|
rollNo: '', |
||||
|
customerId: '', |
||||
|
totalQty: 0, |
||||
|
perBoxQty: 0, |
||||
|
boxQty: 0, |
||||
|
lastBoxQty: 0, |
||||
|
rollNos: [], |
||||
|
// 选中模板列表 |
||||
|
reportFileList: [], |
||||
|
// 手工参数 |
||||
|
param: [] |
||||
|
}, |
||||
|
// 记录打印参数 |
||||
|
printParamList: [], |
||||
|
// 模板参数列表 |
||||
|
reportParamList: [], |
||||
|
buttons: { |
||||
|
settingLanguageList: '按语言设置', |
||||
|
edit: '编辑', |
||||
|
delete: '删除', |
||||
|
deleteList: '批量删除', |
||||
|
cz: '操作', |
||||
|
search: '查询', |
||||
|
download: '导出', |
||||
|
settingTable: '设置列表', |
||||
|
defaultTable: '设置默认配置', |
||||
|
list: "列表", |
||||
|
addList: '批量添加', |
||||
|
settingLanguage: "按控件设置" |
||||
|
}, |
||||
|
// 导出 end |
||||
|
buttonList: [ |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '按语言设置', |
||||
|
objectId: 'settingLanguageList', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '编辑', |
||||
|
objectId: 'edit', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '删除', |
||||
|
objectId: 'delete', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '批量删除', |
||||
|
objectId: 'deleteList', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '操作', |
||||
|
objectId: 'cz', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '查询', |
||||
|
objectId: 'search', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '导出', |
||||
|
objectId: 'download', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '设置列表', |
||||
|
objectId: 'settingTable', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '设置默认配置', |
||||
|
objectId: 'defaultTable', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '列表', |
||||
|
objectId: 'list', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
}, |
||||
|
{ |
||||
|
functionId: "this.$route.meta.menuId", |
||||
|
languageValue: '按控件设置', |
||||
|
objectId: 'settingLanguage', |
||||
|
objectType: "button", |
||||
|
tableId: "common1001" |
||||
|
} |
||||
|
], |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
orderInfo: { |
||||
|
handler: function (val, oldVal) { |
||||
|
if (this.orderInfo.totalQty > 0 && this.orderInfo.perBoxQty > 0) { |
||||
|
this.orderInfo.lastBoxQty = this.decimalUtil.mod(this.orderInfo.totalQty, this.orderInfo.perBoxQty) |
||||
|
if (this.decimalUtil.div(this.orderInfo.totalQty, this.orderInfo.perBoxQty) < 1) { |
||||
|
this.orderInfo.boxQty = 1 |
||||
|
} else { |
||||
|
this.orderInfo.boxQty = this.decimalUtil.formatDown(this.decimalUtil.div(this.orderInfo.totalQty, this.orderInfo.perBoxQty), 0) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
// 深度观察监听 |
||||
|
deep: true |
||||
|
}, |
||||
|
updateData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.updateData.projectID = this.updateData.projectID.toUpperCase(); |
||||
|
this.updateData.oriSOOrderNo = this.updateData.oriSOOrderNo.toUpperCase(); |
||||
|
this.updateData.orderType = this.updateData.orderType.toUpperCase(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 800; |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
closeDialog() { |
||||
|
this.visible = false |
||||
|
this.selectReportString = '' |
||||
|
this.reportParamList = [] |
||||
|
}, |
||||
|
init(val) { |
||||
|
this.visible = true |
||||
|
this.rollNos = val |
||||
|
this.searchBoxLabelSO() |
||||
|
}, |
||||
|
// 调用bartender打印 |
||||
|
bartenderPrint() { |
||||
|
|
||||
|
if (!this.rollNos) { |
||||
|
this.$message.warning('请输入卷号') |
||||
|
return |
||||
|
} |
||||
|
if (this.selectReportFileList.length === 0) { |
||||
|
this.$message.warning('选择模板进行打印') |
||||
|
return |
||||
|
} |
||||
|
const loading = this.$loading({ |
||||
|
lock: true, |
||||
|
text: '正在打印', |
||||
|
spinner: 'el-icon-loading', |
||||
|
background: 'rgba(0, 0, 0, 0.7)' |
||||
|
}); |
||||
|
let rollNoList = this.rollNos.split(";") |
||||
|
this.orderInfo.reportFileList = this.selectReportFileList |
||||
|
this.orderInfo.param = this.reportParamList |
||||
|
this.orderInfo.rollNos = rollNoList |
||||
|
this.printParamList = JSON.parse(JSON.stringify(this.reportParamList)) |
||||
|
printLabel(this.orderInfo).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.visible = false |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
loading.close(); |
||||
|
}) |
||||
|
}, |
||||
|
// 获取订单信息 |
||||
|
searchBoxLabelSO() { |
||||
|
|
||||
|
if (!this.rollNos) { |
||||
|
this.$message.warning('请输入卷号') |
||||
|
return |
||||
|
} |
||||
|
let rollNoList = this.rollNos.split(";") |
||||
|
this.reportFileList = [] |
||||
|
checkRollCustomer(rollNoList).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
getRollCustomer(rollNoList[0]).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
let query = { |
||||
|
customerId: data.data.customerId ? data.data.customerId : '*', |
||||
|
reportFamily: '卷标签' |
||||
|
} |
||||
|
getReportFileByCustomer(query).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.reportFileList = data.dataList |
||||
|
this.$refs.reportFileTable.setCurrentRow(this.reportFileList[0]); |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
Object.assign(this.$data, this.$options.data.call(this.orderInfo)); |
||||
|
Object.assign(this.$data, this.$options.data.call(this.selectReportString)); |
||||
|
Object.assign(this.$data, this.$options.data.call(this.reportParamList)); |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取订单数数据 和 打印 模板数据 |
||||
|
getBoxSoAndReportFile() { |
||||
|
this.searchBoxLabelSO() |
||||
|
}, |
||||
|
handleClick() { |
||||
|
|
||||
|
}, |
||||
|
// 选择模板 |
||||
|
handleCurrentChange(val) { |
||||
|
if (!val) return |
||||
|
this.selectReportFileList = [] |
||||
|
let query = { |
||||
|
reportId: val.reportid, |
||||
|
defaultFlag: val.DefaultFlag, |
||||
|
reportFile: val.Reportfile, |
||||
|
reportFamily: '外箱标签', |
||||
|
customerId: this.orderInfo.customerId, |
||||
|
} |
||||
|
this.selectReportFileList.push(query) |
||||
|
this.searchReportSubFileList(query) |
||||
|
this.searchReportParameters(query) |
||||
|
|
||||
|
}, |
||||
|
// 获取子模版 |
||||
|
searchReportSubFileList(val) { |
||||
|
let str = '' |
||||
|
str += val.reportId + ' | ' + val.reportFile + '\n' |
||||
|
this.selectReportString = str |
||||
|
getReportSubFileList(val).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
for (let item of data.data) { |
||||
|
str += item.reportid + ' | ' + item.Reportfile + '\n' |
||||
|
let reportFile = { |
||||
|
reportId: item.reportid, |
||||
|
defaultFlag: 'Y', |
||||
|
reportFile: item.Reportfile, |
||||
|
reportFamily: '外箱标签', |
||||
|
customerId: this.orderInfo.customerId, |
||||
|
} |
||||
|
this.selectReportFileList.push(reportFile) |
||||
|
} |
||||
|
this.selectReportString = str |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
// 获取柱模版打印参数 |
||||
|
searchReportParameters(val) { |
||||
|
let printParamList = JSON.parse(JSON.stringify(this.printParamList)) |
||||
|
getReportParameters(val.reportId).then(({data}) => { |
||||
|
if (data.code === 0) { |
||||
|
this.reportParamList = data.data |
||||
|
if (printParamList) { |
||||
|
for (let item1 of printParamList) { |
||||
|
for (let item2 of this.reportParamList) { |
||||
|
if (item1.parametername === item2.parametername) { |
||||
|
item2.optionvalue = item1.optionvalue |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
/*添加定制的css类*/ |
||||
|
customerCellClassName({row, column, rowIndex, columnIndex}) { |
||||
|
if (columnIndex === 2) { |
||||
|
return 'customer-text-cell'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/*添加定制的cess样式*/ |
||||
|
customerCellStyle({row, column, rowIndex, columnIndex}) { |
||||
|
if (columnIndex === 2) { |
||||
|
return 'padding: 0px 0px;'; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
/deep/ .sl-el .el-tabs__item { |
||||
|
padding: 0 13px; |
||||
|
height: 26px; |
||||
|
line-height: 26px; |
||||
|
font-size: 12px; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
/deep/ div.table-input { |
||||
|
padding: 0px 0px; |
||||
|
height: 25px !important; |
||||
|
} |
||||
|
|
||||
|
/*table中input*/ |
||||
|
div.table-input /deep/ input.el-input__inner { |
||||
|
padding: 0px 0px; |
||||
|
height: 23px !important; |
||||
|
text-align: right; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,405 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" |
||||
|
width="300px" style="height: 680px;" class="customer-dialog"> |
||||
|
<el-form :inline="true" label-position="top" style="height: 100px;" |
||||
|
label-width="80px"> |
||||
|
<!-- 当前卷 --> |
||||
|
<el-row> |
||||
|
<el-col :span="10"> |
||||
|
<el-form-item class="customer-item" label="当前卷号:"> |
||||
|
<el-input v-model="pageData.rollNo" readonly style="width: 100px;"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item class="customer-item" label="当前卷数量:"> |
||||
|
<el-input v-model="pageData.rollQty" @blur="checkValidQty" style="width: 80px;"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item class="customer-item" label=""> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<!-- 新卷 --> |
||||
|
<el-row> |
||||
|
<el-col :span="10"> |
||||
|
<el-form-item class="customer-item" label="新卷卷号:"> |
||||
|
<el-input ref="newRollNo" v-model="pageData.newRollNo" style="width: 100px;"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item class="customer-item" label="新卷数量:"> |
||||
|
<el-input v-model="pageData.newRollQty" @blur="checkValidQty" style="width: 80px;"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item class="customer-item" label="总数量:"> |
||||
|
<el-input v-model="pageData.totalQty" readonly style="width: 60px;"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-top: -20px;"> |
||||
|
<el-button type="primary" @click="warnMergeSfdcRollsConfirm">确 定</el-button> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
<com-roll-label ref="comRollLabel" ></com-roll-label> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import comRollLabel from "../../common/com-roll-label";/*切换操作员*/ |
||||
|
import { |
||||
|
getMergeRollPageData, |
||||
|
checkMergeSfdcRoll,/*校验是否合并卷*/ |
||||
|
processMergeSfdcRoll,/*执行合并卷的操作*/ |
||||
|
getSfdcFlowLabelData,/*执行打印的请求*/ |
||||
|
} from "@/api/yieldReport/com_merge_roll.js"; |
||||
|
|
||||
|
/*打印标签专用的js*/ |
||||
|
import { |
||||
|
printSfdcLabel, |
||||
|
} from "@/views/modules/yieldReport/print_roll_label.js"; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
titleCon: '合并卷', |
||||
|
rollType: '', |
||||
|
scheduleData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
seqNo: '', |
||||
|
orderNo: '', |
||||
|
itemNo: 0, |
||||
|
resourceId: '', |
||||
|
scheduledDate: '', |
||||
|
shiftNo: '', |
||||
|
partNo: '', |
||||
|
workCenterNo: '', |
||||
|
workCenterDesc: '', |
||||
|
resourceDesc: '', |
||||
|
rollNo: '', |
||||
|
partDesc: '', |
||||
|
planStartTime: '', |
||||
|
planFinishTime: '', |
||||
|
qtyRequiredOriginal: 0, |
||||
|
preItemDesc: '', |
||||
|
nextItemDesc: '', |
||||
|
nextItemNo: 0, |
||||
|
operatorId: '', |
||||
|
functionName: '', |
||||
|
currentRollFlag: false |
||||
|
}, |
||||
|
pageData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
orderNo: '', |
||||
|
itemNo: '', |
||||
|
seqNo: '', |
||||
|
rollNo: '', |
||||
|
rollQty: 0, |
||||
|
newRollNo: '',/*参与合并的新卷号*/ |
||||
|
newRollQty: 0,/*参与合并的新卷号*/ |
||||
|
reportTime: '', |
||||
|
reportedFlag: 'N', |
||||
|
qtyRequiredOriginal: 0, |
||||
|
scheduledDate: '', |
||||
|
shiftNo: '', |
||||
|
preItemDesc: '', |
||||
|
nextItemDesc: '', |
||||
|
nextItemNo: 0, |
||||
|
currentRollFlag: false |
||||
|
}, |
||||
|
operatorData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
operatorId: '', |
||||
|
operatorName: '', |
||||
|
status: '', |
||||
|
seqNo: '', |
||||
|
showFlag: false |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
comRollLabel,// 打印组件 |
||||
|
}, |
||||
|
methods: { |
||||
|
//初始化页面 |
||||
|
init(scheduleData, operatorData, rollType) { |
||||
|
this.rollType = rollType ? 1 : 0 |
||||
|
//初始化参数 |
||||
|
this.scheduleData = scheduleData; |
||||
|
//初始化操作员对象 |
||||
|
this.operatorData = JSON.parse(JSON.stringify(operatorData)); |
||||
|
this.pageData.reportTime = this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'); |
||||
|
//设置对应的参数 |
||||
|
this.pageData.orderNo = scheduleData.orderNo; |
||||
|
this.pageData.itemNo = scheduleData.itemNo; |
||||
|
this.pageData.seqNo = scheduleData.seqNo; |
||||
|
this.pageData.rollNo = scheduleData.rollNo; |
||||
|
this.pageData.operatorId = operatorData.operatorId; |
||||
|
this.pageData.newRollNo = ''; |
||||
|
this.pageData.newRollQty = 0; |
||||
|
this.pageData.totalQty = 0; |
||||
|
//执行获取页面参数的功能 |
||||
|
this.refreshPageData(); |
||||
|
//自动获取焦点 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.newRollNo.focus(); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*刷新页面的参数*/ |
||||
|
refreshPageData() { |
||||
|
getMergeRollPageData(this.pageData).then(({data}) => { |
||||
|
//判断是否出现异常 |
||||
|
if (data.code == 200) { |
||||
|
this.pageData.rollQty = data.row.resultQty;// 当前卷的数量 |
||||
|
this.pageData.totalQty = data.row.resultQty;//总良品数量 |
||||
|
} else { |
||||
|
this.pageData.rollQty = 0;// 当前卷的数量 |
||||
|
this.pageData.totalQty = 0;//总良品数量 |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*关闭modal*/ |
||||
|
closeDialog() { |
||||
|
//刷新报工的页面 |
||||
|
this.$emit('refreshPageData'); |
||||
|
//关闭当前的页面 |
||||
|
this.$emit('update:visible', false); |
||||
|
}, |
||||
|
|
||||
|
/*检验良品的总数量*/ |
||||
|
checkValidQty() { |
||||
|
//处理老卷的数量 |
||||
|
let rollQty = parseInt(this.pageData.rollQty); |
||||
|
if (rollQty == null || rollQty == '') { |
||||
|
//this.$message.error('请输入新卷数量!'); |
||||
|
this.pageData.rollQty = 0;//重新赋值 |
||||
|
} |
||||
|
//转换成整数 |
||||
|
if (rollQty <= 0) { |
||||
|
//this.$message.error('新卷数量必须是大于零的整数!'); |
||||
|
this.pageData.rollQty = 0;//重新赋值 |
||||
|
} else { |
||||
|
this.pageData.rollQty = rollQty; |
||||
|
} |
||||
|
//首先判断数值是否通过判断 |
||||
|
let newRollQty = parseInt(this.pageData.newRollQty); |
||||
|
if (newRollQty == null || newRollQty == '') { |
||||
|
//this.$message.error('请输入新卷数量!'); |
||||
|
this.pageData.newRollQty = 0;//重新赋值 |
||||
|
} |
||||
|
if (newRollQty <= 0) { |
||||
|
//this.$message.error('新卷数量必须是大于零的整数!'); |
||||
|
this.pageData.newRollQty = 0;//重新赋值 |
||||
|
} else { |
||||
|
this.pageData.newRollQty = newRollQty; |
||||
|
} |
||||
|
//计算总的数量 |
||||
|
this.pageData.totalQty = newRollQty + rollQty; |
||||
|
}, |
||||
|
|
||||
|
/*执行是否需要提示的操作*/ |
||||
|
warnMergeSfdcRollsConfirm() { |
||||
|
//首先判断数值是否通过判断 |
||||
|
let newRollQty = this.pageData.newRollQty; |
||||
|
if (newRollQty == null || newRollQty == '') { |
||||
|
this.$message.error('请输入新卷数量!'); |
||||
|
this.pageData.newRollQty = 0;//重新赋值 |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
if (newRollQty <= 0 || !Number.isInteger(newRollQty)) { |
||||
|
this.$message.error('新卷数量必须是大于零的整数!'); |
||||
|
this.pageData.newRollQty = 0;//重新赋值 |
||||
|
return false; |
||||
|
} |
||||
|
//判断卷号是否相同 |
||||
|
if (this.pageData.rollNo === this.pageData.newRollNo) { |
||||
|
this.$message.error('相同卷号无法合并!'); |
||||
|
this.pageData.newRollNo = ''; |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
let requestData = { |
||||
|
'site': this.pageData.site, |
||||
|
'orderNo': this.pageData.orderNo, |
||||
|
'itemNo': this.pageData.itemNo, |
||||
|
'seqNo': this.pageData.seqNo, |
||||
|
'rollNo': this.pageData.rollNo, |
||||
|
'rollQty': this.pageData.rollQty, |
||||
|
'newRollNo': this.pageData.newRollNo, |
||||
|
'newRollQty': this.pageData.newRollQty, |
||||
|
'username': this.pageData.username, |
||||
|
'operatorId': this.pageData.operatorId, |
||||
|
parkFlag: this.rollType == 1 ? 'Y' : 'N', |
||||
|
'newRollFlag': false |
||||
|
}; |
||||
|
//先校验当前的卷 |
||||
|
checkMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else if (data.resultMap.resultCode == 300) { |
||||
|
let msg = data.resultMap.resultMsg; |
||||
|
this.$confirm(msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
//校验参与合并的新卷 |
||||
|
requestData.newRollFlag = true; |
||||
|
checkMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else if (data.resultMap.resultCode == 300) { |
||||
|
let msg = data.resultMap.resultMsg; |
||||
|
this.$confirm(msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
//执行合并卷的操作 |
||||
|
processMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else { |
||||
|
this.$message.success(data.msg); |
||||
|
//先打印再继续关闭 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.comRollLabel.init(data.rollNo) |
||||
|
}); |
||||
|
//延时一秒关闭 --预防没有出标签 |
||||
|
setTimeout(() => { |
||||
|
this.closeDialog(); |
||||
|
}, 1000); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} else { |
||||
|
//执行合并卷的操作 |
||||
|
processMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else { |
||||
|
this.$message.success(data.msg); |
||||
|
//先打印再继续关闭 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.comRollLabel.init(data.rollNo) |
||||
|
}); |
||||
|
setTimeout(() => { |
||||
|
this.closeDialog(); |
||||
|
}, 1000); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
//校验通过的情况 |
||||
|
} else { |
||||
|
//校验参与合并的新卷 |
||||
|
requestData.newRollFlag = true; |
||||
|
checkMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else if (data.resultMap.resultCode == 300) { |
||||
|
let msg = data.resultMap.resultMsg; |
||||
|
this.$confirm(msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: "warning" |
||||
|
}).then(() => { |
||||
|
//执行合并卷的操作 |
||||
|
processMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else { |
||||
|
this.$message.success(data.msg); |
||||
|
//先打印再继续关闭 |
||||
|
let printRow = { |
||||
|
site: this.pageData.site, orderNo: this.pageData.orderNo, |
||||
|
rollNo: data.rollNo |
||||
|
}; |
||||
|
this.printSfdcFlowLabel(printRow); |
||||
|
//延时一秒关闭 --预防没有出标签 |
||||
|
setTimeout(() => { |
||||
|
this.closeDialog(); |
||||
|
}, 1000); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} else { |
||||
|
//执行合并卷的操作 |
||||
|
processMergeSfdcRoll(requestData).then(({data}) => { |
||||
|
if (data.code == 500) { |
||||
|
this.$message.error(data.msg); |
||||
|
} else { |
||||
|
this.$message.success(data.msg); |
||||
|
//先打印再继续关闭 |
||||
|
let printRow = { |
||||
|
site: this.pageData.site, orderNo: this.pageData.orderNo, |
||||
|
rollNo: data.rollNo |
||||
|
}; |
||||
|
this.printSfdcFlowLabel(printRow); |
||||
|
//延时一秒关闭 --预防没有出标签 |
||||
|
setTimeout(() => { |
||||
|
this.closeDialog(); |
||||
|
}, 1000); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/*打印流转标签*/ |
||||
|
printSfdcFlowLabel(sfdcRow) { |
||||
|
//先查询打印的卷信息 |
||||
|
getSfdcFlowLabelData(sfdcRow).then(({data}) => { |
||||
|
//开始打印标签 |
||||
|
if (data.code === 200) { |
||||
|
let printList = data.printList; |
||||
|
printSfdcLabel(printList); |
||||
|
} else { |
||||
|
this.$message.error(data.msg); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created() { |
||||
|
// this.factoryList() |
||||
|
// this.getLanguageList() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
/*调节页面button和input的上下间距*/ |
||||
|
.customer-css .customer-button { |
||||
|
margin-top: 25px; |
||||
|
} |
||||
|
|
||||
|
/*调节fieldset下的样式*/ |
||||
|
.customer-fieldset .customer-item { |
||||
|
margin-top: -15px; |
||||
|
} |
||||
|
|
||||
|
/*fieldset下table的样式*/ |
||||
|
.customer-fieldset /deep/ .el-table__header th.is-leaf { |
||||
|
line-height: 16px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue