zds
3 months ago
8 changed files with 28 additions and 621 deletions
@ -1,166 +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> |
|||
<el-form-item label="是否启用"> |
|||
<el-switch |
|||
v-model="query.is_used" |
|||
:active-value="true" |
|||
:inactive-value="false" |
|||
/> |
|||
</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'}" |
|||
@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="物料编码" width="160" /> |
|||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip /> |
|||
<el-table-column prop="material_spec" label="物料规格" width="140" /> |
|||
<!-- <el-table-column prop="class_name" label="物料分类" width="140" />--> |
|||
<el-table-column prop="standing_time" label="回温时间(小时)" width="130px" /> |
|||
<el-table-column prop="update_name" label="修改人" /> |
|||
<el-table-column prop="update_time" label="修改时间" width="135" /> |
|||
</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 '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|||
|
|||
export default { |
|||
name: 'MaterialDialog', |
|||
components: { rrOperation, pagination }, |
|||
dicts: ['is_used'], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '生产任务', |
|||
url: 'api/mdBaseMaterial', |
|||
optShow: {}, |
|||
query: { |
|||
is_used: true |
|||
} |
|||
}) |
|||
}, |
|||
mixins: [presenter(), header()], |
|||
props: { |
|||
dialogShow: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isSingle: { |
|||
type: Boolean, |
|||
default: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
tableRadio: null, |
|||
tableData: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
dialogShow: { |
|||
handler(newValue) { |
|||
this.dialogVisible = newValue |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
clickChange(item) { |
|||
this.tableRadio = item |
|||
}, |
|||
open() { |
|||
|
|||
}, |
|||
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() { |
|||
// 处理单选 |
|||
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) |
|||
} |
|||
} |
|||
} |
|||
</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.workorder_code" |
|||
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'}" |
|||
@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="workorder_code" label="工单编号" width="120px" /> |
|||
<el-table-column v-if="false" prop="material_id" label="物料标识" /> |
|||
<el-table-column prop="workshop_code" label="所属车间" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="update_name" label="修改人" /> |
|||
<el-table-column prop="update_time" label="修改时间" width="150" /> |
|||
</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 '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|||
|
|||
export default { |
|||
name: 'WorkOrderDialog', |
|||
components: { rrOperation, pagination }, |
|||
dicts: ['is_used', 'vehicle_type'], |
|||
cruds() { |
|||
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorder', optShow: {}}) |
|||
}, |
|||
mixins: [presenter(), header()], |
|||
props: { |
|||
dialogShow: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isSingle: { |
|||
type: Boolean, |
|||
default: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
tableRadio: null, |
|||
tableData: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
dialogShow: { |
|||
handler(newValue) { |
|||
this.dialogVisible = newValue |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
clickChange(item) { |
|||
this.tableRadio = item |
|||
}, |
|||
open() { |
|||
|
|||
}, |
|||
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() { |
|||
// 处理单选 |
|||
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) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
::v-deep .el-dialog__body { |
|||
padding-top: 0px; |
|||
} |
|||
</style> |
|||
|
@ -1,35 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/material', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/material/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/material', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getGroup(data) { |
|||
return request({ |
|||
url: 'api/material/getGroup', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del, getGroup } |
Loading…
Reference in new issue