Commit dd79d013 by liuzhanxin

修改

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