| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <div class="ele-body">
- <el-card shadow="never">
- <div class="page-title">
- <el-page-header @back="back" content="发布工单"> </el-page-header>
- </div>
- <el-descriptions title="" :column="6" border class="mb-20">
- <el-descriptions-item label="计划编号">{{
- infoData.code
- }}</el-descriptions-item>
- <el-descriptions-item label="计划类型">{{
- planType[infoData.planType]
- }}</el-descriptions-item>
- <el-descriptions-item label="物料编码">{{
- infoData.productCode
- }}</el-descriptions-item>
- <el-descriptions-item label="牌号">{{
- infoData.brandNo
- }}</el-descriptions-item>
- <el-descriptions-item label="型号">{{
- infoData.model
- }}</el-descriptions-item>
- <el-descriptions-item label="生产版本">{{
- infoData.produceVersionName
- }}</el-descriptions-item>
- <el-descriptions-item label="工艺路线名称">{{
- infoData.routingName
- }}</el-descriptions-item>
- <el-descriptions-item label="工艺路线版本">{{
- infoData.routingVersion
- }}</el-descriptions-item>
- <el-descriptions-item label="产品数量"
- >{{ infoData.productNum }}PCS</el-descriptions-item
- >
- <el-descriptions-item label="产品重量"
- >{{ infoData.productWeight
- }}{{ infoData.productUnitWeight }}</el-descriptions-item
- >
- <el-descriptions-item label="要求成型数量"
- >{{ infoData.requiredFormingNum }}PCS</el-descriptions-item
- >
- <el-descriptions-item label="要求成型重量"
- >{{ infoData.requiredFormingWeight }}kg</el-descriptions-item
- >
- </el-descriptions>
- <!-- <div class="rules-box">
- <div class="rule-label">工单生成规则</div>
- <div class="rule-wrapper">
- <div class="content">
- <div class="select-box" v-for="(item, index) in rules" :key="index">
- <el-radio-group v-model="item.value" v-if="item.type === 'radio'">
- <el-radio
- v-for="(itm, idx) in item.list"
- :key="idx"
- :label="itm.label"
- ></el-radio>
- </el-radio-group>
- <el-checkbox-group v-model="item.value" v-else>
- <el-checkbox
- v-for="(itm, idx) in item.list"
- :key="idx"
- :label="itm.label"
- :disabled="
- itm.lastDisabled
- ? item.value.length < item.list.length - 1
- : false
- "
- ></el-checkbox>
- </el-checkbox-group>
- </div>
- </div>
- <div class="btn-box">
- <el-tooltip
- placement="top-start"
- title="标题"
- width="200"
- trigger="hover"
- content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
- >
- <el-button type="text" icon="el-icon-question"></el-button>
- </el-tooltip>
- <el-button type="primary" plain>一键生成方案</el-button>
- </div>
- </div>
- </div> -->
- <planView key="first" :infoData="infoData" :orderList="orderList" />
- <!-- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="默认" name="first"
- ><planView key="first" :infoData="infoData"
- /></el-tab-pane>
- <el-tab-pane
- v-for="(item, index) in planList"
- :label="item.label"
- :name="index"
- ><planView :key="index" :infoData="infoData"
- /></el-tab-pane>
- </el-tabs> -->
- </el-card>
- </div>
- </template>
- <script>
- import planView from './components/plan-view';
- import { getById, getReleaseInfoById } from '@/api/productionPlan/index';
- import { getRouteTabKey, removePageTab } from '@/utils/page-tab-util';
- export default {
- components: { planView },
- data () {
- return {
- activeName: 'first',
- planList: [],
- rules: [
- {
- type: 'radio',
- value: '',
- list: [
- { label: '多设备优先', value: 0 },
- { label: '多班次优先', value: 1 }
- ]
- },
- {
- type: 'checked',
- value: [],
- list: [
- { label: '设备产能优先', value: 0 },
- { label: '最早开始时间优先', value: 1 },
- { label: '开始时间优先', value: 2, lastDisabled: true }
- ]
- },
- {
- type: 'checked',
- value: [],
- list: [
- { label: '非空闲设备可用', value: 0 },
- { label: '检修设备可用', value: 1 },
- { label: '检修设备优先', value: 1, lastDisabled: true }
- ]
- },
- {
- type: 'radio',
- value: '',
- list: [{ label: '末单均衡', value: 0 }]
- }
- ],
- infoData: {},
- orderList: [],
- planType: ['', '内销计划', '外销计划', '预制计划'],
- id: null
- };
- },
- methods: {
- back () {
- const key = getRouteTabKey();
- if (this.type == 2) {
- this.$router.push('/productionPlan');
- removePageTab({ key });
- return;
- }
- this.$confirm('返回后将清空所有方案,是否要继续?', '提示').then(() => {
- this.$router.push('/productionPlan');
- removePageTab({ key });
- });
- },
- async getInfo () {
- const data = await getById(this.id);
- this.infoData = data;
- },
- async getReleaseInfoById () {
- const data = await getReleaseInfoById(this.id);
- this.infoData = data.productionPlan;
- this.orderList = data.workOrderList.map(itm => ({
- ...itm,
- productCode: data.productionPlan.productCode,
- productName: data.productionPlan.productName
- }));
- }
- },
- created () {
- const { query = {} } = this.$route;
- this.type = query.type;
- this.id = query.id;
- if (query.type == 2) {
- this.getReleaseInfoById();
- } else {
- this.getInfo();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .rules-box {
- padding: 20px 0;
- display: flex;
- justify-content: space-between;
- .rule-label {
- font-size: 18px;
- font-weight: bold;
- }
- .rule-wrapper {
- flex: 1;
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- .content {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- padding: 0 10px;
- .select-box {
- border: 1px solid #ccc;
- padding: 5px 10px;
- margin: 0 10px 10px 0;
- }
- }
- .btn-box {
- display: flex;
- justify-content: space-between;
- width: 160px;
- }
- }
- }
- .mb-20 {
- margin-bottom: 20px;
- }
- </style>
|