| | |
| | | <div style="width: 90%"> |
| | | <el-form-item label="项目名称:"> |
| | | <el-select |
| | | v-model="formInline.status" |
| | | v-model="formInline.projId" |
| | | style="width:200px" |
| | | clearable |
| | | placeholder="请选择" |
| | |
| | | </div> |
| | | </div> |
| | | <el-form-item style="text-align: right;"> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 8px;" v-if='filterBtnById("150102")' @click="addProduct">新 增</el-button> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 8px;" @click="onSearch">查 询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_box"> |
| | | <div style="margin-left: 10px;text-align: right;"> |
| | | <el-button type="primary" size="small" v-if='filterBtnById("420201")' @click="addPromotion">新增推广位</el-button> |
| | | </div> |
| | | <Etable |
| | | hasIndex |
| | | httpUrl="promoteList" |
| | |
| | | @getDataList="getDataList" |
| | | :exportUrl="{ |
| | | url: '/qyp/promote/export', |
| | | powerId: '150103', |
| | | powerId: '420204', |
| | | name: '项目列表', |
| | | }" |
| | | ></Etable> |
| | | </div> |
| | | <el-dialog top="8vh" title="新增商品" :visible.sync="addProd" width="60%"> |
| | | <el-dialog top="2vh" :title="title" :visible.sync="addProd" width="50%"> |
| | | <!-- 新增商品名称 --> |
| | | |
| | | |
| | | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :disabled="disabled" size="small" label-width="100px" class="demo-ruleForm"> |
| | | <el-form-item label="项目" prop="projId"> |
| | | <el-select v-model="ruleForm.projId" placeholder="请选择项目"> |
| | | <el-option |
| | | v-for="item in relustObj.projList" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="代理名称" prop="agencyName"> |
| | | <el-input v-model="ruleForm.agencyName" :disabled="disabled"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="推广位名称" prop="promName"> |
| | | <el-input v-model="ruleForm.promName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="推广位姓名" prop="promoterName"> |
| | | <el-input v-model="ruleForm.promoterName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="推广位电话" prop="promoterMblNo"> |
| | | <el-input v-model="ruleForm.promoterMblNo"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="推广位状态" prop="status"> |
| | | <el-radio-group v-model="ruleForm.status" :disabled="disabled"> |
| | | <el-radio v-for="item in relustObj.statusList" :key="item.code" :label="item.code">{{ item.name }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item style="text-align:right;" v-if="!disabled"> |
| | | <el-button type="primary" @click="submitForm('ruleForm')">保 存</el-button> |
| | | <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> --> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import Etable from "@/components/table.vue"; |
| | | import {promoteInit,promoteAdd,promoteDtl,promotePpdate} from "@/api/credit"; |
| | | import uploadImg from "@/components/upload.vue"; |
| | | import MultipleSelect from "@/components/secect.vue"; |
| | | import MultipleSelect from "@/components/fl-select.vue"; |
| | | export default { |
| | | name: "order", |
| | | components: { Etable, MultipleSelect, uploadImg }, |
| | | data() { |
| | | let validateImage = (rule, value, callback) => { //验证器 |
| | | if (!this.payForm.prodListImages.length) { //为true代表图片在 false报错 |
| | | callback(new Error('请上传商品展示图片')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | let validateImage1 = (rule, value, callback) => { //验证器 |
| | | if (!this.payForm.prodImages.length) { //为true代表图片在 false报错 |
| | | callback(new Error('请上传商品轮播图')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | let validateImage2 = (rule, value, callback) => { //验证器 |
| | | if (!this.payForm.prodDescImages.length) { //为true代表图片在 false报错 |
| | | callback(new Error('请上传商品详情图片')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | return { |
| | | disabled: true, |
| | | payForm: { |
| | | prodImages: [], |
| | | prodListImages:[], |
| | | prodDescImages:"", |
| | | }, |
| | | disabled: false, |
| | | ruleForm: {}, |
| | | columns: [ |
| | | { |
| | | lable: "推广位链接", |
| | |
| | | render: (h, scope) => { |
| | | return h("div", [ |
| | | h( |
| | | "span", |
| | | "el-button", |
| | | { |
| | | props:{ |
| | | type:'text', |
| | | size:'small' |
| | | }, |
| | | style: { |
| | | cursor: "pointer", |
| | | color: "#3C8EFE", |
| | | display: this.filterBtnById(150101) |
| | | display: this.filterBtnById(420203) |
| | | ? "inline-block" |
| | | : "none", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | |
| | | this.title ='推广位详情'; |
| | | this.disabled =true; |
| | | let { promId } = scope.row; |
| | | this.getProductDetail(promId) |
| | | }, |
| | | }, |
| | | }, |
| | | "查看详情" |
| | | ), |
| | | h( |
| | | "span", |
| | | "el-button", |
| | | { |
| | | props:{ |
| | | type:'text', |
| | | size:'small' |
| | | }, |
| | | style: { |
| | | cursor: "pointer", |
| | | "margin-left": "8px", |
| | | color: "#3C8EFE", |
| | | display: this.filterBtnById(150104) |
| | | display: this.filterBtnById(420202) |
| | | ? "inline-block" |
| | | : "none", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | |
| | | this.disabled = false; |
| | | this.title ='编辑推广位'; |
| | | let { promId } = scope.row; |
| | | this.getProductDetail(promId) |
| | | }, |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | ], |
| | | licensePaths: [], |
| | | prodListImages:[], |
| | | prodDescImages:[], |
| | | payFormRule: { |
| | | prodListImage:[{ required: true, trigger: "change",validator: validateImage}], |
| | | prodImages:[{ required: true, trigger: "change",validator: validateImage1}], |
| | | prodDescImages:[{ required: true, trigger: "change",validator: validateImage2}], |
| | | desc: [{ required: true, message: "请输入商品简介", trigger: "blur" }], |
| | | rules: { |
| | | projId:[{ required: true, trigger: "change",message: "请选择项目"}], |
| | | agencyName:[{ required: true, trigger: "blur",message: "请输入代理名称"}], |
| | | promName:[{ required: true, trigger: "blur",message: "请输入推广位名称"}], |
| | | promoterName:[{ required: true, trigger: "blur",message: "请输入推广位姓名"}], |
| | | promoterMblNo:[{ required: true, trigger: "blur",message: "请输入推广位电话"}], |
| | | status:[{ required: true, message: "请选择上架状态", trigger: "change" }] |
| | | }, |
| | | formInline: { |
| | | projId:"all", |
| | | status:"all", |
| | | }, |
| | | searchData: {}, |
| | | |
| | | relustObj: {}, |
| | | addProd:false, |
| | | createdTime:[], |
| | | promotionCreatedTime:[] |
| | | promotionCreatedTime:[], |
| | | title:'新增推广位' |
| | | } |
| | | }, |
| | | watch:{ |
| | | addProd:{ |
| | | handler: function(val) { |
| | | if(!val){ |
| | | this.ruleForm = { |
| | | agencyName:"", |
| | | promName:"", |
| | | promoterName:"", |
| | | promoterMblNo:"", |
| | | status:"" |
| | | }; |
| | | this.$refs['ruleForm'].resetFields(); |
| | | } |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | //生命周期 - 创建完成(可以访问当前this实例) |
| | |
| | | //只能输入整数 |
| | | e.target.value = e.target.value.replace(/[^\d]/g, ""); |
| | | }, |
| | | addPDH(){ |
| | | this.$refs['skuObj'].validate((valid) => { |
| | | submitForm(){ |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if(valid){ |
| | | let {productAttr,prodName,prodFundType,prodOsType} = this.skuObj; |
| | | let data = {prodName,prodFundType,prodOsType,prodBrandCode:productAttr[1].value,prodModelCode:productAttr[2].value,prodType:productAttr[0].value}; |
| | | prodAdd(data).then((res)=>{ |
| | | let { promId } = this.ruleForm; |
| | | let event = {promoteAdd,promotePpdate}; |
| | | event[promId?"promotePpdate":"promoteAdd"](this.ruleForm).then((res)=>{ |
| | | this.addProd = false; |
| | | this.initSerch(); |
| | | this.onSearch(); |
| | | }) |
| | | } |
| | | }) |
| | |
| | | this.$refs["skuObj"].resetFields(); |
| | | this.addProd = false; |
| | | }, |
| | | addProduct(){ |
| | | addPromotion(){ |
| | | this.addProd = true; |
| | | this.title='新增推广位'; |
| | | this.disabled = false; |
| | | }, |
| | | onSearch() { |
| | |
| | | this.formInline.projCreEndTime = null; |
| | | } |
| | | if (this.promotionCreatedTime && this.promotionCreatedTime.length) { |
| | | this.formInline.promCreEndTime = this.createdTime[0]; |
| | | this.formInline.promCreStartTime = this.createdTime[1]; |
| | | this.formInline.promCreEndTime = this.promotionCreatedTime[0]; |
| | | this.formInline.promCreStartTime = this.promotionCreatedTime[1]; |
| | | } else { |
| | | this.formInline.promCreEndTime = null; |
| | | this.formInline.promCreStartTime = null; |
| | | } |
| | | let objForm = JSON.parse(JSON.stringify(this.formInline)); |
| | | for (let key in objForm) { |
| | | if (objForm[key] === "all") { |
| | | if (objForm[key] === "all"||objForm[key] === ""||objForm[key] === null) { |
| | | delete objForm[key]; |
| | | } |
| | | } |
| | |
| | | }, |
| | | getDataList(e) { |
| | | }, |
| | | // prodDescSend(e){ |
| | | // //文件上传 |
| | | // this.payForm.prodDescImages = e.map((res) => { |
| | | // return res.filePath; |
| | | // }); |
| | | // this.$refs.prodDescImagesIplaod.clearValidate(); |
| | | // }, |
| | | // productShowUSend(e){ |
| | | // this.payForm.prodListImages = e.map((res) => { |
| | | // return res.filePath; |
| | | // }); |
| | | // this.$refs.productShowUpload.clearValidate(); |
| | | // }, |
| | | getProductDetail(promId,type){ |
| | | promoteDtl({promId:promId}).then(({body})=>{ |
| | | this.ruleForm = body; |
| | | this.$nextTick(()=>{ |
| | | this.addProd = true; |
| | | }); |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |