新增
This commit is contained in:
230
mes/qd/src/views/wms/pdm/produce/dailyplan/AddDialog.vue
Normal file
230
mes/qd/src/views/wms/pdm/produce/dailyplan/AddDialog.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="日计划编辑"
|
||||
width="800px"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="115px" label-suffix=":">
|
||||
<el-form-item label="日计划编码" prop="plan_code">
|
||||
<label slot="label">日计划编码:</label>
|
||||
<el-input v-model="form.plan_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划生产日期" prop="planstart_date">
|
||||
<el-date-picker v-model="form.planstart_date" value-format="yyyy-MM-dd" type="date" placeholder="选择开始时间" style="width: 210px" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划类型" prop="workorder_type">
|
||||
<el-select
|
||||
v-model="form.workorder_type"
|
||||
placeholder="计划类型"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.workorder_type2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货日期" prop="plan_finish_date">
|
||||
<el-date-picker v-model="form.plan_finish_date" value-format="yyyy-MM-dd" type="date" style="width: 210px" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品" prop="material_code">
|
||||
<label slot="label">产品:</label>
|
||||
<el-input v-model="form.material_code" style="width: 210px" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系列" prop="product_series_id">
|
||||
<el-select
|
||||
v-model="form.product_series_id"
|
||||
placeholder=""
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in XLList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申报单位" prop="plan_org_code">
|
||||
<el-select
|
||||
v-model="form.plan_org_code"
|
||||
placeholder=""
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="product_weight">
|
||||
<label slot="label">重量(KG):</label>
|
||||
<el-input-number
|
||||
v-model="form.product_weight"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="1"
|
||||
:disabled="crud.status.view > 0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键设备" prop="device_id">
|
||||
<label slot="label">关键设备:</label>
|
||||
<el-select
|
||||
v-model="form.device_id"
|
||||
size="mini"
|
||||
placeholder="关键设备"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/></el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 480px;" rows="3" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<DeviceDialog :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button slot="left" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
<el-button slot="left" type="primary" :loading="crud.cu === 2" @click="crud.submitCU">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import DeviceDialog from '@/views/wms/pub/DeviceDialog'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
import workorder from '@/api/wms/pdm/workorder'
|
||||
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||
import producetask from '@/api/wms/pdm/producetask'
|
||||
import Date from '@/utils/datetime'
|
||||
|
||||
const defaultForm = {
|
||||
plan_code: '',
|
||||
material_code: '',
|
||||
material_id: '',
|
||||
device_name: '',
|
||||
device_id: '',
|
||||
plan_org_code: '',
|
||||
plan_org_name: '',
|
||||
status: '10',
|
||||
product_series_id: '',
|
||||
product_weight: '500',
|
||||
workorder_type: '02',
|
||||
remark: '',
|
||||
plan_finish_date: new Date().daysLater(5),
|
||||
planstart_date: new Date().daysLater(5)
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { DeviceDialog, MaterDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['workorder_status', 'workorder_type2', 'product_series'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
materType: '05',
|
||||
XLList: [],
|
||||
Depts: [],
|
||||
Devices: [],
|
||||
materShow: false,
|
||||
rules: {
|
||||
plan_finish_date: [
|
||||
{ required: true, message: '交货日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
planstart_date: [
|
||||
{ required: true, message: '计划生产日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
workorder_type: [
|
||||
{ required: true, message: '计划类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_org_code: [
|
||||
{ required: true, message: '申报单位不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '产品不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_series_id: [
|
||||
{ required: true, message: '系列不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_weight: [
|
||||
{ required: true, message: '重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
producetask.getDevices().then(res => {
|
||||
this.Devices = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
async queryMater(index, row) {
|
||||
this.materShow = true
|
||||
},
|
||||
tableChanged2(row) {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.product_series_id = row.product_series
|
||||
this.form.weight_unit_id = row.base_unit_id
|
||||
this.form.weight_unit_name = row.base_unit_id_name
|
||||
this.form.pcsn = ''
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.device_id = row.device_id
|
||||
this.form.device_name = row.device_name
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
345
mes/qd/src/views/wms/pdm/produce/dailyplan/index.vue
Normal file
345
mes/qd/src/views/wms/pdm/produce/dailyplan/index.vue
Normal file
@@ -0,0 +1,345 @@
|
||||
<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-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@input="onInput()"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键设备">
|
||||
<label slot="label">关键设备:</label>
|
||||
<el-select
|
||||
v-model="query.device_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="关键设备"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日计划编号">
|
||||
<el-input
|
||||
v-model="query.plan_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入日计划编号"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@change="MyQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.planstatus"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划类型">
|
||||
<el-select
|
||||
v-model="query.workorder_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="计划类型"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@change="MyQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.workorder_type2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="save()"
|
||||
>
|
||||
重排
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="downdtl()"
|
||||
>
|
||||
导出excel
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="createWork()"
|
||||
>
|
||||
生成工令
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column
|
||||
v-permission="['admin','workorder:del','workorder:edit']"
|
||||
min-width="130"
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="plan_code" label="日计划编码" width="120" />
|
||||
<el-table-column :formatter="seriesFormat" min-width="80" prop="product_series_id" label="系列产线" />
|
||||
<el-table-column prop="device_code" label="关键设备" width="100" />
|
||||
<el-table-column prop="planstart_date" label="计划开始日期" width="100" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位" width="100" />
|
||||
<el-table-column prop="workorder_type" label="计划类型" :formatter="workorder_typeFormat" min-width="120" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="120"/>
|
||||
<el-table-column prop="old_mark" label="牌号" />
|
||||
<el-table-column :formatter="seriesFormat" min-width="80" prop="mater_product_series" label="产品系列" />
|
||||
<el-table-column prop="product_weight" label="生产重量(kg)" :formatter="crud.formatNum3" min-width="120" />
|
||||
<el-table-column prop="planend_date" label="计划结束日期" width="100" />
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="100" />
|
||||
<el-table-column prop="day_num" label="提前天数" width="90" :formatter="crud.formatNum0" />
|
||||
<el-table-column :formatter="stateFormat" min-width="80" prop="status" label="状态" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="140px" />
|
||||
<el-table-column prop="create_name" label="创建人" width="100" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import producetask from '@/api/wms/pdm/producetask'
|
||||
import dailyplan from '@/api/wms/pdm/dailyplan'
|
||||
import AddDialog from '@/views/wms/pdm/produce/dailyplan/AddDialog'
|
||||
import CRUD, { presenter, header, 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'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import workorder from '@/api/wms/pdm/workorder'
|
||||
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'dailyplan',
|
||||
dicts: ['product_mode', 'workorder_type2', 'planstatus'],
|
||||
components: { crudOperation, rrOperation, udOperation, AddDialog, pagination },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '日计划管理',
|
||||
url: 'api/dailyplan',
|
||||
idField: 'dailyplan_id',
|
||||
sort: 'dailyplan_id',
|
||||
query: { device_id: '' },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: { 'Authorization': getToken() },
|
||||
permission: {
|
||||
add: ['admin', 'workorder:add'],
|
||||
edit: ['admin', 'workorder:edit'],
|
||||
del: ['admin', 'workorder:del']
|
||||
},
|
||||
dialogVisible: false,
|
||||
save_flag: true,
|
||||
sub_flag: true,
|
||||
Depts: [],
|
||||
Devices: [],
|
||||
Capacitytes: [],
|
||||
XLList: [],
|
||||
fileList: [],
|
||||
checkrows: [],
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
|
||||
producetask.getDevices().then(res => {
|
||||
this.Devices = res
|
||||
})
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
producetask.getCapacitytes().then(res => {
|
||||
this.Capacitytes = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.status === '01'
|
||||
},
|
||||
canUd(row) {
|
||||
return row.status !== '01'
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.planstatus[row.status]
|
||||
},
|
||||
workorder_typeFormat(row) {
|
||||
return this.dict.label.workorder_type2[row.workorder_type]
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
MyQuery(value) {
|
||||
if (value === '1') {
|
||||
this.save_flag = false
|
||||
} else {
|
||||
this.save_flag = true
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
seriesFormat(row) {
|
||||
for (const item of this.XLList) {
|
||||
if (item.id === row.product_series) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
save() {
|
||||
this.checkrows = this.$refs.table.data
|
||||
if (this.checkrows.length === 0) {
|
||||
this.crud.notify('重排记录数不能为0!')
|
||||
return false
|
||||
}
|
||||
if(this.crud.query.device_id === '' || this.crud.query.device_id === undefined ){
|
||||
this.crud.notify('请先选择关键设备!')
|
||||
return false
|
||||
}
|
||||
/* dailyplan.submit2({ query: this.crud.query, rows: this.checkrows} ).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
})*/
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
},
|
||||
downdtl() {
|
||||
crud.downloadLoading = true
|
||||
download('/api/dailyplan/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '日计划', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
},
|
||||
createWork() {
|
||||
this.checkrows = this.$refs.table.selection
|
||||
if (this.checkrows.length === 0) {
|
||||
this.crud.notify('请勾选需要操作的记录!')
|
||||
return false
|
||||
}
|
||||
dailyplan.submit({ query: this.crud.query, rows: this.checkrows }).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
315
mes/qd/src/views/wms/pdm/produce/mouthtask/index.vue
Normal file
315
mes/qd/src/views/wms/pdm/produce/mouthtask/index.vue
Normal file
@@ -0,0 +1,315 @@
|
||||
<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="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="计划月份">
|
||||
<label slot="label">计划月份:</label>
|
||||
<el-date-picker
|
||||
v-model="query.plan_month"
|
||||
type="month"
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
value-format="yyyyMM"
|
||||
placeholder="选择年月"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键设备">
|
||||
<label slot="label">关键设备:</label>
|
||||
<el-select
|
||||
v-model="query.device_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="关键设备"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申报单位">
|
||||
<label slot="label">申报单位:</label>
|
||||
<el-select
|
||||
v-model="query.plan_org_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="申报单位"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="query.is_proc"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@change="MyQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_proc2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="任务号">
|
||||
<el-input
|
||||
v-model="query.task_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入任务号"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="排产模板">
|
||||
<label slot="label">排产模板:</label>
|
||||
<el-select
|
||||
v-model="query.captemplate_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="排产模板"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Capacitytes"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="初始日期">
|
||||
<label slot="label">初始日期:</label>
|
||||
<el-date-picker
|
||||
v-model="query.nowstart_date"
|
||||
type="date"
|
||||
style="width: 200px"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<el-checkbox v-model="query.checked">启用</el-checkbox>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="save()"
|
||||
>
|
||||
预排
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="plan_month" label="计划月份" />
|
||||
<el-table-column prop="task_code" label="任务号" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位" width="100" />
|
||||
<el-table-column prop="device_code" label="关键设备" width="100" />
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="90" />
|
||||
<el-table-column prop="old_mark" label="牌号" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150"/>
|
||||
<el-table-column :formatter="seriesFormat" min-width="80" prop="product_series" label="系列" />
|
||||
<el-table-column prop="product_type_name" label="生产方式" />
|
||||
<el-table-column prop="fact_weight" label="生产重量(t)" :formatter="pcsn_num_format2" min-width="90" />
|
||||
<el-table-column prop="standard_weight" label="每批重量kg" width="90" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="pcsn_num" label="批数" :formatter="pcsn_num_format"/>
|
||||
<el-table-column :formatter="stateFormat" min-width="80" prop="is_proc" label="状态" />
|
||||
<el-table-column prop="update_time" label="提交时间" width="140px" />
|
||||
<el-table-column prop="update_optname" label="提交人" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import producetask from '@/api/wms/pdm/producetask'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import workorder from '@/api/wms/pdm/workorder'
|
||||
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||
import Date from '@/utils/datetime'
|
||||
|
||||
export default {
|
||||
name: 'mouthtask',
|
||||
dicts: ['product_mode', 'is_proc2'],
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '月计划管理',
|
||||
url: 'api/producetask/mouthtask',
|
||||
idField: 'plan_id',
|
||||
sort: '',
|
||||
query:{ nowstart_date: new Date(), captemplate_id: '',is_proc: '1'},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: { 'Authorization': getToken() },
|
||||
dialogVisible: false,
|
||||
save_flag: true,
|
||||
sub_flag: true,
|
||||
Depts: [],
|
||||
Devices: [],
|
||||
Capacitytes: [],
|
||||
XLList: [],
|
||||
fileList: [],
|
||||
checkrows: [],
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
|
||||
producetask.getDevices().then(res => {
|
||||
this.Devices = res
|
||||
})
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
producetask.getCapacitytes().then(res => {
|
||||
this.Capacitytes = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.crud.query.is_proc === '0') {
|
||||
this.save_flag = false
|
||||
} else {
|
||||
this.save_flag = true
|
||||
}
|
||||
return true
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.is_proc === '1'
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.is_proc2[row.is_proc]
|
||||
},
|
||||
pcsn_num_format(row) {
|
||||
return Math.ceil(row.fact_weight / row.standard_weight)
|
||||
},
|
||||
pcsn_num_format2(row) {
|
||||
return parseFloat(row.fact_weight / 1000.0).toFixed(3)
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
MyQuery(value) {
|
||||
if (value === '1') {
|
||||
this.save_flag = false
|
||||
} else {
|
||||
this.save_flag = true
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
seriesFormat(row) {
|
||||
for (const item of this.XLList) {
|
||||
if (item.id === row.product_series) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
save() {
|
||||
if(this.crud.query.captemplate_id === '' || this.crud.query.captemplate_id === undefined ){
|
||||
this.crud.notify('请先选择排产模板!')
|
||||
return false
|
||||
}
|
||||
this.checkrows = this.$refs.table.selection
|
||||
if(this.checkrows.length === 0 ){
|
||||
this.crud.notify('请勾选需要提交的记录!')
|
||||
return false
|
||||
}
|
||||
producetask.submit2({ query: this.crud.query, rows: this.checkrows}).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
389
mes/qd/src/views/wms/pdm/produce/producetask/index.vue
Normal file
389
mes/qd/src/views/wms/pdm/produce/producetask/index.vue
Normal file
@@ -0,0 +1,389 @@
|
||||
<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="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="计划月份">
|
||||
<label slot="label">计划月份:</label>
|
||||
<el-date-picker
|
||||
v-model="query.plan_month"
|
||||
type="month"
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
value-format="yyyyMM"
|
||||
placeholder="选择年月"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申报单位">
|
||||
<label slot="label">申报单位:</label>
|
||||
<el-select
|
||||
v-model="query.plan_org_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="申报单位"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@input="onInput()"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="query.is_proc"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
@change="MyQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_proc"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="open"
|
||||
>
|
||||
导入Excel
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="save_flag"
|
||||
@click="submit()"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="sub_flag"
|
||||
@click="save()"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!-- 文件上传弹出框-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:before-upload="beforeUpload"
|
||||
:auto-upload="false"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:on-exceed="handleExceed"
|
||||
:action="nowAction"
|
||||
>
|
||||
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="upload">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="mySelectionChange">
|
||||
<el-table-column
|
||||
v-permission="['admin','producetask:del']"
|
||||
min-width="60"
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
:isVisiableEdit="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="task_code" label="任务号" width="120" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位" width="100" />
|
||||
<el-table-column prop="plan_month" label="计划月份" />
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="90" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150"/>
|
||||
<el-table-column prop="old_mark" label="牌号" />
|
||||
<el-table-column prop="product_type_name" label="生产方式" />
|
||||
<el-table-column prop="product_weight" label="需求重量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="fact_weight" label="生产重量" :formatter="crud.formatNum3" width="150" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number size="mini" v-model="scope.row.fact_weight" :disabled="save_flag" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="weight_unit_name" label="单位"/>
|
||||
<el-table-column prop="standard_weight" label="每批重量kg" width="90" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="pcsn_num" label="批数" :formatter="pcsn_num_format"/>
|
||||
<el-table-column :formatter="stateFormat" min-width="80" prop="is_proc" label="状态" />
|
||||
<el-table-column prop="update_time" label="提交时间" width="140px" />
|
||||
<el-table-column prop="update_optname" label="提交人" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import producetask from '@/api/wms/pdm/producetask'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { mapGetters } from 'vuex'
|
||||
import workorder from '@/api/wms/pdm/workorder'
|
||||
|
||||
export default {
|
||||
name: 'producetask',
|
||||
dicts: ['product_mode', 'is_proc'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '生产任务管理',
|
||||
url: 'api/producetask',
|
||||
idField: 'plan_id',
|
||||
sort: 'plan_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: false
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: { 'Authorization': getToken() },
|
||||
dialogVisible: false,
|
||||
save_flag: true,
|
||||
sub_flag: true,
|
||||
nowAction: this.baseApi + '/api/producetask/importExcel/1',
|
||||
Depts: [],
|
||||
fileList: [],
|
||||
checkrows: [],
|
||||
permission: {
|
||||
del: ['admin', 'producetask:del']
|
||||
},
|
||||
form: { name: '' },
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.crud.query.is_proc === '0') {
|
||||
this.save_flag = false
|
||||
} else {
|
||||
this.save_flag = true
|
||||
}
|
||||
return true
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.is_proc !== '2'
|
||||
},
|
||||
canUd(row) {
|
||||
return row.is_proc === '2'
|
||||
},
|
||||
mySelectionChange(rows) {
|
||||
this.buttonChange(rows)
|
||||
},
|
||||
buttonChange(rows) {
|
||||
if (rows.length !== 0) {
|
||||
this.sub_flag = false
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if (rows[i].is_proc !== '0') {
|
||||
this.sub_flag = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 100
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小不能超过 100MB!')
|
||||
}
|
||||
this.form.name = file.name
|
||||
return isLt2M
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.checkrows = []
|
||||
this.sub_flag = true
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.is_proc[row.is_proc]
|
||||
},
|
||||
open() {
|
||||
const a = this.fileList
|
||||
this.fileList = a.splice(0, 0)
|
||||
this.nowAction = this.baseApi + '/api/producetask/importExcel/1'
|
||||
this.dialogVisible = true
|
||||
},
|
||||
pcsn_num_format(row) {
|
||||
return Math.ceil(row.fact_weight / row.standard_weight)
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
MyQuery(value) {
|
||||
if (value === '0') {
|
||||
this.save_flag = false
|
||||
} else {
|
||||
this.save_flag = true
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
upload() {
|
||||
this.$refs.upload.submit()
|
||||
this.dialogVisible = false
|
||||
},
|
||||
submit() {
|
||||
this.checkrows = this.$refs.table.data
|
||||
if(this.checkrows.length === 0 ){
|
||||
this.crud.notify('无可提交的记录!')
|
||||
return false
|
||||
}
|
||||
producetask.submit({'status': '0', rows: this.checkrows}).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
save() {
|
||||
this.checkrows = this.$refs.table.selection
|
||||
if(this.checkrows.length === 0 ){
|
||||
this.crud.notify('请勾选需要提交的记录!')
|
||||
return false
|
||||
}
|
||||
producetask.submit({'status': '1', rows: this.checkrows}).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning('当前限制只能选择 1 个文件')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user