2024-04-17 16:17:07 +08:00
|
|
|
<!--
|
|
|
|
* @Author: zhp
|
2024-04-28 11:04:33 +08:00
|
|
|
* @Date: 2024-04-17 16:31:51
|
2024-05-22 16:28:47 +08:00
|
|
|
* @LastEditTime: 2024-05-20 18:09:09
|
2024-05-20 14:55:36 +08:00
|
|
|
* @LastEditors: DY
|
2024-04-17 16:17:07 +08:00
|
|
|
* @Description:
|
|
|
|
-->
|
|
|
|
<template>
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-drawer class="drawer" :visible.sync="visible" size="55%" @closed="$emit('destroy')">
|
2024-04-17 16:17:07 +08:00
|
|
|
<small-title slot="title" :no-padding="true">
|
2024-05-20 14:55:36 +08:00
|
|
|
{{ dataForm.id ? '编辑' : '新增' }}
|
2024-04-17 16:17:07 +08:00
|
|
|
</small-title>
|
|
|
|
<div class="detailBox">
|
2024-04-28 11:04:33 +08:00
|
|
|
<el-form ref="form" :model="dataForm" label-width="80px" label-position="top">
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="8">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item v-if="ftype === 0" label="工厂名称" prop="factory">
|
|
|
|
<el-select v-model="dataForm.factory" placeholder="请选择工厂名称" clearable>
|
|
|
|
<el-option v-for="(item, index) in dhgfactoryList" :key="index" :label="item.name" :value="item.id">
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item v-else label="工厂名称" prop="factory">
|
|
|
|
<el-select v-model="dataForm.factory" placeholder="请选择工厂名称" clearable>
|
|
|
|
<el-option v-for="(item, index) in tyjxfactoryList" :key="index" :label="item.name" :value="item.id">
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="时间维度" prop="targetType">
|
|
|
|
<el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable @change="clearTime">
|
|
|
|
<!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> -->
|
|
|
|
<el-option label="月" :value="0" />
|
|
|
|
<el-option label="年" :value="1" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item v-show="dataForm.targetType !== 1" label="时间" prop="reportTime">
|
|
|
|
<el-date-picker v-model="dataForm.reportTime" value-format="yyyy-MM" type="month" placeholder="选择月份">
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item v-show="dataForm.targetType === 1" label="时间" prop="targetYear">
|
|
|
|
<el-date-picker clearable v-model="dataForm.showYear" value-format="yyyy" type="year" placeholder="开始时间">
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-row>
|
|
|
|
<el-divider></el-divider>
|
|
|
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
|
|
|
{{ '芯片' }}
|
|
|
|
</small-title>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片产量" prop="chipYield">
|
|
|
|
<el-input-number v-model="dataForm.chipYield" :precision="0" controls-position="right" placeholder="请输入芯片产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片良率" prop="chipYieldRate">
|
|
|
|
<el-input-number v-model="dataForm.chipYieldRate" :precision="2" :max="100" controls-position="right" placeholder="请输入芯片良率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片BOM" prop="chipBom">
|
|
|
|
<el-input-number v-model="dataForm.chipBom" :precision="2" controls-position="right" placeholder="请输入芯片BOM" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片总功率" prop="chipTotalPower">
|
|
|
|
<el-input-number v-model="dataForm.chipTotalPower" :precision="2" controls-position="right" placeholder="请输入芯片总功率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-22 16:28:47 +08:00
|
|
|
<el-form-item v-if="ftype === 0" label="FTO投入量" prop="ftoInput">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-input-number v-model="dataForm.ftoInput" :precision="0" controls-position="right" placeholder="请输入FTO投入量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
2024-05-22 16:28:47 +08:00
|
|
|
<el-form-item v-else label="钼电极投入量" prop="molybdenumElectrodeInput">
|
|
|
|
<el-input-number v-model="dataForm.molybdenumElectrodeInput" :precision="0" controls-position="right" placeholder="请输入钼电极投入量" style="width: 100%" />
|
|
|
|
</el-form-item>
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-22 16:28:47 +08:00
|
|
|
<el-form-item v-if="ftype === 0" label="CSS稼动率" prop="chipCssMarriageRate">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-input-number v-model="dataForm.chipCssMarriageRate" :precision="2" controls-position="right" placeholder="请输入CSS稼动率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
2024-05-22 16:28:47 +08:00
|
|
|
<el-form-item v-else label="PID6稼动率" prop="chipCssMarriageRate">
|
|
|
|
<el-input-number v-model="dataForm.chipCssMarriageRate" :precision="2" controls-position="right" placeholder="请输入PID6稼动率" style="width: 100%" />
|
|
|
|
</el-form-item>
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片段OEE" prop="chipOee">
|
|
|
|
<el-input-number v-model="dataForm.chipOee" :precision="2" controls-position="right" placeholder="请输入芯片段OEE" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片平均功率" prop="chipAveragePower">
|
|
|
|
<el-input-number v-model="dataForm.chipAveragePower" :precision="2" controls-position="right" placeholder="请输入芯片平均功率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片人均产量" prop="chipAnnualAverageProduction">
|
|
|
|
<el-input-number v-model="dataForm.chipAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入芯片人均产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片产能利用率" prop="chipCapacityUtilizationRate">
|
|
|
|
<el-input-number v-model="dataForm.chipCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片产能利用率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-divider></el-divider>
|
|
|
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
|
|
|
{{ '标准组件' }}
|
|
|
|
</small-title>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="封装BOM" prop="componentBom">
|
|
|
|
<el-input-number v-model="dataForm.componentBom" :precision="2" controls-position="right" placeholder="请输入封装BOM" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="封装线OEE" prop="componentOee">
|
|
|
|
<el-input-number v-model="dataForm.componentOee" :precision="2" controls-position="right" placeholder="请输入封装线OEE" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="标准组件良率" prop="componentYieldRate">
|
|
|
|
<el-input-number v-model="dataForm.componentYieldRate" :precision="2" controls-position="right" placeholder="请输入标准组件良率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="标准组件产量" prop="componentYield">
|
|
|
|
<el-input-number v-model="dataForm.componentYield" :precision="0" controls-position="right" placeholder="请输入标准组件产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="标准组件总功率" prop="componentTotalPower">
|
|
|
|
<el-input-number v-model="dataForm.componentTotalPower" :precision="2" controls-position="right" placeholder="请输入标准组件总功率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="封装产能利用率" prop="componentCapacityUtilizationRate">
|
|
|
|
<el-input-number v-model="dataForm.componentCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入封装产能利用率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="标准组件人均产量" prop="componentAnnualAverageProduction">
|
|
|
|
<el-input-number v-model="dataForm.componentAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入标准组件人均产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="标准组件平均功率" prop="componentAveragePower">
|
|
|
|
<el-input-number v-model="dataForm.componentAveragePower" :precision="2" controls-position="right" placeholder="请输入标准组件平均功率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-divider></el-divider>
|
|
|
|
|
|
|
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
|
|
|
{{ 'BIPV产品' }}
|
|
|
|
</small-title>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="产品产量" prop="bipvProductOutput">
|
|
|
|
<el-input-number v-model="dataForm.bipvProductOutput" :precision="0" controls-position="right" placeholder="请输入产品产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="人均产量" prop="bipvAnnualAverageProduction">
|
|
|
|
<el-input-number v-model="dataForm.bipvAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入人均产量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片使用量" prop="bipvChipUsage">
|
|
|
|
<el-input-number v-model="dataForm.bipvChipUsage" :precision="0" controls-position="right" placeholder="请输入芯片使用量" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="芯片利用率" prop="bipvChipUtilizationRate">
|
|
|
|
<el-input-number v-model="dataForm.bipvChipUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片利用率" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="24" style="padding: 0 32px;">
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="内部材料成本" prop="bipvInsideMaterialCost">
|
|
|
|
<el-input-number v-model="dataForm.bipvInsideMaterialCost" :precision="2" controls-position="right" placeholder="请输入内部材料成本" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="OEM及委外材料成本" prop="bipvOeeMaterialCost">
|
|
|
|
<el-input-number v-model="dataForm.bipvOeeMaterialCost" :precision="2" controls-position="right" placeholder="请输入OEM及委外材料成本" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="6">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-form-item label="综合材料成本" prop="bipvComprehensiveMaterialCost">
|
|
|
|
<el-input-number v-model="dataForm.bipvComprehensiveMaterialCost" :precision="2" controls-position="right" placeholder="请输入综合材料成本" style="width: 100%" />
|
2024-04-28 11:04:33 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
<div class="footer">
|
2024-05-20 14:55:36 +08:00
|
|
|
<el-button @click="visible = false">取 消</el-button>
|
2024-04-28 11:04:33 +08:00
|
|
|
<el-button type="primary" @click="handleClose()">确 定</el-button>
|
2024-04-17 16:17:07 +08:00
|
|
|
</div>
|
|
|
|
</el-drawer>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// import basicAdd from './basic-add';
|
|
|
|
// import {
|
|
|
|
// createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
|
|
|
// getTeamList, getDetList, getLineList
|
|
|
|
// } from "@/api/base/qualityScrapLog";
|
|
|
|
// import { getList, } from "@/api/base/qualityScrapType";
|
|
|
|
import SmallTitle from './SmallTitle';
|
2024-05-20 14:55:36 +08:00
|
|
|
import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData';
|
|
|
|
import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants";
|
|
|
|
|
2024-04-17 16:17:07 +08:00
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
SmallTitle,
|
|
|
|
},
|
|
|
|
// mixins: [basicAdd],
|
2024-05-20 14:55:36 +08:00
|
|
|
props: {
|
|
|
|
ftype: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
}
|
|
|
|
},
|
2024-04-17 16:17:07 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2024-05-20 14:55:36 +08:00
|
|
|
factoryList,
|
|
|
|
dhgfactoryList,
|
|
|
|
tyjxfactoryList,
|
2024-04-17 16:17:07 +08:00
|
|
|
lineList: [],
|
|
|
|
typeList: [],
|
|
|
|
workOrderList: [],
|
|
|
|
detList: [],
|
|
|
|
teamList: [],
|
|
|
|
sourceList: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: '手动',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
name: '自动',
|
|
|
|
}
|
|
|
|
],
|
2024-05-20 14:55:36 +08:00
|
|
|
// factoryList: [
|
|
|
|
// {
|
|
|
|
// name: '瑞昌中建材光电材料有限公司',
|
|
|
|
// id: 0
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '邯郸中建材光电材料有限公司',
|
|
|
|
// id: 1
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '中建材株洲光电材料有限公司',
|
|
|
|
// id: 2
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '佳木斯中建材光电材料有限公司',
|
|
|
|
// id: 3
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '成都中建材光电材料有限公司',
|
|
|
|
// id: 4
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '凯盛光伏材料有限公司',
|
|
|
|
// id: 5
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '蚌埠兴科玻璃有限公司',
|
|
|
|
// id: 6
|
|
|
|
// }
|
|
|
|
// ],
|
2024-04-17 16:17:07 +08:00
|
|
|
sectionList: [],
|
|
|
|
visible: false,
|
|
|
|
dataForm: {
|
2024-05-20 14:55:36 +08:00
|
|
|
factoryType: 0,
|
2024-04-17 16:17:07 +08:00
|
|
|
id: undefined,
|
2024-05-20 14:55:36 +08:00
|
|
|
reportTime: undefined, // 月时间
|
|
|
|
factory: undefined,
|
|
|
|
targetType: undefined,
|
|
|
|
targetYear: undefined,
|
|
|
|
showYear: undefined,
|
|
|
|
targetMonth: undefined,
|
|
|
|
chipYield: undefined,
|
|
|
|
chipYieldRate: undefined,
|
|
|
|
chipBom: undefined,
|
|
|
|
chipTotalPower: undefined,
|
|
|
|
ftoInput: undefined,
|
|
|
|
chipCssMarriageRate: undefined,
|
|
|
|
chipOee: undefined,
|
|
|
|
chipAveragePower: undefined,
|
|
|
|
chipAnnualAverageProduction: undefined,
|
|
|
|
chipCapacityUtilizationRate: undefined,
|
|
|
|
componentBom: undefined,
|
|
|
|
componentOee: undefined,
|
|
|
|
componentYieldRate: undefined,
|
|
|
|
componentYield: undefined,
|
|
|
|
componentTotalPower: undefined,
|
|
|
|
componentCapacityUtilizationRate: undefined,
|
|
|
|
componentAnnualAverageProduction: undefined,
|
|
|
|
componentAveragePower: undefined,
|
|
|
|
bipvProductOutput: undefined,
|
|
|
|
bipvAnnualAverageProduction: undefined,
|
|
|
|
bipvChipUsage: undefined,
|
|
|
|
bipvChipUtilizationRate: undefined,
|
|
|
|
bipvInsideMaterialCost: undefined,
|
|
|
|
bipvOeeMaterialCost: undefined,
|
2024-05-22 16:28:47 +08:00
|
|
|
bipvComprehensiveMaterialCost: undefined,
|
|
|
|
molybdenumElectrodeInput: undefined
|
2024-04-17 16:17:07 +08:00
|
|
|
},
|
|
|
|
// materialList: [],
|
|
|
|
dataRule: {
|
|
|
|
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
2024-05-20 14:55:36 +08:00
|
|
|
// workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
|
|
|
// num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
|
|
|
// detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
2024-04-17 16:17:07 +08:00
|
|
|
|
2024-05-20 14:55:36 +08:00
|
|
|
// logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
2024-04-17 16:17:07 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
// this.getCurrentTime()
|
|
|
|
},
|
|
|
|
methods: {
|
2024-05-20 14:55:36 +08:00
|
|
|
formClear() {
|
|
|
|
if (this.$refs.dataForm !== undefined) {
|
|
|
|
this.$refs.dataForm.resetFields()
|
|
|
|
}
|
2024-04-17 16:17:07 +08:00
|
|
|
},
|
2024-05-20 14:55:36 +08:00
|
|
|
clearTime() {
|
|
|
|
this.dataForm.targetYear = undefined
|
|
|
|
this.dataForm.targetMonth = undefined
|
2024-04-17 16:17:07 +08:00
|
|
|
},
|
2024-05-20 14:55:36 +08:00
|
|
|
handleClose() {
|
|
|
|
// 新增
|
|
|
|
if (this.dataForm.targetType === 0) {
|
|
|
|
const timeArray = this.dataForm.reportTime.split('-')
|
|
|
|
this.dataForm.targetYear = Number(timeArray[0])
|
|
|
|
this.dataForm.targetMonth = Number(timeArray[1])
|
|
|
|
}
|
|
|
|
if (this.dataForm.targetType === 1) {
|
|
|
|
this.dataForm.targetYear = Number(this.dataForm.showYear)
|
|
|
|
}
|
|
|
|
// if (this.dataForm.factory === 5) {
|
|
|
|
// this.dataForm.factoryType = 1
|
|
|
|
// } else {
|
|
|
|
// this.dataForm.factoryType = 0
|
|
|
|
// }
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
// 修改
|
|
|
|
updateProduceTarget({
|
|
|
|
...this.dataForm,
|
|
|
|
showYear: undefined,
|
|
|
|
reportTime: undefined
|
|
|
|
}).then(res => {
|
|
|
|
if (res.code === 0) {
|
|
|
|
this.$message.success('修改成功!')
|
|
|
|
this.visible = false
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
// 新增
|
|
|
|
createProduce({
|
|
|
|
...this.dataForm,
|
|
|
|
showYear: undefined,
|
|
|
|
reportTime: undefined
|
|
|
|
}).then(res => {
|
|
|
|
if (res.code === 0) {
|
|
|
|
this.$message.success('新增成功!')
|
|
|
|
this.visible = false
|
|
|
|
this.$emit('refreshDataList')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
init(id) {
|
|
|
|
this.dataForm.id = id || undefined
|
2024-05-22 16:28:47 +08:00
|
|
|
this.dataForm.factoryType = this.ftype
|
2024-05-20 14:55:36 +08:00
|
|
|
this.visible = true
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
getProduceTargetDetail(this.dataForm.id).then(res => {
|
|
|
|
this.dataForm = res.data
|
|
|
|
if (this.dataForm.targetType === 1) {
|
|
|
|
if (this.dataForm.targetYear) {
|
|
|
|
this.$set(this.dataForm, 'showYear', String(this.dataForm.targetYear))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.dataForm.targetType === 0) {
|
|
|
|
if (this.dataForm.targetYear && this.dataForm.targetMonth !== null) {
|
|
|
|
if (this.dataForm.targetMonth < 10) {
|
|
|
|
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-0' + String(this.dataForm.targetMonth))
|
|
|
|
} else {
|
|
|
|
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-' + String(this.dataForm.targetMonth))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-17 16:17:07 +08:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
2024-04-28 11:04:33 +08:00
|
|
|
.footer {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 1%;
|
|
|
|
right: 2%;
|
|
|
|
}
|
|
|
|
.drawer-footer {
|
|
|
|
width: 100%;
|
|
|
|
margin-top: 50px;
|
|
|
|
border-top: 1px solid #e8e8e8;
|
|
|
|
padding: 10px 50px;
|
|
|
|
text-align: left;
|
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
.el-divider--horizontal{
|
|
|
|
margin: 0;
|
|
|
|
}
|
2024-04-17 16:17:07 +08:00
|
|
|
.drawer >>> .el-drawer {
|
|
|
|
border-radius: 8px 0 0 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer >>> .el-form-item__label {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer >>> .el-drawer__header {
|
|
|
|
margin: 0;
|
|
|
|
padding: 32px 32px 24px;
|
|
|
|
border-bottom: 1px solid #dcdfe6;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
}
|
|
|
|
.detailBox p {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 32px;
|
|
|
|
}
|
|
|
|
.detailBox .title {
|
|
|
|
/* width: 56px; */
|
|
|
|
/* height: 14px; */
|
|
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 14px;
|
|
|
|
color: rgba(0, 0, 0, 0.85);
|
|
|
|
line-height: 16px;
|
|
|
|
text-align: left;
|
|
|
|
font-style: normal;
|
|
|
|
text-transform: none;
|
|
|
|
}
|
|
|
|
.detailBox .text {
|
|
|
|
font-size: 14px;
|
|
|
|
font-weight: 400;
|
|
|
|
color: rgba(102,102,102,0.75);
|
|
|
|
padding-bottom: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|