rev:新增导入相关功能
This commit is contained in:
@@ -64,4 +64,28 @@ export function unSubmit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getRoute, getRouteDtl, getProductRouteDtl, submit, unSubmit }
|
||||
export function queryDevice(data) {
|
||||
return request({
|
||||
url: 'api/productprocessroute/queryDevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveDevice(data) {
|
||||
return request({
|
||||
url: 'api/productprocessroute/saveDevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/productprocessroute/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getRoute, getRouteDtl, getProductRouteDtl, submit, unSubmit, queryDevice, saveDevice, excelImport }
|
||||
|
||||
@@ -79,4 +79,12 @@ export function getClassName() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/Classstandard/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName, excelImport }
|
||||
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/customerbase/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, excelImport }
|
||||
|
||||
@@ -55,4 +55,12 @@ export function getProductSeries() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, synchronize, getProductSeries }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/mdMeMaterialbase/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, synchronize, getProductSeries, excelImport }
|
||||
|
||||
@@ -32,4 +32,12 @@ export function updateRawmaterial(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, updateRawmaterial }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/semirealrawmaterial/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, updateRawmaterial, excelImport }
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudClassstandard.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
debugger
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -44,6 +44,16 @@
|
||||
>
|
||||
全部展开
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -126,6 +136,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -138,6 +149,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import UploadDialog from '@/views/wms/masterdata_manage/master/class/UploadDialog'
|
||||
|
||||
let defaultForm = {
|
||||
class_id: null,
|
||||
@@ -166,7 +178,7 @@ let defaultForm = {
|
||||
export default {
|
||||
name: 'Classstandard',
|
||||
dicts: ['base_data'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -184,6 +196,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
classes: [],
|
||||
uploadShow: false,
|
||||
classNames: [],
|
||||
permission: {},
|
||||
rules: {
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudCustomerbase from '@/api/wms/basedata/master/customerbase'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudCustomerbase.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
debugger
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -13,7 +13,18 @@
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -159,6 +170,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -172,6 +184,7 @@ import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import UploadDialog from '@/views/wms/masterdata_manage/master/customer/UploadDialog'
|
||||
|
||||
const defaultForm = {
|
||||
cust_id: null,
|
||||
@@ -202,7 +215,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Customerbase',
|
||||
dicts: ['is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -220,6 +233,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
uploadShow: false,
|
||||
classes: [],
|
||||
rules: {
|
||||
cust_id: [
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudMaterialbase.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
debugger
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -49,6 +49,16 @@
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -178,6 +188,7 @@
|
||||
<pagination/>
|
||||
</div>
|
||||
<Dialog :dialog-show.sync="dialogShow"/>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -193,6 +204,7 @@ import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
|
||||
import UploadDialog from '@/views/wms/masterdata_manage/master/material/UploadDialog'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
@@ -232,7 +244,7 @@ export default {
|
||||
name: 'Materialbase',
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, Treeselect, Dialog},
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect, Dialog},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -250,6 +262,7 @@ export default {
|
||||
classes2: [],
|
||||
classes3: [],
|
||||
dialogShow: false,
|
||||
uploadShow: false,
|
||||
fullscreenLoading: false,
|
||||
measure_unit: [],
|
||||
productSeries: [],
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSemirealrawmaterial from '@/api/wms/basedata/master/semirealrawmaterial'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudSemirealrawmaterial.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
debugger
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -36,12 +36,38 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属工序">
|
||||
<el-select v-model="form.workprocedure_id" filterable clearable size="small" placeholder="所属工序" class="filter-item" style="width: 280px">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="selectRawMaterialDialog2 = false">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="submit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -54,6 +80,7 @@
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" :min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_code" label="半成品编码" :min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="半成品名称" :min-width="180" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_spec" label="半成品规格" :min-width="150" show-overflow-tooltip/>
|
||||
@@ -73,6 +100,7 @@
|
||||
<pagination/>
|
||||
<SelectRawMaterialDialog ref="selectRawMaterialDialog" :dialog-show.sync="selectRawMaterialDialog"
|
||||
@tableChanged3="tableChanged3"/>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -83,6 +111,8 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import SelectRawMaterialDialog from './SelectRawMaterialDialog'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
import UploadDialog from './UploadDialog'
|
||||
|
||||
const defaultForm = {
|
||||
relation_id: null,
|
||||
@@ -98,7 +128,7 @@ const defaultForm = {
|
||||
|
||||
export default {
|
||||
name: 'Semirealrawmaterial',
|
||||
components: {pagination, crudOperation, rrOperation, SelectRawMaterialDialog},
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, SelectRawMaterialDialog},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -117,16 +147,22 @@ export default {
|
||||
return {
|
||||
selectRawMaterialDialog: false,
|
||||
selectRawMaterialDialog2: false,
|
||||
uploadShow: false,
|
||||
workList: [],
|
||||
form: {
|
||||
material_code: '',
|
||||
material_id: '',
|
||||
relation_id: '',
|
||||
workprocedure_id: '',
|
||||
rate_qty: ''
|
||||
},
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkprocedure()
|
||||
},
|
||||
methods: {
|
||||
addMaterial(row) {
|
||||
this.form.relation_id = row.relation_id
|
||||
@@ -140,6 +176,12 @@ export default {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
},
|
||||
getWorkprocedure() { // 获取工序下拉框
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
console.log(res)
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if (this.form.relation_id === '') {
|
||||
this.crud.notify('请选择一条要设置的半成品', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属区域">
|
||||
<el-form-item label="生产车间">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
type="success"Ï
|
||||
icon="el-icon-check"
|
||||
:disabled="crud.selections.length === 0"
|
||||
size="mini"
|
||||
|
||||
@@ -23,21 +23,42 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品" prop="material_code">
|
||||
<el-input v-model="form.material_code" readonly :disabled="crud.status.edit || crud.status.view > 0 " style="width: 200px;">
|
||||
<el-button
|
||||
slot="append"
|
||||
icon="el-icon-plus"
|
||||
:disabled="crud.status.edit || crud.status.view > 0"
|
||||
@click="queryMater"
|
||||
/>
|
||||
</el-input>
|
||||
<el-form-item label="产品系列">
|
||||
<treeselect
|
||||
v-model="form.class_id"
|
||||
:options="classes3"
|
||||
:disabled="crud.status.view > 0"
|
||||
:auto-load-root-options="false"
|
||||
:load-options="loadChildNodes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产车间" prop="product_area">
|
||||
<el-select
|
||||
v-model="form.product_area"
|
||||
placeholder=""
|
||||
:disabled="crud.status.view > 0"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工艺路线" prop="processroute_id">
|
||||
<el-select
|
||||
@@ -67,72 +88,80 @@
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-top: 30px;margin-bottom: 12px">
|
||||
<span class="role-span">产品工艺路线明细</span>
|
||||
</div>
|
||||
<span v-if="crud.status.cu > 0 || crud.status.view > 0" class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="insertLine"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="delLine"
|
||||
>
|
||||
删除一行
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="processroute_name" label="工艺名称" />
|
||||
<el-table-column prop="workprocedure_no" label="工序顺序" />
|
||||
<el-table-column prop="workprocedure_name" label="当前工序" />
|
||||
</el-table>
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12" style="margin-bottom: 15px">
|
||||
<el-card class="box-card">
|
||||
<div class="crud-opts2" style="margin-top: 30px;margin-bottom: 12px">
|
||||
<span class="role-span">产品工艺路线明细</span>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="processroute_name" label="工艺名称" />
|
||||
<el-table-column prop="workprocedure_no" label="工序顺序" />
|
||||
<el-table-column prop="workprocedure_name" label="当前工序" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<div class="crud-opts2" style="margin-top: 30px;margin-bottom: 12px">
|
||||
<span class="role-span">设备列表</span>
|
||||
</div>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
style="float: right; margin-bottom: 5px;"
|
||||
type="primary"
|
||||
@click="save"
|
||||
>保存
|
||||
</el-button>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="deviceList"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<MaterDtl :dialog-show.sync="materShow" :mater-opt-code="materType" @setMaterValue="setMaterValue" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import CRUD, { form, crud } from '@crud/crud'
|
||||
import crudProductRoute from '@/api/productprocessroute'
|
||||
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
|
||||
|
||||
const defaultForm = {
|
||||
productprocess_id: null,
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
class_id: null,
|
||||
processroute_id: null,
|
||||
remark: null,
|
||||
product_area: null,
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
dicts: ['product_area'],
|
||||
components: {Treeselect },
|
||||
mixins: [form(defaultForm), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -146,9 +175,10 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
routeList: [],
|
||||
classes3: [],
|
||||
deviceList: [],
|
||||
dialogVisible: false,
|
||||
materType: '03',
|
||||
materShow: false,
|
||||
currentRow: null,
|
||||
serieseList: [],
|
||||
rules: {
|
||||
material_code: [
|
||||
@@ -174,12 +204,29 @@ export default {
|
||||
this.form.tableData = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
crudMdPbMeasureunit.getUnit().then(res => {
|
||||
this.measure_unit = res.content
|
||||
})
|
||||
// 物料系列为空,新增
|
||||
if (!form.class_id) {
|
||||
form.class_id = null // 必须为null,否则会出现unknown
|
||||
} else { // 更新
|
||||
this.getSubTypes('03', form.class_id)
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
this.getDtl(this.form.processroute_id)
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
[CRUD.HOOK.afterToView](crud, form) {
|
||||
this.getRoute()
|
||||
this.getDtl(this.form.processroute_id)
|
||||
// 物料系列为空,新增
|
||||
if (!form.class_id) {
|
||||
form.class_id = null // 必须为null,否则会出现unknown
|
||||
} else { // 更新
|
||||
this.getSubTypes('03', form.class_id)
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
@@ -189,7 +236,51 @@ export default {
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
initClass3() {
|
||||
const param = {
|
||||
parent_class_code: '07'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes3 = data
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (!this.deviceList) {
|
||||
this.crud.notify('设备列表不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
const row = {}
|
||||
row.jo = this.currentRow
|
||||
row.class_id = this.form.class_id
|
||||
row.rows = this.$refs.multipleTable.selection
|
||||
crudProductRoute.saveDevice(row).then(res => {
|
||||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
getSubTypes(type, id) {
|
||||
const that = this
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
const data = res.content
|
||||
that.buildTree(data)
|
||||
if (type === '03') {
|
||||
this.classes3 = data
|
||||
}
|
||||
})
|
||||
},
|
||||
buildTree(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildTree(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null // 重点代码
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.deviceList = []
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
@@ -197,22 +288,59 @@ export default {
|
||||
this.materShow = true
|
||||
},
|
||||
open() {
|
||||
this.initClass3()
|
||||
this.getRoute()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
if (!this.form.class_id) {
|
||||
this.crud.notify('请先选择系列!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.currentRow = val
|
||||
val.class_id = this.form.class_id
|
||||
crudProductRoute.queryDevice(val).then(res => {
|
||||
this.deviceList = res.device_list
|
||||
// toggleRowSelection 需在$nextTick中使用!
|
||||
this.$nextTick(() => {
|
||||
this.deviceList.forEach(row => {
|
||||
res.check_list.forEach(selected => {
|
||||
if (selected.device_code === row.device_code) {
|
||||
debugger
|
||||
this.$refs.multipleTable.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
getRoute() {
|
||||
// 查询原材料库的仓库
|
||||
crudProductRoute.getRoute({}).then(res => {
|
||||
this.routeList = res
|
||||
})
|
||||
},
|
||||
setMaterValue(row) {
|
||||
console.log(row)
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_id = row.material_id
|
||||
},
|
||||
insertLine() {
|
||||
this.form.tableData.push({ workprocedure_no: '', is_check: '1' })
|
||||
},
|
||||
// 获取子节点数据
|
||||
loadChildNodes({action, parentNode, callback}) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({pid: parentNode.id}).then(res => {
|
||||
parentNode.children = res.content.map(function (obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
delLine() {
|
||||
this.form.tableData.splice(-1)
|
||||
},
|
||||
|
||||
125
mes/qd/src/views/wms/pdm/base/productRoute/UploadDialog.vue
Normal file
125
mes/qd/src/views/wms/pdm/base/productRoute/UploadDialog.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductRoute from '@/api/productprocessroute'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudProductRoute.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
debugger
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -50,6 +50,16 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@@ -83,6 +93,8 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="product_area" label="车间" :min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="class_name" label="系列名称" :min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="processroute_code" label="工艺路线编码" :min-width="100" show-overflow-tooltip >
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.processroute_code }}</el-link>
|
||||
@@ -90,8 +102,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="processroute_name" label="工艺路线名称" :min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="status_name" label="工艺路线状态" :min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="产品编码" :min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="名称" :min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column prop="audit_optname" label="审核人" />
|
||||
@@ -111,6 +121,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="queryTable" />
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -122,10 +133,11 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pdm/base/productRoute/AddDialog'
|
||||
import UploadDialog from '@/views/wms/pdm/base/productRoute/UploadDialog'
|
||||
|
||||
export default {
|
||||
name: 'Productprocessroute',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
components: {UploadDialog, pagination, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -142,6 +154,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
uploadShow: false,
|
||||
procStatusList: [
|
||||
{ 'label': '生成', 'code': '10' },
|
||||
{ 'label': '提交', 'code': '20' }
|
||||
@@ -181,6 +194,9 @@ export default {
|
||||
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
unSubmit() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
|
||||
@@ -24,20 +24,20 @@
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form
|
||||
ref="form"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
size="mini"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form
|
||||
ref="form"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
class="demo-form-inline"
|
||||
size="mini"
|
||||
label-width="auto"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工艺路线号" prop="processroute_code">
|
||||
<el-input
|
||||
v-model="form.processroute_code"
|
||||
@@ -47,8 +47,8 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工艺路线名称" prop="processroute_name">
|
||||
<el-input
|
||||
v-model="form.processroute_name"
|
||||
@@ -58,15 +58,37 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产车间" prop="processroute_name">
|
||||
<el-select
|
||||
v-model="form.product_area"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
style="width: 210px;"
|
||||
placeholder="区域类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery()"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-top: 30px">
|
||||
<span class="role-span">工艺路线明细</span>
|
||||
@@ -136,6 +158,7 @@ const defaultForm = {
|
||||
processroute_code: null,
|
||||
processroute_name: null,
|
||||
processroute_status: null,
|
||||
product_area: null,
|
||||
remark: null,
|
||||
tableData: []
|
||||
}
|
||||
@@ -143,7 +166,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
mixins: [form(defaultForm), crud()],
|
||||
dicts: ['ST_INV_TYPE_RC'],
|
||||
dicts: ['ST_INV_TYPE_RC', 'product_area'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -36,6 +36,23 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产车间">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="区域类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery()"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -111,6 +128,7 @@ import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
export default {
|
||||
name: 'Processroute',
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['product_area'],
|
||||
mixins: [presenter(), header(), form(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
|
||||
@@ -121,17 +121,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品系列">
|
||||
<treeselect
|
||||
v-model="form.product_series"
|
||||
:options="classes3"
|
||||
:multiple="true"
|
||||
:auto-load-root-options="false"
|
||||
:load-options="loadChildNodes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产物料规格">
|
||||
<el-input v-model="form.spec" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user