| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <template>
- <el-dialog
- :visible.sync="visible"
- title="计划提交"
- width="60vw"
- append-to-body
- >
- <div class="main_container">
- <el-descriptions
- title=""
- :column="3"
- size="medium"
- border
- label-class-name="title-col"
- content-class-name="title-col"
- >
- <el-descriptions-item>
- <template slot="label"> 计划编号 </template>
- {{ info.code }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 计划类型 </template>
- {{ getDictValue('订单计划类型', info.planType) }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 产品编码</template>
- {{ info.productCode }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 牌号 </template>
- {{ info.brandNo }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 型号 </template>
- {{ info.model }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 规格 </template>
- {{ info.specification }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 销售单数量 </template>
- {{ info.codeNum }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 生产类型 </template>
- {{ info.produceVersionName }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 工艺路线 </template>
- {{ info.produceRoutingName }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 订单总数量 </template>
- {{ info.contractNum }}{{ info.measuringUnit }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 订单重量 </template>
- {{ info.sumOrderWeight }} {{ info.weightUnit }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 要求生产数量 </template>
- {{ Number(info.requiredFormingNum) }}{{ info.measuringUnit }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 要求生产重量 </template>
- {{ info.newSumOrderWeight }} {{ info.newWeightUnit }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 要求完成日期 </template>
- {{ info.reqMoldTime }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 批次号 </template>
- {{ info.batchNo }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 所属工厂 </template>
- {{ info.factoriesIdName }}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 生产要求 </template>
- {{ info.productionRequirements }}
- </el-descriptions-item>
- <el-descriptions-item :span="3">
- <template slot="label"> </template>
- </el-descriptions-item>
- </el-descriptions>
- </div>
- <headerTitle title="计划列表" class="mt20" v-if="isAutoGenerateSubPlans">
- </headerTitle>
- <ele-pro-table
- ref="table2"
- :needPage="false"
- :columns="jsColumns"
- :datasource="jhList"
- tool-class="ele-toolbar-actions"
- max-height="360px"
- v-if="isAutoGenerateSubPlans"
- >
- <!-- <template v-slot:toolbar>
- <div class="toolbar_box">
- <el-button type="primary" size="mini" @click="handleAdd"
- >新增</el-button
- >
- </div>
- </template> -->
- <template v-slot:produceRoutingName="{ row }">
- <span>{{ row.produceRoutingName }}</span>
- </template>
- <template v-slot:startTime="{ row }">
- <el-date-picker
- class="w100"
- v-model="row.startTime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="开始时间"
- @change="handleStartTimeChange(row)"
- disabled
- ></el-date-picker>
- </template>
- <template v-slot:endTime="{ row }">
- <el-date-picker
- class="w100"
- v-model="row.endTime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- @change="handleEndTimeChange(row)"
- placeholder="完成时间"
- disabled
- ></el-date-picker>
- </template>
- <template v-slot:requiredFormingNum="{ row }">
- <span>{{ row.requiredFormingNum }} {{ row.measuringUnit }}</span>
- </template>
- <template v-slot:action="{ row, $index }">
- <el-popconfirm
- class="ele-action"
- title="确定要删除这条数据吗?"
- @confirm="removeRow(row, $index)"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table>
- <div slot="footer" class="footer">
- <div>
- <el-button @click="cancel">取消</el-button>
- <el-button
- @click="submit(2)"
- type="primary"
- :loading="loading"
- v-if="type != 'edit'"
- >提交并发布</el-button
- >
- <el-button type="primary" @click="submit(1)" :loading="loading"
- >提交</el-button
- >
- </div>
- </div>
- </el-dialog>
- </template>
- <script>
- import { getCode } from '@/api/codeManagement';
- import dictMixins from '@/mixins/dictMixins';
- import { debounce } from 'lodash';
- import { parameterGetByCode } from '@/api/mainData/index';
- export default {
- mixins: [dictMixins],
- props: {
- info: Object,
- type: String
- },
- data() {
- return {
- visible: false,
- loading: false,
- tableList: [],
- isAutoGenerateSubPlans: false,
- jhList: [],
- jsColumns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- prop: 'productCode',
- label: '编码',
- align: 'center',
- minWidth: 140
- },
- {
- prop: 'productName',
- label: '名称',
- align: 'center',
- minWidth: 140
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- minWidth: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- slot: 'startTime',
- prop: 'startTime',
- label: '计划开始时间',
- align: 'center',
- minWidth: 180
- },
- {
- slot: 'endTime',
- prop: 'endTime',
- label: '计划完成时间',
- align: 'center',
- minWidth: 180
- },
- {
- prop: 'produceRoutingName',
- slot: 'produceRoutingName',
- label: '工艺路线',
- align: 'center',
- minWidth: 120
- },
- {
- prop: 'requiredFormingNum',
- label: '要求生产数量',
- align: 'center',
- slot: 'requiredFormingNum',
- width: 130
- }
- // {
- // columnKey: 'action',
- // label: '操作',
- // width: 90,
- // align: 'center',
- // fixed: 'right',
- // slot: 'action'
- // }
- ]
- };
- },
- computed: {},
- created() {
- this.requestDict('订单计划类型');
- this.getAutoGenerateSubPlans('auto_split_produce_plan');
- },
- methods: {
- open() {
- this.visible = true;
- if (this.type != 'edit') {
- this.getPlanCode();
- }
- if (this.isAutoGenerateSubPlans) {
- console.log(this.info, 'this.infothis.info');
- this.getJHListData(this.info);
- }
- },
- cancel() {
- this.visible = false;
- },
- async getAutoGenerateSubPlans(code) {
- await parameterGetByCode({ code }).then((res) => {
- this.isAutoGenerateSubPlans = res.value == '0' ? false : true;
- });
- },
- getJHListData(m) {
- for (let i = 0; i < this.jhList.length; i++) {
- let item = this.jhList[i];
- if (item.id == m.id) {
- return;
- }
- }
- let row = {};
- // if (
- // m.processRoute &&
- // m.processRoute.list &&
- // m.processRoute.list.length > 0
- // ) {
- // row = m.processRoute.list[0];
- // }
- // let _num =
- // ((this.formData.requiredFormingNum || 0) / (this.baseCount || 0)) *
- // m.dosage;
- // _num = _num.toFixed(3);
- // _num = this.formattedNum(_num);
- let data = {
- id: m.id,
- categoryId: m.categoryId,
- productCode: m.productCode,
- productName: m.productName,
- brandNo: m.brandNo,
- specification: m.specification,
- model: m.model,
- produceRoutingName: m.produceRoutingName || '',
- productUnitWeight: m.productUnitWeight,
- requiredFormingNum: m.requiredFormingNum,
- measuringUnit: m.measuringUnit,
- startTime: m.startTime || '',
- endTime: m.endTime || '',
- unit: this.unit,
- resourceType: 0
- };
- this.jhList.push(data);
- },
- async getPlanCode() {
- this.loading = true;
- try {
- const code = await getCode('product_code');
- this.$set(this.info, 'code', code);
- } catch (err) {}
- this.loading = false;
- },
- submit: debounce(function (type) {
- this.$emit('publish', type);
- this.visible = false;
- }, 800)
- }
- };
- </script>
- <style lang="scss">
- .basic-details-title {
- margin: 10px 0;
- }
- .title-col {
- color: #000000 !important;
- background-color: #fff;
- }
- </style>
|