|
@@ -1,9 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="plan-view">
|
|
|
<div class="description">
|
|
<div class="description">
|
|
|
- <div class="label">方案说明</div>
|
|
|
|
|
- <!-- <div class="content">
|
|
|
|
|
- <template v-for="(item, index) in rules">
|
|
|
|
|
|
|
+ <div class="label"></div>
|
|
|
|
|
+ <!-- <div class="label">方案说明</div>
|
|
|
|
|
+ <div class="content">
|
|
|
|
|
+ <template v-for="(item, index) in rulesList">
|
|
|
<template v-for="(itm, idx) in item.list">
|
|
<template v-for="(itm, idx) in item.list">
|
|
|
<template v-if="!itm.lastDisabled">
|
|
<template v-if="!itm.lastDisabled">
|
|
|
<div class="tag" :key="index + '' + idx">{{ itm.label }}</div>
|
|
<div class="tag" :key="index + '' + idx">{{ itm.label }}</div>
|
|
@@ -12,8 +13,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
</div> -->
|
|
</div> -->
|
|
|
<div class="operate">
|
|
<div class="operate">
|
|
|
- <el-button type="primary" plain>发布当前方案</el-button>
|
|
|
|
|
- <el-button type="primary">保存</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" plain @click="handleRelease"
|
|
|
|
|
+ >发布当前方案</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <el-button type="primary">保存</el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -21,81 +24,153 @@
|
|
|
<el-button type="primary" plain size="small" @click="addOrder"
|
|
<el-button type="primary" plain size="small" @click="addOrder"
|
|
|
>添加工单</el-button
|
|
>添加工单</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button type="primary" plain size="small">删除</el-button>
|
|
|
|
|
|
|
+ <!-- <el-button type="primary" plain size="small">删除</el-button> -->
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<span class="label">累计工单条数</span>
|
|
<span class="label">累计工单条数</span>
|
|
|
- 14条
|
|
|
|
|
|
|
+ {{ tableData.length }}条
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<span class="label">累计成型数量</span>
|
|
<span class="label">累计成型数量</span>
|
|
|
- 14pcs
|
|
|
|
|
|
|
+ {{ sumData.formingNum }}pcs
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<span class="label">累计成型重量</span>
|
|
<span class="label">累计成型重量</span>
|
|
|
- 14kg
|
|
|
|
|
|
|
+ {{ sumData.formingWeight }}kg
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<span class="label">设备数量</span>
|
|
<span class="label">设备数量</span>
|
|
|
14条
|
|
14条
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="items">
|
|
|
|
|
|
|
+ <!-- <div class="items">
|
|
|
<span class="label">成型剂需求</span>
|
|
<span class="label">成型剂需求</span>
|
|
|
14条
|
|
14条
|
|
|
</div>
|
|
</div>
|
|
|
<div class="items">
|
|
<div class="items">
|
|
|
<span class="label">混合料需求</span>
|
|
<span class="label">混合料需求</span>
|
|
|
14条
|
|
14条
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <el-table :data="tableData">
|
|
|
|
|
- <el-table-column type="index" label="序号"></el-table-column>
|
|
|
|
|
- <el-table-column label="工单号" prop=""></el-table-column>
|
|
|
|
|
- <el-table-column label="成型数量" prop="">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <el-input type="number" v-model.number="row.num"></el-input>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="成型重量" prop="">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <el-input type="number" v-model.number="row.num"></el-input>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="开始日期" prop="">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <el-input type="number" v-model.number="row.num"></el-input>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="班次" prop="">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <el-select v-model="row.ba">
|
|
|
|
|
- <el-option></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="设备编码" prop=""></el-table-column>
|
|
|
|
|
- <el-table-column label="设备名称" prop=""></el-table-column>
|
|
|
|
|
- <el-table-column label="可执行人" prop=""></el-table-column>
|
|
|
|
|
- <el-table-column label="操作" prop="">
|
|
|
|
|
- <template v-slot="{ row }">
|
|
|
|
|
- <el-link type="danger">删除</el-link>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column type="selection"></el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- <equipmentDailog ref="equipmentDailogRef" @success="equipmentSelect" />
|
|
|
|
|
|
|
+ <el-form :model="{ tableData }" label-width="0" ref="formRef">
|
|
|
|
|
+ <el-table :data="tableData">
|
|
|
|
|
+ <el-table-column type="index" label="序号"></el-table-column>
|
|
|
|
|
+ <el-table-column label="工单号" prop="code"></el-table-column>
|
|
|
|
|
+ <el-table-column label="成型数量" prop="">
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="`tableData.${$index}.formingNum`"
|
|
|
|
|
+ :rules="rule.formingNum"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ v-model.number="row.formingNum"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="成型重量" prop="">
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="`tableData.${$index}.formingWeight`"
|
|
|
|
|
+ :rules="rule.formingWeight"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ v-model.number="row.formingWeight"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="开始日期" prop="">
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="`tableData.${$index}.planStartTime`"
|
|
|
|
|
+ :rules="rule.planStartTime"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ class="w100"
|
|
|
|
|
+ :clearable="false"
|
|
|
|
|
+ v-model="row.planStartTime"
|
|
|
|
|
+ :disabledDate="() => true"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="班次" prop="">
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="`tableData.${$index}.classeId`"
|
|
|
|
|
+ :rules="rule.classeId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <classesSelect
|
|
|
|
|
+ v-model="row.classeId"
|
|
|
|
|
+ @selfChange="(val) => handleClasseChange(val, row)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="设备编码" prop="deviceCode"></el-table-column>
|
|
|
|
|
+ <el-table-column label="设备名称" prop="deviceName">
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :value="row.deviceName"
|
|
|
|
|
+ @click.native="editOrder(row)"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="可执行人" prop=""></el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" prop="">
|
|
|
|
|
+ <template v-slot="{ $index }">
|
|
|
|
|
+ <el-link type="danger" @click="handleDelete($index)">删除</el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column type="selection"></el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <equipmentDailog
|
|
|
|
|
+ ref="equipmentDailogRef"
|
|
|
|
|
+ @success="equipmentSelect"
|
|
|
|
|
+ :producteVersionId="infoData.producteVersionId"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import equipmentDailog from './equipment-dailog.vue';
|
|
import equipmentDailog from './equipment-dailog.vue';
|
|
|
- import { save } from '@/api/productionPlan/index.js';
|
|
|
|
|
|
|
+ import classesSelect from '@/components/CommomSelect/classes-select';
|
|
|
|
|
+ import { getExector } from '@/api/workforceManagement/classes';
|
|
|
|
|
+
|
|
|
|
|
+ import { release } from '@/api/productionPlan/order.js';
|
|
|
|
|
+ import { getCode } from '@/api/codeManagement';
|
|
|
export default {
|
|
export default {
|
|
|
- components: { equipmentDailog },
|
|
|
|
|
|
|
+ components: { equipmentDailog, classesSelect },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ infoData: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: () => ({})
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
tableData: [],
|
|
tableData: [],
|
|
|
- rules: [
|
|
|
|
|
|
|
+ rule: {
|
|
|
|
|
+ formingNum: [
|
|
|
|
|
+ { required: true, message: '请输入成型数量', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ formingWeight: [
|
|
|
|
|
+ { required: true, message: '请输入成型重量', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ planStartTime: [
|
|
|
|
|
+ { required: true, message: '请选择开始日期', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ classeId: [
|
|
|
|
|
+ { required: true, message: '请选择班次', trigger: 'change' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ rulesList: [
|
|
|
{
|
|
{
|
|
|
type: 'radio',
|
|
type: 'radio',
|
|
|
value: '',
|
|
value: '',
|
|
@@ -131,28 +206,105 @@
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ sumData () {
|
|
|
|
|
+ let formingNum = 0;
|
|
|
|
|
+ let formingWeight = 0;
|
|
|
|
|
+ this.tableData.forEach((ele) => {
|
|
|
|
|
+ formingNum += ele.formingNum || 0;
|
|
|
|
|
+ formingWeight += ele.formingWeight || 0;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return { formingNum, formingWeight };
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 发布
|
|
|
|
|
+ handleRelease () {
|
|
|
|
|
+ this.$refs.formRef.validate((value) => {
|
|
|
|
|
+ if (value) {
|
|
|
|
|
+ this.$confirm('发布工地后不可撤回,确定发布吗?', '发布确认').then(
|
|
|
|
|
+ async () => {
|
|
|
|
|
+ await release(this.tableData);
|
|
|
|
|
+
|
|
|
|
|
+ this.$message.success('发布成功!');
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 班次改变选择执行人
|
|
|
|
|
+ async handleClasseChange (val, row) {
|
|
|
|
|
+ const res = await getExector(val);
|
|
|
|
|
+
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ },
|
|
|
addOrder () {
|
|
addOrder () {
|
|
|
this.$refs.equipmentDailogRef.open(this.tableData);
|
|
this.$refs.equipmentDailogRef.open(this.tableData);
|
|
|
},
|
|
},
|
|
|
- equipmentSelect (list) {
|
|
|
|
|
|
|
+ editOrder (row) {
|
|
|
|
|
+ this.$refs.equipmentDailogRef.openSingle([row], (current) => {
|
|
|
|
|
+ row.deviceCode = current.code;
|
|
|
|
|
+ row.deviceId = current.id;
|
|
|
|
|
+ row.deviceName = current.name;
|
|
|
|
|
+ row.planStartTime = '';
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ async equipmentSelect (list) {
|
|
|
this.tableData = this.tableData.filter((item) =>
|
|
this.tableData = this.tableData.filter((item) =>
|
|
|
list.find((i) => i.id == item.id)
|
|
list.find((i) => i.id == item.id)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- this.tableData = list.reduce((cur, pre) => {
|
|
|
|
|
- if (!cur.find((i) => i.id == pre.id)) {
|
|
|
|
|
- cur.push(pre);
|
|
|
|
|
|
|
+ for (const pre of list) {
|
|
|
|
|
+ if (!this.tableData.find((i) => i.id == pre.id)) {
|
|
|
|
|
+ const code = await getCode('product_order_code');
|
|
|
|
|
+ // classeId 班次id false
|
|
|
|
|
+ // classeName 班次名称 false
|
|
|
|
|
+ // code 工单号 false
|
|
|
|
|
+ // deviceCode 设备编码 false
|
|
|
|
|
+ // deviceId 设备id false
|
|
|
|
|
+ // deviceName 设备名称 false
|
|
|
|
|
+ // executorId 执行人id false
|
|
|
|
|
+ // executorName 执行人名称 false
|
|
|
|
|
+ // formingNum 成型数量 false
|
|
|
|
|
+ // generativeRules 生成规则 false
|
|
|
|
|
+ // planCompleteTime 计划完成时间 false
|
|
|
|
|
+ // planStartTime 计划开始时间 false
|
|
|
|
|
+ // productionPlanCode 生产计划号 false
|
|
|
|
|
+ // productionPlanId 生产计划id false
|
|
|
|
|
+ // workOrderType 工单类型
|
|
|
|
|
+ this.tableData.push({
|
|
|
|
|
+ classeId: pre.classeId,
|
|
|
|
|
+ code: code,
|
|
|
|
|
+ deviceCode: pre.code,
|
|
|
|
|
+ deviceId: pre.id,
|
|
|
|
|
+ deviceName: pre.name,
|
|
|
|
|
+ executorId: pre.executorId,
|
|
|
|
|
+ productionPlanId: this.infoData.id,
|
|
|
|
|
+ productionPlanCode: this.infoData.code,
|
|
|
|
|
+ planCompleteTime: '', //当班下班时间,
|
|
|
|
|
+ planStartTime: '',
|
|
|
|
|
+ formingNum: pre.formingNum,
|
|
|
|
|
+ formingWeight: ''
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- return cur;
|
|
|
|
|
- }, this.tableData);
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDelete (index) {
|
|
|
|
|
+ this.tableData.splice(index, 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+ .plan-view {
|
|
|
|
|
+ ::v-deep(.el-form-item) {
|
|
|
|
|
+ margin-top: 16px;
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.description {
|
|
.description {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|