opt:对比菜单功能代码,删除不是本项目的功能代码
This commit is contained in:
@@ -1,344 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="输入供应商编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1200px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supp_code">
|
||||
<el-input v-model="form.supp_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称 " prop="supp_name">
|
||||
<el-input v-model="form.supp_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表">
|
||||
<el-input v-model="form.jurid_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税务登记号">
|
||||
<el-input v-model="form.tax_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工商注册号">
|
||||
<el-input v-model="form.register_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="经营许可证号">
|
||||
<el-input v-model="form.manage_lice_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照">
|
||||
<el-input v-model="form.busi_char_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="条码打印起始值">
|
||||
<el-input v-model="form.barcode_print" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮政编码">
|
||||
<el-input v-model="form.zip_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司电话">
|
||||
<el-input v-model="form.corp_tele_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司地址">
|
||||
<el-input v-model="form.corp_address" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资金计划履约天数">
|
||||
<el-input v-model="form.honour_days" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="基础分类" prop="class_id">
|
||||
<treeselect
|
||||
v-model="form.class_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 600px;" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="supp_code" label="供应商编码" />
|
||||
<el-table-column prop="supp_name" label="供应商名称 " />
|
||||
<el-table-column prop="corp_address" label="公司地址" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSupplierbase from '@/views/wms/basedata/master/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudClassstandard from '@/views/wms/basedata/master/customer/customerbase'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
const defaultForm = {
|
||||
supp_id: null,
|
||||
supp_code: null,
|
||||
supp_name: null,
|
||||
jurid_name: null,
|
||||
tax_no: null,
|
||||
register_no: null,
|
||||
manage_lice_no: null,
|
||||
busi_char_name: null,
|
||||
area_id: null,
|
||||
zip_code: null,
|
||||
corp_tele_no: null,
|
||||
corp_address: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_used_time: null,
|
||||
is_used: '1',
|
||||
is_delete: null,
|
||||
ext_id: null,
|
||||
barcode_print: null,
|
||||
class_code: null,
|
||||
remark: null,
|
||||
honour_days: null
|
||||
}
|
||||
export default {
|
||||
name: 'Supplierbase',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '供应商',
|
||||
url: 'api/supplierbase',
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'supp_id',
|
||||
sort: 'supp_id,desc',
|
||||
crudMethod: { ...crudSupplierbase }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
rules: {
|
||||
supp_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
supp_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
class_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (form.material_type_id != null) {
|
||||
this.getSubTypes(form.material_type_id)
|
||||
} else {
|
||||
this.getClass()
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
})
|
||||
},
|
||||
getClass() {
|
||||
crudClassstandard.getClass({ enabled: true, 'base_data_type': '04' }).then(res => {
|
||||
this.classes = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadClass({ 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)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.supp_code + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudSupplierbase.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,27 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/supplierbase/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -1,74 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/device',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/device/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/device',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorkprocedure() {
|
||||
return request({
|
||||
url: 'api/device/getWorkprocedure',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getItemByDevice(data) {
|
||||
return request({
|
||||
url: 'api/device/getItemByDevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function savaDeviceItem(data) {
|
||||
return request({
|
||||
url: 'api/device/savaDeviceItem',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getItemByDeviceId(data) {
|
||||
return request({
|
||||
url: 'api/device/getItemByDeviceId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function copyAdd(data) {
|
||||
return request({
|
||||
url: 'api/device/copyAdd',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/device/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive }
|
||||
@@ -1,151 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入设备编码或名称"
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="device_name">
|
||||
<el-input v-model="form.device_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备型号">
|
||||
<el-input v-model="form.device_model" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备产能">
|
||||
<el-input v-model="form.productivity" type="number" oninput="value = value.replace(/[^\d]/g, '')" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="外部编码">
|
||||
<el-input v-model="form.extend_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="device_model" label="设备型号" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="productivity" label="设备产能" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDevice from '@/views/wms/mps/device/device'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { device_id: null, device_code: null, device_name: null, device_model: null, workprocedure_id: null, extend_code: null, devicebill_id: null, remark: null, is_active: null, create_id: null, create_name: null, create_time: null, is_delete: null, productivity: null }
|
||||
export default {
|
||||
name: 'Device',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '生产设备', url: 'api/device', idField: 'device_id', sort: 'device_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudDevice }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用设备,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用设备,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudDevice.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,27 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/deviceitem',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/deviceitem/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/deviceitem',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -1,162 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.search" clearable placeholder="项点编码或名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="475px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="项点编码" prop="item_code">
|
||||
<el-input v-model="form.item_code" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项点名称" prop="item_name">
|
||||
<el-input v-model="form.item_name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序号" prop="order_seq">
|
||||
<el-input-number v-model="form.order_seq" controls-position="center" style="width: 250px;text-align: left" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认值数据类型" prop="data_type">
|
||||
<el-select
|
||||
v-model="form.data_type"
|
||||
placeholder=""
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ITEM_VALUE_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="默认值">
|
||||
<el-select
|
||||
v-if="form.data_type === '01'"
|
||||
v-model="form.default_value"
|
||||
style="width: 250px;"
|
||||
placeholder="请先选择默认值数据类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IS_OR_NOT"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-else-if="form.data_type === '02'" v-model="form.default_value" type="number" style="width: 250px;" />
|
||||
<el-input v-else v-model="form.default_value" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="item_code" label="项点编码" />
|
||||
<el-table-column prop="item_name" label="项点名称" />
|
||||
<el-table-column prop="order_seq" label="顺序号" />
|
||||
<el-table-column prop="default_value" label="默认值">
|
||||
<template slot-scope="scope">
|
||||
{{ is_or_no(scope.row.default_value, scope.row.data_type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="data_type" label="默认值数据类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.ITEM_VALUE_TYPE[scope.row.data_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDeviceitem from '@/views/wms/mps/item/deviceitem'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { data_type: '01', item_id: null, item_code: null, item_name: null, default_value: null, remark: null, order_seq: null }
|
||||
export default {
|
||||
name: 'Deviceitem',
|
||||
dicts: ['ITEM_VALUE_TYPE', 'IS_OR_NOT'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '生产设备扩展项', url: 'api/deviceitem', idField: 'item_id', sort: 'item_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudDeviceitem }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
item_code: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
item_name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
data_type: [
|
||||
{ required: true, message: '默认值数据类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'item_code', display_name: '项点编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
is_or_no(val, type) {
|
||||
if (type === '01' && val === '1') {
|
||||
return '是'
|
||||
} else if (type === '01' && val === '0') {
|
||||
return '否'
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,144 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.user_name === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="deleteRows(crud.selections)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" :min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="workprocedure_name" label="所属工序" :min-width="180" show-overflow-tooltip />
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudPersoncorrdevice from '@/views/wms/mps/personcorrdevice/personcorrdevice'
|
||||
import CRUD, { header, presenter, form } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
|
||||
const defaultForm = {
|
||||
user_id: null,
|
||||
user_name: null,
|
||||
team_person_device_id: null,
|
||||
jockey_id: null,
|
||||
device_id: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'DevicesDialog',
|
||||
components: { pagination, crudOperation },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/personcorrdevice/getDeviceByPerson',
|
||||
idField: 'team_person_device_id',
|
||||
query: { user_id: '', user_name: '' },
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ person: { user_id: this.query.user_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
tableLabel: [],
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader()
|
||||
return true
|
||||
},
|
||||
deleteRows(data) {
|
||||
this.$confirm('此操作将删除"' + data.length + '"条信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPersoncorrdevice.deleteRow({ user_id: this.query.user_id, rows: data }).then(res => {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
getHeader(workprocedure_id) {
|
||||
crudPersoncorrdevice.getHeader({ user_id: this.query.user_id }).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="设备选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入设备编码或名称"
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<label class="el-form-item-label">所属工序</label>
|
||||
<el-select v-model="query.workprocedure_id" filterable clearable size="small" placeholder="所属工序" class="filter-item" style="width: 220px" @change="changeHeader(query.search, query.workprocedure_id)">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;margin-top: 15px"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/views/wms/mps/personcorrdevice/personcorrdevice'
|
||||
import crudDevice from '@/views/wms/mps/device/device'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '设备选择', url: 'api/device', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: [],
|
||||
workList: [],
|
||||
tableLabel: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getWorkprocedure()
|
||||
this.getDeviceIdByUserId(this.user_id)
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (Number(row.device_id) === Number(person.device_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条设备信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addDevices({ user_id: this.user_id, devices: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
},
|
||||
changeHeader(search, workprocedure_id) {
|
||||
this.getHeader(search, workprocedure_id)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader(this.query.search, this.query.workprocedure_id)
|
||||
return true
|
||||
},
|
||||
getWorkprocedure() {
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
getHeader(search, workprocedure_id) {
|
||||
crudDevice.getItemByDeviceId({ search: search, workprocedure_id: workprocedure_id }).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
getDeviceIdByUserId(user_id) {
|
||||
crudPersoncorrdevice.getDeviceIdByUserId({ user_id: user_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<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-input
|
||||
v-model="query.blurry"
|
||||
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"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" />
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/views/wms/mps/personcorrdevice/personcorrdevice'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
setData(data) {
|
||||
this.tableData = data
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
console.log(this.tableData)
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addPersons({ persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入人员名称或者电话" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addDevice(scope.row)">添加设备</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>设备详情</span>
|
||||
</div>
|
||||
<DevicesDialog ref="devicesDialog" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="selectDeviceDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPersoncorrdevice from '@/views/wms/mps/personcorrdevice/personcorrdevice'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DevicesDialog from './DevicesDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
|
||||
const defaultForm = { team_person_device_id: null, jockey_id: null, device_id: null, user_id: null, user_name: null }
|
||||
export default {
|
||||
name: 'Personcorrdevice',
|
||||
components: { pagination, crudOperation, rrOperation, DevicesDialog, SelectPeersonDialog, SelectDeviceDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '人员设备维护', url: 'api/personcorrdevice', idField: 'jockey_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudPersoncorrdevice }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
selectDeviceDialog: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
addDevice(row) {
|
||||
this.$refs.selectDeviceDialog.setForm(row.user_id)
|
||||
this.selectDeviceDialog = true
|
||||
this.$refs.selectDeviceDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.devicesDialog) {
|
||||
this.$refs.devicesDialog.query.user_name = ''
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
this.$refs.selectPeersonDialog.setData(this.crud.data)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
// return true
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.devicesDialog.query.user_name = val.username
|
||||
this.$refs.devicesDialog.query.user_id = val.user_id
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,67 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getHeader(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/getHeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeviceIdByUserId(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/getDeviceIdByUserId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addDevices(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/addDevices',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRow(data) {
|
||||
return request({
|
||||
url: 'api/personcorrdevice/deleteRow',
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, addPersons, getHeader, getDeviceIdByUserId, deleteRow, addDevices }
|
||||
@@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.team_name === ''">
|
||||
<div class="my-code">点击查看人员详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" label="所属班组id">
|
||||
{{ query.team_id }}
|
||||
</el-table-column>
|
||||
<el-table-column label="所属班组">
|
||||
{{ query.team_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
// import crudStructrelamaterial from '@/api/wms/st/basedata/structrelamaterial'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
team_id: null,
|
||||
team_code: null,
|
||||
team_name: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'PersonDialog',
|
||||
components: { pagination, crudOperation },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员详情',
|
||||
url: 'api/teamcorrperson',
|
||||
idField: 'team_person_id',
|
||||
query: { team_id: '', team_name: '' },
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ team: { team_id: this.query.team_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
material_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeDelete](row) {
|
||||
return true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
<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-input
|
||||
v-model="query.blurry"
|
||||
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"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
team_id: '',
|
||||
personIds: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudTeamcorrperson.getPersonIdByTeamId({ team_id: this.team_id }).then(res => {
|
||||
this.personIds = res
|
||||
})
|
||||
},
|
||||
setForm(team_id) {
|
||||
this.team_id = team_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.personIds.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudTeamcorrperson.addPersons({ team_id: this.team_id, persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入编码或者名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="班组编码" prop="team_code">
|
||||
<el-input v-model="form.team_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="team_name">
|
||||
<el-input v-model="form.team_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属班制">
|
||||
<el-select v-model="form.classsystem_id" filterable clearable class="filter-item" style="width: 370px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.classsystem_id"
|
||||
:label="item.classsystem_name"
|
||||
:value="item.classsystem_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="team_code" label="班组编码" />
|
||||
<el-table-column prop="team_name" label="班组名称" />
|
||||
<el-table-column prop="is_active" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_active(scope.row.is_active)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_active)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人姓名" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addPerson(scope.row)">添加人员</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>人员详情</span>
|
||||
</div>
|
||||
<PersonDialog ref="personDialog" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudWorkteam from '@/views/wms/mps/teamcorrperson/workteam'
|
||||
import PersonDialog from './PersonDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
|
||||
const defaultForm = { team_id: null, team_code: null, team_name: null, classsystem_id: null, remark: null, is_active: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, sysdeptid: null, syscompanyid: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Teamcorrperson',
|
||||
components: { pagination, crudOperation, rrOperation, PersonDialog, SelectPeersonDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '班组', url: 'api/workteam', idField: 'team_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudWorkteam }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
permission: {},
|
||||
classList: [],
|
||||
personIds: [],
|
||||
rules: {
|
||||
team_code: [
|
||||
{ required: true, message: '班组编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
team_name: [
|
||||
{ required: true, message: '班组名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getClasssystem()
|
||||
},
|
||||
methods: {
|
||||
addPerson(row) {
|
||||
this.$refs.selectPeersonDialog.setForm(row.team_id)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.personDialog) {
|
||||
this.$refs.personDialog.query.team_name = ''
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
// return true
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.personDialog.query.team_name = val.team_name
|
||||
this.$refs.personDialog.query.team_id = val.team_id
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
format_is_active(is_active) {
|
||||
return is_active === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudWorkteam.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_active = !data.is_active
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getClasssystem() {
|
||||
crudWorkteam.getClasssystem().then(res => {
|
||||
this.classList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,43 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getPersonIdByTeamId(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/getPersonIdByTeamId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getPersonIdByTeamId, addPersons }
|
||||
@@ -1,42 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/workteam',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/workteam/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/workteam',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getClasssystem() {
|
||||
return request({
|
||||
url: 'api/workteam/getClasssystem',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/workteam/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClasssystem, changeActive }
|
||||
@@ -1,175 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="请选择设备"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row style="margin-bottom: 10px;">
|
||||
<el-col :span="22">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="模糊搜索:">
|
||||
<el-input v-model="query.search" placeholder="请输入编码、名称" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
|
||||
<el-table-column prop="device_model" label="设备型号" show-overflow-tooltip />
|
||||
<el-table-column prop="device_model" label="设备型号" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="外部编码" show-overflow-tooltip />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudDevice from '@/views/wms/mps/device/device'
|
||||
|
||||
export default {
|
||||
name: 'EndPointDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['sch_area_type', 'sch_point_type'],
|
||||
cruds() {
|
||||
return CRUD({ title: '设备', url: 'api/device', crudMethod: { ...crudDevice }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {
|
||||
search: ''
|
||||
},
|
||||
tableRadio: '',
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
material: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
debugger
|
||||
this.query.region_id = this.openParam
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请选择设备')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row>td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,29 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/incharge',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/incharge/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/incharge',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function charge(data) {
|
||||
return request({
|
||||
url: 'api/incharge/charge',
|
||||
@@ -32,4 +8,4 @@ export function charge(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, charge }
|
||||
export default { charge }
|
||||
|
||||
@@ -165,24 +165,20 @@
|
||||
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'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudInchargefrom from '@/views/wms/st/incharge/incharge'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
export default {
|
||||
name: 'Incharge',
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker, ViewDialog },
|
||||
components: { crudOperation, rrOperation, pagination, ViewDialog },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '入库冲销',
|
||||
url: 'api/incharge',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudInchargefrom },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
@@ -247,6 +243,9 @@ export default {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
charge() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
crudInchargefrom.charge(_selectData[0]).then(res => {
|
||||
|
||||
@@ -129,9 +129,6 @@
|
||||
style="width: 100%;"
|
||||
highlight-current-row
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
@@ -167,24 +164,20 @@
|
||||
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'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudOutchargefrom from '@/views/wms/st/outcharge/outcharge'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
export default {
|
||||
name: 'Outcharge',
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker, ViewDialog },
|
||||
components: { crudOperation, rrOperation, pagination, ViewDialog },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '出库冲销',
|
||||
url: 'api/outcharge',
|
||||
idField: 'iostorinv_id',
|
||||
sort: 'iostorinv_id,desc',
|
||||
crudMethod: { ...crudOutchargefrom },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
@@ -262,30 +255,8 @@ export default {
|
||||
bill_typeFormat(row, column) {
|
||||
return this.dict.label.ST_INV_OUT_TYPE[row.bill_type]
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(currentRow) {
|
||||
if (currentRow !== null) {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
charge() {
|
||||
debugger
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="请选择点位"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row style="margin-bottom: 10px;">
|
||||
<el-col :span="22">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="模糊搜索:">
|
||||
<el-input v-model="query.search" placeholder="请输入点位编码或名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="region_id">
|
||||
<el-select
|
||||
v-model="query.region_id"
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reginoList"
|
||||
:label="item.region_name"
|
||||
:value="item.region_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="point_code" label="终点点位编码" show-overflow-tooltip />
|
||||
<el-table-column prop="point_name" label="终点点位名称" show-overflow-tooltip />
|
||||
<el-table-column prop="region_name" label="所属区域" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_qty" label="载具数量" show-overflow-tooltip :formatter="formatQty" />
|
||||
<el-table-column prop="point_type" label="点位类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.sch_point_type[scope.row.point_type] }}
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudPoint from '@/views/wms/sch/point/point'
|
||||
|
||||
export default {
|
||||
name: 'EndPointDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['sch_area_type', 'sch_point_type'],
|
||||
cruds() {
|
||||
return CRUD({ title: '点位', url: 'api/point/selectPoint', crudMethod: { ...crudPoint }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {
|
||||
search: ''
|
||||
},
|
||||
tableRadio: '',
|
||||
tableData: [],
|
||||
reginoList: [],
|
||||
dialogVisible: false,
|
||||
material: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudPoint.getRegion().then(res => {
|
||||
this.reginoList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先选择终点点位')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.rows)
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatQty(row) {
|
||||
debugger
|
||||
if (row.vehicle_qty === '') {
|
||||
return '0'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row>td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,217 +0,0 @@
|
||||
<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-input
|
||||
v-model="query.bill_code"
|
||||
clearable
|
||||
placeholder="单据编号"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createTask"
|
||||
>
|
||||
生成任务
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="数量:" prop="vehicle_qty">
|
||||
<el-input v-model="form.vehicle_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起始点位:" prop="start_point_code">
|
||||
<el-input v-model="form.start_point_name" style="width: 370px;" @focus="openStartPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下一点位:">
|
||||
<el-input v-model="form.next_point_name" style="width: 370px;" @focus="openEndPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="record_uuid" label="记录标识" />
|
||||
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位" />
|
||||
<el-table-column prop="next_point_code" label="下一点位" />
|
||||
<el-table-column prop="start_region_name" label="起始区域" />
|
||||
<el-table-column prop="endt_region_name" label="终点区域" />
|
||||
<el-table-column prop="vehicle_qty" label="数量" />
|
||||
<el-table-column prop="task_uuid" label="任务标识" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150px" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<PointDialog :dialog-show.sync="pointDialog" @tableChanged2="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInemptyvehicl from '@/views/wms/st/vehiclebill/in/inemptyvehicl'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import PointDialog from '@/views/wms/st/vehiclebill/PointDialog'
|
||||
|
||||
const defaultForm = {
|
||||
record_uuid: null,
|
||||
bill_code: null,
|
||||
io_type: null,
|
||||
bill_status: null,
|
||||
vehicle_qty: null,
|
||||
start_point_code: null,
|
||||
next_point_code: null,
|
||||
start_point_name: null,
|
||||
next_point_name: null,
|
||||
start_region_id: null,
|
||||
end_region_id: null,
|
||||
task_uuid: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'Inemptyvehicle',
|
||||
dicts: ['st_bill_status'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, PointDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '空载具入库',
|
||||
url: 'api/inemptyvehicle',
|
||||
idField: 'record_uuid',
|
||||
sort: 'record_uuid,desc',
|
||||
crudMethod: { ...crudInemptyvehicl },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pointDialog: false,
|
||||
is_startAndEnd: null,
|
||||
loading: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
vehicle_qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
start_point_code: [
|
||||
{ required: true, message: '起始点位不能为空', trigger: 'blur' }
|
||||
],
|
||||
next_point_code: [
|
||||
{ required: true, message: '终点点位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openStartPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '1'
|
||||
this.pointDialog = true
|
||||
},
|
||||
openEndPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '2'
|
||||
this.pointDialog = true
|
||||
},
|
||||
tableChanged2(row) {
|
||||
if (this.is_startAndEnd === '1') {
|
||||
this.form.start_point_code = row.point_code
|
||||
this.form.start_point_name = row.point_name
|
||||
}
|
||||
if (this.is_startAndEnd === '2') {
|
||||
this.form.next_point_code = row.point_code
|
||||
this.form.next_point_name = row.point_name
|
||||
}
|
||||
},
|
||||
createTask() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData[0].bill_status !== '10') {
|
||||
return this.crud.notify('只能对生成状态的单据生成任务', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const data = _selectData[0]
|
||||
this.loading = true
|
||||
crudInemptyvehicl.createTask(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loading = false
|
||||
}).cache(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/inemptyvehicle',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inemptyvehicle/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inemptyvehicle',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function createTask(data) {
|
||||
return request({
|
||||
url: 'api/inemptyvehicle/createTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, createTask }
|
||||
@@ -1,217 +0,0 @@
|
||||
<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-input
|
||||
v-model="query.bill_code"
|
||||
clearable
|
||||
placeholder="单据编号"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createTask"
|
||||
>
|
||||
生成任务
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="数量:" prop="vehicle_qty">
|
||||
<el-input v-model="form.vehicle_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起始点位:">
|
||||
<el-input v-model="form.start_point_name" style="width: 370px;" @focus="openStartPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下一点位:" prop="next_point_code">
|
||||
<el-input v-model="form.next_point_name" style="width: 370px;" @focus="openEndPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="record_uuid" label="记录标识" />
|
||||
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位" />
|
||||
<el-table-column prop="next_point_code" label="下一点位" />
|
||||
<el-table-column prop="start_region_name" label="起始区域" />
|
||||
<el-table-column prop="endt_region_name" label="终点区域" />
|
||||
<el-table-column prop="vehicle_qty" label="数量" />
|
||||
<el-table-column prop="task_uuid" label="任务标识" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150px" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<PointDialog :dialog-show.sync="pointDialog" @tableChanged2="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOutemptyvehicl from '@/views/wms/st/vehiclebill/out/outemptyvehicl'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import PointDialog from '@/views/wms/st/vehiclebill/PointDialog'
|
||||
|
||||
const defaultForm = {
|
||||
record_uuid: null,
|
||||
bill_code: null,
|
||||
io_type: null,
|
||||
bill_status: null,
|
||||
vehicle_qty: null,
|
||||
start_point_code: null,
|
||||
next_point_code: null,
|
||||
start_point_name: null,
|
||||
next_point_name: null,
|
||||
start_region_id: null,
|
||||
end_region_id: null,
|
||||
task_uuid: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'Outemptyvehicle',
|
||||
dicts: ['st_bill_status'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, PointDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '空载具出库',
|
||||
url: 'api/outemptyvehicle',
|
||||
idField: 'record_uuid',
|
||||
sort: 'record_uuid,desc',
|
||||
crudMethod: { ...crudOutemptyvehicl },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pointDialog: false,
|
||||
is_startAndEnd: null,
|
||||
loading: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
vehicle_qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
start_point_code: [
|
||||
{ required: true, message: '起始点位不能为空', trigger: 'blur' }
|
||||
],
|
||||
next_point_code: [
|
||||
{ required: true, message: '终点点位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openStartPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '1'
|
||||
this.pointDialog = true
|
||||
},
|
||||
openEndPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '2'
|
||||
this.pointDialog = true
|
||||
},
|
||||
tableChanged2(row) {
|
||||
if (this.is_startAndEnd === '1') {
|
||||
this.form.start_point_code = row.point_code
|
||||
this.form.start_point_name = row.point_name
|
||||
}
|
||||
if (this.is_startAndEnd === '2') {
|
||||
this.form.next_point_code = row.point_code
|
||||
this.form.next_point_name = row.point_name
|
||||
}
|
||||
},
|
||||
createTask() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData[0].bill_status !== '10') {
|
||||
return this.crud.notify('只能对生成状态的单据生成任务', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const data = _selectData[0]
|
||||
this.loading = true
|
||||
crudOutemptyvehicl.createTask(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loading = false
|
||||
}).cache(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/outemptyvehicle',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/outemptyvehicle/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/outemptyvehicle',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function createTask(data) {
|
||||
return request({
|
||||
url: 'api/outemptyvehicle/createTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, createTask }
|
||||
@@ -1,319 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
|
||||
<el-form-item label="仓库">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
style="width: 220px;"
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storList"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<label slot="label">日 期:</label>
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item label="子卷批次">
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
placeholder="请输入子卷批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="木箱号">
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.package_box_sn"
|
||||
clearable
|
||||
placeholder="请输入木箱号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="sap批次">
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.sap_pcsn"
|
||||
clearable
|
||||
placeholder="请输入sap批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" :cell-style="cellStyleMst" show-summary :summary-method="getSum" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column prop="stor_name" label="仓库"/>
|
||||
<el-table-column prop="sect_date" label="日期" width="100px" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_model" label="规格/型号" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="pcsn" label="批次号" min-width="140" show-overflow-tooltip/>
|
||||
<el-table-column prop="sap_pcsn" label="sap批次" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="package_box_sn" label="木箱号" width="250px" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="start_num" label="期初主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<el-table-column prop="in_num" label="入库主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<el-table-column prop="out_num" label="出库主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<el-table-column prop="end_num" label="结存主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudIostordaily from '@/views/wms/statistics/sendReceiveQuery/iostordaily'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
const defaultForm = {
|
||||
stordaily_id: null,
|
||||
stor_id: null,
|
||||
stor_code: null,
|
||||
stor_name: null,
|
||||
sect_date: null,
|
||||
material_id: null,
|
||||
quality_scode: null,
|
||||
pcsn: null,
|
||||
ivt_level: null,
|
||||
is_active: null,
|
||||
start_num: null,
|
||||
in_num: null,
|
||||
out_num: null,
|
||||
more_num: null,
|
||||
less_num: null,
|
||||
end_num: null,
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null
|
||||
}
|
||||
export default {
|
||||
name: 'SendReceiveQuery',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '收发存查询',
|
||||
url: 'api/iostordaily',
|
||||
idField: 'stordaily_id',
|
||||
sort: '',
|
||||
crudMethod: { ...crudIostordaily },
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
QualityList: [],
|
||||
IvtList: [],
|
||||
class_idStr: null,
|
||||
storList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudUserStor.getUserStor().then(res => {
|
||||
this.storList = res
|
||||
})
|
||||
const param = {
|
||||
'materOpt_code': '00'
|
||||
}
|
||||
/* crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})*/
|
||||
/* crudBucketrecord.getQualityList().then(res => {
|
||||
this.QualityList = res
|
||||
})
|
||||
crudBucketrecord.getIvtList().then(res => {
|
||||
this.IvtList = res
|
||||
})*/
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatIvtName(row, column) {
|
||||
for (const item of this.IvtList) {
|
||||
if (item.code === row.ivt_level) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
formatQualityName(row, column) {
|
||||
for (const item of this.QualityList) {
|
||||
if (item.code === row.quality_scode) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
formatIsName(row, column) {
|
||||
if (row.is_active === '1') {
|
||||
return '是'
|
||||
} else if (row.is_active === '0') {
|
||||
return '否'
|
||||
}
|
||||
},
|
||||
getSum(param) {
|
||||
// 将所有number的字段合计
|
||||
const {columns, data} = param
|
||||
const sums = []
|
||||
let values = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'start_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'in_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'out_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'end_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'more_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'less_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else {
|
||||
sums[index] = '--'
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
cellStyleMst({ row, column, rowIndex, columnIndex }) {
|
||||
if (column.property === 'dept_name') {
|
||||
if (row.is_yellow !== undefined) {
|
||||
return 'background: yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,34 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/iostordaily/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStor() {
|
||||
return request({
|
||||
url: 'api/iostordaily/getStor',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStor }
|
||||
Reference in New Issue
Block a user