初始化

This commit is contained in:
lyd
2022-10-15 15:31:18 +08:00
parent b9d1c04bb5
commit c61b5e4641
1123 changed files with 187 additions and 1440 deletions

View File

@@ -0,0 +1,175 @@
<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>

View File

@@ -0,0 +1,212 @@
<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="物料类别">
<treeselect
v-model="query.material_type_id"
:load-options="loadClass"
:options="classes"
style="width: 200px;"
placeholder="选择物料类别"
/>
</el-form-item>
<el-form-item label="模糊搜索">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@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="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" min-width="200" show-overflow-tooltip />
<el-table-column prop="material_spec" label="规格" show-overflow-tooltip />
<el-table-column prop="material_model" label="型号" show-overflow-tooltip />
<el-table-column prop="class_code" label="分类编码" show-overflow-tooltip />
<el-table-column prop="class_name" label="物料分类" show-overflow-tooltip />
<el-table-column prop="unit_name" label="计量单位" />
</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 crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudClassstandard from '@/views/wms/basedata/master/customer/customerbase'
export default {
name: 'MaterDtl',
components: { rrOperation, pagination, Treeselect },
cruds() {
return CRUD({ title: '物料', url: 'api/Materialbase', crudMethod: { ...crudMaterialbase }, optShow: {}})
},
mixins: [presenter(), header()],
dicts: ['product_series'],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
}
},
data() {
return {
dialogVisible: false,
classes: [],
tableRadio: null,
class_idStr: null,
checkrow: null,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
return this.dict.label.product_series[row.product_series]
},
open() {
const param = {
'materOpt_code': this.materOptCode
}
crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = res.class_idStr
this.crud.toQuery()
this.queryClassId()
})
},
queryClassId() {
const param = {
'class_idStr': this.class_idStr
}
crudClassstandard.queryClassById(param).then(res => {
this.classes = res.content.map(obj => {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
handleSelectionChange(val, row) {
if (this.isSingle) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('setMaterValue', 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('setMaterValue', this.rows)
},
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)
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,178 @@
<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="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="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: [],
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('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()
}
}
}
</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>