add:策略管理,单据管理

This commit is contained in:
2025-06-25 21:56:44 +08:00
parent cc3376f60d
commit 638b8a109b
17 changed files with 2271 additions and 1 deletions

View File

@@ -87,7 +87,7 @@
<script>
import crudStrategy from './strategy'
import AddDialog from './AddDialog'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'

View File

@@ -0,0 +1,253 @@
<template>
<el-dialog
title="单据选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="单据类型">
<el-select
v-model="query.form_type"
filterable
size="mini"
placeholder="请选择/搜索"
class="filter-item"
@change="crud.toQuery()"
>
<el-option
v-for="item in tableEnum.bm_form_struc"
:key="item.value"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item label="单据编码">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
@current-change="clickChange"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :label="item.lable" >
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
<el-table-column
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
<el-dialog
title="单据明细"
append-to-body
:visible.sync="dtlVisible"
destroy-on-close
width="1000px"
>
<!--表格渲染-->
<el-table
:data="childrenList">
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="210px" />
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120"/>
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in cols" :key="item.value" :label="item.lable" >
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
</el-table>
<!--分页组件-->
<span slot="footer" class="dialog-footer">
<el-button @click="dtlVisible = false"> </el-button>
</span>
</el-dialog>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
// import crudClassstandard from '@/views/wms/base_manage/class_standard/classstandard'
import crudFormData from "./formData";
export default {
name: 'FormDia',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '单据', url: 'api/pmFormData', crudMethod: { ...crudFormData }, optShow: {}})
},
mixins: [presenter(), header()],
tableEnums: [ 'bm_form_struc#form_name#form_type' ],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
}
},
data() {
return {
cols: [],
dialogVisible: false,
dtlVisible: false,
childrenList: [],
tableRadio: null,
checkrow: null,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
},
[CRUD.HOOK.beforeRefresh]() {
// if (this.query.form_type !=null){
// formstruc.getHeader(this.query.form_type).then(res => {
// this.cols = res
// })
// return true
// }
// return false
},
toView(row){
if (row.hasChildren){
this.dtlVisible = true
this.childrenList = row.children;
}
},
clickChange(item) {
this.tableRadio = item
},
handleSelectionChange(val, row) {
if (this.isSingle) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.dialogVisible = false
let subData = {}
this.$set(subData, 't', this.form)
this.$set(subData, 'item', this.tableRadio)
this.$emit('update:dialogShow', false)
this.$emit('setMaterValue', subData)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
let subData = {}
this.$set(subData, 't', this.rows[0])
this.$set(subData, 'item', this.rows[0].children)
this.$emit('setMaterValue', subData)
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View 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 crudClassstandard from './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 => {-->
<!-- 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>-->

View File

@@ -0,0 +1,272 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
title="单据详情"
:visible.sync="dialogVisible"
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" size="mini" label-width="100px" label-suffix=":">
<el-form-item label="单据编号" prop="code">
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据类型" prop="form_type">
<el-input v-model="form.form_type" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据类型" prop="source_form_type">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据id" prop="source_form_id">
<el-input v-model="form.biz_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="业务单据时间" prop="source_form_date">
<!-- <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.biz_date" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="批次" prop="pcsn">
<el-input v-model="form.pcsn" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="物料数量" prop="qty">
<el-input v-model="form.qty" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="载具编号" prop="vehicle_code">
<el-input v-model="form.vehicle_code" disabled clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="单据状态" prop="status">
<el-select
v-model="form.status"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 180px;"
disabled
>
<el-option
v-for="item in formStatus"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
<!-- value-format="yyyy-MM-dd" :disabled="true"/>-->
<el-input v-model="form.create_time" disabled clearable style="width: 210px"/>
</el-form-item>
<template v-for="(col,index) in cols">
<el-form-item label="col.lable" prop="bill_code">
<label slot="label">{{ col.lable }}:</label>
<el-input disabled v-model="form.form_data[col.value]" :value="col.value" clearable style="width: 210px"/>
</el-form-item>
</template>
</el-form>
<div class="crud-opts2">
<span class="role-span2">单据明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="分配数量" show-overflow-tooltip/>
<el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_type" label="业务单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="source_form_date" label="业务单据时间" show-overflow-tooltip width="130"/>
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120"/>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
:label="item.lable">
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间"/>
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import {crud} from '@crud/crud'
import crudFormData, {getSonFormData} from './formData'
//import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
export default {
name: 'ViewDialog',
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
cols: [],
dtlCols: [],
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {},
formStatus: [
{
value: '10',
label: '生成'
},
{
value: '20',
label: '执行中'
},
{
value: '99',
label: '完成'
}
]
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
},
setForm(row) {
this.dialogVisible = true
this.form = row
let dtl_form_type = this.form.children[0].form_type;
// formstruc.getHeader(this.form.form_type).then(res => {
// this.cols = res
// })
// formstruc.getHeader(dtl_form_type).then(res => {
// this.dtlCols = res
// })
this.queryTableDtl(row.id)
},
close() {
this.dialogVisible = false
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
statusFormat(row) {
return this.dict.label.status[row.status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl(id) {
crudFormData.getSonFormData(id).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.status[row.status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,48 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/pmFormData',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/pmFormData',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/pmFormData',
method: 'put',
data
})
}
export function getFormType() {
return request({
url: 'api/bmFormStruc/getTypes',
method: 'get',
})
}
export function getParentFormTypes() {
return request({
url: 'api/bmFormStruc/getParentFormTypes',
method: 'get',
})
}
export function getSonFormData(id) {
return request({
url: 'api/pmFormData/getSonFormData/' + id,
method: 'get',
})
}
export default {add, edit, del, getFormType, getParentFormTypes, getSonFormData}

View File

@@ -0,0 +1,303 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="单据类型">
<el-select
v-model="query.form_type"
filterable
size="mini"
placeholder="请选择/搜索"
class="filter-item"
popper-append-to-body="false"
@change="crud.toQuery()"
>
<el-option
v-for="item in fromTypes"
:key="item.value"
:value="item.value"
:label="item.lable"
/>
</el-select>
</el-form-item>
<el-form-item label="单据编码">
<el-input
v-model="query.code"
clearable
size="mini"
placeholder="编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="单据状态">
<el-select
v-model="query.status"
size="mini"
placeholder="单据状态"
class="filter-item"
clearable
@change="crud.toQuery()"
>
<el-option
v-for="item in statusEnum.FORM_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<template v-for="(col,index) in cols" v-if="hideShowDialog">
<el-form-item label="col.lable">
<label slot="label">{{ col.lable }}:</label>
<el-input v-model="query.form_query[col.value]" :value="col.value" clearable style="width: 210px" />
</el-form-item>
</template>
<rrOperation :crud="crud" />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
size="mini"
type="success"
icon="el-icon-s-operation"
>
全部展开
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-upload2"
size="mini"
>
导入
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- icon="el-icon-view"-->
<!-- size="mini"-->
<!-- @click="hideShow"-->
<!-- >-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"
icon="el-icon-view"
size="mini"
@click="hideShow"
/>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
lazy
:data="crud.data"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-link v-if="scope.row.hasChildren" type="warning" @click="toView(scope.row)">{{
scope.row.code
}}
</el-link>
<span v-else>{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120" />
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
</template>
</el-table-column>
<!-- <el-table-column prop="vehicle_code" label="载具编号" show-overflow-tooltip width="120" />-->
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip />
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120" />
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120" />
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120" />
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
<el-table-column prop="unit_id" label="单位" show-overflow-tooltip width="120" />
<el-table-column prop="biz_code" label="业务单据编码" show-overflow-tooltip width="120" />
<el-table-column prop="biz_date" label="业务单据时间" show-overflow-tooltip width="130" />
<el-table-column prop="parent_id" label="父单据数据id" show-overflow-tooltip width="120" />
<el-table-column
v-for="(item, index) in cols"
:key="item.value"
width="130"
show-overflow-tooltip
:label="item.lable"
>
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" />
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120" />
<el-table-column
v-permission="['admin','Classstandard:edit','Classstandard:del']"
label="操作"
width="120px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
style="display: inline"
:data="scope.row"
:permission="permission"
:disabled-edit="scope.row.is_modify === '0'"
:disabled-dle="scope.row.is_modify === '0'"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<ViewDialog ref="viewDialog" />
</div>
</template>
<script>
import crudFormData from './formData'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
// import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
import ViewDialog from './ViewDialog'
// import UploadDialog from './UploadDialog'
const defaultForm = {
id: null,
code: null,
proc_inst_id: null,
biz_id: null,
boz_code: null,
biz_date: null,
form_type: null,
status: null,
create_time: null,
create_name: null,
material_id: null,
qty: null,
pcsn: null,
vehicle_code: null,
from_data: null,
parent_id: null
}
export default {
name: 'FormData',
dicts: ['base_data'],
components: { pagination, crudOperation, rrOperation, udOperation, ViewDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
statusEnums: ['FORM_STATUS'],
cruds() {
return CRUD({
title: '表单数据',
url: 'api/pmFormData',
idField: 'id',
sort: 'id,desc',
crudMethod: { ...crudFormData },
optShow: {
add: true,
reset: true
},
query: {
form_data: {}
}
})
},
data() {
return {
cols: [],
classes: [],
uploadShow: false,
fromTypes: [],
permission: {},
rules: {},
hideShowDialog: false,
formStatus: [
{
value: '10',
label: '生成'
},
{
value: '20',
label: '执行中'
},
{
value: '30',
label: '暂停'
},
{
value: '80',
label: '完成'
}
]
}
},
created() {
// 获取分类
this.getFromTypes()
},
mounted() {
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
if (this.fromTypes.length > 0) {
// formstruc.getHeader(this.query.form_type).then(res => {
// this.cols = res
// res.forEach(a => {
// this.form.form_data[a.value, '']
// this.$set(this.query, 'form_query', {})
// })
// })
// return true
}
return false
},
getFromTypes() {
crudFormData.getParentFormTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
this.fromTypes = res
if (this.fromTypes.length > 0) {
this.$set(this.query, 'form_type', this.fromTypes[0].value)
this.crud.toQuery()
}
})
},
hideShow() {
if (this.hideShowDialog) {
// this.$set(this.query, 'form_query', {})
}
this.hideShowDialog = !this.hideShowDialog
},
toView(row) {
if (row !== null) {
this.$refs.viewDialog.setForm(row)
}
}
}
}
</script>
<style scoped>
</style>