init
This commit is contained in:
41
src/views/orderManage/components/detailBtn.vue
Normal file
41
src/views/orderManage/components/detailBtn.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<!--
|
||||
* @Date: 2021-01-07 20:09:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-03-20 15:17:31
|
||||
* @FilePath:
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<span>
|
||||
<el-button type="text" size="small" @click="emitClick">{{ 'routerTitle.order.workOrderManage.tagDetail' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
<tag-detail v-if="tagDetailVisible" ref="tagDetail" :packaging-box-id="injectData.id" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tagDetail from './tagDetail'
|
||||
export default {
|
||||
components: { tagDetail },
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tagDetailVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitClick() {
|
||||
this.tagDetailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tagDetail.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
108
src/views/orderManage/components/echarts-Bar.vue
Normal file
108
src/views/orderManage/components/echarts-Bar.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-03-03 16:39:34
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-23 10:30:57
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :id="id" :style="barStyle" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return 'barChart'
|
||||
}
|
||||
},
|
||||
barStyle: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
color: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return ['#5470C6']
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
|
||||
this.chart.setOption({
|
||||
color: this.color,
|
||||
title: this.title,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: this.legend,
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: this.xAxis,
|
||||
yAxis: this.yAxis,
|
||||
series: this.series
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
135
src/views/orderManage/components/powerClassification-add.vue
Normal file
135
src/views/orderManage/components/powerClassification-add.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 14:42:17
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="110px" @keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item :label="$t('module.orderManage.powerClassification.typeName')" prop="name">
|
||||
<el-input v-model="dataForm.name" :placeholder="$i18nForm(['placeholder.input', $t('module.orderManage.powerClassification.typeName')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.orderManage.powerClassification.typeCode')" prop="code">
|
||||
<el-input v-model="dataForm.code" :placeholder="$i18nForm(['placeholder.input', $t('module.orderManage.powerClassification.typeCode')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.orderManage.powerClassification.parentClass')" prop="parentId">
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
v-model="dataForm.parentId"
|
||||
:placeholder="$i18nForm(['placeholder.input', $t('module.orderManage.powerClassification.parentClass')])"
|
||||
:props="{ checkStrictly: true,value: 'id',label: 'name' }"
|
||||
:options="parentArr"
|
||||
filterable
|
||||
clearable
|
||||
@change="setParent"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Remarks')])" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { powerClassificationTree, powerClassificationDetail, powerClassificationUpdate, powerClassificationAdd, powerClassificationCode } from '@/api/orderManage/powerClassification'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
name: '',
|
||||
code: '',
|
||||
parentId: '',
|
||||
parentName: '',
|
||||
remark: ''
|
||||
},
|
||||
parentArr: [],
|
||||
dataRule: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.orderManage.powerClassification.typeName')]),
|
||||
trigger: 'blur' }
|
||||
],
|
||||
parentId: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.input', this.$t('module.orderManage.powerClassification.parentClass')]),
|
||||
trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || ''
|
||||
this.visible = true
|
||||
this.parentArr.splice(0, this.parentArr.length)
|
||||
powerClassificationTree().then(res => {
|
||||
this.parentArr = res.data
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
powerClassificationDetail(this.dataForm.id).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
} else {
|
||||
powerClassificationCode().then(res => {
|
||||
this.dataForm.code = res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = this.dataForm
|
||||
data.parentId = data.parentId[data.parentId.length - 1]
|
||||
if (this.dataForm.id) {
|
||||
powerClassificationUpdate(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
powerClassificationAdd(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
setParent(val) {
|
||||
this.dataForm.parentName = this.$refs['cascader'].getCheckedNodes()[0].pathLabels[this.$refs['cascader'].getCheckedNodes()[0].pathLabels.length - 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
131
src/views/orderManage/components/substrateBatchAttr-add.vue
Normal file
131
src/views/orderManage/components/substrateBatchAttr-add.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-03-30 18:39:46
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:append-to-body="true"
|
||||
:show-close="false"
|
||||
:visible.sync="visible"
|
||||
size="40%"
|
||||
>
|
||||
<div slot="title" style=" background-color:#02BCFF;font-size:1.5em;color:white;padding:5px 20px">
|
||||
{{ !dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter }}
|
||||
</div>
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" @keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item :label="$t('module.basicData.visual.AttributeName')" prop="attrName">
|
||||
<el-input v-model="dataForm.attrName" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.AttributeName')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.visual.AttributeValue')" prop="attrValue">
|
||||
<el-input v-model="dataForm.attrValue" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.AttributeValue')])" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="drawer-footer">
|
||||
<el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
|
||||
<el-button type="primary" :loading="btnLoading" @click="dataFormSubmit()">{{ 'btn.confirm' | i18nFilter }}</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { substrateBatchAttrDetail, substrateBatchAttrUpdate, substrateBatchAttrAdd } from '@/api/orderManage/substrateBatchAttr'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
subId: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
attrName: '',
|
||||
attrValue: ''
|
||||
},
|
||||
dataRule: {
|
||||
attrName: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.visual.AttributeName')]), trigger: 'blur' }
|
||||
],
|
||||
attrValue: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.visual.AttributeValue')]), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || ''
|
||||
this.btnLoading = false
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
substrateBatchAttrDetail(this.dataForm.id).then(res => {
|
||||
this.dataForm.attrName = res.data.name
|
||||
this.dataForm.attrValue = res.data.value
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.btnLoading = true
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const data = {
|
||||
'name': this.dataForm.attrName,
|
||||
'value': this.dataForm.attrValue,
|
||||
'subId': this.subId,
|
||||
'id': this.dataForm.id
|
||||
}
|
||||
if (this.dataForm.id) {
|
||||
substrateBatchAttrUpdate(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
substrateBatchAttrAdd(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
235
src/views/orderManage/components/substrateBatchAttr.vue
Normal file
235
src/views/orderManage/components/substrateBatchAttr.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-03-31 11:24:59
|
||||
* @enName:
|
||||
-->
|
||||
<template>
|
||||
<div style="margin:20px">
|
||||
<div slot="title" style=" background-color:#02BCFF;font-size:1.5em;color:white;padding:5px 20px;margin:20px">{{ isdetail? 'btn.detail' : !dataForm.id ? 'btn.add' : 'btn.edit' | i18nFilter }}</div>
|
||||
<div style="margin:0 15px">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" @keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item :label="$t('module.orderManage.substrateBatch.batchName')" prop="name">
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.orderManage.substrateBatch.batchName')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.orderManage.substrateBatch.batchCode')" prop="code">
|
||||
<el-input v-model="dataForm.code" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.orderManage.substrateBatch.batchCode')])" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.basicData.visual.Remarks')" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" :placeholder="$i18nForm(['placeholder.input', $t('module.basicData.visual.Remarks')])" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin:20px">
|
||||
<el-button type="success" @click="goback()">{{ 'btn.back' | i18nFilter }}</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">{{ 'btn.edit' | i18nFilter }}</el-button>
|
||||
<span v-if="!isdetail">
|
||||
<el-button type="primary" @click="dataFormSubmit()">{{ 'btn.save' | i18nFilter }}</el-button>
|
||||
<el-button v-if="listQuery.subId" type="primary" @click="addNew()">{{ 'btn.addattr' | i18nFilter }}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<div style="height:380px;overflow:auto">
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
>
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
</div>
|
||||
</div>
|
||||
<substrate-batch-attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :sub-id="listQuery.subId" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import i18n from '@/lang'
|
||||
import { substrateBatchDetail, substrateBatchUpdate, substrateBatchAdd, substrateBatchCode } from '@/api/orderManage/substrateBatch'
|
||||
import { substrateBatchAttrList, substrateBatchAttrDelete } from '@/api/orderManage/substrateBatchAttr'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
|
||||
import substrateBatchAttrAdd from './substrateBatchAttr-add'
|
||||
import { timeFormatter } from '@/filters'
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: 'btn.edit'
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: 'btn.delete'
|
||||
}
|
||||
]
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: i18n.t('module.basicData.factory.createTime'),
|
||||
filter: timeFormatter,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: i18n.t('module.basicData.visual.AttributeName'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'value',
|
||||
label: i18n.t('module.basicData.visual.AttributeValue'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
components: { BaseTable, MethodBtn, substrateBatchAttrAdd },
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
trueWidth: 200,
|
||||
tableProps,
|
||||
list: [],
|
||||
dataForm: {
|
||||
name: '',
|
||||
code: '',
|
||||
enName: '',
|
||||
abbr: '',
|
||||
category: '',
|
||||
description: '',
|
||||
remark: ''
|
||||
},
|
||||
dataRule: {
|
||||
name: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.material.MaterialName')]), trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.basicData.material.MaterialCoding')]), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 990,
|
||||
subId: ''
|
||||
},
|
||||
isdetail: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listQuery.subId = this.$route.query.id
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.isdetail = false
|
||||
this.isdetail = Boolean(this.$route.query.isdetail)
|
||||
this.list.splice(0, this.list.length)
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.listQuery.subId) {
|
||||
substrateBatchDetail(this.listQuery.subId).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
substrateBatchAttrList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
substrateBatchCode().then(res => {
|
||||
this.dataForm.code = res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
substrateBatchAttrList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`${this.$t('module.basicData.visual.TipsBefore')}[${raw.data.name}]?`, this.$t('module.basicData.visual.Tips'), {
|
||||
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText'),
|
||||
cancelButtonText: this.$t('module.basicData.visual.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
substrateBatchAttrDelete(raw.data.id).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.addNew(raw.data.id)
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dataForm.id = this.listQuery.subId
|
||||
const data = this.dataForm
|
||||
if (this.listQuery.subId) {
|
||||
substrateBatchUpdate(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
})
|
||||
} else {
|
||||
substrateBatchAdd(data).then(res => {
|
||||
this.$message({
|
||||
message: this.$t('module.basicData.visual.success'),
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
this.listQuery.subId = res.data.id
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false
|
||||
},
|
||||
goback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
197
src/views/orderManage/components/tagDetail.vue
Normal file
197
src/views/orderManage/components/tagDetail.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-07-21 09:33:06
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:append-to-body="true"
|
||||
:show-close="false"
|
||||
:visible.sync="visible"
|
||||
size="55%"
|
||||
>
|
||||
<div
|
||||
slot="title"
|
||||
style=" background-color:#02BCFF;font-size:1.5em;color:white;padding:5px 20px"
|
||||
>
|
||||
{{ "routerTitle.order.workOrderManage.tagDetail" | i18nFilter }}
|
||||
</div>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span><b>{{ "BOX_ID:" + dataForm.id }}</b></span>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="float:right"
|
||||
size="small"
|
||||
@click="btnClickPrint"
|
||||
>{{ "btn.print" | i18nFilter }}</el-button>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-row :gutter="20">
|
||||
<el-col
|
||||
:span="6"
|
||||
><div>{{ "Power:" + dataForm.power }}</div></el-col>
|
||||
<el-col
|
||||
:span="6"
|
||||
><div>{{ "SAP Material:" + dataForm.sapMaterial }}</div></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
<div id="tablePrint">
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
:is-loading="listLoading"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import {
|
||||
packagingDetail,
|
||||
packagingBoxList
|
||||
} from '@/api/orderManage/workOrder/workOrder'
|
||||
// import { timeFormatter } from '@/filters'
|
||||
import { getLodop } from '@/assets/libs/LodopFuncs.js'
|
||||
import { getInfo } from '@/api/packing-manage/packing-label.js'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'woSubstrateId',
|
||||
label: i18n.t('module.orderManage.packingTags.moduleId'),
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// prop: 'finishProduceTime',
|
||||
// label: i18n.t('module.orderManage.packingTags.UnloadingTime'),
|
||||
// align: 'center'
|
||||
// },
|
||||
// {
|
||||
// prop: 'name',
|
||||
// label: i18n.t('module.orderManage.packingTags.UnloadingEquipment'),
|
||||
// align: 'center',
|
||||
// filter: timeFormatter
|
||||
// },
|
||||
{
|
||||
prop: 'oneCode',
|
||||
label: i18n.t('module.orderManage.packingTags.oneDimensionalCode'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
components: { BaseTable },
|
||||
props: {
|
||||
packagingBoxId: {
|
||||
type: String,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: false,
|
||||
dataForm: {},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 500
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.listLoading = true
|
||||
packagingDetail(this.packagingBoxId).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listQuery.packagingBoxId = this.packagingBoxId
|
||||
this.listLoading = true
|
||||
packagingBoxList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// btnClickPrint() {
|
||||
// const LODOP = getLodop()
|
||||
// const strHTML = document.getElementById('tablePrint').innerHTML
|
||||
// LODOP.ADD_PRINT_HTM(30, 5, '100%', '80%', strHTML) // 装载模板
|
||||
// LODOP.PREVIEW()
|
||||
// }
|
||||
btnClickPrint() {
|
||||
getInfo({ id: '1387070313172353025' }).then(res => {
|
||||
this.printPreview('预览', res.data.content)
|
||||
})
|
||||
},
|
||||
printPreview(name = '预览', modelCode) {
|
||||
console.log(modelCode)
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT(name)
|
||||
const aaa = LODOP.ADD_PRINT_DATA('ProgramData', modelCode)
|
||||
console.log(aaa)
|
||||
const obj = {
|
||||
time: this.dataForm.packagingTime,
|
||||
orderCode: this.orderCode,
|
||||
power: this.dataForm.power,
|
||||
sapMaterial: this.dataForm.sapMaterial,
|
||||
BarCode: this.dataForm.boxNo
|
||||
}
|
||||
this.list.forEach((item, index) => {
|
||||
const str = 'modul' + (index + 1)
|
||||
obj[str] = item.woSubstrateId
|
||||
})
|
||||
Object.keys(obj).forEach(key => {
|
||||
LODOP.SET_PRINT_STYLEA(key, 'CONTENT', obj[key])
|
||||
})
|
||||
LODOP.NewPageA()
|
||||
LODOP.PREVIEW()
|
||||
},
|
||||
print(name = '打印') {
|
||||
console.log(name, this.currentIndex)
|
||||
// 装载模板
|
||||
const modelCode = this.printModels[this.currentIndex].printModelContent
|
||||
console.log(modelCode)
|
||||
this.objs.forEach(obj => {
|
||||
const LODOP = getLodop() // 调用getLodop获取LODOP对象
|
||||
LODOP.PRINT_INIT(name)
|
||||
const aaa = LODOP.ADD_PRINT_DATA('ProgramData', modelCode)
|
||||
console.log(aaa)
|
||||
obj.partCode = obj.itemCode
|
||||
obj.productTypeName = obj.itemTypeName
|
||||
Object.keys(obj).forEach(key => {
|
||||
LODOP.SET_PRINT_STYLEA(key, 'CONTENT', obj[key])
|
||||
})
|
||||
// LODOP.ADD_PRINT_HTM(10, 10, 350, 600, `--------${index}----------`);
|
||||
LODOP.NewPageA()
|
||||
LODOP.PRINT()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user