diff --git a/admin-web-master/src/components/add/addfa.vue b/admin-web-master/src/components/add/addfa.vue
index 4911ad5..482cf66 100644
--- a/admin-web-master/src/components/add/addfa.vue
+++ b/admin-web-master/src/components/add/addfa.vue
@@ -122,6 +122,7 @@
import {
cereResourceStrategy,
cereBusinessOperationadd,
+ modifyResourceStatus
} from '@/api/newly.js'
export default {
components: {
@@ -255,79 +256,95 @@
}
})
},
- async add() {
- if (this.formInline.id) {
-
- } else {
- let c2 = ''
- let alllist = this.buildTree(this.AddData)
- console.error(alllist)
- //判断alllist是不是数组
- if (Array.isArray(alllist)) {
- for (let i = 0; i < alllist.length; i++) {
- let cnet = alllist[i].id
- await this.addclall(alllist[i].id,alllist[i].clids)
- if (i == 0) {
- c2 = cnet
- } else {
- c2 = c2 + ',' + cnet
- }
+ async clinfo() {
+ let c2 = ''
+ let alllist = this.buildTree(this.AddData)
+ console.error(alllist)
+ //判断alllist是不是数组
+ if (Array.isArray(alllist)) {
+ for (let i = 0; i < alllist.length; i++) {
+ let cnet = alllist[i].id
+ await this.addclall(alllist[i].id,alllist[i].clids.split(","))
+ if (i == 0) {
+ c2 = cnet
+ } else {
+ c2 = c2 + ',' + cnet
}
-
- } else{
+ }
+
+ } else{
+ return
+ }
+ console.error(c2)
+ await cereBusinessOperationadd({
+ type: '发布',
+ resourceId: c2,
+ operator: localStorage.getItem('roleName'),
+ operationTime: this.gettime()
+ }).then(res => {
+ console.error(res)
+ })
+ this.formInline.resourceManagement = c2
+ console.error({
+ ...this.formInline
+ })
+ fangAdd({
+ ...this.formInline
+ }).then(res => {
+ console.error(res)
+ this.$message({
+ message: '添加成功',
+ type: 'success'
+ })
+ modifyResourceStatus({
+ resourcesId: c2,
+ status:"1"
+ }).then(res => {
+ console.error(res)
+ })
+ this.$emit('removeonaction', '1')
return
+ if (res.code == 200) {
+ this.$message({
+ message: '添加成功',
+ type: 'success'
+ })
+ modifyResourceStatus({
+ resourcesId: c2,
+ status:"1"
+ }).then(res => {
+ console.error(res)
+ })
+ this.$emit('removeonaction', '1')
+ } else {
+ this.$message({
+ message: res.msg,
+ type: 'error'
+ })
}
- console.error(c2)
- await cereBusinessOperationadd({
- type: '发布',
- resourceId: c2,
- operator: localStorage.getItem('roleName'),
- operationTime: this.gettime()
- }).then(res => {
- console.error(res)
- })
- this.formInline.resourceManagement = c2
- console.error({
- ...this.formInline
- })
- // return
- this.$refs.heForm.validate((valid) => {
- console.log(valid)
- if (valid) {
- fangAdd({
- ...this.formInline
- }).then(res => {
- console.error(res)
- if (res.code == 200) {
- this.$message({
- message: '添加成功',
- type: 'success'
- })
- modifyResourceStatus({
- resourcesId: c2,
- status:"1"
- }).then(res => {
- console.error(res)
- })
- this.$emit('removeonaction', '1')
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- })
- } else {
+ })
+ },
+ async add() {
+ this.$refs.heForm.validate((valid) => {
+ console.log(valid)
+ if (valid) {
+ if(this.AddData.length == 0) {
this.$message({
- message: '请填写完整信息',
+ message: '请选择招商资源',
type: 'error'
})
- return false;
+ return
}
- })
-
- }
+ this.clinfo()
+ } else {
+ this.$message({
+ message: '请填写完整信息',
+ type: 'error'
+ })
+ return false;
+ }
+ })
},
close() {
this.$emit('removeonaction', '1')
diff --git a/admin-web-master/src/views/ads/fangli/index.vue b/admin-web-master/src/views/ads/fangli/index.vue
index d73e705..612690b 100644
--- a/admin-web-master/src/views/ads/fangli/index.vue
+++ b/admin-web-master/src/views/ads/fangli/index.vue
@@ -150,6 +150,10 @@
} from '@/api/information';
import add from '@/components/add/addfa'
import resourceCommodity from '@/components/resourceCommodity/index'
+ import {
+ fangGetAll,
+ fangDel,
+ } from '@/api/fangli'
import cl from '@/components/change/cl.vue'
import {
cereResourceStrategy,
@@ -167,16 +171,16 @@
contractChangeReason: '',
detailsinfo: {},
pagequery: {
- belongingRegion:'',
- shopName:'',
- pageNumber: 0,
+ // belongingRegion:'',
+ // shopName:'',
+ pageNumber: 1,
pageSize: 10,
- belongingGreenwaySection:'',
- belongingDepartment:''
+ // belongingGreenwaySection:'',
+ // belongingDepartment:''
},
tableData: [],
total: 0,
- onaction: '2',
+ onaction: '1',
formInline: {
},
}
@@ -193,8 +197,8 @@
},
async created() {
this.getAll()
- const lvdao = await lvdaoduan()
- this.lvdaoList = lvdao.data
+ // const lvdao = await lvdaoduan()
+ // this.lvdaoList = lvdao.data
},
methods: {
minSev(e) {
@@ -333,7 +337,7 @@
this.onaction = '4'
},
async getAll() {
- const res = await getAlls(this.pagequery)
+ const res = await fangGetAll(this.pagequery)
this.tableData = res.data.content
this.total = res.data.totalElements
},
diff --git a/wenjuan-h5/config/api.js b/wenjuan-h5/config/api.js
index f924923..29a66ed 100644
--- a/wenjuan-h5/config/api.js
+++ b/wenjuan-h5/config/api.js
@@ -20,8 +20,10 @@ let DOMAIN_PREFIX = 'http://10.0.0.41:9007'
let host = window.location.host;
let hostall = window.location.href;
if(host === 'localhost:8080' || host === 'localhost:8081' || host === 'localhost:9528'|| host === '192.168.31.45:9528'|| host === 'localhost:9529' ) {
- // DOMAIN_PREFIXPING = `http://10.0.0.41:9003`
- // DOMAIN_PREFIX = 'http://10.0.0.41:9007'
+
+ DOMAIN_PREFIXPING = 'http://10.0.0.41:9003'
+ DOMAIN_PREFIX = 'http://10.0.0.41:9007'
+
} else {
let c1 = hostall.split('cdwlMall')[0];
DOMAIN_PREFIXPING = `${c1}/cdwlMall/admin-server`
diff --git a/wenjuan-h5/pages_category_page1/question/question.vue b/wenjuan-h5/pages_category_page1/question/question.vue
index 4688ec4..cee5104 100644
--- a/wenjuan-h5/pages_category_page1/question/question.vue
+++ b/wenjuan-h5/pages_category_page1/question/question.vue
@@ -146,7 +146,7 @@
-
+
@@ -274,7 +274,7 @@
if (res.data.id) {
this.wenjuan = res.data
this.wenjuan.question = JSON.parse(res.data.question)
- console.error(this.wenjuan.question)
+
//检查this.wenjuan.question这个list的每个里面是否有maxChoose参数,没有的话就加一个
// this.wenjuan.question.forEach(item => {
// console.log(item)
@@ -378,13 +378,25 @@
let question = qust[key];
if (question.required === '必填') {
if (question.type === '文本' || question.type === '单选') {
- if (question.choose === '') {
-
- this.$refs.uToast.show({
- title: '请填写所有必填题目',
- })
-
- return false; // 返回false表示有未填写的必填题目
+ if(Array.isArray(question.choose)) {
+ if (question.choose.length>0 && question.choose[0]) {
+
+ } else{
+ this.$refs.uToast.show({
+ title: '请填写所有必填题目',
+ })
+
+ return false; // 返回false表示有未填写的必填题目
+ }
+ } else{
+ if (question.choose === '') {
+
+ this.$refs.uToast.show({
+ title: '请填写所有必填题目',
+ })
+
+ return false; // 返回false表示有未填写的必填题目
+ }
}
} else if (question.type === '多选') {
@@ -543,7 +555,7 @@
// }
- console.log(this.wenjuan)
+ // console.log(this.wenjuan)
// let obj = {
// questionnaireId: this.wenjuanIds,
@@ -587,7 +599,7 @@
for (var key in obj.question) {
- console.log(obj.question[key])
+ // console.log(obj.question[key])
if (obj.question[key].type == '多选') {
obj.question[key].choose = []
obj.question[key].options.map(res => {
@@ -599,8 +611,12 @@
obj.question[key].choose = obj.question[key].choose.join(',')
}
}
+<<<<<<< HEAD
const result = Object.keys(obj.question).reduce((acc, key1) => {
console.log(obj.question[key])
+=======
+ const result = Object.keys(obj.question).reduce((acc, key) => {
+>>>>>>> 6831f623bce8e6b705cfe4179e206802a72a8a54
const question = obj.question[key];
let chooseAnswers = []
if (!Array.isArray(question.choose)) {
@@ -615,12 +631,11 @@
return optionIndex >= 0 ? optionIndex + 1 : null; // 序号从1开始
});
- acc[key1] = indexes.filter((index) => index !== null).join(","); // 只保留有效序号
+ acc[key] = indexes.filter((index) => index !== null).join(","); // 只保留有效序号
return acc;
}, {});
-
// 计算总分数
- const totalScore = Object.keys(obj.question).reduce((sum, key1) => {
+ const totalScore = Object.keys(obj.question).reduce((sum, key) => {
const question = obj.question[key]
if (question.type === "单选" || question.type === "多选") {
// const chooseAnswers = question.choose.split(","); // 多选时拆分答案
@@ -667,6 +682,7 @@
// questionnaireScore: null,
// }
+
obj.question = JSON.stringify(obj.question)
let tijiaoObj = {
questionnaireId: this.wenjuanIds,
@@ -682,7 +698,13 @@
question: obj.question
}
-
+
+ // console.log(result)
+ // console.log(JSON.stringify(result))
+ // console.log(tijiaoObj)
+ // console.log(JSON.stringify(tijiaoObj))
+ // return
+
NET.request(API.wenjuanUp, tijiaoObj, 'post').then(res => {
// this.show =true
@@ -737,7 +759,7 @@
// this.$forceUpdate();
},
chooseAnswerOne(options, chooseItem, idx) {
- console.error(options, chooseItem, idx)
+
options.forEach(item => {
item.disabled = false
})
@@ -745,9 +767,9 @@
for (let key in this.wenjuan.question) {
this.wenjuan.question[key].options.map(res => {
if (res.answer == chooseItem.answer) {
- console.error(';;',chooseItem.answer)
+
this.wenjuan.question[key].choose = chooseItem.answer
- console.log(';;',this.wenjuan.question[key].choose)
+
}
})
}
@@ -763,15 +785,14 @@
// ...chooseItem
// }
chooseItem.disabled = true
- console.error(options, chooseItem, idx)
+
},
chooseAnswer(val,idx,item,index) {
- console.log(val,idx,item,index)
- console.error(this.wenjuan.question[Number(index)].options[idx])
+
if (item.maxChoose && item.maxChoose > 0) {
// 获取当前题目的已选中选项数量
const selectedCount = item.options.filter(option => option.disabled).length;
- console.error(selectedCount)
+
// 如果已选中到达 maxChoose,并且当前项未被选中,则不允许选择
if (selectedCount > item.maxChoose ) {
uni.showToast({
@@ -786,7 +807,7 @@
}
},
chooseAnswerMore(chooseItem, idx, item) {
- console.log(chooseItem, idx, item)
+
// item.maxChoose =2
if (item.maxChoose && item.maxChoose > 0) {
// 获取当前题目的已选中选项数量
diff --git a/wenjuan-h5/unpackage/dist/build/web.zip b/wenjuan-h5/unpackage/dist/build/web.zip
index 7b1e9de..704c63a 100644
--- a/wenjuan-h5/unpackage/dist/build/web.zip
+++ b/wenjuan-h5/unpackage/dist/build/web.zip
diff --git a/wenjuan-h5/unpackage/dist/build/web/index.html b/wenjuan-h5/unpackage/dist/build/web/index.html
index 78bd0d3..b2300d6 100644
--- a/wenjuan-h5/unpackage/dist/build/web/index.html
+++ b/wenjuan-h5/unpackage/dist/build/web/index.html
@@ -1,2 +1,2 @@
问卷调查
\ No newline at end of file
+ document.write('')