this.Api.removeRow() // 删除行数据 这个api 括号里填什么参数?

问题描述: this.Api.removeRow() // 删除行数据  这个api 括号里填什么参数?


解决方案: this.Api.removeRow(formData) // 删除行( 根据数据判断删除或者添加删除线 )

                 this.Api.removeRow(formData, true) // 直接删除行

示例代码:

this.Api.removeRow({‘name’:'primeton'},true) 

调用删除行接口后,会弹出提示框,如下图:

更多请参见EOS Low-Code Platform 8 

将下面代码canCancel设置返回类型,如果是true返回1,false返回0:<template> <div class="container"> <el-tabs type="border-card"> <el-tab-pane :label="title"> <el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form-item label="介绍图片:" prop="cover"> <div style="display: flex;"> <div class="flex-row"> <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" :before-upload="beforeAvatarUpload" :on-change="handleAvatarChange"> <img v-if="form.cover" :src="form.cover" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </div> </div> </el-form-item> <el-row> <el-col :span="12"> <el-form-item label="团购名称:" prop="name"> <el-input class="input" v-model="form.name" placeholder="请输入团购名称" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="自动截止:" prop="isAutoEnd"> <el-switch v-model="form.isAutoEnd" :active-value="true" :inactive-value="false" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="团购内容:" prop="detailInfo"> <el-input class="input" v-model="form.detailInfo" placeholder="请输入团购内容" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="开始时间:" prop="startTime"> <el-date-picker clearable v-model="form.startTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动开始时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="截止时间:" prop="endTime"> <el-date-picker clearable v-model="form.endTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动截止时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最大接龙人数" prop="maxJoinNum"> <el-input class="input" v-model="form.maxJoinNum" placeholder="请输入" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最小成交金额" prop="minAmount"> <el-input class="input" v-model="form.minAmount" placeholder="请输入" /> </el-form-item> </el-col> </el-row> <el-form-item label="其它信息:"> <el-checkbox-group v-model="selectedItemsOther" @change="updateOtherInfo"> <el-checkbox label="真实姓名"></el-checkbox> <el-checkbox label="手机号码"></el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item label="功能选择:"> <el-checkbox-group v-model="selectedItemsFunction" @change="updateFunctionSelection"> <el-checkbox label="发布最新接龙列表"></el-checkbox> <el-checkbox label="接龙金额仅创建人可见"></el-checkbox> <el-checkbox label="禁止用户取消订单"></el-checkbox> </el-checkbox-group> </el-form-item> <div> <el-form-item label="商品信息:" > </el-form-item> <el-table :data="form.products" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="商品名称" align="center" prop="product.name"> <template slot-scope="{row,$index}"> <el-input v-model="row.name" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品价格" align="center" prop="product.price"> <template slot-scope="{row,$index}"> <el-input v-model="row.price" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品数量" align="center" prop="product.soldNum"> <template slot-scope="{row,$index}"> <el-input v-model="row.soldNum" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="每单限制购买量" align="center" prop="product.limitNum" width="180"> <template slot-scope="{row,$index}"> <el-input v-model="row.limitNum" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="商品图片" align="center" prop="product.image" width="180"> <template slot-scope="{row,$index}"> <el-input v-model="row.imagee" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <!-- <el-button size="mini" type="text" v-if="scope.row.status != &#39;4&#39;" icon="el-icon-edit" @click="openApproval(scope.row)" v-hasPermi="[&#39;solitaire:list:order&#39;]">添加 </el-button > --> <el-button @click="addproduct()"> 添加</el-button> <el-button type="danger" icon="el-icon-delete" @click="removeRow($index)">删除</el-button> </template> </el-table-column> </el-table> </div> </el-form> <!-- 修改/新增 --> <div class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> <el-button @click="handleBack">取 消</el-button> </div> </el-tab-pane> </el-tabs> </div> </template> <script> import { imgUrl } from &#39;@/utils/request&#39; import { getISOTime, checkLongitudeValidator, checkPointIsNumber } from &#39;@/utils/parsing&#39; import { checkPhone } from &#39;@/utils/validate&#39; import mapView from &#39;@/components/MapContainer/index.vue&#39; import { addGroupShop, editGroupBuy, getGroupBuyDetail } from &#39;@/api/solitaire/solitaire&#39; export default { components: { mapView }, data() { return { // 第一个复选框组绑定值 selectedItemsOther: [], // 第二个复选框组绑定值 selectedItemsFunction: [], checkList: [&#39;选中且禁用&#39;,&#39;复选框 A&#39;], checked: true, // 单个复选框的绑定 dataList: [], title: "接龙", // 封面图片 selectImgUrl: &#39;&#39;, queryParams: {}, currentImgIndex: 0, // 封面图片类型选择 imgDialogVisible: false, // 表单数据 form: { canCancel: 0, cover:&#39;&#39;, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isGetPhone: false, isGetRealName: false, isHideList: false, isHideOrderAmount: false, isJoin: 0, maxJoinNum: 0, minAmount: 0, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, }, // 表单校验 rules: { cover: [ { required: true, message: &#39;请选择活动图片&#39;, trigger: [&#39;change&#39;, &#39;blur&#39;] } ], name: [ { required: true, message: &#39;请输入团购名称&#39;, trigger: &#39;change&#39; } ], othermessage: [ { type: &#39;array&#39;, required: true, message: &#39;请选择其它信息&#39;, trigger: &#39;change&#39; } ], selectability: [ { type: &#39;array&#39;, required: true, message: &#39;请选择功能&#39;, trigger: &#39;change&#39; }, ], serviceSafeguard: [ { type: &#39;array&#39;, required: true, message: &#39;请选择志愿者保障&#39;, trigger: &#39;change&#39; } ], detailInfo: [ { required: true, message: &#39;请输入团购内容&#39;, trigger: &#39;change&#39; } ], maxJoinNum: [ { required: true, message: &#39;最大人数不能为空&#39;, trigger: &#39;change&#39; } ], minAmount: [ { required: true, message: &#39;最小成交金额不能为空&#39;, trigger: &#39;change&#39; } ], endTime: [ { required: true, message: &#39;结束时间必须选择&#39;, trigger: &#39;change&#39; } ], startTime: [ { required: true, message: &#39;开始时间不能为空&#39;, trigger: &#39;change&#39; } ], description: [ { required: true, message: &#39;活动开始内容不能为空&#39;, trigger: &#39;change&#39; } ], address: [ { required: true, message: &#39;地点不能为空&#39;, trigger: &#39;change&#39; } ], conditionRequire: [ { required: true, message: &#39;请输入条件说明&#39;, trigger: &#39;change&#39; } ], // signStartDatetime: [ // { required: true, message: &#39;报名开始时间必须选择&#39;, trigger: &#39;change&#39; } // ], signEndDatetime: [ { required: true, message: &#39;活动截止时间必须选择&#39;, trigger: &#39;change&#39; } ], jobUserVOLists: [ { type: &#39;array&#39;, required: true, message: &#39;请添加岗位需求&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].name&#39;: [ { required: true, message: &#39;请添加活动主办方姓名&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].linkmanName&#39;: [ { required: true, message: &#39;请添加活动负责人联系人&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].phone&#39;: [ { required: true, message: &#39;请添加活动负责人电话&#39;, trigger: &#39;change&#39; }, { validator: checkPhone, trigger: &#39;blur&#39; } ] }, // 图片前缀 cover: imgUrl, // //分页 column: { pageSize: null, pageNum: null }, // 队伍列表 duiwoptions: [], // 查询队伍 userqueryParams: { realName: null, role: 1, teamId: null, account: null, contactAddress: null }, checkList1: [], checkList2: [], checkList3: [], userList: [], // 补录图片 fileList: [], dialogImageUrl: &#39;&#39;, dialogVisible: false, // 一个时间段岗位 oneTime: { startDatetime: &#39;&#39;, endDatetime: &#39;&#39;, jobList: [], checkLongitude: &#39;&#39;, checkLatitude: &#39;&#39;, checkLocation: &#39;&#39; }, // 一个岗位 oneJob: { jobName: &#39;&#39;, checkInTime: &#39;&#39;, checkOutTime: &#39;&#39;, jobCount: &#39;&#39;, workHour: 0, point: &#39;&#39;, pointPercent: &#39;&#39;, userIdList: [], jobUsers: [], checkLatitude: &#39;&#39;, checkLongitude: &#39;&#39;, checkLocation: &#39;&#39; }, // 岗位表单校验 jobRules: { jobName: [ { required: true, message: &#39;请输入岗位名称&#39;, trigger: &#39;change&#39; } ], jobCount: [ { required: true, message: &#39;请输入岗位人数&#39;, trigger: &#39;change&#39; } ], workHour: [ { required: true, message: &#39;请输入工时&#39;, trigger: &#39;change&#39; } ], pointPercent: [ { required: true, message: &#39;请输入积分(每人每小时)&#39;, trigger: &#39;change&#39; }, { validator: checkPointIsNumber, message: &#39;积分必须为数字&#39; } ], checkInTime: [ { required: true, message: &#39;请输入签到时间&#39;, trigger: &#39;change&#39; } ], checkOutTime: [ { required: true, message: &#39;请输入签退时间&#39;, trigger: &#39;change&#39; } ], checkLocation: [ { required: true, message: &#39;请选择签到地点&#39;, trigger: &#39;change&#39; } ] }, // 高德地图key key: &#39;6SZBZ-RKVKZ-6JCXL-7CSK2-CPYU6-FZB32&#39;, mapVisible: false, location: {}, locationMsg: { timeIndex: 0, jobIndex: 0 } } }, created() { this.queryParams = this.$route.query; if (this.queryParams.id && this.queryParams.type == &#39;edit&#39;) { // 编辑 this.title = &#39;修改团购&#39; this.getDetail({ status: 1 }) } else { //添加 this.title = &#39;新增团购&#39; this.reset() } console.log(this.title) }, methods: { removeRow(index) { if (this.form.products.length > 1) { this.form.products.splice(index, 1); } else { this.$message.warning(&#39;至少保留一行数据&#39;); } }, addproduct(){ this.form.products.push({ id: &#39;&#39;, image: &#39;&#39;, limitNum: &#39;&#39;, name: "", parentId: &#39;&#39;, price: &#39;&#39;, soldNum: &#39;&#39;, totalNum: &#39;&#39; }) }, handleAvatarChange(file) { if (!file || !file.raw) return; const reader = new FileReader(); reader.onload = (e) => { // 直接更新表单封面数据 this.form.cover = e.target.result; }; reader.readAsDataURL(file.raw); }, beforeAvatarUpload(file) { const validTypes = [&#39;image/jpeg&#39;, &#39;image/png&#39;, &#39;image/gif&#39;, &#39;image/webp&#39;]; const isImage = validTypes.includes(file.type); const isLt2M = file.size / 1024 / 1024 < 2; if (!isImage) { this.$message.error(&#39;只支持 JPG/PNG/GIF 格式!&#39;); return false; } if (!isLt2M) { this.$message.error(&#39;图片大小不能超过 2MB!&#39;); return false; } return true; }, // handleAvatarSuccess(res, file) { // this.cover = URL.createObjectURL(file.raw); // }, // handleCustomUpload(fileObj) { // const file = fileObj.file; // const fd = new FormData(); // fd.append(&#39;file&#39;, file); // uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { // this.form.cover = res; // 关键:将返回的URL绑定到form.cover // this.$message.success(&#39;图片上传成功&#39;); // }).catch(err => { // this.$message.error(&#39;上传失败: &#39; + err.message); // }); // }, updateOtherInfo() { this.form.isGetRealName = this.selectedItemsOther.includes(&#39;真实姓名&#39;); this.form.isGetPhone = this.selectedItemsOther.includes(&#39;手机号码&#39;); }, // 更新"功能选择"表单值 updateFunctionSelection() { this.form.isHideList = this.selectedItemsFunction.includes(&#39;发布最新接龙列表&#39;); this.form.isHideOrderAmount = this.selectedItemsFunction.includes(&#39;接龙金额仅创建人可见&#39;); // "禁止用户取消订单"需要特殊处理:选中时canCancel=false this.form.canCancel = !this.selectedItemsFunction.includes(&#39;禁止用户取消订单&#39;); }, // 获取活动详情 getDetail(status) { getGroupBuyDetail(this.queryParams.id, status).then(response => { this.queryParams.id, status this.form = response console.log(response,&#39;789&#39;) }) }, // 表单重置 reset() { this.form = { cover: null, canCancel: 0, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isGetPhone: 0, isGetRealName: 0, isHideList: 0, isHideOrderAmount: 0, isJoin: 0, maxJoinNum: 0, minAmount: 0, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, } }, // // 取消关闭弹窗 // closeDialog() { // this.currentImgIndex = 0 // this.selectImgUrl = &#39;&#39; // this.imgDialogVisible = false // }, // // 确认默认图片关闭弹窗 // submitPic() { // this.form.cover = this.selectImgUrl // this.imgDialogVisible = false // }, hasCommonValue(arr) { let seen = new Set(); // 用于存储已经遇到的值 for (let obj of arr) { for (let value of obj.jobUsers) { // 如果值已经存在于 set 中,返回 true if (seen.has(value.userId)) { return true; } // 将当前值加入 set seen.add(value.userId); } } return false; // 如果没有重复的值,返回 false }, /** 提交按钮 */ submitForm() { console.log(this.form.products.image,&#39;000&#39;) let newForm = { canCancel: this.form.canCancel, cover: this.form.cover, detailInfo: this.form.detailInfo, endTime: this.form.endTime, id: this.form.id, isAutoEnd: this.form.isAutoEnd, isGetPhone: this.form.isGetPhone, isGetRealName: this.form.isGetRealName, isHideList: this.form.isHideList, isHideOrderAmount: this.form.isHideOrderAmount, isJoin: this.form.isJoin, maxJoinNum: this.form.maxJoinNum, minAmount: this.form.minAmount, name: this.form.name, // 修正products处理:遍历数组中的每个对象 products: this.form.products.map(item => ({ id: item.id, image: item.image, //代码误用value limitNum: item.limitNum, name: item.name, parentId: item.parentId, price: item.price, soldNum: item.soldNum, totalNum: item.totalNum })), realEndTime: this.form.realEndTime, startTime: this.form.startTime, status: this.form.status, // 修正为this.form.status }; console.log(newForm,this.form.id) //判断每个时间段是否有岗位 // let isJobEmpty = this.form.jobUserVOLists.some(item => item.jobList.length == 0) this.$refs[&#39;form&#39;].validate(valid => { if (valid) { if (this.form.id != 0) { editGroupBuy(newForm).then(response => { console.log(response) this.$modal.msgSuccess(&#39;修改成功&#39;) this.$router.back(-1) }) } else { if(this.form.id==0){ addGroupShop(newForm).then(response => { console.log(response) this.$modal.msgSuccess(&#39;新增成功&#39;) this.$router.back(-1) }) } else { console.log(this.form.id,&#39;09&#39;) this.$modal.msgError(&#39;请完善信息&#39;) } } } }) }, handleBack(){ this.$router.back(-1) }, // handleSelectionChange(selection) { this.ids = selection.map(item => item.pkId) this.single = selection.length !== 1 this.multiple = !selection.length }, // 上传图片 // selectPicUpload(obj) { // let fd = new FormData() //参数的格式是formData格式的 // fd.append(&#39;file&#39;, obj.file) //参数 // uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { // this.form.cover = res // }) // }, // 上传图片之前拦截 //活动补录图片 // selectPicUploadMaterial(obj) { // console.log(obj) // let fd = new FormData() //参数的格式是formData格式的 // fd.append(&#39;file&#39;, obj.file) //参数 // console.log(fd) // uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { // console.log(res, &#39;=====&#39;) // this.form.material.push(res) // }) // }, //移除图片 // handleRemoveMaterial(file, fileList) { // console.log(file, fileList); // //拿到删除索引 // let index = this.fileList.indexOf(file) // this.form.material.splice(index, 1) // const list = JSON.parse(JSON.stringify(fileList)) // this.fileList = list.map(item => ({ // name: item.name, // url: item.url // })) // }, //图片预览 // handlePictureCardPreviewMaterial(file) { // this.dialogImageUrl = file.url; // this.dialogVisible = true; // }, // 新增时间段 addTime() { this.$set(this.form.jobUserVOLists, this.form.jobUserVOLists.length, JSON.parse(JSON.stringify(this.oneTime))) // this.form.jobUserVOLists.push(JSON.parse(JSON.stringify(this.oneTime))) }, // 岗位新增 async jobAdd(index) { let data1 = this.form.jobUserVOLists[index] let isPassNum = this.form.jobUserVOLists.filter(item => item.jobList.some(itemson => itemson.jobUsers.length > itemson.jobCount) ); if (isPassNum.length > 0) { this.$modal.msgError(&#39;所添加志愿者数目不能超过岗位人数&#39;) return } else { if (data1.startDatetime && data1.endDatetime) { this.oneJob.checkInTime = data1.startDatetime this.oneJob.checkOutTime = data1.endDatetime this.oneJob.checkLongitude = data1.checkLongitude this.oneJob.checkLatitude = data1.checkLatitude this.oneJob.checkLocation = data1.checkLocation this.oneJob.workHour = getISOTime(data1.startDatetime, data1.endDatetime) console.log(this.oneJob) } console.log(this.oneJob) this.$set(data1.jobList, data1.jobList.length, JSON.parse(JSON.stringify(this.oneJob))) } console.log(&#39;this.form.jobUserVOLists&#39;, JSON.stringify(this.form.jobUserVOLists)) }, // 改变时间段的初始时间 changeStartTime(value, timeIndex) { console.log(this.form.jobUserVOLists[timeIndex].jobList) if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkInTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的初始时间 changeEndTime(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkOutTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的签到纬度 changeLatitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLatitude = value }) } }, // 改变时间段的签到经度 changeLongitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLongitude = value }) } }, // 跳转 toPrck() { window.open(&#39;https://lbs.amap.com/tools/picker&#39;) }, // 删除时间段 deleteTime(timeIndex) { this.$modal.confirm(&#39;是否确认该时间段?&#39;).then(function () { }).then(() => { this.form.jobUserVOLists.splice(timeIndex, 1) this.changeNumber() }).catch(() => { }) }, // 删除岗位按钮 deleteSelect(timeIndex, jobIndex) { this.$modal.confirm(&#39;是否确认删除此岗位?&#39;).then(function () { }).then(() => { this.form.jobUserVOLists[timeIndex].jobList.splice(jobIndex, 1) this.changeNumber() }).catch(() => { }) }, // 活动最大人数改变 changeNumber() { this.form.maxCount = 0 this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { this.form.maxCount += itemson.jobUsers.length }) }) }, // 岗位人数改变 changeJobNumber(timeIndex, jobIndex) { if (this.form.jobUserVOLists[timeIndex].jobList[jobIndex].length > this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobCount) { this.$modal.msgError(&#39;所添加志愿者数目不能超过岗位人数&#39;) } else { this.form.maxCount = 0 this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { this.form.maxCount += parseInt(itemson.jobCount) }) }) } }, // 改变岗位时间 async changTime(timeIndex, jobIndex) { let data1 = this.form.jobUserVOLists[timeIndex].jobList[jobIndex] if (data1.checkOutTime && data1.checkInTime) { data1.workHour = getISOTime(data1.checkInTime, data1.checkOutTime) data1.point = parseInt(data1.pointPercent) * data1.workHour if (data1.jobUsers) { data1.jobUsers.forEach(item => { item.workHour = data1.workHour item.point = parseInt(data1.pointPercent) * data1.workHour }) } } }, //岗位志愿者选择 async AddSelect1(value, timeIndex, jobIndex) { console.log(this.form.jobUserVOLists) this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.forEach(item => { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers.push({ &#39;userId&#39;: item, point: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour * parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent), &#39;workHour&#39;: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour }) }) console.log(&#39;this.form.jobUserVOLists&#39;, JSON.stringify(this.form.jobUserVOLists)) // this.submitForm() // this.totalPeople(index) // 筛选出远程数据中有的数据进行保留,其余的push新的 // if (this.form.jobUserVOS[index].id !== &#39;&#39;) { // let oldDate = value.filter(item => this.form.jobUserVOS[index].oldUserList.includes(item)) //远程有的 // let changeDate = value.filter(item => !oldDate.includes(item)); //剩余的新的 // let newDate = [] // changeDate.forEach(item => { // newDate.push({ // &#39;userId&#39;: item, // point: this.form.jobUserVOS[index].point, // &#39;workHour&#39;: this.form.jobUserVOS[index].workHour // }) // }) // this.form.jobUserVOS[index].jobUsers = this.form.jobUserVOS[index].oldJobUsers.filter(item => oldDate.includes(item.userId)).concat(newDate) // } else { // this.form.jobUserVOS[index].jobUsers = [] // this.form.jobUserVOS[index].userIdList.forEach(item => { // this.form.jobUserVOS[index].jobUsers.push({ // &#39;userId&#39;: item, // point: this.form.jobUserVOS[index].point, // &#39;workHour&#39;: this.form.jobUserVOS[index].workHour // }) // }) // } // this.totalPeople(index) }, // 岗位志愿者全选 selectAll(timeIndex, jobIndex) { console.log(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList) if (this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.length - 1 < this.userList.length) { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList = this.userList.map(item => item.uid) this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.forEach(item => { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers.push({ &#39;userId&#39;: item, point: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour * parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent), &#39;workHour&#39;: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour }) }) } else { // 取消全选 this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] } }, // 改变积分/每人 changePointPercent(timeIndex, jobIndex) { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].point = parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent) * this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour console.log(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].point) this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { itemson.jobUsers.forEach(itemson1 => { itemson1.point = itemson.workHour * parseInt(itemson.pointPercent) }) }) }) }, // 补录删除志愿者 deleteUser(e, p) { this.form.jobUserVOS[e].jobUsers.splice(p, 1) this.$modal.msgSuccess(&#39;删除成功&#39;) }, } } </script> <style scoped> .container { background-color: #f5f5f5; padding: 1%; } .title_type { font-size: 24px; font-weight: 700; margin-bottom: 20px; } .dialog-footer { display: flex; flex-direction: row; justify-content: center; align-items: center; padding-bottom: 30px; } .avatar-uploader .el-upload { border: 1px solid #f8f3f3; border-radius: 6px; cursor: pointer; position: relative; overflow: hidden; } .avatar-uploader .el-upload:hover { border-color: #409EFF; } .avatar-uploader-icon { font-size: 28px; color: #8c939d; width: 120px; height: 120px; line-height: 120px; text-align: center; } .coverImage { width: 214px; height: 129px; border-radius: 6px; cursor: pointer; } .select_mask { position: absolute; z-index: 2; background-color: rgba(127, 125, 121, 0.5); text-align: center; top: 0; bottom: 0; left: 0; right: 0; width: 214px; height: 129px; display: flex; justify-content: center; align-items: center; } .avatar { width: 214px; height: 129px; display: block; } .margin-right-10 { margin-right: 10px; } .job_box { /* border: 1px solid #ccc; */ background-color: #F8F8F8; padding: 46px 10px 10px; margin-bottom: 10px; margin-left: 50px; border-radius: 10px; } </style>
10-25
下面代码如何将新增的数据传入修改的表单进行修改:<template> <div class="container"> <el-tabs type="border-card"> <el-tab-pane :label="title"> <el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form-item label="介绍图片:" prop="cover"> <div style="display: flex;"> <div class="flex-row"> <el-upload class="avatar-uploader" action :http-request="selectPicUpload" :show-file-list="false" :before-upload="beforeAvatarUpload" :on-change="handleAvatarChange"> <img v-if="form.cover" :src="form.cover" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </div> </div> </el-form-item> <el-row> <el-col :span="12"> <el-form-item label="团购名称:" prop="name"> <el-input class="input" v-model="form.name" placeholder="请输入团购名称" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="自动截止:" prop="isAutoEnd"> <el-switch v-model="form.isAutoEnd" :active-value="true" :inactive-value="false" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="团购内容:" prop="detailInfo"> <el-input class="input" v-model="form.detailInfo" placeholder="请输入团购内容" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="开始时间:" prop="startTime"> <el-date-picker clearable v-model="form.startTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动开始时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="截止时间:" prop="endTime"> <el-date-picker clearable v-model="form.endTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动截止时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最大接龙人数" prop="maxJoinNum"> <el-input class="input" v-model="form.maxJoinNum" placeholder="请输入" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最小成交金额" prop="minAmount"> <el-input class="input" v-model="form.minAmount" placeholder="请输入" /> </el-form-item> </el-col> </el-row> <el-form-item label="其它信息:"> <el-checkbox-group v-model="selectedItemsOther" @change="updateOtherInfo"> <el-checkbox label="真实姓名"></el-checkbox> <el-checkbox label="手机号码"></el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item label="功能选择:"> <el-checkbox-group v-model="selectedItemsFunction" @change="updateFunctionSelection"> <el-checkbox label="发布最新接龙列表"></el-checkbox> <el-checkbox label="接龙金额仅创建人可见"></el-checkbox> <el-checkbox label="禁止用户取消订单"></el-checkbox> </el-checkbox-group> </el-form-item> <div> <el-form-item label="商品信息:"> </el-form-item> <el-table :data="form.products" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="商品名称" align="center" prop="product.name"> <template slot-scope="{row,$index}"> <el-input v-model="row.name" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品价格" align="center" prop="products.price"> <template slot-scope="{row,$index}"> <el-input v-model="row.price" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品数量" align="center" prop="products.soldNum"> <template slot-scope="{row,$index}"> <el-input v-model="row.soldNum" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="每单限制购买量" align="center" prop="products.limitNum" width="180"> <template slot-scope="{row,$index}"> <el-input v-model="row.limitNum" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="商品图片" align="center" prop="producst.image" width="100" > <template slot-scope="{row,$index}"> <el-upload class="avatar-uploader" action :http-request="selectProductUpload" :show-file-list="false" :before-upload="beforeAvatarUpload" :on-change="handleProductAvatarChange"> <img v-if="row.image" :src="row.image" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </template> </el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <!-- <el-button size="mini" type="text" v-if="scope.row.status != &#39;4&#39;" icon="el-icon-edit" @click="openApproval(scope.row)" v-hasPermi="[&#39;solitaire:list:order&#39;]">添加 </el-button > --> <el-button @click="addproduct()"> 添加</el-button> <el-button type="danger" icon="el-icon-delete" @click="removeRow($index)">删除</el-button> </template> </el-table-column> </el-table> </div> </el-form> <!-- 修改/新增 --> <div class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> <el-button @click="handleBack">取 消</el-button> </div> </el-tab-pane> </el-tabs> </div> </template> <script> import { imgUrl } from &#39;@/utils/request&#39; import { getISOTime, checkLongitudeValidator, checkPointIsNumber } from &#39;@/utils/parsing&#39; import { checkPhone } from &#39;@/utils/validate&#39; import mapView from &#39;@/components/MapContainer/index.vue&#39; import { addGroupShop, editGroupBuy, getGroupBuyDetail } from &#39;@/api/solitaire/solitaire&#39; import { uploadPic } from &#39;@/api/activity/activity&#39; import {onMounted,beforeDestroy} from &#39;vue&#39; import { reset } from &#39;echarts/lib/visual/seriesColor&#39; export default { components: { mapView }, data() { return { currentTime: new Date().toLocaleTimeString(), timer: null, // 第一个复选框组绑定值 selectedItemsOther: [], // 第二个复选框组绑定值 selectedItemsFunction: [], checkList: [&#39;选中且禁用&#39;, &#39;复选框 A&#39;], checked: true, // 单个复选框的绑定 dataList: [], title: "接龙", // 封面图片 selectImgUrl: &#39;&#39;, queryParams: {}, currentImgIndex: 0, // 封面图片类型选择 imgDialogVisible: false, // 表单数据 form: { ids:null, addressIds: [&#39;1&#39;], canCancel: 0, cover: &#39;&#39;, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isGetPhone: false, isGetRealName: false, isHideList: false, isHideOrderAmount: false, isJoin: 0, maxJoinNum: 0, minAmount: 0, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, }, // 表单校验 rules: { cover: [ { required: true, message: &#39;请选择活动图片&#39;, trigger: [&#39;change&#39;, &#39;blur&#39;] } ], name: [ { required: true, message: &#39;请输入团购名称&#39;, trigger: &#39;change&#39; } ], othermessage: [ { type: &#39;array&#39;, required: true, message: &#39;请选择其它信息&#39;, trigger: &#39;change&#39; } ], selectability: [ { type: &#39;array&#39;, required: true, message: &#39;请选择功能&#39;, trigger: &#39;change&#39; }, ], serviceSafeguard: [ { type: &#39;array&#39;, required: true, message: &#39;请选择志愿者保障&#39;, trigger: &#39;change&#39; } ], detailInfo: [ { required: true, message: &#39;请输入团购内容&#39;, trigger: &#39;change&#39; } ], maxJoinNum: [ { required: true, message: &#39;最大人数不能为空&#39;, trigger: &#39;change&#39; } ], minAmount: [ { required: true, message: &#39;最小成交金额不能为空&#39;, trigger: &#39;change&#39; } ], endTime: [ { required: true, message: &#39;结束时间必须选择&#39;, trigger: &#39;change&#39; } ], startTime: [ { required: true, message: &#39;开始时间不能为空&#39;, trigger: &#39;change&#39; } ], description: [ { required: true, message: &#39;活动开始内容不能为空&#39;, trigger: &#39;change&#39; } ], address: [ { required: true, message: &#39;地点不能为空&#39;, trigger: &#39;change&#39; } ], conditionRequire: [ { required: true, message: &#39;请输入条件说明&#39;, trigger: &#39;change&#39; } ], // signStartDatetime: [ // { required: true, message: &#39;报名开始时间必须选择&#39;, trigger: &#39;change&#39; } // ], signEndDatetime: [ { required: true, message: &#39;活动截止时间必须选择&#39;, trigger: &#39;change&#39; } ], jobUserVOLists: [ { type: &#39;array&#39;, required: true, message: &#39;请添加岗位需求&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].name&#39;: [ { required: true, message: &#39;请添加活动主办方姓名&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].linkmanName&#39;: [ { required: true, message: &#39;请添加活动负责人联系人&#39;, trigger: &#39;change&#39; } ], &#39;organizer[0].phone&#39;: [ { required: true, message: &#39;请添加活动负责人电话&#39;, trigger: &#39;change&#39; }, { validator: checkPhone, trigger: &#39;blur&#39; } ] }, // 图片前缀 cover: imgUrl, // //分页 column: { pageSize: null, pageNum: null }, // 队伍列表 // 岗位表单校验 jobRules: { jobName: [ { required: true, message: &#39;请输入岗位名称&#39;, trigger: &#39;change&#39; } ], jobCount: [ { required: true, message: &#39;请输入岗位人数&#39;, trigger: &#39;change&#39; } ], workHour: [ { required: true, message: &#39;请输入工时&#39;, trigger: &#39;change&#39; } ], pointPercent: [ { required: true, message: &#39;请输入积分(每人每小时)&#39;, trigger: &#39;change&#39; }, { validator: checkPointIsNumber, message: &#39;积分必须为数字&#39; } ], checkInTime: [ { required: true, message: &#39;请输入签到时间&#39;, trigger: &#39;change&#39; } ], checkOutTime: [ { required: true, message: &#39;请输入签退时间&#39;, trigger: &#39;change&#39; } ], checkLocation: [ { required: true, message: &#39;请选择签到地点&#39;, trigger: &#39;change&#39; } ] }, } }, created() { this.queryParams = this.$route.query; if (this.queryParams.type == &#39;fix&#39;) { // 编辑 this.title = &#39;修改团购&#39; this.form.ids=1 } else { //添加 this.title = &#39;新增团购&#39; this.form.ids=0 this.reset() } console.log(this.title) }, methods: { onMounted() { }, beforeDestroy() { clearInterval(this.timer); }, removeRow(index) { if (this.form.products.length > 1) { this.form.products.splice(index, 1); } else { this.$message.warning(&#39;至少保留一行数据&#39;); } }, addproduct() { this.form.products.push({ id: &#39;&#39;, image: &#39;&#39;, limitNum: &#39;&#39;, name: "", parentId: &#39;&#39;, price: &#39;&#39;, soldNum: &#39;&#39;, totalNum: &#39;&#39; }) }, handleProductAvatarChange(file) { if (!file || !file.raw) return; const reader = new FileReader(); reader.onload = (e) => { const img = new Image(); img.onload = () => { // 限制最大尺寸(合理值:800×600) const MAX_SIZE = 800; let width = img.width; let height = img.height; // 按比例缩放到最大尺寸 if (width > MAX_SIZE || height > MAX_SIZE) { const scale = Math.min(MAX_SIZE / width, MAX_SIZE / height); width *= scale; height *= scale; } // 画布压缩处理 const canvas = document.createElement(&#39;canvas&#39;); const ctx = canvas.getContext(&#39;2d&#39;); canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); // 关键优化:降质量并生成更短Data URL this.form.products.image= canvas.toDataURL(file.type, 0.01); // 压缩质量65% }; img.src = e.target.result; }; reader.readAsDataURL(file.raw); }, handleAvatarChange(file) { if (!file || !file.raw) return; const reader = new FileReader(); reader.onload = (e) => { const img = new Image(); img.onload = () => { // 限制最大尺寸(合理值:800×600) const MAX_SIZE = 800; let width = img.width; let height = img.height; // 按比例缩放到最大尺寸 if (width > MAX_SIZE || height > MAX_SIZE) { const scale = Math.min(MAX_SIZE / width, MAX_SIZE / height); width *= scale; height *= scale; } // 画布压缩处理 const canvas = document.createElement(&#39;canvas&#39;); const ctx = canvas.getContext(&#39;2d&#39;); canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); // 关键优化:降质量并生成更短Data URL this.form.cover = canvas.toDataURL(file.type, 0.01); // 压缩质量65% }; img.src = e.target.result; }; reader.readAsDataURL(file.raw); }, beforeAvatarUpload(file) { const validTypes = [&#39;image/jpeg&#39;, &#39;image/png&#39;, &#39;image/webp&#39;]; // 移除GIF减小潜在数据量 const MAX_SIZE_MB = 1.2; // 更严格的大小限制 const isImage = validTypes.includes(file.type); const isSizeValid = file.size / 1024 / 1024 < MAX_SIZE_MB; if (!isImage) { this.$message.error(&#39;仅支持 JPG/PNG/WEBP 格式&#39;); return false; } if (!isSizeValid) { this.$message.error(`图片大小不能超过 ${MAX_SIZE_MB}MB`); return false; } return true; }, updateOtherInfo() { this.form.isGetRealName = this.selectedItemsOther.includes(&#39;真实姓名&#39;); this.form.isGetPhone = this.selectedItemsOther.includes(&#39;手机号码&#39;); }, // 更新"功能选择"表单值 updateFunctionSelection() { this.form.isHideList = this.selectedItemsFunction.includes(&#39;发布最新接龙列表&#39;); this.form.isHideOrderAmount = this.selectedItemsFunction.includes(&#39;接龙金额仅创建人可见&#39;); // "禁止用户取消订单"需要特殊处理:选中时canCancel=false this.form.canCancel = !this.selectedItemsFunction.includes(&#39;禁止用户取消订单&#39;); }, // 获取活动详情 // getDetail(status) { // getGroupBuyDetail(this.queryParams.id, status).then(response => { // this.queryParams.id, status // this.form = response // console.log(response, &#39;789&#39;) // }) // }, // 表单重置 reset() { this.form = { addressIds: [&#39;1&#39;], cover: null, canCancel: 0, ids:null, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isGetPhone: 0, isGetRealName: 0, isHideList: 0, isHideOrderAmount: 0, isJoin: 0, maxJoinNum: 0, minAmount: 0, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, } }, selectPicUpload(obj) { let fd = new FormData() //参数的格式是formData格式的 fd.append(&#39;file&#39;, obj.file) //参数 uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { this.form.cover = res }) }, selectProductUpload(obj) { let fd = new FormData() //参数的格式是formData格式的 fd.append(&#39;file&#39;, obj.file) //参数 uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { console.log(this.form.products.image,&#39;999&#39;) this.form.products.image = res }) }, // // 取消关闭弹窗 // closeDialog() { // this.currentImgIndex = 0 // this.selectImgUrl = &#39;&#39; // this.imgDialogVisible = false // }, // // 确认默认图片关闭弹窗 // submitPic() { // this.form.cover = this.selectImgUrl // this.imgDialogVisible = false // }, hasCommonValue(arr) { let seen = new Set(); // 用于存储已经遇到的值 for (let obj of arr) { for (let value of obj.jobUsers) { // 如果值已经存在于 set 中,返回 true if (seen.has(value.userId)) { return true; } // 将当前值加入 set seen.add(value.userId); } } return false; // 如果没有重复的值,返回 false }, /** 提交按钮 */ submitForm() { console.log(this.form.products.image, &#39;000&#39;) let newForm = { ids:this.form.ids, addressIds: this.form.addressIds, canCancel: this.form.canCancel == true ? 1 : 0, cover: this.form.cover, detailInfo: this.form.detailInfo, endTime: this.form.endTime, id: this.form.id, isAutoEnd: this.form.isAutoEnd == true ? 1 : 0, isGetPhone: this.form.isGetPhone == true ? 1 : 0, isGetRealName: this.form.isGetRealName == true ? 1 : 0, isHideList: this.form.isHideList == true ? 1 : 0, isHideOrderAmount: this.form.isHideOrderAmount == true ? 1 : 0, isJoin: this.form.isJoin, maxJoinNum: this.form.maxJoinNum, minAmount: this.form.minAmount, name: this.form.name, // 修正products处理:遍历数组中的每个对象 products: this.form.products.map(item => ({ id: item.id, image: item.image, //代码误用value limitNum: item.limitNum, name: item.name, parentId: item.parentId, price: item.price, soldNum: item.soldNum, totalNum: item.totalNum })), realEndTime: this.form.realEndTime, startTime: this.form.startTime, status: this.form.status, // 修正为this.form.status }; console.log(newForm, this.form.id) //判断每个时间段是否有岗位 // let isJobEmpty = this.form.jobUserVOLists.some(item => item.jobList.length == 0) this.$refs[&#39;form&#39;].validate(valid => { console.log if (valid) { if (this.form.ids ==1) { editGroupBuy(newForm).then(response => { console.log(response) this.$modal.msgSuccess(&#39;修改成功&#39;) this.$router.back(-1) }) } else { if (this.form.ids == 0) { addGroupShop(newForm).then(response => { console.log(response) this.$modal.msgSuccess(&#39;新增成功&#39;) this.$router.back(-1) }) } else { console.log(this.form.id, &#39;09&#39;) this.$modal.msgError(&#39;请完善信息&#39;) } } } }) }, handleBack() { this.$router.back(-1) }, // handleSelectionChange(selection) { this.ids = selection.map(item => item.pkId) this.single = selection.length !== 1 this.multiple = !selection.length }, // 新增时间段 addTime() { this.$set(this.form.jobUserVOLists, this.form.jobUserVOLists.length, JSON.parse(JSON.stringify(this.oneTime))) // this.form.jobUserVOLists.push(JSON.parse(JSON.stringify(this.oneTime))) }, // 岗位新增 async jobAdd(index) { let data1 = this.form.jobUserVOLists[index] let isPassNum = this.form.jobUserVOLists.filter(item => item.jobList.some(itemson => itemson.jobUsers.length > itemson.jobCount) ); if (isPassNum.length > 0) { this.$modal.msgError(&#39;所添加志愿者数目不能超过岗位人数&#39;) return } else { if (data1.startDatetime && data1.endDatetime) { this.oneJob.checkInTime = data1.startDatetime this.oneJob.checkOutTime = data1.endDatetime this.oneJob.checkLongitude = data1.checkLongitude this.oneJob.checkLatitude = data1.checkLatitude this.oneJob.checkLocation = data1.checkLocation this.oneJob.workHour = getISOTime(data1.startDatetime, data1.endDatetime) console.log(this.oneJob) } console.log(this.oneJob) this.$set(data1.jobList, data1.jobList.length, JSON.parse(JSON.stringify(this.oneJob))) } console.log(&#39;this.form.jobUserVOLists&#39;, JSON.stringify(this.form.jobUserVOLists)) }, changeStatus(){ if(this.currentTime){ this.timer = setInterval(() => { this.currentTime = new Date().toLocaleTimeString(); console.log(this.currentTime,&#39;90&#39;) }, 1000); } }, // 改变时间段的初始时间 changeStartTime(value, timeIndex) { console.log(this.form.jobUserVOLists[timeIndex].jobList) if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkInTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的初始时间 changeEndTime(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkOutTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的签到纬度 changeLatitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLatitude = value }) } }, // 改变时间段的签到经度 changeLongitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLongitude = value }) } }, // 跳转 toPrck() { window.open(&#39;https://lbs.amap.com/tools/picker&#39;) }, // 删除时间段 deleteTime(timeIndex) { this.$modal.confirm(&#39;是否确认该时间段?&#39;).then(function () { }).then(() => { this.form.jobUserVOLists.splice(timeIndex, 1) this.changeNumber() }).catch(() => { }) }, // 删除岗位按钮 deleteSelect(timeIndex, jobIndex) { this.$modal.confirm(&#39;是否确认删除此岗位?&#39;).then(function () { }).then(() => { this.form.jobUserVOLists[timeIndex].jobList.splice(jobIndex, 1) this.changeNumber() }).catch(() => { }) }, // 活动最大人数改变 changeNumber() { this.form.maxCount = 0 this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { this.form.maxCount += itemson.jobUsers.length }) }) }, // 岗位人数改变 changeJobNumber(timeIndex, jobIndex) { if (this.form.jobUserVOLists[timeIndex].jobList[jobIndex].length > this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobCount) { this.$modal.msgError(&#39;所添加志愿者数目不能超过岗位人数&#39;) } else { this.form.maxCount = 0 this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { this.form.maxCount += parseInt(itemson.jobCount) }) }) } }, // 改变岗位时间 async changTime(timeIndex, jobIndex) { let data1 = this.form.jobUserVOLists[timeIndex].jobList[jobIndex] if (data1.checkOutTime && data1.checkInTime) { data1.workHour = getISOTime(data1.checkInTime, data1.checkOutTime) data1.point = parseInt(data1.pointPercent) * data1.workHour if (data1.jobUsers) { data1.jobUsers.forEach(item => { item.workHour = data1.workHour item.point = parseInt(data1.pointPercent) * data1.workHour }) } } }, //岗位志愿者选择 async AddSelect1(value, timeIndex, jobIndex) { console.log(this.form.jobUserVOLists) this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.forEach(item => { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers.push({ &#39;userId&#39;: item, point: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour * parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent), &#39;workHour&#39;: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour }) }) console.log(&#39;this.form.jobUserVOLists&#39;, JSON.stringify(this.form.jobUserVOLists)) // this.submitForm() // this.totalPeople(index) // 筛选出远程数据中有的数据进行保留,其余的push新的 // if (this.form.jobUserVOS[index].id !== &#39;&#39;) { // let oldDate = value.filter(item => this.form.jobUserVOS[index].oldUserList.includes(item)) //远程有的 // let changeDate = value.filter(item => !oldDate.includes(item)); //剩余的新的 // let newDate = [] // changeDate.forEach(item => { // newDate.push({ // &#39;userId&#39;: item, // point: this.form.jobUserVOS[index].point, // &#39;workHour&#39;: this.form.jobUserVOS[index].workHour // }) // }) // this.form.jobUserVOS[index].jobUsers = this.form.jobUserVOS[index].oldJobUsers.filter(item => oldDate.includes(item.userId)).concat(newDate) // } else { // this.form.jobUserVOS[index].jobUsers = [] // this.form.jobUserVOS[index].userIdList.forEach(item => { // this.form.jobUserVOS[index].jobUsers.push({ // &#39;userId&#39;: item, // point: this.form.jobUserVOS[index].point, // &#39;workHour&#39;: this.form.jobUserVOS[index].workHour // }) // }) // } // this.totalPeople(index) }, // 岗位志愿者全选 selectAll(timeIndex, jobIndex) { console.log(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList) if (this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.length - 1 < this.userList.length) { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList = this.userList.map(item => item.uid) this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList.forEach(item => { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers.push({ &#39;userId&#39;: item, point: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour * parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent), &#39;workHour&#39;: this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour }) }) } else { // 取消全选 this.form.jobUserVOLists[timeIndex].jobList[jobIndex].userIdList = [] this.form.jobUserVOLists[timeIndex].jobList[jobIndex].jobUsers = [] } }, // 改变积分/每人 changePointPercent(timeIndex, jobIndex) { this.form.jobUserVOLists[timeIndex].jobList[jobIndex].point = parseInt(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].pointPercent) * this.form.jobUserVOLists[timeIndex].jobList[jobIndex].workHour console.log(this.form.jobUserVOLists[timeIndex].jobList[jobIndex].point) this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { itemson.jobUsers.forEach(itemson1 => { itemson1.point = itemson.workHour * parseInt(itemson.pointPercent) }) }) }) }, // 补录删除志愿者 deleteUser(e, p) { this.form.jobUserVOS[e].jobUsers.splice(p, 1) this.$modal.msgSuccess(&#39;删除成功&#39;) }, } } </script> <style scoped> .container { background-color: #f5f5f5; padding: 1%; } .title_type { font-size: 24px; font-weight: 700; margin-bottom: 20px; } .dialog-footer { display: flex; flex-direction: row; justify-content: center; align-items: center; padding-bottom: 30px; } .avatar-uploader .el-upload { border: 1px solid #f8f3f3; border-radius: 6px; cursor: pointer; position: relative; overflow: hidden; } .avatar-uploader .el-upload:hover { border-color: #409EFF; } .avatar-uploader-icon { font-size: 28px; color: #8c939d; width: 120px; height: 120px; line-height: 120px; text-align: center; } .coverImage { width: 214px; height: 129px; border-radius: 6px; cursor: pointer; } .select_mask { position: absolute; z-index: 2; background-color: rgba(127, 125, 121, 0.5); text-align: center; top: 0; bottom: 0; left: 0; right: 0; width: 214px; height: 129px; display: flex; justify-content: center; align-items: center; } .avatar { width: 214px; height: 129px; display: block; } .margin-right-10 { margin-right: 10px; } .job_box { /* border: 1px solid #ccc; */ background-color: #F8F8F8; padding: 46px 10px 10px; margin-bottom: 10px; margin-left: 50px; border-radius: 10px; } </style>
10-29
<template> <div class="app-container"> <el-form ref="modelForm" :model="modalForm" :title="title" :rules="formRules"> <div class="form-title">{{ title }}</div> <div class="form-bordered"> <el-collapse v-model="activeNames"> <!-- 基本信息 --> <el-collapse-item name="1"> <template slot="title"> {{ $t(&#39;BasicInformation&#39;) }} <span style="color: #004097; font-weight: 900">({{ $t(&#39;ClickToExpandOrcollapse&#39;) }})</span> </template> <div class="form-bordered"> <el-row> <!-- 编号 --> <el-col :span="12"> <el-form-item :label="$t(&#39;rm.rm.formCode&#39;)"> <span v-if="modalForm.formCode">{{ modalForm.formCode }}</span> <span v-else style="color: red;">提交后自动生成</span> </el-form-item> </el-col> <!-- 来源 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.source&#39;)" prop="source"> <el-input v-model="modalForm.source" clearable :placeholder="$t(&#39;pleaseEnter&#39;, { param: $t(&#39;spl.supplierClaim.source&#39;) })" /> </el-form-item> </el-col> </el-row> <el-row> <!-- 供方简称 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.shortName&#39;)" prop="shortName"> <dataSelect v-model="modalForm.shortName" :title="&#39;选择供应商主数据&#39;" :api="getSupplierList" :columns="[ { label: $t(&#39;baseData.supplier.supplierCode&#39;), code: &#39;supplierCode&#39; }, { label: $t(&#39;baseData.supplier.supplierName&#39;), code: &#39;supplierName&#39; } ]" :search-params-list="[ { label: $t(&#39;baseData.supplier.supplierCode&#39;), code: &#39;supplierCode&#39; }, { label: $t(&#39;baseData.supplier.supplierName&#39;), code: &#39;supplierName&#39; } ]" :show-search="true" :on-page="false" :single-select="true" :bind-object="{ label: &#39;supplierName&#39;, key: &#39;supplierName&#39; }" @selectUserClosepopIndex="handleSelectSupplier" /> </el-form-item> </el-col> <!-- 申请部门 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.applyDeptBy&#39;)" prop="applyDeptBy"> <org-picker ref="orgPickerApplyDeptBy" type="dept" :multiple="false" :parent-this="this" :form-props="&#39;applyDeptBy&#39;" :selected.sync="modalForm.applyDeptBy" /> </el-form-item> </el-col> </el-row> <el-row> <!-- 申请日期 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.applicatTime&#39;)" prop="applicatTime"> <el-date-picker v-model="modalForm.applicatTime" type="date" clearable value-format="yyyy-MM-dd" /> </el-form-item> </el-col> <!-- 物料名称 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.materialName&#39;)" prop="materialName"> <dataSelect v-model="modalForm.materialName" :title="&#39;选择物料主数据&#39;" :api="getMaterialMasterDataList" :columns="[ { label: &#39;物料编码&#39;, code: &#39;materialCode&#39; }, { label: &#39;物料名称&#39;, code: &#39;materialName&#39; } ]" :search-params-list="[ { label: &#39;物料编码&#39;, code: &#39;materialCode&#39; }, { label: &#39;物料名称&#39;, code: &#39;materialName&#39; } ]" :show-search="true" :on-page="false" :single-select="false" :bind-object="{ label: &#39;materialName&#39;, key: &#39;materialCode&#39; }" @selectUserClosepop="handleSelectMaterial" /> </el-form-item> </el-col> </el-row> <el-row> <!-- 物料编码 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.materialCode&#39;)" prop="materialCode"> <el-input v-model="modalForm.materialCode" disabled readonly /> </el-form-item> </el-col> <!-- 订单号 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.orderCode&#39;)"> <el-input v-model="modalForm.orderCode" clearable :placeholder="$t(&#39;pleaseEnter&#39;, { param: $t(&#39;spl.supplierClaim.orderCode&#39;) })" /> </el-form-item> </el-col> </el-row> <el-row> <!-- 数量 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.quantityNum&#39;)" prop="quantityNum"> <el-input v-model="modalForm.quantityNum" clearable :placeholder="$t(&#39;pleaseEnter&#39;, { param: $t(&#39;spl.supplierClaim.quantityNum&#39;) })" /> </el-form-item> </el-col> <!-- 质量协议 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.dealUrl&#39;)"> <fileUpload v-model="modalForm.dealUrl" :limit="1" :is-read-only="false" /> </el-form-item> </el-col> </el-row> <el-row> <!-- 异常描述 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.description&#39;)" prop="description"> <el-input v-model="modalForm.description" type="textarea" clearable @change="descriptionChange" :placeholder="$t(&#39;pleaseEnter&#39;, { param: $t(&#39;spl.supplierClaim.description&#39;) })" /> </el-form-item> </el-col> <!-- 异常描述附件 --> <el-col :span="12"> <el-form-item :label="$t(&#39;spl.supplierClaim.descriptionUrl&#39;)"> <fileUpload v-model="modalForm.descriptionUrl" :limit="1" :is-read-only="false" /> </el-form-item> </el-col> </el-row> <!-- SQE --> <el-row v-if="modalForm.roles !== &#39;CQE&#39;"> <el-col :span="12"> <el-form-item :label="$t(&#39;SQE&#39;)" prop="sqeName"> <el-select v-model="modalForm.sqeName" :placeholder="$t(&#39;pleaseEnter&#39;, { param: $t(&#39;SQE&#39;) })" @change="sqeChange" > <el-option v-for="(item, index) in sqeList" :key="index" :label="item.label" :value="item.label" /> </el-select> </el-form-item> </el-col> </el-row> <!-- CQE 角色下使用 org-picker --> <el-row v-else> <el-col :span="12"> <el-form-item :label="$t(&#39;SQE&#39;)" prop="sqe"> <org-picker ref="orgPickersqe" type="user" :multiple="false" :parent-this="this" :form-props="&#39;sqe&#39;" :selected.sync="modalForm.sqe" /> </el-form-item> </el-col> </el-row> </div> </el-collapse-item> <!-- 异常费用核算 --> <el-collapse-item name="2"> <template slot="title"> 异常费用核算 <span style="color: #004097; font-weight: 900">({{ $t(&#39;ClickToExpandOrcollapse&#39;) }})</span> </template> <el-tabs v-model="activeTab" type="card" @edit="removeTab"> <el-tab-pane v-for="item in classifyList" :key="item.materialCode" :label="`${item.materialName} - ${item.materialCode}`" :name="item.materialCode" > <el-table :data="item.subList" border> <el-table-column align="center" label="操作" width="120"> <template #default="{ row, $index }"> <div class="el-zlw-operate"> <a href="javascript:" @click="copyRow(item.subList, $index)"> <i class="el-icon-copy-document"/> </a> <a href="javascript:" @click="addRow(item.subList, $index)"> <i class="el-icon-circle-plus-outline"/> </a> <a href="javascript:" :style="{ visibility: item.subList.length > 1 ? &#39;visible&#39; : &#39;hidden&#39; }" @click="removeRow(item.subList, $index)" > <i class="el-icon-remove-outline"/> </a> </div> </template> </el-table-column> <el-table-column align="center" type="index" label="序号" width="60"/> <!-- 修订前项次内容 --> <el-table-column label="修订前项次内容"> <template #default="{ row }"> <el-form-item label-width="0" prop="materialCode" :rules="[{ required: true, message: &#39;请输入修订前项次内容&#39;, trigger: &#39;blur&#39; }]" > <el-input v-model="row.materialCode" placeholder="请输入修订前项次内容" clearable type="textarea" :rows="2" maxlength="100" /> </el-form-item> </template> </el-table-column> </el-table> </el-tab-pane> </el-tabs> </el-collapse-item> </el-collapse> </div> <!-- 操作按钮 --> <div style="margin-top: 20px;"> <el-button type="primary" @click="submitForm">提交</el-button> <el-button @click="saveForm">暂存</el-button> <el-button @click="$router.back()">取消</el-button> </div> </el-form> </div> </template> <script> import { getSupplierClaimInfo, addSupplierClaim, updateSupplierClaim } from &#39;@/api/spl/supplierClaim/api&#39;; import { getSupplierList } from &#39;@/api/baseData/supplier/api&#39;; import { getMaterialMasterDataList } from &#39;@/api/baseData/materialMasterData/api&#39;; import { getUserInfoByRoleCode } from &#39;@/api/system/user/api&#39;; // 默认子项 function createDefaultSub() { return { materialCode: &#39;&#39;, sonList: [{ workPeople: &#39;&#39; }] // 如果后续需要孙级输入 }; } export default { name: &#39;SupplierClaimCreateOrEdit&#39;, components: { dataSelect }, data() { return { modalForm: { id: null, formCode: null, source: &#39;&#39;, shortName: &#39;&#39;, applyDeptBy: &#39;&#39;, applicatTime: &#39;&#39;, materialName: &#39;&#39;, materialCode: &#39;&#39;, orderCode: &#39;&#39;, quantityNum: &#39;&#39;, dealUrl: &#39;&#39;, description: &#39;&#39;, descriptionUrl: &#39;&#39;, sqe: &#39;&#39;, // JSON 字符串 sqeName: &#39;&#39;, roles: &#39;&#39;, state: &#39;未提交&#39; }, classifyList: [], activeTab: &#39;&#39;, activeNames: [&#39;1&#39;, &#39;2&#39;], sqeList: [], isEditMode: false, title: &#39;供应商索赔确认单&#39; }; }, computed: { formRules() { return { source: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;来源&#39; }), trigger: &#39;blur&#39; }], shortName: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;供方简称&#39; }), trigger: &#39;blur&#39; }], applyDeptBy: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;申请部门&#39; }), trigger: &#39;change&#39; }], applicatTime: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;申请日期&#39; }), trigger: &#39;change&#39; }], materialName: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;物料名称&#39; }), trigger: &#39;change&#39; }], materialCode: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;物料编码&#39; }), trigger: &#39;blur&#39; }], quantityNum: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;数量&#39; }), trigger: &#39;blur&#39; }], description: [{ required: true, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;异常描述&#39; }), trigger: &#39;blur&#39; }], sqeName: [ { required: this.modalForm.roles !== &#39;CQE&#39;, message: this.$t(&#39;pleaseEnter&#39;, { param: &#39;SQE&#39; }), trigger: &#39;change&#39; } ] }; } }, async created() { const dataForm = JSON.parse(this.$route.query.dataForm || &#39;{}&#39;); this.isEditMode = !!dataForm.id; // 设置角色 const roles = this.$store.getters.roles; if (roles.includes(&#39;PD&#39;)) this.modalForm.roles = &#39;PD&#39;; else if (roles.includes(&#39;CQE&#39;)) this.modalForm.roles = &#39;CQE&#39;; else if (roles.includes(&#39;SQE&#39;)) this.modalForm.roles = &#39;SQE&#39;; await this.loadSqeList(); if (this.isEditMode) { await this.loadEditData(dataForm.id); } }, methods: { async loadSqeList() { try { const res = await getUserInfoByRoleCode(&#39;SQE&#39;); this.sqeList = res.data.map(u => ({ label: u.nickName })); } catch (err) { this.$message.error(&#39;获取SQE列表失败&#39;); } }, async loadEditData(id) { try { const res = await getSupplierClaimInfo(id); const data = res.data; Object.assign(this.modalForm, data); // 回显物料 tab const materials = data.detailList?.map(m => ({ materialName: m.materialName, materialCode: m.materialCode })) || []; this.handleSelectMaterial(materials); // 回显每个物料的 subList if (data.detailList && this.classifyList.length > 0) { data.detailList.forEach(detail => { const tab = this.classifyList.find(t => t.materialCode === detail.materialCode); if (tab) { tab.subList = detail.subList?.length > 0 ? detail.subList.map(sub => ({ materialCode: sub.materialCode, sonList: sub.sonList || [{ workPeople: &#39;&#39; }] })) : [createDefaultSub()]; } }); } // 回显 SQE 名称 if (data.sqe) { try { const parsed = JSON.parse(data.sqe); this.modalForm.sqeName = parsed[0]?.name || &#39;&#39;; } catch (e) { console.warn(&#39;解析 SQE 失败:&#39;, e); } } if (this.classifyList.length > 0) { this.activeTab = this.classifyList[0].materialCode; } } catch (err) { this.$message.error(&#39;加载数据失败&#39;); } }, // 选择供应商 handleSelectSupplier(list) { const item = list[0]; this.modalForm.supplierCode = item.supplierCode; this.modalForm.supplierName = item.supplierName; this.modalForm.shortName = item.supplierName; }, // 选择物料 → 动态生成 tabs handleSelectMaterial(list) { this.classifyList = list.map(material => ({ materialName: material.materialName, materialCode: material.materialCode, subList: [createDefaultSub()] })); this.modalForm.materialCode = list.map(m => m.materialCode).join(&#39;,&#39;); this.modalForm.materialName = list.map(m => m.materialName).join(&#39;,&#39;); if (this.classifyList.length > 0) { this.activeTab = this.classifyList[0].materialCode; } }, // 表格行操作 copyRow(list, index) { const copy = JSON.parse(JSON.stringify(list[index])); list.splice(index, 0, copy); }, addRow(list, index) { list.splice(index + 1, 0, createDefaultSub()); }, removeRow(list, index) { if (list.length <= 1) { this.$message.warning(&#39;至少保留一行&#39;); return; } list.splice(index, 1); }, // 删除 Tab removeTab(materialCode) { if (this.classifyList.length <= 1) { this.$message.warning(&#39;至少保留一个物料&#39;); return; } this.classifyList = this.classifyList.filter(t => t.materialCode !== materialCode); if (this.activeTab === materialCode && this.classifyList.length > 0) { this.activeTab = this.classifyList[0].materialCode; } }, // 描述去空格 descriptionChange() { this.modalForm.description = this.modalForm.description.replace(/\s/g, &#39;&#39;); }, // SQE 变更 sqeChange(val) { this.modalForm.sqe = JSON.stringify([{ name: val }]); }, // 提交与保存 submitForm() { this.modalForm.state = &#39;已提交&#39;; this.save(); }, saveForm() { this.modalForm.state = &#39;未提交&#39;; this.save(); }, async save() { await this.$refs.modelForm.validate(async valid => { if (!valid) return this.$setScroll(); const payload = this.buildPayload(); const api = this.isEditMode ? updateSupplierClaim : addSupplierClaim; try { const res = await api(payload); if (res.code === 200) { this.$message.success(this.isEditMode ? &#39;修改成功&#39; : &#39;新增成功&#39;); this.$router.back(); } else { this.$message.error(&#39;保存失败&#39;); } } catch (err) { this.$message.error(&#39;请求失败&#39;); } }); }, buildPayload() { return { ...this.modalForm, detailList: this.classifyList.map(item => ({ materialCode: item.materialCode, materialName: item.materialName, subList: item.subList.map(sub => ({ materialCode: sub.materialCode, sonList: sub.sonList.filter(son => son.workPeople) })).filter(sub => sub.materialCode || sub.sonList.length > 0) })) }; } } }; </script> <style scoped> .el-zlw-operate a { margin: 0 3px; color: #606266; text-decoration: none; } .el-zlw-operate i { font-size: 1.2em; } .required::before { position: absolute; top: 50%; left: 0; transform: translateY(-50%); color: #f54a4f; content: &#39;*&#39;; } </style> tab 是modlForm 的子孙表,帮忙优化下
09-19
下面代码修改页面的数据不能返回到提货地址的下拉框面:<template> <div class="container"> <el-tabs type="border-card"> <el-tab-pane :label="title"> <el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form-item label="介绍图片:" prop="cover"> <div style="display: flex;"> <div class="flex-row"> <el-upload class="avatar-uploader" action :http-request="selectPicUpload" :show-file-list="false" :before-upload="beforeAvatarUpload" :on-change="handleAvatarChange"> <img v-if="form.cover" :src="form.cover" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </div> </div> </el-form-item> <el-row> <el-col :span="12"> <el-form-item label="团购名称:" prop="name"> <el-input class="input" v-model="form.name" placeholder="请输入团购名称" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="自动截止:" prop="isAutoEnd"> <el-switch v-model="form.isAutoEnd" :active-value="true" :inactive-value="false" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="团购内容:" prop="detailInfo"> <el-input class="input" v-model="form.detailInfo" placeholder="请输入团购内容" /> <!-- <Tinymce v-model="form.detailInfo" :disabled="allDisabled"></Tinymce> --> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="开始时间:" prop="startTime"> <el-date-picker clearable v-model="form.startTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动开始时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="截止时间:" prop="endTime"> <el-date-picker clearable v-model="form.endTime" type="datetime" default-time="12:00:00" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择活动截止时间"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最大接龙人数" prop="maxJoinNum"> <el-input class="input" v-model="form.maxJoinNum" placeholder="请输入" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="最小成交金额" > <el-input class="input" v-model="form.minAmount" placeholder="请输入" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="提货地址:" prop="addressIds"> <el-select v-model="form.addressIds" filterable placeholder="请选择" multiple> <el-option v-for="item in addressoptions" :key="item.id" :label="item.addressName" :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> </el-row> <el-form-item label="其它信息:"> <el-checkbox-group v-model="form.selectedItemsOther"> <el-checkbox label="isGetRealName">真实姓名</el-checkbox> <el-checkbox label="isGetPhone">手机号码</el-checkbox> </el-checkbox-group> </el-form-item> <el-form-item label="功能选择:"> <el-checkbox-group v-model="form.selectedItemsFunction"> <el-checkbox label="isHideList">发布最新接龙列表</el-checkbox> <el-checkbox label="isHideOrderAmount">接龙金额仅创建人可见</el-checkbox> <el-checkbox label="canCancel">禁止用户取消订单</el-checkbox> </el-checkbox-group> </el-form-item> <div> <el-form-item label="商品信息:" prop="products"> <el-table :data="form.products" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="商品名称" align="center" prop="product.name"> <template slot-scope="{row,$index}"> <el-input v-model="row.name" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品价格" align="center" prop="products.price"> <template slot-scope="{row,$index}"> <el-input v-model="row.price" placeholder="请输入名称"></el-input> </template>" </el-table-column> <el-table-column label="商品数量" align="center" prop="products.soldNum"> <template slot-scope="{row,$index}"> <el-input v-model="row.soldNum" placeholder="请输入名称"><el-button icon="el-icon-remove-outline" @click="addmount()"></el-button></el-input> </template> </el-table-column> <el-table-column label="每单限制购买量" align="center" prop="products.limitNum" width="180"> <template slot-scope="{row,$index}"> <el-input v-model="row.limitNum" placeholder="请输入名称"></el-input> </template> </el-table-column> <el-table-column label="商品图片" align="center" prop="image" width="100"> <template slot-scope="{row,$index}"> <el-upload class="avatar-uploader" action :http-request="(fileObj) => selectProductUpload(fileObj, $index)" :show-file-list="false" :before-upload="beforeAvatarUpload"> <img v-if="row.image" :src="row.image" class="avatar"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </template> </el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <!-- <el-button size="mini" type="text" v-if="scope.row.status != &#39;4&#39;" icon="el-icon-edit" @click="openApproval(scope.row)" v-hasPermi="[&#39;solitaire:list:order&#39;]">添加 </el-button > --> <el-button @click="addproduct()"> 添加</el-button> <el-button type="danger" icon="el-icon-delete" :disabled="form.products.length <= 1" @click="removeRow(scope.$index)">删除</el-button> </template> </el-table-column> </el-table> </el-form-item> </div> </el-form> <!-- 修改/新增 --> <div class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> <el-button @click="handleBack">取 消</el-button> </div> </el-tab-pane> </el-tabs> </div> </template> <script> import { imgUrl } from &#39;@/utils/request&#39; import { getISOTime, checkLongitudeValidator, checkPointIsNumber } from &#39;@/utils/parsing&#39; import { checkPhone } from &#39;@/utils/validate&#39; import mapView from &#39;@/components/MapContainer/index.vue&#39; import { addGroupShop, editGroupBuy, getGroupBuyAddressPage, getGroupBuyDetail } from &#39;@/api/solitaire/solitaire&#39; import { uploadPic } from &#39;@/api/activity/activity&#39; import { onMounted, beforeDestroy } from &#39;vue&#39; import { reset } from &#39;echarts/lib/visual/seriesColor&#39; export default { components: { mapView }, onMounted() { }, watch: { &#39;$route.query&#39;(newVal) { if (!newVal.id) { this.title = "新增接龙"; this.resetForm(); // 重置表单方法 } } }, data() { return { addressoptions: [], addressList: [], currentTime: new Date().toLocaleTimeString(), timer: null, // 第一个复选框组绑定值 // 第二个复选框组绑定值 selectedItemsFunction: [], checkList: [&#39;选中且禁用&#39;, &#39;复选框 A&#39;], checked: true, // 单个复选框的绑定 dataList: [], title: "新增接龙", // 封面图片 selectImgUrl: &#39;&#39;, queryParams: {}, currentImgIndex: 0, // 封面图片类型选择 imgDialogVisible: false, // 表单数据 form: { selectedItemsOther: [], selectedItemsFunction: [], ids: null, // addressIds: [&#39;1&#39;], addressIds: [], canCancel: 0, cover: &#39;&#39;, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isHideList: false, isHideOrderAmount: false, isJoin: 0, maxJoinNum: 0, minAmount:null, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, }, // 表单校验 rules: { products: [ { validator: (rule, value, callback) => { // 自定义校验逻辑 if (!value || value.length === 0) { callback(new Error(&#39;至少需要添加一个商品&#39;)); return; } const isValid = value.every(item => item.name && item.price !== undefined && item.price !== null && item.image && item.image !== imgUrl // 确保不是默认图片 ); if (!isValid) { callback(new Error(&#39;请完善所有商品信息(名称、价格和图片必)&#39;)); } else { callback(); } }, trigger: &#39;change&#39; // 可以根据需要改为&#39;blur&#39;或保持&#39;change&#39; } ], addressIds: [ { required: true, message: &#39;请选择提货地址&#39;, trigger: [&#39;change&#39;, &#39;blur&#39;] } ], cover: [ { required: true, message: &#39;请选择活动图片&#39;, trigger: [&#39;change&#39;, &#39;blur&#39;] } ], name: [ { required: true, message: &#39;请输入团购名称&#39;, trigger: &#39;change&#39; } ], othermessage: [ { type: &#39;array&#39;, required: true, message: &#39;请选择其它信息&#39;, trigger: &#39;change&#39; } ], selectability: [ { type: &#39;array&#39;, required: true, message: &#39;请选择功能&#39;, trigger: &#39;change&#39; }, ], shopmessage: [ { required: true, message: &#39;请输入商品信息&#39;, trigger: &#39;change&#39; }, ], detailInfo: [ { required: true, message: &#39;请输入团购内容&#39;, trigger: &#39;change&#39; } ], maxJoinNum: [ { required: true, message: &#39;最大人数不能为空&#39;, trigger: &#39;change&#39; } ], minAmount: [ { required: true, message: &#39;最小成交金额不能为空&#39;, trigger: &#39;change&#39; } ], endTime: [ { required: true, message: &#39;结束时间必须选择&#39;, trigger: &#39;change&#39; } ], startTime: [ { required: true, message: &#39;开始时间不能为空&#39;, trigger: &#39;change&#39; } ], description: [ { required: true, message: &#39;活动开始内容不能为空&#39;, trigger: &#39;change&#39; } ], address: [ { required: true, message: &#39;地点不能为空&#39;, trigger: &#39;change&#39; } ], conditionRequire: [ { required: true, message: &#39;请输入条件说明&#39;, trigger: &#39;change&#39; } ], // signStartDatetime: [ // { required: true, message: &#39;报名开始时间必须选择&#39;, trigger: &#39;change&#39; } // ], signEndDatetime: [ { required: true, message: &#39;活动截止时间必须选择&#39;, trigger: &#39;change&#39; } ], jobUserVOLists: [ { type: &#39;array&#39;, required: true, message: &#39;请添加岗位需求&#39;, trigger: &#39;change&#39; } ], }, // 图片前缀 cover: imgUrl, // //分页 column: { pageSize: null, pageNum: null }, // 队伍列表 // 岗位表单校验 jobRules: { jobName: [ { required: true, message: &#39;请输入岗位名称&#39;, trigger: &#39;change&#39; } ], jobCount: [ { required: true, message: &#39;请输入岗位人数&#39;, trigger: &#39;change&#39; } ], workHour: [ { required: true, message: &#39;请输入工时&#39;, trigger: &#39;change&#39; } ], pointPercent: [ { required: true, message: &#39;请输入积分(每人每小时)&#39;, trigger: &#39;change&#39; }, { validator: checkPointIsNumber, message: &#39;积分必须为数字&#39; } ], checkInTime: [ { required: true, message: &#39;请输入签到时间&#39;, trigger: &#39;change&#39; } ], checkOutTime: [ { required: true, message: &#39;请输入签退时间&#39;, trigger: &#39;change&#39; } ], checkLocation: [ { required: true, message: &#39;请选择签到地点&#39;, trigger: &#39;change&#39; } ] }, } }, created() { this.getAddressList() if (!this.$route.query.id) { this.$router.replace({ ...this.$route, query: {} }); } else { this.queryParams = this.$route.query; console.log(this.queryParams.id, &#39;888&#39;) if (this.queryParams.id) { // 编辑 this.title = &#39;修改接龙&#39; getGroupBuyDetail(this.queryParams.id).then(res => { const boolConvert = val => val === 1; console.log(res, &#39;---&#39;) const { cover, id } = res; console.log(res.isGetRealName) this.form = { ...res, isAutoEnd: res.isAutoEnd = 1 ? true : false, id, cover, addressIds:res.addressIds || [], selectedItemsOther: [], selectedItemsFunction: [], products:res.products || [{ image:imgUrl }] } if (res.isGetRealName === 1) { this.form.selectedItemsOther.push(&#39;isGetRealName&#39;) } if (res.isGetPhone === 1) { this.form.selectedItemsOther.push(&#39;isGetPhone&#39;) } if (res.isHideList === 1) { this.form.selectedItemsFunction.push(&#39;isHideList&#39;) } if (res.isHideOrderAmount === 1) { this.form.selectedItemsFunction.push(&#39;isHideOrderAmount&#39;) } if (res.canCancel === 1) { this.form.selectedItemsFunction.push(&#39;canCancel&#39;) } }) }} }, methods: { onMounted() { }, getAddressList() { getGroupBuyAddressPage().then(res => { this.addressoptions = res.pageData }) }, beforeDestroy() { clearInterval(this.timer); }, addproduct() { this.form.products.push({ /* 初始化新商品 */ }); this.$nextTick(() => { this.$refs.form.validateField(&#39;products&#39;); // 触发products字段校验 }); }, removeRow(index) { // 添加长度检查 if (this.form.products.length <= 1) { this.$message.warning(&#39;至少需要保留一个商品&#39;); return; } this.form.products.splice(index, 1); this.$nextTick(() => { this.$refs.form.validateField(&#39;products&#39;); }); }, // 在图片上传成功后的回调中也触发校验 selectProductUpload(obj, index) { uploadPic().then(res => { this.$set(this.form.products, index, { ...this.form.products[index], image: res}) this.$nextTick(() => { this.$refs.form.validateField(&#39;products&#39;); }); }); }, handleProductAvatarChange(file) { if (!file || !file.raw) return; const reader = new FileReader(); reader.onload = (e) => { const img = new Image(); img.onload = () => { // 限制最大尺寸(合理值:800×600) const MAX_SIZE = 800; let width = img.width; let height = img.height; // 按比例缩放到最大尺寸 if (width > MAX_SIZE || height > MAX_SIZE) { const scale = Math.min(MAX_SIZE / width, MAX_SIZE / height); width *= scale; height *= scale; } // 画布压缩处理 const canvas = document.createElement(&#39;canvas&#39;); const ctx = canvas.getContext(&#39;2d&#39;); canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); // 关键优化:降质量并生成更短Data URL this.form.products.image = canvas.toDataURL(file.type, 0.01); // 压缩质量65% }; img.src = e.target.result; }; reader.readAsDataURL(file.raw); }, handleAvatarChange(file) { if (!file || !file.raw) return; const reader = new FileReader(); reader.onload = (e) => { const img = new Image(); img.onload = () => { // 限制最大尺寸(合理值:800×600) const MAX_SIZE = 800; let width = img.width; let height = img.height; // 按比例缩放到最大尺寸 if (width > MAX_SIZE || height > MAX_SIZE) { const scale = Math.min(MAX_SIZE / width, MAX_SIZE / height); width *= scale; height *= scale; } // 画布压缩处理 const canvas = document.createElement(&#39;canvas&#39;); const ctx = canvas.getContext(&#39;2d&#39;); canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); // 关键优化:降质量并生成更短Data URL this.form.cover = canvas.toDataURL(file.type, 0.01); // 压缩质量65% }; img.src = e.target.result; }; reader.readAsDataURL(file.raw); }, beforeAvatarUpload(file) { const validTypes = [&#39;image/jpeg&#39;, &#39;image/png&#39;, &#39;image/webp&#39;]; // 移除GIF减小潜在数据量 const MAX_SIZE_MB = 1.2; // 更严格的大小限制 const isImage = validTypes.includes(file.type); const isSizeValid = file.size / 1024 / 1024 < MAX_SIZE_MB; if (!isImage) { this.$message.error(&#39;仅支持 JPG/PNG/WEBP 格式&#39;); return false; } if (!isSizeValid) { this.$message.error(`图片大小不能超过 ${MAX_SIZE_MB}MB`); return false; } return true; }, // updateOtherInfo() { // this.form.isGetRealName = this.selectedItemsOther.includes(&#39;真实姓名&#39;); // this.form.isGetPhone = this.selectedItemsOther.includes(&#39;手机号码&#39;); // }, // 更新"功能选择"表单值 updateFunctionSelection() { this.form.isHideList = this.selectedItemsFunction.includes(&#39;发布最新接龙列表&#39;); this.form.isHideOrderAmount = this.selectedItemsFunction.includes(&#39;接龙金额仅创建人可见&#39;); // "禁止用户取消订单"需要特殊处理:选中时canCancel=false this.form.canCancel = !this.selectedItemsFunction.includes(&#39;禁止用户取消订单&#39;); }, // 获取活动详情 // getDetail(status) { // getGroupBuyDetail(this.queryParams.id, status).then(response => { // this.queryParams.id, status // this.form = response // console.log(response, &#39;789&#39;) // }) // }, // 表单重置 reset() { this.form = { addressIds: [], cover: null, canCancel: 0, ids: null, detailInfo: null, endTime: null, id: 0, isAutoEnd: 0, isGetPhone: 0, isGetRealName: 0, isHideList: 0, isHideOrderAmount: 0, isJoin: 0, maxJoinNum: 0, minAmount: 0, name: "", products: [ { id: 0, image: imgUrl, limitNum: 0, name: "", parentId: 0, price: 0, soldNum: 0, totalNum: 0 } ], realEndTime: "", startTime: "", status: 0, } }, selectPicUpload(obj) { let fd = new FormData() //参数的格式是formData格式的 fd.append(&#39;file&#39;, obj.file) //参数 uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { this.form.cover = res }) }, selectProductUpload(obj, index) { let fd = new FormData(); fd.append(&#39;file&#39;, obj.file); uploadPic(fd, { modularName: &#39;ACTIVITY&#39; }).then(res => { // 直接更新对应索引位置的图片URL this.$set(this.form.products, index, { ...this.form.products[index], image: res }); }).catch(error => { console.error(&#39;商品图片上传失败:&#39;, error); this.$message.error(&#39;商品图片上传失败&#39;); }); }, // // 取消关闭弹窗 // closeDialog() { // this.currentImgIndex = 0 // this.selectImgUrl = &#39;&#39; // this.imgDialogVisible = false // }, // // 确认默认图片关闭弹窗 // submitPic() { // this.form.cover = this.selectImgUrl // this.imgDialogVisible = false // }, hasCommonValue(arr) { let seen = new Set(); // 用于存储已经遇到的值 for (let obj of arr) { for (let value of obj.jobUsers) { // 如果值已经存在于 set 中,返回 true if (seen.has(value.userId)) { return true; } // 将当前值加入 set seen.add(value.userId); } } return false; // 如果没有重复的值,返回 false }, /** 提交按钮 */ submitForm() { console.log(this.form.products.image, &#39;000&#39;) let newForm = { ids: this.form.ids, addressIds: this.form.addressIds, canCancel: this.form.selectedItemsFunction.includes(&#39;canCancel&#39;) ? 1 : 0, cover: this.form.cover, detailInfo: this.form.detailInfo, endTime: this.form.endTime, id: this.form.id, isAutoEnd: this.form.isAutoEnd == true ? 1 : 0, isGetPhone: this.form.selectedItemsOther.includes(&#39;isGetPhone&#39;) ? 1 : 0, isGetRealName: this.form.selectedItemsOther.includes(&#39;isGetRealName&#39;) ? 1 : 0, isHideList: this.form.selectedItemsFunction.includes(&#39;isHideList&#39;) ? 0 : 1, isHideOrderAmount: this.selectedItemsFunction.includes(&#39;isHideOrderAmount&#39;) ? 1 : 0, isJoin: this.form.isJoin, maxJoinNum: this.form.maxJoinNum, minAmount: this.form.minAmount, name: this.form.name, // 遍历数组中的每个对象 products: this.form.products.map(item => ({ id: item.id, image: item.image, limitNum: item.limitNum, name: item.name, parentId: item.parentId, price: item.price, soldNum: item.soldNum, totalNum: item.totalNum })), realEndTime: this.form.realEndTime, startTime: this.form.startTime, status: this.form.status, // 修正为this.form.status }; console.log(newForm, this.form.id) //判断每个时间段是否有岗位 // let isJobEmpty = this.form.jobUserVOLists.some(item => item.jobList.length == 0) this.$refs[&#39;form&#39;].validate(valid => { if (valid) { if (this.form.id) { editGroupBuy(newForm).then(response => { console.log(response, &#39;00&#39;) this.$modal.msgSuccess(&#39;修改成功&#39;) this.$router.back(-1) }) } else { if (this.form.name != &#39;&#39; && this.form.cover != &#39;&#39;) { addGroupShop(newForm).then(response => { console.log(response) this.$modal.msgSuccess(&#39;新增成功&#39;) this.$router.back(-1) }) } else { console.log(this.form.ids, &#39;09&#39;) this.$modal.msgError(&#39;请完善信息&#39;) } } } }) }, handleBack() { this.$router.back(-1) }, // handleSelectionChange(selection) { this.ids = selection.map(item => item.pkId) this.single = selection.length !== 1 this.multiple = !selection.length }, // 新增时间段 changeStatus() { if (this.currentTime) { this.timer = setInterval(() => { this.currentTime = new Date().toLocaleTimeString(); console.log(this.currentTime, &#39;90&#39;) }, 1000); } }, // 改变时间段的初始时间 changeStartTime(value, timeIndex) { console.log(this.form.jobUserVOLists[timeIndex].jobList) if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkInTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的初始时间 changeEndTime(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkOutTime = value if (item.checkOutTime && item.checkInTime) { item.workHour = getISOTime(item.checkInTime, item.checkOutTime) if (item.jobUsers) { item.jobUsers.forEach(itemson => { itemson.workHour = item.workHour itemson.point = parseInt(item.pointPercent) * item.workHour }) } } }) } }, // 改变时间段的签到纬度 changeLatitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLatitude = value }) } }, // 改变时间段的签到经度 changeLongitude(value, timeIndex) { if (this.form.jobUserVOLists[timeIndex].jobList) { this.form.jobUserVOLists[timeIndex].jobList.forEach(item => { item.checkLongitude = value }) } }, // 跳转 toPrck() { window.open(&#39;https://lbs.amap.com/tools/picker&#39;) }, // 删除时间段 deleteTime(timeIndex) { this.$modal.confirm(&#39;是否确认该时间段?&#39;).then(function () { }).then(() => { this.form.jobUserVOLists.splice(timeIndex, 1) this.changeNumber() }).catch(() => { }) }, // 删除岗位按钮 // 活动最大人数改变 changeNumber() { this.form.maxCount = 0 this.form.jobUserVOLists.forEach(item => { item.jobList.forEach(itemson => { this.form.maxCount += itemson.jobUsers.length }) }) }, // 岗位人数改变 //岗位志愿者选择 } } </script> <style scoped> .container { background-color: #f5f5f5; padding: 1%; } .title_type { font-size: 24px; font-weight: 700; margin-bottom: 20px; } .dialog-footer { display: flex; flex-direction: row; justify-content: center; align-items: center; padding-bottom: 30px; } .avatar-uploader .el-upload { border: 1px solid #f8f3f3; border-radius: 6px; cursor: pointer; position: relative; overflow: hidden; } .avatar-uploader .el-upload:hover { border-color: #409EFF; } .avatar-uploader-icon { font-size: 28px; color: #8c939d; width: 120px; height: 120px; line-height: 120px; text-align: center; } .coverImage { width: 214px; height: 129px; border-radius: 6px; cursor: pointer; } .select_mask { position: absolute; z-index: 2; background-color: rgba(127, 125, 121, 0.5); text-align: center; top: 0; bottom: 0; left: 0; right: 0; width: 214px; height: 129px; display: flex; justify-content: center; align-items: center; } .avatar { width: 50px; height: 50px; display: block; } .margin-right-10 { margin-right: 10px; } .job_box { /* border: 1px solid #ccc; */ background-color: #F8F8F8; padding: 46px 10px 10px; margin-bottom: 10px; margin-left: 50px; border-radius: 10px; } </style>
11-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值