pengyh 1 rok pred
rodič
commit
4b82d178bc

+ 36 - 15
src/views/mallManagement/activityOrder/detail.vue

@@ -84,7 +84,7 @@
 				</el-form>
 			</div>
 		</el-card>
-		<el-card class="box-card">
+		<el-card class="box-card" v-if="activeItems.length > 0">
 			<div slot="header" class="clearfix">
 				<span>报名信息</span>
 			</div>
@@ -113,10 +113,14 @@
 			      </div>
 			    </div>
 			  </div>
-			  <div class="input-container" v-else>
+			  <div class="input-container" v-else-if="item.type == 3">
 			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div>
 				<el-input type="text" v-model="item.inputValue" :maxlength="item.answer[0].option_limit" :disabled="formType!=0" :placeholder="`请输入${item.question}`"></el-input>
 			  </div>
+			  <div class="input-container" v-else>
+			    <div class="label"><span v-if="item.isRequire">*</span>{{item.question}}</div><br/>
+				<ImageUpload :fileList="item.inputValue" :limit="1" :isEdit="formType==0" :fileType="['image','video']"/>
+			  </div>
 			</div>
 		</el-card>
 		<el-card class="box-card" v-if="formType != 0">
@@ -237,28 +241,35 @@
 				})
 			},
 			getActiveList(){
-				getActiveList({}).then(res => {
+				getActiveList({pageNum: 1,pageSize: -1,status: 1}).then(res => {
 					this.activeList = res.data.records
 				})
 			},
 			getActiveDetail(id,items){
 				getActiveDetail({id}).then(res => {
-					res.data.promotionQuestionnaireItems.forEach(item=>{
+					this.formData.activeDate = [res.data.startTime,res.data.endTime]
+					res.data.promotionQuestionnaireItems.forEach((item,index)=>{
 						item.answer = JSON.parse(item.answer)
 						if(items){
-							items.forEach(it=>{
-								item.answer.forEach(it1 => {
-								  JSON.parse(it.answer).forEach(it2 => {
-								    if(it1.option_value == it2.option_value && it2.active){
-										it1.active = true;
-									}else{
-										it.active = false;
-									}
-								  })
-								})
+							item.answer.forEach((it,ind) => {
+								let data = JSON.parse(items[index].answer)
+								if(data[ind]?.active){
+									it.active = true;
+								}else{
+									it.active = false;
+								}
+								if(items[index].type == 3){
+									item.inputValue = data[ind]?.option_value
+								}else if(item.type == 4){
+									item.inputValue = [{url: data[ind]?.option_value}]
+								}
 							})
 						}else{
-							item.inputValue = '';
+							if(item.type == 4){
+								item.inputValue = []
+							}else{
+								item.inputValue = '';
+							}
 							item.answer.forEach(it => {
 							  it.active = false;
 							})
@@ -294,6 +305,10 @@
 							    if(this.activeItems[i].type == 3 && !this.activeItems[i].inputValue) {
 									return this.$message.warning(`请输入${this.activeItems[i].question}`)
 							    }
+								// 图片视频
+								if(this.activeItems[i].type == 4 && this.activeItems[i].inputValue.length==0) {
+									return this.$message.warning(`请上传${this.activeItems[i].question}`)
+								}
 							  }
 							}
 							// 生成题目提交信息
@@ -312,6 +327,12 @@
 							    activeItems[index].answer = JSON.stringify(activeItems[index].answer);
 							    items.push(activeItems[index]);
 							  }
+							  // 图片视频
+							  if (activeItems[index].type == 4 && activeItems[index].inputValue.length > 0) {
+							    activeItems[index].answer[0].option_value = activeItems[index].inputValue[0].url;
+							    activeItems[index].answer = JSON.stringify(activeItems[index].answer);
+							    items.push(activeItems[index]);
+							  }
 							}
 							add({
 								promotionQuestionnaireId: this.formData.promotionActivityId,

+ 9 - 4
src/views/mallManagement/activityOrder/index.vue

@@ -59,7 +59,8 @@ export default {
 			// 表格属性
 			tableAttributes: {
 				// 启用勾选列
-				selectColumn: true
+				selectColumn: true,
+				selectable: this.selectable
 			},
 			// 表格事件
 			tableEvents: {
@@ -69,10 +70,11 @@ export default {
 			recordSelected: [],
 			/** 表单变量 */
 			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialogTitles: ["新增", "跟进", "详情"],
 			formDialog: false,
 			status: 'ING',
 			id: '',
+			promotion_questionnaire_id: '',
 			isShow: false,
 			formData: {
 				status: 'END',
@@ -117,13 +119,13 @@ export default {
 		backList() {
 			this.id = ''
 			this.formDialog = false;
-			this.$refs.pageRef.refreshList()
+			this.$refs?.pageRef?.refreshList()
 		},
 		// 列表请求函数
 		getList(p, cb) {
 			try {
 				var pam = JSON.parse(JSON.stringify(p))
-				pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+				pam.params.push({ "param": "a.status", "compare": "=", "value": this.status },{ "param": "a.promotion_questionnaire_id", "compare": "=", "value": this.$route.query.promotion_questionnaire_id })
 				cb && cb(pam)
 				return listPageV2(pam)
 			} catch (error) {
@@ -136,6 +138,9 @@ export default {
 		columnParsing(item, defaultData) {
 			return defaultData
 		},
+		selectable(row, index) {
+			return ["ING"].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
+		},
 		// 监听勾选变化
 		selectionChange(data) {
 			this.recordSelected = data

+ 2 - 2
src/views/mallManagement/goods/goodsWarehouse/detail.vue

@@ -16,7 +16,7 @@
 						</div>
 						<div class="mymain-container">
 							<el-row :gutter="20" justify="start">
-								<el-col :span="24">
+								<!-- <el-col :span="24">
 									<el-form-item label="商品可选状态" prop="status" :required="true">
 										<div class="flex_ac">
 											<el-radio-group v-model="formData.status">
@@ -26,7 +26,7 @@
 											<div class="hui" style="margin-left: 80px;">开启状态,商户可选择本商品;关闭则不允许商户选择;</div>
 										</div>
 									</el-form-item>
-								</el-col>
+								</el-col> -->
 								<el-col :span="6">
 									<el-form-item label="品牌" prop="brandName" :rules="[{ required: true, message: `请输入品牌`, trigger: 'blur' }]">
 										<el-input type="text" v-model="formData.brandName" disabled placeholder="请输入"></el-input>