init project

This commit is contained in:
2022-06-27 09:50:26 +08:00
parent b3fcd339ea
commit b5da790c94
644 changed files with 94073 additions and 0 deletions

View File

@@ -0,0 +1,237 @@
<template>
<el-dialog
title="桶记录选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-select
v-model="query.storagevehicle_type"
placeholder="桶类别"
clearable
>
<el-option
v-for="item in dict.MD_BUCKET_TYPE"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="6">
<el-input
v-model="query.bucketunique"
clearable
style="width: 200px"
size="mini"
placeholder="桶号"
class="filter-item"
/>
</el-col>
<el-col :span="6">
<el-select
v-model="query.status"
placeholder="状态"
clearable
>
<el-option
v-for="item in dict.bucket_status"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<el-row style="padding-top: 10px;padding-bottom: 10px;">
<el-col :span="6">
<el-input
v-model="query.storagevehicle_code"
clearable
style="width: 200px"
size="mini"
placeholder="载具"
class="filter-item"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.material_search"
clearable
style="width: 200px"
size="mini"
placeholder="物料编码、名称"
class="filter-item"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.pcsn"
clearable
style="width: 200px"
size="mini"
placeholder="批次"
class="filter-item"
/>
</el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="bucketunique" label="桶号" min-width="150" show-overflow-tooltip/>
<el-table-column prop="label" label="桶类别" />
<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="pcsn" label="批次" />
<el-table-column prop="storage_qty" label="数量">
<template slot-scope="scope">
{{ fun(scope.row.storage_qty) }}
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" />
<el-table-column prop="quality_scode" :formatter="qualityFormat" label="品质类型" />
<el-table-column prop="ivt_level" :formatter="ivtFormat" label="库存等级" />
<el-table-column prop="is_active" :formatter="activeFormat" label="是否可用" />
<el-table-column prop="storagevehicle_code" label="载具号" />
<el-table-column prop="record_order" label="顺序号" />
<el-table-column prop="bag_qty" 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 CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudStructattr from '@/api/wms/basedata/st/structattr'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'BucketDiv',
components: { crudOperation, rrOperation, pagination },
cruds() {
return CRUD({
title: '桶',
optShow: {},
query: { pcsn: '', storagevehicle_type: '', status: '', bucketunique: '', storagevehicle_code: '', material_search: '' },
url: 'api/Bucket',
idField: 'bucket_record_id',
sort: 'bucket_record_id,desc',
crudMethod: { ...crudStructattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
bucketProp: {
type: Object,
default: {}
}
},
dicts: ['MD_BUCKET_TYPE', 'bucket_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'IS_OR_NOT'],
data() {
return {
sects: [],
classes: [],
dialogVisible: false,
bucket: {},
checkrow: {},
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
bucketProp: {
handler(newValue, oldValue) {
this.bucket = newValue
this.crud.query.material_search = this.bucket.material_code
this.crud.query.pcsn = this.bucket.pcsn
this.crud.query.status = this.bucket.bucket_status
this.crud.query.storagevehicle_type = this.bucket.storagevehicle_type
this.crud.query.is_active = this.bucket.is_active
this.crud.query.quality_scode = this.bucket.quality_scode
this.crud.query.ivt_level = this.bucket.ivt_level
this.crud.toQuery()
}
}
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
open() {
crudSectattr.getSect().then(res => {
this.sects = res.content
})
this.crud.toQuery()
},
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()
},
close() {
this.crud.resetQuery()
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选仓位')
return
}
this.$emit('update:dialogShow', false)
this.$emit('bucketChange', this.checkrow)
},
qualityFormat(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
ivtFormat(row, column) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
activeFormat(row, column) {
return this.dict.label.IS_OR_NOT[row.is_active]
}
}
}
</script>

View File

@@ -0,0 +1,174 @@
<template>
<el-dialog
title="设备选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-input
v-model="query.device_code"
clearable
style="width: 200px"
size="mini"
placeholder="请输入设备编码、名称、外部编码"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
<el-col :span="6" >
<el-select
v-model="query.workprocedure_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
style="width: 200px;"
v-show="disablePro"
>
<el-option
v-for="item in workProcedureList"
:label="item.workprocedure_name"
:value="item.workprocedure_id"
/>
</el-select>
</el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="device_code" label="设备编码" width="130px" />
<el-table-column prop="device_name" label="设备名称" />
<el-table-column prop="extend_code" label="外部编码" />
<el-table-column prop="device_model" label="设备型号" />
<el-table-column prop="device_specification" label="设备规格" />
<el-table-column prop="workprocedure_name" label="工序名称" />
<el-table-column prop="manufacturer" label="供应商" />
<el-table-column prop="device_attribute_name" label="设备属性" />
<el-table-column prop="is_produceuse" label="生产用途" :formatter="formatProduceuserName" />
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150px" />
</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 crudDeviceinfo from '@/api/wms/basedata/em/deviceinfo'
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
export default {
name: 'DeviceDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: '设备信息',
optShow: {},
url: 'api/deviceinfo',
idField: 'device_id',
sort: '',
query: { device_code: '', workprocedure_id: '' }
})
},
dicts: ['IS_OR_NOT'],
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
workProcedureList: [],
produceuseList: [],
dialogVisible: false,
checkrow: {},
disablePro: true,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
created() {
crudWorkProcedure.downSelect().then(res => {
this.workProcedureList = res
})
crudDeviceinfo.getProduceuseList().then(res => {
this.produceuseList = res
})
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.disablePro = false
this.crud.query.workprocedure_id = msg
this.crud.toQuery()
},
formatProduceuserName(row, column) {
for (const item of this.produceuseList) {
if (item.code === row.is_produceuse) {
return item.name
}
}
},
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()
},
close() {
this.crud.resetQuery()
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选设备')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)
}
}
}
</script>

