|
@@ -7,6 +7,17 @@
|
|
|
<view class="delOpTxt">删除</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="lineCont">
|
|
|
+ <view class="lineContLeft">检测项</view>
|
|
|
+ <view class="lineContRight" @click="pickerClick(item)">
|
|
|
+ <picker mode="multiSelector" @change="bindPickerChange" @columnchange="columnchange" :value="index" :range="array"
|
|
|
+ range-key="title">
|
|
|
+ <view class="timeNoSpan" v-if="!item.checkName">{{title}}</view>
|
|
|
+ <view v-else>{{item.categoryName}}-{{item.checkName}}</view>
|
|
|
+ </picker>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="lineCont">
|
|
|
<view class="lineContLeft">负责人</view>
|
|
|
<view class="lineContRight" >
|
|
@@ -53,12 +64,21 @@
|
|
|
suggest:'',
|
|
|
orderFinishTime:'',
|
|
|
managerName:'',
|
|
|
+ sheetCategoryID:'',
|
|
|
+ sheetSectionID:'',
|
|
|
+ categoryName:'',
|
|
|
+ checkName:'',
|
|
|
}
|
|
|
],
|
|
|
sheetID:'',
|
|
|
shopName:'',
|
|
|
Contactor:'',
|
|
|
nowDate:'',
|
|
|
+ index: [0, 0],
|
|
|
+ array: [[],[]],
|
|
|
+ childArr: [], // 二级分类数据源
|
|
|
+ title: '请选择',
|
|
|
+ pickerItem:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad(opt) {
|
|
@@ -70,9 +90,28 @@
|
|
|
this.suggestList=this.$store.state.suggestList;
|
|
|
this.addOp()
|
|
|
}
|
|
|
- this.getTime()
|
|
|
+ this.getTime();
|
|
|
+ this.getqueryCheckCategory();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 选择任务分类
|
|
|
+ bindPickerChange: function(e) {
|
|
|
+ //console.log(e)
|
|
|
+ console.log('picker发送选择改变,携带值为', e.target.value)
|
|
|
+ let value = e.target.value;
|
|
|
+ this.index = value;
|
|
|
+ if (this.array[0].length != 0) {
|
|
|
+ //this.title = this.array[0][this.index[0]].title
|
|
|
+ this.pickerItem.categoryName= this.array[0][this.index[0]].title
|
|
|
+ this.pickerItem.sheetCategoryID= this.array[0][this.index[0]].id
|
|
|
+ };
|
|
|
+ if (this.array[1].length != 0) {
|
|
|
+ //this.title += ',' + this.array[1][this.index[1]].title
|
|
|
+ this.pickerItem.checkName=this.array[1][this.index[1]].title;
|
|
|
+ this.pickerItem.sheetSectionID= this.array[1][this.index[1]].id;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
bindTimeChange(e){
|
|
|
console.log(e)
|
|
|
this.pickerItem.orderFinishTime=e.detail.value;
|
|
@@ -85,6 +124,10 @@
|
|
|
suggest:'',
|
|
|
orderFinishTime:'',
|
|
|
managerName:'',
|
|
|
+ sheetCategoryID:'',
|
|
|
+ sheetSectionID:'',
|
|
|
+ categoryName:'',
|
|
|
+ checkName:'',
|
|
|
}
|
|
|
this.suggestList.push(obj)
|
|
|
},
|
|
@@ -109,6 +152,7 @@
|
|
|
var goname=true;
|
|
|
var gotime=true;
|
|
|
var gosuggest=true;
|
|
|
+ var gojc=true;
|
|
|
var that=this;
|
|
|
this.suggestList.forEach(item=>{
|
|
|
if(item.managerName==''){
|
|
@@ -120,6 +164,9 @@
|
|
|
if(item.suggest==''){
|
|
|
gosuggest=false;
|
|
|
}
|
|
|
+ if(item.sheetCategoryID==''){
|
|
|
+ gojc=false;
|
|
|
+ }
|
|
|
})
|
|
|
if(!goname){
|
|
|
uni.showToast({
|
|
@@ -142,7 +189,15 @@
|
|
|
duration: 2000,
|
|
|
});
|
|
|
return false;
|
|
|
+ }else if(!gojc){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择检测项',
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
}
|
|
|
+ console.log(gojc)
|
|
|
console.log(this.suggestList);
|
|
|
|
|
|
uni.showLoading({ });
|
|
@@ -172,6 +227,7 @@
|
|
|
var goname=true;
|
|
|
var gotime=true;
|
|
|
var gosuggest=true;
|
|
|
+ var gojc=true;
|
|
|
this.suggestList.forEach(item=>{
|
|
|
if(item.managerName==''){
|
|
|
goname=false;
|
|
@@ -182,6 +238,9 @@
|
|
|
if(item.suggest==''){
|
|
|
gosuggest=false;
|
|
|
}
|
|
|
+ if(item.sheetCategoryID==''){
|
|
|
+ gojc=false;
|
|
|
+ }
|
|
|
})
|
|
|
if(!goname){
|
|
|
uni.showToast({
|
|
@@ -204,6 +263,13 @@
|
|
|
duration: 2000,
|
|
|
});
|
|
|
return false;
|
|
|
+ }else if(!gojc){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请选择检测项',
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
}
|
|
|
uni.showLoading({ });
|
|
|
this.$http('accompany/SuperCheckSheet/saveSuperCheckSheetSuggest', {
|
|
@@ -245,6 +311,39 @@
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ getqueryCheckCategory(){
|
|
|
+ this.$http('accompany/SuperCheckSheet/queryCheckCategory', {
|
|
|
+ sheetID:this.sheetID,
|
|
|
+
|
|
|
+ }, 'GET').then(res => {
|
|
|
+ res.data.forEach(item=>{
|
|
|
+ item.title=item.categoryName
|
|
|
+ item.sectionList.forEach(v=>{
|
|
|
+ v.title=v.checkName
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.array[0]=res.data;
|
|
|
+ this.childArr = res.data.map((item) => item.sectionList)
|
|
|
+ // 第一次打开时,默认给一级分类添加它的二级分类
|
|
|
+ this.array[1] = this.childArr[0]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取二级分类
|
|
|
+ columnchange(e) {
|
|
|
+ // 当滚动切换一级分类时,为当前的一级分类添加它的子类
|
|
|
+ if (e.detail.column == 0) {
|
|
|
+ // #ifdef H5
|
|
|
+ // 在小程序中直接赋值无效 H5 可直接赋值
|
|
|
+ this.array[1] = this.childArr[e.detail.value]
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ // 在 H5 环境下 $set 会导致一级分类无法滚动, 小程序正常运行
|
|
|
+ this.$set(this.array, 1, this.childArr[e.detail.value])
|
|
|
+ // #endif
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
getTime(){
|
|
|
var date = new Date(),
|
|
|
year = date.getFullYear(),
|