提交 6233bd56 authored 作者: JaxBBLL's avatar JaxBBLL

fix

上级 b5d355e2
import SqlliteDbUtil from "@/utils/sqllitedb"; import SqlliteDbUtil from "@/utils/sqllitedb";
import table from "./sqllite/table.js"; import table from "./sqllite/table.js";
import { import { fixNullVal } from "@/utils/common";
fixNullVal
} from "@/utils/common";
// 巡检 // 巡检
export default { export default {
...@@ -24,6 +22,7 @@ export default { ...@@ -24,6 +22,7 @@ export default {
let sqllitedb = await SqlliteDbUtil.initSqlliteDB(); let sqllitedb = await SqlliteDbUtil.initSqlliteDB();
let sql = `select * from ${table.inspectionRecordName} where id = '${id}'`; let sql = `select * from ${table.inspectionRecordName} where id = '${id}'`;
let res = await sqllitedb.selectSQL(sql); let res = await sqllitedb.selectSQL(sql);
debugger;
if (res && res.length > 0) { if (res && res.length > 0) {
return res[0]; return res[0];
} }
...@@ -61,12 +60,12 @@ export default { ...@@ -61,12 +60,12 @@ export default {
idx++; idx++;
} }
column = column.endsWith(",") ? column = column.endsWith(",")
column.substring(0, column.length - 1) : ? column.substring(0, column.length - 1)
column; : column;
values = values.endsWith(",") ? values = values.endsWith(",")
values.substring(0, values.length - 1) : ? values.substring(0, values.length - 1)
values; : values;
let sql = `insert into ${table.inspectionRecordName}(${column}) values(${values})`; let sql = `insert into ${table.inspectionRecordName}(${column}) values(${values})`;
let has = await this.info(data.id); let has = await this.info(data.id);
...@@ -116,9 +115,9 @@ export default { ...@@ -116,9 +115,9 @@ export default {
'${JSON.stringify(data.inspectionData)}' '${JSON.stringify(data.inspectionData)}'
); );
`; `;
debugger
let result = await sqllitedb.executeReturnDataSQL(sql); let result = await sqllitedb.executeReturnDataSQL(sql);
console.log(result, '有有有有有有') console.log(result, "有有有有有有");
return result;
} catch (e) { } catch (e) {
console.log(e.message); console.log(e.message);
} finally { } finally {
......
...@@ -102,10 +102,9 @@ ...@@ -102,10 +102,9 @@
class="iconfont icon-shibai1" class="iconfont icon-shibai1"
></text> ></text>
</template> </template>
<text class="status" v-if="card.isSubmit == 0">草稿</text> <text class="status" v-if="card.isSubmit == 0">草稿</text>
<text class="status" v-else="card.isSubmit == 1">{{ <text class="status" v-else>{{ card.statusLable }}</text>
card.statusLable
}}</text>
</view> </view>
<view class="second-row"> <view class="second-row">
<text class="location">{{ card.name }}</text> <text class="location">{{ card.name }}</text>
......
...@@ -250,6 +250,7 @@ export default { ...@@ -250,6 +250,7 @@ export default {
: this.deepClone(tabsInfo1); : this.deepClone(tabsInfo1);
console.log("机房查看options", options); console.log("机房查看options", options);
this.all_data = this.$store.state.all_data || []; this.all_data = this.$store.state.all_data || [];
if (options.uid) { if (options.uid) {
this.getDetails(options.uid); this.getDetails(options.uid);
} else { } else {
...@@ -299,6 +300,7 @@ export default { ...@@ -299,6 +300,7 @@ export default {
}, },
// 回显数据 // 回显数据
getDetails(uid) { getDetails(uid) {
console.log("getDetails", uid);
uni.showLoading(); uni.showLoading();
inspectApi inspectApi
.info(uid) .info(uid)
...@@ -495,7 +497,14 @@ export default { ...@@ -495,7 +497,14 @@ export default {
const send = dataToSql(data); const send = dataToSql(data);
const api = this.uid ? inspectApi.update : inspectApi.save; const api = this.uid ? inspectApi.update : inspectApi.save;
api(this.uid ? { id: this.uid, ...send } : send).then((res) => { api(this.uid ? { id: this.uid, ...send } : send).then((res) => {
console.log("保存成功",res); // if (!this.uid) {
console.log(this.uid);
this.uid = res.lastInsertId;
setTimeout(() => {
this.getDetails(res.lastInsertId);
}, 300);
// }
console.log("保存成功", res);
}); });
}, },
// 提交 // 提交
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论