生产管理
Šī revīzija ir iekļauta:
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-15 10:49:13
|
||||
* @LastEditTime: 2024-05-17 17:54:54
|
||||
* @LastEditTime: 2024-05-22 16:22:57
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -92,26 +92,38 @@
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @destroy="detailOrUpdateVisible = false" />
|
||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :ftype="facType" @destroy="detailOrUpdateVisible = false" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :ftype="facType" @refreshDataList="getDataList" @destroy="addOrUpdateVisible = false" />
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:file-list="fileList"
|
||||
:disabled="upload.isUploading"
|
||||
:on-success="handleFileSuccess"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<!-- <div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
||||
</div> -->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> -->
|
||||
</div>
|
||||
</el-upload>
|
||||
<!-- <el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action="#"
|
||||
:limit="1"
|
||||
:file-list="fileList"
|
||||
:auto-upload="false"
|
||||
:http-request="handleFileSuccess"> -->
|
||||
<!-- <el-button size="small" type="primary">点击上传</el-button>
|
||||
<div slot="tip" class="el-upload__tip">只能上传.xlsx, .xls文件,且不超过500kb</div>
|
||||
</el-upload> -->
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
@@ -130,7 +142,7 @@
|
||||
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget } from '@/api/produceData';
|
||||
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
|
||||
// import inputTable from './inputTable.vue';
|
||||
import lineChart from './lineChart';
|
||||
import moment from 'moment'
|
||||
@@ -153,6 +165,7 @@ export default {
|
||||
dhgfactoryList,
|
||||
tyjxfactoryList,
|
||||
currentMenu: '碲化镉工厂',
|
||||
fileList: [],
|
||||
start: undefined,
|
||||
end: undefined,
|
||||
listQuery: {
|
||||
@@ -182,7 +195,7 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: getBaseHeader(),
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/ip/prod-target/di-target-import-excel'
|
||||
url: process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||
},
|
||||
tableBtn: [
|
||||
{
|
||||
@@ -332,8 +345,8 @@ export default {
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'molybdenumElectrodeInput',
|
||||
label: '钼电极投入量(片)',
|
||||
prop: 'ftoInput',
|
||||
label: 'FTO投入量(片)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
@@ -405,26 +418,85 @@ export default {
|
||||
// all: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
weekNum() {
|
||||
return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||
},
|
||||
// computed: {
|
||||
// weekNum() {
|
||||
// return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||
// },
|
||||
// },
|
||||
watch: {
|
||||
facType(value) {
|
||||
if (value === 0) {
|
||||
this.$set(this.tableProps, 3, {
|
||||
prop: 'ftoInput',
|
||||
label: 'FTO投入量(片)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
})
|
||||
this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||
} else {
|
||||
this.$set(this.tableProps, 3, {
|
||||
prop: 'molybdenumElectrodeInput',
|
||||
label: '钼电极投入量(片)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
})
|
||||
this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
|
||||
}
|
||||
console.log(112, this.tableProps)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.getDict()
|
||||
// this.getCurrentYearFirst()
|
||||
// this.getDataList()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
handleImport() {
|
||||
this.upload.title = "生产目标导入";
|
||||
this.upload.open = true;
|
||||
this.fileList = []
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
// handleFileSuccess(param, type) {
|
||||
// console.log('带的', param.file)
|
||||
// const formData = new FormData()
|
||||
// formData.append('multipartFile', param.file)
|
||||
// console.log('送送', param)
|
||||
// importDiTarget(formData).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code !== 0) {
|
||||
// this.$modal.msgError(response.msg)
|
||||
// return;
|
||||
// }
|
||||
// this.upload.open = false;
|
||||
// this.upload.isUploading = false;
|
||||
// this.$refs.upload.clearFiles();
|
||||
// }).catch(() => {
|
||||
// this.upload.open = false
|
||||
// this.upload.isUploading = false
|
||||
// })
|
||||
// // 拼接提示语
|
||||
// // let data = response.data;
|
||||
// // let text = '创建成功数量:' + data.createUsernames.length;
|
||||
// // for (const username of data.createUsernames) {
|
||||
// // text += '<br /> ' + username;
|
||||
// // }
|
||||
// // text += '<br />更新成功数量:' + data.updateUsernames.length;
|
||||
// // for (const username of data.updateUsernames) {
|
||||
// // text += '<br /> ' + username;
|
||||
// // }
|
||||
// // text += '<br />更新失败数量:' + Object.keys(data.failureUsernames).length;
|
||||
// // for (const username in data.failureUsernames) {
|
||||
// // text += '<br /> ' + username + ':' + data.failureUsernames[username];
|
||||
// // }
|
||||
// this.$message.success('导入成功!');
|
||||
// this.getDataList();
|
||||
// },
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.$modal.msgError(response.msg)
|
||||
@@ -433,22 +505,8 @@ export default {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
// 拼接提示语
|
||||
// let data = response.data;
|
||||
// let text = '创建成功数量:' + data.createUsernames.length;
|
||||
// for (const username of data.createUsernames) {
|
||||
// text += '<br /> ' + username;
|
||||
// }
|
||||
// text += '<br />更新成功数量:' + data.updateUsernames.length;
|
||||
// for (const username of data.updateUsernames) {
|
||||
// text += '<br /> ' + username;
|
||||
// }
|
||||
// text += '<br />更新失败数量:' + Object.keys(data.failureUsernames).length;
|
||||
// for (const username in data.failureUsernames) {
|
||||
// text += '<br /> ' + username + ':' + data.failureUsernames[username];
|
||||
// }
|
||||
this.$message.success('导入成功!');
|
||||
this.getDataList();
|
||||
this.$message.success('导入成功!')
|
||||
this.getDataList()
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
@@ -463,6 +521,11 @@ export default {
|
||||
changeFactory($event) {
|
||||
this.currentMenu = $event
|
||||
this.facType = this.currentMenu === '碲化镉工厂' ? 0 : 1
|
||||
// if (this.facType === 0) {
|
||||
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||
// } else {
|
||||
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
|
||||
// }
|
||||
this.getDataList()
|
||||
},
|
||||
handleClick(val) {
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user