View File

@@ -0,0 +1,228 @@
<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="型号" min-width="130" show-overflow-tooltip />
<el-table-column
show-overflow-tooltip
:formatter="seriesFormat"
min-width="100"
prop="product_series"
label="系列"
/>
<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 '@/api/wms/basedata/master/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 '@/api/wms/basedata/master/classstandard'
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
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: [],
XLList: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
created() {
crudseriesProcessRoute.getXLlist2().then(res => {
this.XLList = res
})
},
methods: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
for (const item of this.XLList) {
if (item.id === row.product_series) {
return item.name
}
}
},
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('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)
},
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,230 @@
<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="型号" min-width="130" show-overflow-tooltip />
<el-table-column prop="class_code" label="分类编码" min-width="100" show-overflow-tooltip/>
<el-table-column prop="class_name" label="物料分类" />
<el-table-column
show-overflow-tooltip
:formatter="seriesFormat"
min-width="100"
prop="product_series"
label="系列"
/>
<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 '@/api/wms/basedata/master/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 '@/api/wms/basedata/master/classstandard'
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
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: [],
XLList: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
created() {
crudseriesProcessRoute.getXLlist2().then(res => {
this.XLList = res
})
},
methods: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
for (const item of this.XLList) {
if (item.id === row.product_series) {
return item.name
}
}
},
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('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)
},
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,181 @@
<template>
<el-dialog
title="点位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-select
v-model="query.area_type"
:disabled="typeDisable"
clearable
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in sch_area_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="6">
<el-input
v-model="query.name"
clearable
style="width: 200px"
size="mini"
placeholder="输入点位编码或名称"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="point_code" label="点位编码" align="center" />
<el-table-column prop="point_name" label="点位名称" align="center" />
<el-table-column prop="area_type_name" label="所属区域" align="center" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import crudPoint from '@/api/wms/sch/point'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import checkoutbill, { schAreaType } from '@/api/wms/st/core/outbill/checkoutbill'
export default {
name: 'PointDialog',
components: { crudOperation, rrOperation, pagination },
cruds() {
return CRUD({ title: '点位',
url: 'api/point',
query: { area_type: '', name: '' },
crudMethod: { ...crudPoint },
optShow: {}})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
dialogAreatype: {
type: String
},
dialogTypedisable: {
type: Boolean,
default: false
}
},
data() {
return {
classes: [],
dialogVisible: false,
areaType: '',
typeDisable: false,
sch_area_type: [],
checkrow: {},
lock: '',
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
dialogTypedisable: {
handler(newValue, oldValue) {
this.typeDisable = newValue
}
},
dialogAreatype: {
handler(newValue, oldValue) {
this.areaType = newValue
checkoutbill.schAreaType({ ids: this.areaType }).then(res => {
this.sch_area_type = res
})
}
}
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.lock = '00'
this.areaType = msg
},
open() {
this.crud.query.ids = this.areaType
this.crud.query.lock_type = this.lock
checkoutbill.schAreaType({ ids: this.areaType }).then(res => {
this.sch_area_type = res
})
this.crud.toQuery()
},
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()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
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('PointChanged', this.checkrow)
}
}
}
</script>

View File

@@ -0,0 +1,201 @@
<template>
<el-dialog
title="货位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-cascader
placeholder="所属库区"
v-model="query.sect"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="material_height_type_name" label="高度类型" />
<el-table-column prop="sect_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 CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudStructattr from '@/api/wms/basedata/st/structattr'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'StructDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: '仓位',
optShow: {},
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
query: { search: '', is_lock: '1', lock_type: '',sect_id: '', stor_id: '' },
crudMethod: { ...crudStructattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object
}
},
data() {
return {
sects: [],
classes: [],
dialogVisible: false,
sect: {},
checkrow: {},
rows: [],
dialogDis: true,
lock: ''
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
debugger
this.sect = newValue
}
}
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.dialogDis = msg
this.lock = '00'
},
[CRUD.HOOK.beforeRefresh]() {
this.query.lock_type = this.lock
return true
},
open() {
crudSectattr.getSect().then(res => {
this.sects = res.content
})
debugger
if (this.sect) {
this.query.sect = this.sect
if (this.sect.length === 1) {
this.query.stor_id = this.sect[0]
this.query.sect_id = ''
}
if (this.sect.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sect.length === 2) {
this.query.stor_id = this.sect[0]
this.query.sect_id = this.sect[1]
}
}
this.query.is_lock = '1'
this.query.lock_type = this.lock
this.query.is_used = '1'
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选仓位')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)
}
}
}
</script>