Commit dd79d013 by liuzhanxin

修改

parent a48bfcc4
...@@ -170,7 +170,11 @@ ...@@ -170,7 +170,11 @@
name: 'discard', name: 'discard',
relation: 4,//不等于 relation: 4,//不等于
values:[true], values:[true],
} },{
name: 'status',
relation: 3,//不等于
values:["published"],
},
] ]
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
<view style="display: flex;flex-direction: column;"> <view style="display: flex;flex-direction: column;">
<text class="title" style="margin-top: 40rpx;">预约时间:</text> <text class="title" style="margin-top: 40rpx;">预约时间:</text>
<text v-for=" index in calendarInfo" :key= "index.endTime" class="contenttextTime" style="margin-top: 40rpx;">{{index.startTime}}~{{index.endTime}}</text> <text v-for=" index in calendarInfo" v-if="index.checked" :key= "index.endTime" class="contenttextTime" style="margin-top: 40rpx;">{{index.startTime}}~{{index.endTime}}</text>
</view> </view>
<view class="ori"> <view class="ori">
<text class="title" style="margin-top: 40rpx;">预约人:</text> <text class="title" style="margin-top: 40rpx;">预约人:</text>
......
...@@ -102,13 +102,7 @@ ...@@ -102,13 +102,7 @@
status: "fckkk" status: "fckkk"
}, },
itemList: [], itemList: [],
statusData: [{ statusData: [ {
label: "待确定",
value: "unconfirmed"
}, {
label: "待处理",
value: "pend"
}, {
label: "待整改", label: "待整改",
value: "correct" value: "correct"
}, { }, {
...@@ -118,8 +112,8 @@ ...@@ -118,8 +112,8 @@
label: "已处理", label: "已处理",
value: "finish" value: "finish"
}, { }, {
label: '已取消', label: '已废弃',
value: 'cancel' value: 'discard'
}], }],
curType: "", curType: "",
labData: [], labData: [],
......
...@@ -224,8 +224,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue" ...@@ -224,8 +224,8 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
filePath:imgPath[0], filePath:imgPath[0],
name:"file", name:"file",
header: { header: {
'user' : JSON.stringify(user), "x-auth-token":this.GLOBALUTIL.commonHeader["x-auth-token"],
'Content-Type': 'multipart/form-data', // 'Content-Type': 'multipart/form-data',
}, },
success: (res) => { success: (res) => {
var uri = JSON.parse(res.data).data; var uri = JSON.parse(res.data).data;
......
...@@ -77,15 +77,13 @@ ...@@ -77,15 +77,13 @@
// opt.checkitems = []; // opt.checkitems = [];
}) })
that.dataList = content; that.dataList = content;
that.loadData();
console.log(that.dataList) console.log(that.dataList)
that.$forceUpdate() that.$forceUpdate()
}) })
this.loadData();
}, },
onUnload() { onUnload() {
uni.$off('sendCheckItem', function(data) { uni.$off('sendCheckItem')
})
}, },
/*下拉刷新的回调 */ /*下拉刷新的回调 */
downCallback() { downCallback() {
...@@ -115,7 +113,9 @@ ...@@ -115,7 +113,9 @@
uni.navigateTo({ uni.navigateTo({
url: "./index" url: "./index"
}) })
setTimeout(()=>{
uni.$emit("safeReportData", [this.objectData, item, this.taskId]); uni.$emit("safeReportData", [this.objectData, item, this.taskId]);
},300)
}, },
loadData() { loadData() {
var user = {}; var user = {};
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
header: this.GLOBALUTIL.commonHeader, header: this.GLOBALUTIL.commonHeader,
body: null, body: null,
success: (res) => { success: (res) => {
// console.log(JSON.stringify(res)) console.log(JSON.stringify(res))
this.dataList.map((opt) => { this.dataList.map((opt) => {
opt.checkitems = res.data.data; opt.checkitems = res.data.data;
}) })
...@@ -138,7 +138,9 @@ ...@@ -138,7 +138,9 @@
// console.log(JSON.stringify(this.dataList)) // console.log(JSON.stringify(this.dataList))
// console.log(JSON.stringify(this.checkitems)) // console.log(JSON.stringify(this.checkitems))
this.checkResult = []; this.checkResult = [];
console.log(this.dataList)
this.dataList.map((opt) => { this.dataList.map((opt) => {
console.log("¿¿¿¿¿")
var res = { var res = {
name: this.checkitems[0].name, name: this.checkitems[0].name,
id: this.checkitems[0].id, id: this.checkitems[0].id,
...@@ -152,6 +154,7 @@ ...@@ -152,6 +154,7 @@
"lab_id": this.objectData.id "lab_id": this.objectData.id
} }
this.checkResult.push(item) this.checkResult.push(item)
console.log(this.checkResult)
}) })
} }
}) })
...@@ -172,6 +175,7 @@ ...@@ -172,6 +175,7 @@
console.log(JSON.stringify(res)) console.log(JSON.stringify(res))
if (res.statusCode == 200) { if (res.statusCode == 200) {
uni.$emit("refreshTaskList") uni.$emit("refreshTaskList")
uni.$emit("refreshCheckObject")
this.$refs.popup.open({ this.$refs.popup.open({
type: 'success', type: 'success',
content: '提交成功!', content: '提交成功!',
...@@ -180,7 +184,7 @@ ...@@ -180,7 +184,7 @@
}); });
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 2 delta: 1
}) })
}, 1000) }, 1000)
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
this.loadData(); this.loadData();
}, },
onUnload() { onUnload() {
uni.$off('refreshTaskList', function(data) {}) uni.$off('refreshTaskList')
}, },
/*下拉刷新的回调 */ /*下拉刷新的回调 */
downCallback() { downCallback() {
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
color = "finish" color = "finish"
} else { } else {
var check_scope = JSON.parse(data.check_scope); var check_scope = JSON.parse(data.check_scope);
console.log(check_scope)
var checked = 0; var checked = 0;
check_scope.map((opt) => { check_scope.map((opt) => {
if (opt.execute_state) { if (opt.execute_state) {
...@@ -111,10 +112,10 @@ ...@@ -111,10 +112,10 @@
} }
}) })
if (checked == check_scope.length) { if (checked == check_scope.length) {
text = "已完成 " + check_scope.length + "/" + check_scope.length; text = "已完成 " + data.check_scope_finish + "/" + data.check_scope_total;
color = "finish" color = "finish"
} else { } else {
text = '未完成 ' + checked + '/' + check_scope.length; text = '未完成 ' + data.check_scope_finish + '/' + data.check_scope_total;
color = "unfinish" color = "unfinish"
} }
} }
......
...@@ -5,14 +5,11 @@ ...@@ -5,14 +5,11 @@
<text class="value">{{selObjectText}}</text> <text class="value">{{selObjectText}}</text>
<image class="arrow-right" src="../../static/common/arrow_right_gray.png"> <image class="arrow-right" src="../../static/common/arrow_right_gray.png">
</view> </view>
<view style="width: 100%;margin-top: 20rpx;"><text class="title">检查项类型</text></view> <view v-if="itemData.length > 0" style="width: 100%;margin-top: 40rpx;"><text class="title">检查项类型:</text></view>
<view class="location-container" @click="showTypePicker"> <view class="type-container" hover-class="submithover" @click="onSubmitClick(item)" v-for="(item,index) in itemData " :key='index'>
<text class="value">{{selectItemText}}</text> <text space="ensp">{{item.code + " "+item.content}}</text>
<image class="arrow-right" src="../../static/common/arrow_right_gray.png"> <text>{{item.execute_state ? "(已完成)" : ""}}</text>
</view> </view>
<button hover-class="submithover" @click="onSubmitClick" class="submit-button">
<text class="submittext">开始检查</text>
</button>
<Picker mode="selector" @confirm="onConfirm" ref="picker" themeColor="#f00" :selectList="itemList"></Picker> <Picker mode="selector" @confirm="onConfirm" ref="picker" themeColor="#f00" :selectList="itemList"></Picker>
</view> </view>
</template> </template>
...@@ -37,8 +34,15 @@ ...@@ -37,8 +34,15 @@
} }
}, },
onLoad(option) { onLoad(option) {
var that = this;
this.taskId = option.taskId this.taskId = option.taskId
this.loadTaskObject(); this.loadTaskObject();
uni.$on('refreshCheckObject', function(data) {
that.loadItemData();
})
},
onUnload() {
uni.$off('refreshCheckObject')
}, },
methods: { methods: {
itemClick: function() { itemClick: function() {
...@@ -76,15 +80,14 @@ ...@@ -76,15 +80,14 @@
} }
}, },
onSubmitClick() { onSubmitClick(item) {
var objectData = this.findObjectData(); var objectData = this.findObjectData();
var itemData = this.findItemData(); // var itemData = this.findItemData();
uni.navigateTo({ uni.navigateTo({
url: "security-checkitem" url: "security-checkitem"
}) })
console.log(itemData)
setTimeout(()=>{ setTimeout(()=>{
uni.$emit("sendCheckItem", [objectData, itemData, this.taskId]); uni.$emit("sendCheckItem", [objectData, item, this.taskId]);
},300) },300)
}, },
showObjectPicker() { showObjectPicker() {
...@@ -92,14 +95,6 @@ ...@@ -92,14 +95,6 @@
this.curType = "object" this.curType = "object"
this.$refs.picker.show() this.$refs.picker.show()
}, },
showTypePicker() {
if (this.selObject == "") {
return
}
this.itemList = this.itemarr;
this.curType = "item";
this.$refs.picker.show()
},
loadTaskObject() { loadTaskObject() {
var user = {}; var user = {};
user.id = this.GLOBALUTIL.user.userid; user.id = this.GLOBALUTIL.user.userid;
...@@ -137,14 +132,15 @@ ...@@ -137,14 +132,15 @@
success: (res) => { success: (res) => {
var data = res.data; var data = res.data;
this.itemData = data; this.itemData = data;
var itemList = data.map((opt) => { console.log(data)
var status = opt.execute_state ? "(已完成)" : "" // var itemList = data.map((opt) => {
return { // var status = opt.execute_state ? "(已完成)" : ""
label: opt.content + status, // return {
value: opt.id // label: opt.content + status,
}; // value: opt.id
}) // };
this.itemarr = itemList; // })
// this.itemarr = itemList;
} }
}) })
}, },
...@@ -226,9 +222,16 @@ ...@@ -226,9 +222,16 @@
width: 100%; width: 100%;
height: 60rpx; height: 60rpx;
border-bottom: 1rpx solid #898989; border-bottom: 1rpx solid #898989;
} }
.type-container{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100rpx;
border-bottom: 1rpx solid #898989;
}
.arrow-right { .arrow-right {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
......
...@@ -70,28 +70,48 @@ ...@@ -70,28 +70,48 @@
var statusStr = searchStr.split("&")[1] var statusStr = searchStr.split("&")[1]
var code = codeStr.split("=")[1] var code = codeStr.split("=")[1]
var status = statusStr.split("=")[1] var status = statusStr.split("=")[1]
var body = {
"code":code
}
uni.request({ uni.request({
url: this.GLOBALUTIL.url+'/app-auth/accesstoken', url: this.GLOBALUTIL.url+'/api/wx/login', //仅为示例,并非真实接口地址。
method: 'GET', method: 'POST',
header: { data: body,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
success: (res) => {
console.log(res)
uni.request({
url: this.GLOBALUTIL.url+'/app-auth/getUserInfo/' + code,
method: 'GET',
header: { header: {
'Accept': 'application/json', 'Accept': 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}, },
success: (res) => { success: (res) => {
console.log(res) console.log(res);
}
})
} }
}) })
// uni.request({
// url: this.GLOBALUTIL.url+'/app-auth/accesstoken',
// method: 'GET',
// header: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// },
// success: (res) => {
// console.log(res)
// var bod = {
// "code":code,
// "token":res.data
// }
// uni.request({
// url: this.GLOBALUTIL.url+'/app-auth/getUserInfo',
// method: 'POST',
// data: JSON.stringify(bod),
// header: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// },
// success: (res1) => {
// console.log(res1)
// }
// })
// }
// })
console.log(code) console.log(code)
console.log(status) console.log(status)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment