提交 198631c3 authored 作者: 邓文彬's avatar 邓文彬

fix(pad): 数据导出格式和PC端对齐,能够成功导出PC

上级 e0881957
...@@ -58,7 +58,8 @@ export default { ...@@ -58,7 +58,8 @@ export default {
}, },
onShow: function () { onShow: function () {
const now_user = uni.getStorageSync("now_user") || {}; const now_user = uni.getStorageSync("now_user") || {};
if (now_use.user) { console.log("--now_user-", now_user)
if (now_user.user) {
this.$store.commit("SET_USER", now_user); this.$store.commit("SET_USER", now_user);
} }
this.init(); this.init();
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
details.synchronization == 0 ? "待同步" : "已同步" details.synchronization == 0 ? "待同步" : "已同步"
}}</text> }}</text>
<view v-if="details.isException == 2" class="status alarm"> <view v-if="details.isException == 1" class="status alarm">
<text class="iconfont icon-yichang1"></text> <text class="iconfont icon-yichang1"></text>
<text>有异常</text></view <text>有异常</text></view
> >
......
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
init() { init() {
this.formData = { this.formData = {
inspectionType: "1", inspectionType: "1",
inspectionCode: `JFXJ${moment().format("yyyyMMDDhhmmss")}`, inspectionCode: `JFXJ${moment().format("yyyyMMDDhhmmss")}${(Math.floor(Math.random() * 900) + 100)}`,
recordName: `${moment().format("yyyyMMDD")}-机房巡检记录`, recordName: `${moment().format("yyyyMMDD")}-机房巡检记录`,
inspectionTime: moment().format("yyyy-MM-DD HH:mm:ss"), inspectionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
inspectionBy: this.$store.state.now_user.user, inspectionBy: this.$store.state.now_user.user,
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
const inspectionCode = `${ const inspectionCode = `${
val.detail.value == 1 ? "JFXJ" : "JDXJ" val.detail.value == 1 ? "JFXJ" : "JDXJ"
}${moment().format("yyyyMMDDhhmmss")}`; }${moment().format("yyyyMMDDhhmmss")}`;
this.formData.inspectionCode = inspectionCode; this.formData.inspectionCode = inspectionCode + (Math.floor(Math.random() * 900) + 100);
}, },
back() { back() {
......
...@@ -366,7 +366,7 @@ export default { ...@@ -366,7 +366,7 @@ export default {
lookTable() { lookTable() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/report/sampleTable", url: "/pages/report/sampleTable?isJF=1",
}); });
}, },
...@@ -427,8 +427,8 @@ export default { ...@@ -427,8 +427,8 @@ export default {
}); });
const isException = items.filter((item) => item.inspectionResult > 0) const isException = items.filter((item) => item.inspectionResult > 0)
.length .length
? 2 ? 1
: 1; : 0;
return { return {
...temp, ...temp,
......
...@@ -114,6 +114,7 @@ export default { ...@@ -114,6 +114,7 @@ export default {
this.person.user == this.personList[key].user && this.person.user == this.personList[key].user &&
this.person.pd == this.personList[key].passWord this.person.pd == this.personList[key].passWord
) { ) {
console.log("-userInfo---",userInfo)
const userInfo = this.personList[key]; const userInfo = this.personList[key];
this.$store.commit("SET_USER", userInfo); this.$store.commit("SET_USER", userInfo);
uni.setStorageSync("now_user", userInfo); uni.setStorageSync("now_user", userInfo);
......
...@@ -14,25 +14,23 @@ ...@@ -14,25 +14,23 @@
</uni-nav-bar> </uni-nav-bar>
<view class="main"> <view class="main">
<!-- 占位---不可删除 --> <!-- 占位---不可删除 -->
<view class="seize-seat"> </view> <view class="seize-seat"> </view>
<view class="container box-shaow-box"> <view class="container box-shaow-box">
<!-- <view class="image-item top-image"> <view v-if="isJF" class="image-item top-image">
<image <image
src="@/static/img/add-img/jf_table.png" src="@/static/img/add-img/jf_table.png"
mode="widthFix" mode="widthFix"
></image> ></image>
</view> --> </view>
<view class="image-item top-image"> <view v-else class="image-item top-image">
<image <image
src="@/static/img/add-img/jd_bg.png" src="@/static/img/add-img/jd_table.png"
mode="widthFix" mode="widthFix"
></image> ></image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -40,10 +38,18 @@ ...@@ -40,10 +38,18 @@
<script> <script>
export default { export default {
data() {
return {
isJF: false,
};
},
onNavigationBarButtonTap(val) { onNavigationBarButtonTap(val) {
// console.log(val); // console.log(val);
uni.navigateBack(); uni.navigateBack();
}, },
onLoad(options) {
this.isJF = options.isJF == 1;
},
methods: { methods: {
checkImage(val) { checkImage(val) {
let res = ""; let res = "";
...@@ -62,23 +68,23 @@ export default { ...@@ -62,23 +68,23 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: linear-gradient( background-image: linear-gradient(
90deg, 90deg,
#e9f7fe 0%, #e9f7fe 0%,
#dceffe 40%, #dceffe 40%,
#d5ebfd 66%, #d5ebfd 66%,
#c9e8fe 100% #c9e8fe 100%
); );
.main { .main {
margin-top: -44px; margin-top: -44px;
width: 100%; width: 100%;
background-size: 100% 40rpx; background-size: 100% 40rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
.container { .container {
margin: 0 auto; margin: 0 auto;
width: 730rpx; width: 730rpx;
height: calc(100vh - 44px - var(--status-bar-height) - 20px); height: calc(100vh - 44px - var(--status-bar-height) - 20px);
padding: 23.53rpx 17.65rpx; padding: 23.53rpx 17.65rpx;
padding-bottom: 0; padding-bottom: 0;
...@@ -90,6 +96,7 @@ export default { ...@@ -90,6 +96,7 @@ export default {
justify-sampletable: space-between; justify-sampletable: space-between;
.image-item { .image-item {
text-align: center;
width: 60%; width: 60%;
// height: 100%; // height: 100%;
background-color: #ffffff; background-color: #ffffff;
......
...@@ -286,7 +286,7 @@ export default { ...@@ -286,7 +286,7 @@ export default {
}, },
lookTable() { lookTable() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/report/sampleTable", url: "/pages/report/sampleTable?isJF=0",
}); });
}, },
...@@ -316,8 +316,8 @@ export default { ...@@ -316,8 +316,8 @@ export default {
const isException = ((tempForm[index] || {}).temp || []).filter( const isException = ((tempForm[index] || {}).temp || []).filter(
(item) => item.inspectionResult > 0 (item) => item.inspectionResult > 0
).length ).length
? 2 ? 1
: 1; : 0;
return { return {
...baseInfo, ...baseInfo,
...@@ -334,7 +334,7 @@ export default { ...@@ -334,7 +334,7 @@ export default {
...temp[0], ...temp[0],
isSubmit: 0, isSubmit: 0,
isException: temp.filter((item) => item.isException > 1).length ? 2 : 1, // 总的数据 isException: temp.filter((item) => item.isException > 1).length ? 1 : 0, // 总的数据
items: [], items: [],
synchronization: 0, // 是否导出过 synchronization: 0, // 是否导出过
submitTime: moment().format("yyyy-MM-DD"), // 记录提交时间 submitTime: moment().format("yyyy-MM-DD"), // 记录提交时间
......
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
} }
let timeStr = getDateTime.dateTimeStr('y-m-d h:i') let timeStr = getDateTime.dateTimeStr('y-m-d h:i')
let operData = { let operData = {
name: this.$store.state.now_use.user, name: this.$store.state.now_user.user,
level: '秘密', level: '秘密',
user: this.$store.state.now_user.user, user: this.$store.state.now_user.user,
module: moduleName, module: moduleName,
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
} }
let timeStr = getDateTime.dateTimeStr('y-m-d h:i') let timeStr = getDateTime.dateTimeStr('y-m-d h:i')
let operData = { let operData = {
name: this.$store.state.now_use.user, name: this.$store.state.now_user.user,
level: '秘密', level: '秘密',
user: this.$store.state.now_user.user, user: this.$store.state.now_user.user,
module: moduleName, module: moduleName,
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
// } // }
// let timeStr = getDateTime.dateTimeStr('y-m-d h:i') // let timeStr = getDateTime.dateTimeStr('y-m-d h:i')
// let operData = { // let operData = {
// name: this.$store.state.now_use.user, // name: this.$store.state.now_user.user,
// level: '秘密', // level: '秘密',
// user: this.$store.state.now_user.user, // user: this.$store.state.now_user.user,
// module: moduleName, // module: moduleName,
......
...@@ -114,6 +114,8 @@ export default { ...@@ -114,6 +114,8 @@ export default {
}) })
.then(() => { .then(() => {
console.log("---文件删除成功----"); console.log("---文件删除成功----");
console.log("coverData----", this.$store.state.now_user.user);
this.coverData(); this.coverData();
}) })
.catch((error) => { .catch((error) => {
...@@ -128,15 +130,13 @@ export default { ...@@ -128,15 +130,13 @@ export default {
}, },
// 处理数据 // 处理数据
coverData() { coverData() {
const userName = this.$store.state.now_use.user; const userName = this.$store.state.now_user.user;
const notSynchronizationList = this.notSynchronizationList; const notSynchronizationList = this.notSynchronizationList;
const allList = this.allList; const allList = this.allList;
// console.log("-同步数据--", notSynchronizationList); // console.log("-同步数据--", notSynchronizationList);
let timeStr = moment().format("yyyy-MM-DD_hh:mm:ss"); let timeStr = moment().format("yyyy_MM_DD_hh_mm_ss");
let JFXJ_DATA_FILE_NAME = `${userName}_JFXJ_${timeStr}.txt`;
let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}.txt`;
const JFXJ_DATA = notSynchronizationList const JFXJ_DATA = notSynchronizationList
.filter((item) => item.inspectionType == 1) .filter((item) => item.inspectionType == 1)
...@@ -147,12 +147,11 @@ export default { ...@@ -147,12 +147,11 @@ export default {
}; };
}); // 机房数据类型是 1 }); // 机房数据类型是 1
const JDXJ_DATA = notSynchronizationList.filter( const JDXJ_DATA = notSynchronizationList
(item) => item.inspectionType == 2 .filter((item) => item.inspectionType == 2)
).map(item => { .map((item) => {
return item[item.inspectionCode] return item[item.inspectionCode];
})// 井道数据类型是 2 }); // 井道数据类型是 2
// console.log("---源数据", [...JDXJ_DATA,...JFXJ_DATA] ) // console.log("---源数据", [...JDXJ_DATA,...JFXJ_DATA] )
...@@ -160,11 +159,21 @@ export default { ...@@ -160,11 +159,21 @@ export default {
// return console.log("--- [...JDXJ_DATA,...JFXJ_DATA]", fileContent ) // return console.log("--- [...JDXJ_DATA,...JFXJ_DATA]", fileContent )
this.loading = true; this.loading = true;
const tmepList = [];
if (JFXJ_DATA.length) {
let JFXJ_DATA_FILE_NAME = `${userName}_JFXJ_${timeStr}.txt`;
// console.log("---机房数据===", JFXJ_DATA);
tmepList.push(this.packedData(JFXJ_DATA, JFXJ_DATA_FILE_NAME));
}
Promise.all([ JDXJ_DATA.forEach((item, index) => {
this.packedData(JFXJ_DATA, JFXJ_DATA_FILE_NAME), let JDXJ_DATA_FILE_NAME = `${userName}_JDXJ_${timeStr}_${index}.txt`;
this.packedData(JDXJ_DATA, JDXJ_DATA_FILE_NAME), // console.log("---井道数据===", item);
]) tmepList.push(this.packedData(item, JDXJ_DATA_FILE_NAME));
});
Promise.all(tmepList)
.then(() => { .then(() => {
// 更新巡检数据状态 // 更新巡检数据状态
const synchronizationUids = notSynchronizationList.map((item) => { const synchronizationUids = notSynchronizationList.map((item) => {
...@@ -185,7 +194,6 @@ export default { ...@@ -185,7 +194,6 @@ export default {
} }
}); });
this.$store.commit("SET_ALL_DATA", allList); this.$store.commit("SET_ALL_DATA", allList);
console.log("---userData---", userData);
const keys = Object.keys(userData); const keys = Object.keys(userData);
const promiseArr = keys.map((key) => { const promiseArr = keys.map((key) => {
...@@ -246,6 +254,7 @@ export default { ...@@ -246,6 +254,7 @@ export default {
// 打包文件 // 打包文件
packedData(content, fileName) { packedData(content, fileName) {
console.log("--------发送数据内容----", fileName, content);
const fileContent = setSm2(content); const fileContent = setSm2(content);
return createFileWithPlusIO( return createFileWithPlusIO(
...@@ -258,16 +267,17 @@ export default { ...@@ -258,16 +267,17 @@ export default {
// 更新最近一次同步时间 // 更新最近一次同步时间
updateSysTime() { updateSysTime() {
getUserList().then((personList) => { getUserList().then((personList) => {
const now_user = this.$store.state.now_user; const now_user = this.$store.state.now_user;
const key = personList.findIndex(item => item.userId == now_user.userId) const key = personList.findIndex(
(item) => item.userId == now_user.userId
);
// 更新用户同步时间 // 更新用户同步时间
const userInfo = personList[key]; const userInfo = personList[key];
const LastSynchronizationTime = moment().format("yyyy-MM-DD HH:mm"); const LastSynchronizationTime = moment().format("yyyy-MM-DD HH:mm");
personList[key].LastSynchronizationTime = LastSynchronizationTime; personList[key].LastSynchronizationTime = LastSynchronizationTime;
userInfo.LastSynchronizationTime = LastSynchronizationTime; userInfo.LastSynchronizationTime = LastSynchronizationTime;
console.log("---更新最近一次同步时间--", userInfo) console.log("---更新最近一次同步时间--", userInfo);
this.$store.commit("SET_USER", userInfo); this.$store.commit("SET_USER", userInfo);
uni.setStorageSync("last_time", userInfo.LastSynchronizationTime || ""); uni.setStorageSync("last_time", userInfo.LastSynchronizationTime || "");
......
static/img/add-img/jd_table.png

26.5 KB | W: | H:

static/img/add-img/jd_table.png

797.5 KB | W: | H:

static/img/add-img/jd_table.png
static/img/add-img/jd_table.png
static/img/add-img/jd_table.png
static/img/add-img/jd_table.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -68,7 +68,7 @@ export const USER_LiST = [ ...@@ -68,7 +68,7 @@ export const USER_LiST = [
LastSynchronizationTime: "", // 上次同步时间 LastSynchronizationTime: "", // 上次同步时间
}, },
{ {
userId: 2, // 有用 userId: 262, // 有用
user: "test1", // 有用 谁创建,谁有权限编辑和删除 user: "test1", // 有用 谁创建,谁有权限编辑和删除
passWord: "JF123456", // 有用 passWord: "JF123456", // 有用
roleName: "巡检员", // 有用 roleName: "巡检员", // 有用
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论