|
@@ -74,6 +74,8 @@
|
|
|
packageID:'',
|
|
|
packageName:'',
|
|
|
sheetID:'',
|
|
|
+ type:'',
|
|
|
+ sheetID:'',
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -88,9 +90,16 @@
|
|
|
this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
|
|
this.userInfo=uni.getStorageSync("userInfo");
|
|
|
this.ShopName=opt.ShopName;
|
|
|
- this.shopId=opt.shopId;
|
|
|
+ this.type=opt.type;
|
|
|
+ if(this.type){
|
|
|
+ this.sheetID=opt.sheetID
|
|
|
+ }else{
|
|
|
+ this.shopId=opt.shopId;
|
|
|
+ this.getCheckPackageInfo();
|
|
|
+ }
|
|
|
+
|
|
|
this.getTime();
|
|
|
- this.getCheckPackageInfo();
|
|
|
+
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
@@ -149,6 +158,89 @@
|
|
|
return timer;
|
|
|
},
|
|
|
goNext(){
|
|
|
+ if(this.type==3){
|
|
|
+ this.goEdit()
|
|
|
+ }else{
|
|
|
+ var go=true;
|
|
|
+ var name='';
|
|
|
+ var categoryList=[]
|
|
|
+ console.log(this.list)
|
|
|
+ this.list.forEach(item=>{
|
|
|
+ var obj={
|
|
|
+ categoryID:item.categoryID,
|
|
|
+ categoryName:item.categoryName,
|
|
|
+ sectionList:[]
|
|
|
+ }
|
|
|
+ item.sectionList.forEach(v=>{
|
|
|
+ if(v.check){
|
|
|
+ var isCheck=1
|
|
|
+ }else{
|
|
|
+ var isCheck=0
|
|
|
+ }
|
|
|
+ var sectionListobj={
|
|
|
+ sectionID:v.sectionID,
|
|
|
+ checkName:v.checkName,
|
|
|
+ checkCycle:v.checkCycle,
|
|
|
+ isCheck:isCheck,
|
|
|
+ isRequired:v.isRequired,
|
|
|
+ itemList:[]
|
|
|
+ }
|
|
|
+ if(v.isRequired==1){
|
|
|
+ if(!v.check){
|
|
|
+ go=false
|
|
|
+ name=v.checkName
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ v.itemList.forEach(i=>{
|
|
|
+ var itemObj={
|
|
|
+ itemName:i.itemName,
|
|
|
+ sectionItemID:i.sectionItemID,
|
|
|
+ itemValue:i.itemValue,
|
|
|
+ describe:i.describe,
|
|
|
+ keyType:i.keyType,
|
|
|
+ keyValue:i.keyValue,
|
|
|
+ }
|
|
|
+ sectionListobj.itemList.push(itemObj)
|
|
|
+ })
|
|
|
+ obj.sectionList.push(sectionListobj)
|
|
|
+ })
|
|
|
+ categoryList.push(obj);
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log('categoryList')
|
|
|
+ console.log(categoryList)
|
|
|
+ if(!go){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请填写'+name,
|
|
|
+ icon:'none',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ uni.showLoading({ });
|
|
|
+ this.$http('accompany/SuperCheckSheet/addSuperCheckSheet', {
|
|
|
+ shopID:this.shopId,
|
|
|
+ shopName:this.ShopName,
|
|
|
+ checkTime:this.date,
|
|
|
+ packageID:this.packageID,
|
|
|
+ packageName:this.packageName,
|
|
|
+ categoryList:JSON.stringify(categoryList)
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ this.sheetID=res.data;
|
|
|
+ console.log(this.sheetID);
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'opinion?sheetID='+this.sheetID
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ goEdit(){
|
|
|
+
|
|
|
var go=true;
|
|
|
var name='';
|
|
|
var categoryList=[]
|
|
@@ -157,6 +249,7 @@
|
|
|
var obj={
|
|
|
categoryID:item.categoryID,
|
|
|
categoryName:item.categoryName,
|
|
|
+ id:item.id,
|
|
|
sectionList:[]
|
|
|
}
|
|
|
item.sectionList.forEach(v=>{
|
|
@@ -171,6 +264,7 @@
|
|
|
checkCycle:v.checkCycle,
|
|
|
isCheck:isCheck,
|
|
|
isRequired:v.isRequired,
|
|
|
+ id:v.id,
|
|
|
itemList:[]
|
|
|
}
|
|
|
if(v.isRequired==1){
|
|
@@ -188,6 +282,7 @@
|
|
|
describe:i.describe,
|
|
|
keyType:i.keyType,
|
|
|
keyValue:i.keyValue,
|
|
|
+ id:i.id,
|
|
|
}
|
|
|
sectionListobj.itemList.push(itemObj)
|
|
|
})
|
|
@@ -196,7 +291,7 @@
|
|
|
categoryList.push(obj);
|
|
|
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
console.log('categoryList')
|
|
|
console.log(categoryList)
|
|
|
if(!go){
|
|
@@ -208,23 +303,18 @@
|
|
|
return false;
|
|
|
}
|
|
|
uni.showLoading({ });
|
|
|
- this.$http('accompany/SuperCheckSheet/addSuperCheckSheet', {
|
|
|
- shopID:this.shopId,
|
|
|
- shopName:this.ShopName,
|
|
|
+ this.$http('accompany/SuperCheckSheet/editSuperCheckSheet', {
|
|
|
+ sheetID:this.sheetID,
|
|
|
checkTime:this.date,
|
|
|
- packageID:this.packageID,
|
|
|
- packageName:this.packageName,
|
|
|
categoryList:JSON.stringify(categoryList)
|
|
|
}, 'POST').then(res => {
|
|
|
this.sheetID=res.data;
|
|
|
console.log(this.sheetID);
|
|
|
uni.navigateTo({
|
|
|
- url:'opinion?sheetID='+this.sheetID
|
|
|
+ url:'opinion?sheetID='+this.sheetID+'&type='+this.type
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
onUnload(){
|
|
|
|