From 5ff704af11fc13dd48a48e133652faf1e13d178d Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期三, 15 十一月 2023 19:21:32 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/zs-mes-before
---
src/views/basic/part/index.vue | 136 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 102 insertions(+), 34 deletions(-)
diff --git a/src/views/basic/part/index.vue b/src/views/basic/part/index.vue
index d529e9a..f33b8f0 100644
--- a/src/views/basic/part/index.vue
+++ b/src/views/basic/part/index.vue
@@ -5,18 +5,22 @@
:prelang="prelang" :options="options" :bottomOffset="125" :ajaxFun="ajaxFun" ref="partTable">
<template #toolbar></template>
</ttable>
+ <!-- <el-upload :headers="{'Authorization': 'Bearer ' + yourToken}" class="upload-demo" action="/mes/part/uploadExcel" :on-preview="handlePreview"
+ :on-remove="handleRemove" :file-list="fileList" :on-success="fileUpload" :limit="1">
+ <el-button size="small" type="primary">鐐瑰嚮Excel瀵煎叆</el-button>
+ </el-upload> -->
<!-- 寮圭獥, 鏂板 / 淇敼 -->
<table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form>
<PrintLabelForm :currshowlist.sync="showPrintLabelForm" :printLabelInfo="printLabelInfo" />
</basic-container>
- <el-dialog title="鍚屾IFS" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
+ <el-dialog title="鑾峰彇IFS闆朵欢" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<el-row>
<el-col :span="6" style="height: 40px;line-height: 30px;">
鍚屾鏃ユ湡锛�
</el-col>
<el-col :span="18">
<el-date-picker style="width: 100%;height: 100%;" v-model="selectDate" type="date" placeholder="閫夋嫨鏃ユ湡">
- </el-date-picker>
+ </el-date-picker>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
@@ -33,21 +37,22 @@
import { mapGetters } from 'vuex'
import ttable from '@/views/common/ztt-table.vue'
import { remote } from '../../../api/admin/dict'
-import { dateFormat } from '@/util/date'
+import { dateFormat, dateFormatYearMonthDate, dateFormatPlus } from '@/util/date'
import PrintLabelForm from './print-label-form.vue'
-
export default {
data() {
return {
- selectDate: null,
+ fileList: [],
+ selectDate: "",
dialogVisible: false,
ajaxFun: fetchList,
addOrUpdateVisible: false,
multipleSelection: [],
+ yourToken: "",
uploadInfo: {
// 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl
isShow: true,
- url: '/mes/part/upload'
+ url: '/mes/part/uploadExcel'
},
prelang: 'operation',
options: {
@@ -61,6 +66,7 @@
seqNo: true,
isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳
isSearch: false, // 楂樼骇鏌ヨ鎸夐挳
+ isRefresh: true,
defaultOrderBy: { column: 'id', direction: 'desc' }
},
table: {
@@ -86,6 +92,24 @@
minWidth: '120',
prop: 'partName',
label: '鍚嶇О',
+ sort: true,
+ isTrue: true,
+ isSearch: true,
+ searchInfoType: 'text'
+ },
+ {
+ minWidth: '120',
+ prop: 'domainNo',
+ label: '鍩熺紪鍙�',
+ sort: true,
+ isTrue: true,
+ isSearch: true,
+ searchInfoType: 'text'
+ },
+ {
+ minWidth: '120',
+ prop: 'domainName',
+ label: '鍩熸弿杩�',
sort: true,
isTrue: true,
isSearch: true,
@@ -358,23 +382,29 @@
}
],
toolbar: [
- {
- text: '鏂板',
- type: 'primary',
- fun: this.addOrUpdateHandle
- },
- {
- text: '鍚屾IFS',
- type: 'primary',
- fun: this.syncISDate,
- loading: false
- },
- {
- text: '澶ф爣绛�',
- type: 'primary',
- fun: this.printLabel,
- loading: false
- }
+ // {
+ // text: '鏂板',
+ // type: 'primary',
+ // fun: this.addOrUpdateHandle
+ // },
+ // {
+ // text: '鑾峰彇IFS闆朵欢',
+ // type: 'primary',
+ // fun: this.syncISDate,
+ // loading: false
+ // },
+ // {
+ // text: '澶ф爣绛�',
+ // type: 'primary',
+ // fun: this.printLabel,
+ // loading: false
+ // },
+ // {
+ // text: 'Excel瀵煎叆',
+ // type: 'primary',
+ // fun: this.uploadPartExcel,
+ // loading: false
+ // },
],
operator: [
{
@@ -413,6 +443,8 @@
PrintLabelForm
},
created() {
+ let token=JSON.parse(sessionStorage.getItem("ztt-access_token")).content
+ this.yourToken=token
this.table.column.find((e) => e.label === 'IFS鍚敤鎵规绠$悊').isTrue = false
this.table.column.find((e) => e.label === '璁″垝鏂规硶').isTrue = false
this.getUnitType('unit')
@@ -428,8 +460,18 @@
...mapGetters(['permissions'])
},
methods: {
- handleClose() {
- this.selectDate=null;
+ handleRemove(file, fileList) {
+ console.log(file, fileList);
+ },
+ handlePreview(file) {
+
+ },
+ fileUpload(){
+ this.$message.success('鍚庡彴姝e湪瀵煎叆涓紝璇风◢鍚庡埛鏂帮紒')
+ this.fileList=[]
+ },
+ handleClose() {
+ this.selectDate = "";
this.dialogVisible = false
},
// 鑾峰彇鏁版嵁鍒楄〃
@@ -634,15 +676,31 @@
// },
syncISDate() {
this.dialogVisible = true
- this.selectDate=null
+ this.selectDate = ''
+ },
+ dateFormat(longTypeDate) {
+ var dateTypeDate = "";
+ var date = new Date();
+ date.setTime(longTypeDate);
+ dateTypeDate += date.getFullYear(); //骞�
+ dateTypeDate += "-" + getMonth(date); //鏈�
+ dateTypeDate += "-" + getDay(date); //鏃�
+ return dateTypeDate;
},
syncIfs() {
- this.table.toolbar.find((e) => e.text === '鍚屾IFS').loading = true
+ this.table.toolbar.find((e) => e.text === '鑾峰彇IFS闆朵欢').loading = true
this.dialogVisible = false
- let datas=new FormData()
- datas.set("date",this.selectDate)
+ let datas = new FormData()
+ let times = null;
+ if (this.selectDate != '' && this.selectDate != null) {
+ times = dateFormatPlus(this.selectDate)
+ } else {
+ times = null
+ }
+ datas.set("date", times)
// console.log(datas.get("date"));
-
+ // return ;np
+ // console.log(datas.get("date"));
// console.log(this.selectDate);
// return
syncPart(datas)
@@ -650,21 +708,26 @@
const data = res.data
console.log(data);
if (data.code === 0) {
- if(data.data>0){
- this.$message.success('鍚屾鎴愬姛'+data.data+"鏉℃暟鎹�")
+ if (data.data > 0) {
+ this.$message.success('鍚屾鎴愬姛' + data.data + "鏉℃暟鎹�")
}
- if(data.data<1){
+ if (data.data < 1) {
this.$message.warning("璇ユ棩鏈熸病鏈夋柊鐨勯浂浠舵暟鎹�");
}
- this.table.toolbar.find((e) => e.text === '鍚屾IFS').loading = false
+ this.table.toolbar.find((e) => e.text === '鑾峰彇IFS闆朵欢').loading = false
this.getData()
} else {
this.$message.error('鍚屾IFS澶辫触')
+ this.table.toolbar.find((e) => e.text === '鑾峰彇IFS闆朵欢').loading = false
+ this.getData()
}
})
.catch((e) => {
// this.$message.error('鍚屾ERP澶辫触:' + e)
})
+ },
+ uploadPartExcel() {
+
},
printLabel() {
if (this.multipleSelection && this.multipleSelection.length > 0) {
@@ -705,3 +768,8 @@
}
}
</script>
+<style>
+.el-upload-dragger {
+ width: 300px !important;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3