index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. <template>
  2. <div class="app-container">
  3. <!-- 活动专区配置 -->
  4. <el-page-header @back="goBack" :content="activityName"></el-page-header>
  5. <el-divider></el-divider>
  6. <div class="form-container">
  7. <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules">
  8. <el-upload
  9. class="avatar-uploader"
  10. :action="baseURL + 'common/upload'"
  11. :headers="myHeaders"
  12. :show-file-list="false"
  13. :on-success="uploadSuccess"
  14. :before-upload="beforeUpload">
  15. </el-upload>
  16. <el-form-item :label="'活动专区图片:'" prop="img1_url">
  17. <div class="images">
  18. <div class="main-img">
  19. <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
  20. <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  21. <div class="mask" v-show="img1_hover">
  22. <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
  23. <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
  24. </div>
  25. </div>
  26. <div class="add" v-else @click="uploadImage('img1')">
  27. <i class="el-icon-plus avatar-uploader-icon"></i>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="tips">
  32. <span>尺寸比例为:{{ratio}}</span>
  33. </div>
  34. </el-form-item>
  35. <el-form-item :label="'活动专区表头图片:'">
  36. <div class="images">
  37. <div class="main-img">
  38. <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
  39. <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  40. <div class="mask" v-show="img2_hover">
  41. <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
  42. <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
  43. <i class="el-icon-delete" @click="deleteImage('img2')"></i>
  44. </div>
  45. </div>
  46. <div class="add" v-else @click="uploadImage('img2')">
  47. <i class="el-icon-plus avatar-uploader-icon"></i>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="tips">
  52. <span>尺寸比例为:750*800</span>
  53. </div>
  54. </el-form-item>
  55. <el-form-item :label="'活动分享图片:'">
  56. <div class="images">
  57. <div class="main-img">
  58. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  59. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  60. <div class="mask" v-show="img3_hover">
  61. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  62. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  63. <i class="el-icon-delete" @click="deleteImage('img3')"></i>
  64. </div>
  65. </div>
  66. <div class="add" v-else @click="uploadImage('img3')">
  67. <i class="el-icon-plus avatar-uploader-icon"></i>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="tips">
  72. <span>尺寸比例为:750*750</span>
  73. </div>
  74. </el-form-item>
  75. <el-form-item :label="'活动专区背景颜色:'" prop="backGroundColor">
  76. <div style="display: flex">
  77. <el-color-picker v-model="mainForm.backGroundColor">
  78. </el-color-picker>
  79. <el-button style="margin-left: 20px" @click="resetFn">重置</el-button>
  80. </div>
  81. </el-form-item>
  82. </el-form>
  83. </div>
  84. <div class="btn-group">
  85. <el-button size="small" type="primary" @click="addClassify">选择分类</el-button>
  86. <el-button size="small" type="primary" @click="addGoods">选择商品</el-button>
  87. </div>
  88. <div class="diy-table">
  89. <div class="table-head clearfix">
  90. <div class="item goods">商品名称</div>
  91. <div class="right">
  92. <div class="item name">规格</div>
  93. <div class="item input">划线价格</div>
  94. <div class="item input">销售价</div>
  95. <div class="item input">分销金额</div>
  96. <div class="item input">佣金比例</div>
  97. <div class="item input">内部分销金额</div>
  98. <div class="item input">内部佣金比例</div>
  99. <div class="item input">库存</div>
  100. <div class="item input">销量</div>
  101. </div>
  102. <div class="blank">操作</div>
  103. </div>
  104. <div class="goods-item" v-for="(item, index) in goodsList" :key="index">
  105. <div class="goods-info" >
  106. <img :src="item.imgUrl" alt="" />
  107. {{ item.goodsName }}
  108. </div>
  109. <div class="spec-list">
  110. <div class="spec-item" v-for="(it, idx) in item.goodsSpecs" :key="idx">
  111. <div class="col name">{{it.name}}-{{it.specValue}}</div>
  112. <div class="col input"><el-input disabled type="number" size="small" v-model="it.orgPrice"></el-input></div>
  113. <div class="col input"><el-input disabled type="number" size="small" v-model="it.price"></el-input></div>
  114. <div class="col input"><el-input disabled type="number" size="small" v-model="it.shareAmount"></el-input></div>
  115. <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input></div>
  116. <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerShareAmount"></el-input></div>
  117. <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input></div>
  118. <div class="col input"><el-input disabled type="number" size="small" v-model="it.stockNum"></el-input></div>
  119. <div class="col input"><el-input disabled type="number" size="small" v-model="it.soldNum"></el-input></div>
  120. </div>
  121. </div>
  122. <div class="operation">
  123. <el-button type="text" style="color: #f56c6c" @click="deleteGoods(item.goodsId,index)">删除</el-button>
  124. </div>
  125. </div>
  126. <div class="empty-text" v-if="goodsList.length < 1">暂无数据</div>
  127. </div>
  128. <div class="page-footer">
  129. <div class="footer" :class="classObj">
  130. <el-button
  131. type="primary"
  132. @click="submitMainForm"
  133. :loading="formLoading"
  134. >{{ formLoading ? "提交中 ..." : "提 交" }}</el-button
  135. >
  136. <el-button @click="goBack">关 闭</el-button>
  137. </div>
  138. </div>
  139. <!-- 选择商品 -->
  140. <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="50%" :close-on-click-modal="false">
  141. <div class="dialog-container clearfix">
  142. <div class="left fl">
  143. <div class="item" @click="changeClassify('')">全部分类</div>
  144. <div class="group" v-for="(item, index) in classifyList" :key="index">
  145. <div class="item" @click="toggleOpen(index)">
  146. <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
  147. </div>
  148. <div class="child" v-if="item.isOpen">
  149. <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="right fl">
  154. <div class="search">
  155. <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
  156. <el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
  157. </el-input>
  158. </div>
  159. <div class="table" style="margin: 10px 0 20px;">
  160. <el-table
  161. v-loading="table_listLoading"
  162. :data="table_dataList"
  163. element-loading-text="Loading"
  164. tooltip-effect="dark"
  165. style="width: 100%"
  166. max-height="270"
  167. @selection-change="handleChooseGoods">
  168. <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
  169. <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
  170. <el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
  171. <el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
  172. </el-table>
  173. </div>
  174. <div class="pagination clearfix">
  175. <div class="fr">
  176. <el-pagination
  177. @current-change="handleTableCurrentChange"
  178. :current-page="table_currentPage"
  179. :page-size="table_pageSize"
  180. background
  181. layout="prev, pager, next"
  182. :total="table_listTotal">
  183. </el-pagination>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <div slot="footer" class="dialog-footer">
  189. <el-button type="primary" @click="submitAddGoods">保 存</el-button>
  190. <el-button @click="cancelAddGoods">取 消</el-button>
  191. </div>
  192. </el-dialog>
  193. <!-- 选择分类 -->
  194. <el-dialog title="选择分类" :visible.sync="addClassifyVisible" :show-close="false" width="40%" :close-on-click-modal="false">
  195. <div class="classify-list">
  196. <el-tree
  197. :data="classifyList"
  198. show-checkbox
  199. default-expand-all
  200. node-key="categoryId"
  201. ref="tree"
  202. highlight-current
  203. :props="defaultProps">
  204. </el-tree>
  205. </div>
  206. <div slot="footer" class="dialog-footer">
  207. <el-button type="primary" @click="submitAddClassify">保 存</el-button>
  208. <el-button @click="cancelAddClassify">取 消</el-button>
  209. </div>
  210. </el-dialog>
  211. </div>
  212. </template>
  213. <script>
  214. import { getToken } from "@/utils/auth";
  215. import { getactivityGoodsDetail,addActiveGoods,editEnterpriseTemplate, getClassifyList, getGoodsList, getMoreGoodsList } from "@/api/special";
  216. export default {
  217. data() {
  218. return {
  219. companyWechatId:"",
  220. useTemplate:"",
  221. activityName: "", // 头部标题
  222. ratio: '',
  223. objectId: "", // 小程序模板id
  224. type: "", // 类型
  225. baseURL: process.env.VUE_APP_BASE_API,
  226. myHeaders: { "x-token": getToken() },
  227. formLoading: false,
  228. mainForm: {
  229. backGroundColor: "#F4F2F2",
  230. },
  231. mainFormRules: {
  232. // img1_url: [
  233. // { required: true, message: "请上传活动专区图片", trigger: "blur" },
  234. // ],
  235. },
  236. goodsList: [], // 列表数据
  237. addGoodsVisible: false,
  238. classifyList: [],
  239. classifyCurrent: '',
  240. keyword: '',
  241. table_dataList: null, // 列表数据
  242. table_listLoading: true, // 列表加载loading
  243. table_currentPage: 1, // 当前页码
  244. table_pageSize: 10, // 每页数量
  245. table_listTotal: 0, // 列表总数
  246. table_chooseGoods: [], // table中 当前选择商品
  247. addClassifyVisible: false,
  248. defaultProps: {
  249. children: 'children',
  250. label: 'name'
  251. },
  252. uploadImageType: null,
  253. img1_url: '',
  254. img1_hover: false,
  255. img2_url: '',
  256. img2_hover: false,
  257. img3_url: '',
  258. img3_hover: false,
  259. };
  260. },
  261. computed: {
  262. sidebar() {
  263. return this.$store.state.app.sidebar;
  264. },
  265. classObj() {
  266. return {
  267. hideSidebar: !this.sidebar.opened,
  268. openSidebar: this.sidebar.opened,
  269. };
  270. },
  271. },
  272. created() {
  273. const { item } = this.$route.query;
  274. this.activityName = item.activityName;
  275. this.objectId = item.objectId;
  276. this.type = item.type;
  277. this.ratio = item.ratio;
  278. this.companyWechatId = JSON.parse(localStorage.getItem("jsmmall_user")).companyWechatId;
  279. this.useTemplate = JSON.parse(localStorage.getItem("jsmmall_user")).useTemplate;
  280. this.getactivityGoodsDetail();
  281. if(item.type == 2){
  282. this.img1_url=item.popupImage
  283. this.img2_url=item.popupHeadImage
  284. this.img3_url=item.popupQrcode
  285. this.mainForm.backGroundColor=item.popupBackgroundColor
  286. } else if(item.type==3){
  287. this.img1_url=item.active1Image
  288. this.img2_url=item.active1HeadImage
  289. this.img3_url=item.active1Qrcode
  290. this.mainForm.backGroundColor=item.active1BackgroundColor
  291. }
  292. else if(item.type==4){
  293. this.img1_url=item.active2LeftImage
  294. this.img2_url=item.active2LeftHeadImage
  295. this.img3_url=item.active2LeftQrcode
  296. this.mainForm.backGroundColor=item.active2LeftBackgroundColor
  297. }else if(item.type==5){
  298. this.img1_url=item.active2RightImage
  299. this.img2_url=item.active2RightHeadImage
  300. this.img3_url=item.active2RightQrcode
  301. this.mainForm.backGroundColor=item.active2RightBackgroundColor
  302. }else if(item.type==6){
  303. this.img1_url=item.only1Image
  304. this.img2_url=item.only1HeadImage
  305. this.img3_url=item.only1Qrcode
  306. this.mainForm.backGroundColor=item.only1BackgroundColor
  307. } else if(item.type==7){
  308. this.img1_url=item.only2Image
  309. this.img2_url=item.only2HeadImage
  310. this.img3_url=item.only2Qrcode
  311. this.mainForm.backGroundColor=item.only2BackgroundColor
  312. } else if(item.type==8){
  313. this.img1_url=item.only3Image
  314. this.img2_url=item.only3HeadImage
  315. this.img3_url=item.only3Qrcode
  316. this.mainForm.backGroundColor=item.only3BackgroundColor
  317. }else {
  318. this.img1_url=item.only4Image
  319. this.img2_url=item.only4HeadImage
  320. this.img3_url=item.only4Qrcode
  321. this.mainForm.backGroundColor=item.only4BackgroundColor
  322. }
  323. },
  324. methods: {
  325. // 更改模板信息
  326. editEnterpriseTemplate(params){
  327. editEnterpriseTemplate(params).then(res=>{console.log('更改模板信息',res)})
  328. },
  329. // 添加活动商品
  330. addActiveGoods(params){
  331. addActiveGoods(params).then(res=>{
  332. if(res.code==200){
  333. this.$router.go(-1)
  334. }
  335. })
  336. },
  337. // 获取活动商品详情
  338. getactivityGoodsDetail() {
  339. const params = {
  340. objectId: this.objectId, // 小程序模板id
  341. type: this.type, // 类型: 1=新维度分类,2=首页弹窗, 3=活动专区1,4=活动专区2左侧,5=活动专区2右侧,6=专场专区1,7=专场专区2 , 8=专场专区3 , 9=专场专区4
  342. };
  343. getactivityGoodsDetail(params).then((res) => {
  344. res.data.activeGoodsList.forEach(item=> {
  345. item.imgUrl = item.goods.imgUrl
  346. });
  347. this.goodsList = res.data.activeGoodsList
  348. });
  349. },
  350. // 重置
  351. resetFn() {
  352. this.mainForm.backGroundColor = "#F4F2F2";
  353. },
  354. // 删除商品
  355. deleteGoods(item,index) {
  356. this.goodsList.splice(index,1)
  357. },
  358. uploadImage(type) {
  359. this.uploadImageType = type;
  360. document.querySelector('.avatar-uploader input').click();
  361. },
  362. // 上传图片
  363. uploadSuccess(res, file) {
  364. this[this.uploadImageType + '_url'] = res.data.url;
  365. },
  366. beforeUpload(file) {
  367. const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
  368. const whiteList = ['jpg', 'jpeg', 'png'];
  369. if (whiteList.indexOf(fileSuffix) === -1) {
  370. this.$errorMsg('只支持上传jpg/jpeg/png文件!');
  371. return false;
  372. }
  373. },
  374. // 预览图片
  375. previewImage(type) {
  376. this.$refs[type].showViewer = true;
  377. },
  378. // 删除图片
  379. deleteImage(type) {
  380. this[type + '_url'] = '';
  381. },
  382. // 返回
  383. goBack() {
  384. this.$router.go(-1);
  385. },
  386. // 获取分类列表
  387. getClassifyList(state) {
  388. getClassifyList({categoryLevel: 1, status: true}).then(res => {
  389. res.data.forEach(item => {
  390. item.isOpen = false;
  391. });
  392. this.classifyList = res.data;
  393. this.classifyCurrent = '';
  394. if(!state) {
  395. this.getGoodsList();
  396. }
  397. })
  398. },
  399. // 展开/收起 分类
  400. toggleOpen(index) {
  401. this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
  402. },
  403. // 切换分类
  404. changeClassify(cid) {
  405. if(this.table_chooseGoods.length > 0) {
  406. return this.$errorMsg('当前已选择商品,不可切换分类');
  407. }
  408. this.classifyCurrent = cid;
  409. this.table_currentPage = 1;
  410. this.getGoodsList();
  411. },
  412. // 搜索
  413. getGoodsListByScreen() {
  414. if(this.table_chooseGoods.length > 0) {
  415. return this.$errorMsg('当前已选择商品,不可搜索');
  416. }
  417. this.table_currentPage = 1;
  418. this.getGoodsList();
  419. },
  420. // 获取商品列表
  421. getGoodsList() {
  422. getGoodsList({
  423. pageNum: this.table_currentPage,
  424. pageSize: this.table_pageSize,
  425. keyword: this.keyword,
  426. categoryId: this.classifyCurrent,
  427. }).then(res => {
  428. let oldGoodsList = this.goodsList;
  429. let newGoodsList = res.data.records;
  430. for(let i = 0; i < oldGoodsList.length; i++) {
  431. let oldItem = oldGoodsList[i]
  432. for(let j = 0; j < newGoodsList.length; j++) {
  433. let newItem = newGoodsList[j]
  434. if(newItem.goodsId === oldItem.goodsId){
  435. newGoodsList[j].selected = true;
  436. break;
  437. }
  438. }
  439. }
  440. for(let j = 0; j < newGoodsList.length; j++) {
  441. let newItem = newGoodsList[j]
  442. if(newItem.promotionGroup === true){
  443. newGoodsList[j].selected = true;
  444. }
  445. }
  446. this.table_dataList = newGoodsList;
  447. this.table_listTotal = res.data.total;
  448. this.table_listLoading = false;
  449. })
  450. },
  451. // 查询重复值并禁选
  452. checkboxSelect (row, rowIndex) {
  453. if (row.selected) {
  454. return false // 禁用
  455. }else{
  456. return true // 不禁用
  457. }
  458. },
  459. // 更改列表当前页
  460. handleTableCurrentChange(val) {
  461. if(this.table_chooseGoods.length > 0) {
  462. return this.$errorMsg('当前已选择商品,不可切换分页');
  463. }
  464. this.table_currentPage = val;
  465. this.getGoodsList();
  466. },
  467. // table点击选择商品
  468. handleChooseGoods(val) {
  469. this.table_chooseGoods = val;
  470. },
  471. // 打开 选择商品
  472. addGoods() {
  473. this.addGoodsVisible = true;
  474. this.getClassifyList();
  475. },
  476. // 取消 选择商品
  477. cancelAddGoods(){
  478. this.addGoodsVisible = false;
  479. },
  480. // 提交 选择商品
  481. submitAddGoods() {
  482. let oldGoodsList = this.goodsList;
  483. let newGoodsList = this.table_chooseGoods;
  484. this.goodsList = oldGoodsList.concat(newGoodsList);
  485. this.addGoodsVisible = false;
  486. },
  487. // 打开 选择分类
  488. addClassify() {
  489. this.addClassifyVisible = true;
  490. this.getClassifyList(true);
  491. },
  492. // 取消 选择分类
  493. cancelAddClassify(){
  494. this.addClassifyVisible = false;
  495. },
  496. // 提交 选择分类
  497. submitAddClassify() {
  498. if(this.$refs.tree.getCheckedNodes().length <= 0) {
  499. return this.$errorMsg('请选择分类');
  500. }
  501. let checkeds = this.$refs.tree.getCheckedNodes();
  502. let ids = [];
  503. checkeds.forEach(item => {
  504. if(item.level === 2) {
  505. ids.push(item.categoryId);
  506. }
  507. })
  508. getMoreGoodsList({ categoryIds: ids.join(',')}).then(res => {
  509. let oldGoodsList = this.goodsList;
  510. let newGoodsList = [];
  511. res.data.forEach(item => {
  512. if(item.promotionGroup === false) {
  513. newGoodsList.push(item);
  514. }
  515. })
  516. let allGoodsList = oldGoodsList.concat(newGoodsList);
  517. let showGoodsList = [];
  518. let obj = {};
  519. for(var i =0; i<allGoodsList.length; i++){
  520. if(!obj[allGoodsList[i].goodsId]){
  521. showGoodsList.push(allGoodsList[i]);
  522. obj[allGoodsList[i].goodsId] = true;
  523. }
  524. }
  525. this.goodsList = showGoodsList;
  526. this.addClassifyVisible = false;
  527. })
  528. },
  529. // 提交
  530. submitMainForm() {
  531. this.$refs.mainForm.validate((valid) => {
  532. if (valid) {
  533. const params={
  534. goodsList: this.goodsList,
  535. objectId: this.objectId,
  536. type: this.type
  537. }
  538. this.addActiveGoods(params)
  539. let comParams = {
  540. companyWechatTemplateId: this.objectId,
  541. companyWechatId:this.companyWechatId,
  542. templateType:this.useTemplate
  543. }
  544. let params1 = {}
  545. if(this.type == 2){
  546. params1 = {
  547. popupBackgroundColor: this.mainForm.backGroundColor,
  548. popupHeadImage: this.img2_url,
  549. popupImage: this.img1_url,
  550. popupQrcode: this.img3_url,
  551. ...comParams
  552. }
  553. } else if(this.type == 3){
  554. params1 = {
  555. active1BackgroundColor: this.mainForm.backGroundColor,
  556. active1HeadImage: this.img2_url,
  557. active1Image: this.img1_url,
  558. active1Qrcode: this.img3_url,
  559. ...comParams
  560. }
  561. } else if(this.type == 4){
  562. params1 = {
  563. active2LeftBackgroundColor: this.mainForm.backGroundColor,
  564. active2LeftHeadImage: this.img2_url,
  565. active2LeftImage: this.img1_url,
  566. active2LeftQrcode: this.img3_url,
  567. ...comParams
  568. }
  569. } else if(this.type == 5){
  570. params1 = {
  571. active2RightBackgroundColor: this.mainForm.backGroundColor,
  572. active2RightHeadImage: this.img2_url,
  573. active2RightImage: this.img1_url,
  574. active2RightQrcode: this.img3_url,
  575. ...comParams
  576. }
  577. } else if(this.type == 6){
  578. params1 = {
  579. only1BackgroundColor: this.mainForm.backGroundColor,
  580. only1HeadImage: this.img2_url,
  581. only1Image: this.img1_url,
  582. only1Qrcode: this.img3_url,
  583. ...comParams
  584. }
  585. } else if(this.type == 7){
  586. params1 = {
  587. only2BackgroundColor: this.mainForm.backGroundColor,
  588. only2HeadImage: this.img2_url,
  589. only2Image: this.img1_url,
  590. only2Qrcode: this.img3_url,
  591. ...comParams
  592. }
  593. } else if(this.type == 8){
  594. params1 = {
  595. only3BackgroundColor: this.mainForm.backGroundColor,
  596. only3HeadImage: this.img2_url,
  597. only3Image: this.img1_url,
  598. only3Qrcode: this.img3_url,
  599. ...comParams
  600. }
  601. } else if(this.type == 9){
  602. params1 = {
  603. only4BackgroundColor: this.mainForm.backGroundColor,
  604. only4HeadImage: this.img2_url,
  605. only4Image: this.img1_url,
  606. only4Qrcode: this.img3_url,
  607. ...comParams
  608. }
  609. }
  610. this.editEnterpriseTemplate(params1)
  611. }
  612. });
  613. },
  614. },
  615. };
  616. </script>
  617. <style lang="scss" scoped>
  618. .form-container {
  619. margin-top: 40px;
  620. // padding: 0 6%;
  621. .title {
  622. font-size: 16px;
  623. margin-bottom: 30px;
  624. padding-left: 10px;
  625. font-weight: bold;
  626. }
  627. .tips {
  628. margin-top: 10px;
  629. span {
  630. display: inline-block;
  631. width: 300px;
  632. text-align: center;
  633. line-height: 32px;
  634. background: #ffefef;
  635. font-size: 14px;
  636. color: #f66460;
  637. }
  638. }
  639. .tips2 {
  640. font-size: 12px;
  641. color: #999999;
  642. line-height: 30px;
  643. }
  644. .container {
  645. padding: 10px 20px 0;
  646. background: #f5f5f5;
  647. border-radius: 10px;
  648. }
  649. .addBtn {
  650. padding: 10px 0;
  651. }
  652. }
  653. .dialog-container {
  654. .left {
  655. width: 140px;
  656. height: 350px;
  657. overflow-y: scroll;
  658. .group {
  659. margin-top: 10px;
  660. }
  661. .child {
  662. margin-top: 5px;
  663. .item {
  664. padding-left: 18px;
  665. }
  666. }
  667. .item {
  668. cursor: pointer;
  669. line-height: 24px;
  670. }
  671. }
  672. .right {
  673. width: calc(100% - 140px);
  674. height: 350px;
  675. box-sizing: border-box;
  676. padding-left: 20px;
  677. }
  678. }
  679. .images {
  680. display: flex;
  681. flex-wrap: wrap;
  682. .main-img {
  683. display: flex;
  684. flex-direction: column;
  685. justify-content: center;
  686. align-items: center;
  687. width: 120px;
  688. margin-right: 20px;
  689. .img {
  690. border: 1px dashed #eaeaea;
  691. border-radius: 5px;
  692. overflow: hidden;
  693. position: relative;
  694. .el-image {
  695. display: block;
  696. }
  697. .mask {
  698. position: absolute;
  699. left: 0;
  700. top: 0;
  701. width: 120px;
  702. height: 120px;
  703. background: rgba($color: #000000, $alpha: 0.3);
  704. display: flex;
  705. align-items: center;
  706. justify-content: center;
  707. i {
  708. font-size: 20px;
  709. color: #ffffff;
  710. cursor: pointer;
  711. margin: 0 8px;
  712. }
  713. }
  714. }
  715. .text {
  716. font-size: 14px;
  717. color: #666666;
  718. }
  719. }
  720. .add {
  721. width: 120px;
  722. height: 120px;
  723. border: 1px dashed #eaeaea;
  724. border-radius: 5px;
  725. cursor: pointer;
  726. display: flex;
  727. align-items: center;
  728. justify-content: center;
  729. i {
  730. font-size: 30px;
  731. color: #999;
  732. }
  733. }
  734. .tmp-img {
  735. position: relative;
  736. .tmp {
  737. position: absolute;
  738. left: 0;
  739. top: 0;
  740. line-height: 20px;
  741. padding: 0 8px;
  742. background: #f66460;
  743. border-radius: 0 0 10px 0;
  744. font-size: 12px;
  745. color: #ffffff;
  746. }
  747. }
  748. }
  749. .classify-list {
  750. height: 50vh;
  751. overflow-y: scroll;
  752. }
  753. .diy-table {
  754. overflow-x: scroll;
  755. border-left: 1px solid #f5f5f5;
  756. margin-top: 20px;
  757. width: 100%;
  758. // margin-left: 77px;
  759. // min-width: 1185px;
  760. max-width: 100%;
  761. .table-head {
  762. display: flex;
  763. .item {
  764. height: 40px;
  765. line-height: 40px;
  766. float: left;
  767. font-weight: 500;
  768. font-size: 14px;
  769. background: #f5f5f5;
  770. text-align: center;
  771. }
  772. .right {
  773. float: left;
  774. width: 94%;
  775. min-width: 1150px;
  776. flex-shrink: 0;
  777. height: 40px;
  778. }
  779. .goods {
  780. width: 20%;
  781. min-width: 250px;
  782. }
  783. .name {
  784. width: 11.1111%;
  785. min-width: 100px;
  786. }
  787. .input {
  788. width: 11.1111%;
  789. min-width: 100px;
  790. }
  791. .opera {
  792. width: 11.1111%;
  793. min-width: 80px;
  794. // text-align: right;
  795. }
  796. .blank {
  797. width: 6%;
  798. min-width: 90px;
  799. font-weight: 500;
  800. font-size: 14px;
  801. background: #f5f5f5;
  802. text-align: center;
  803. line-height: 40px;
  804. }
  805. }
  806. .goods-item {
  807. display: flex;
  808. align-content: center;
  809. .goods-info {
  810. flex-shrink: 0;
  811. width: 20%;
  812. min-width: 250px;
  813. padding: 0 10px;
  814. display: flex;
  815. align-items: center;
  816. border-bottom: 1px solid #f5f5f5;
  817. border-right: 1px solid #f5f5f5;
  818. font-size: 14px;
  819. &:last-child {
  820. border-bottom: none;
  821. }
  822. img {
  823. width: 40px;
  824. height: 40px;
  825. margin-right: 10px;
  826. flex-shrink: 0;
  827. }
  828. }
  829. .spec-list {
  830. width: 94%;
  831. min-width: 1150px;
  832. border-bottom: 1px solid #f5f5f5;
  833. border-right: 1px solid #f5f5f5;
  834. &:last-child {
  835. border-bottom: none;
  836. }
  837. .spec-item {
  838. display: flex;
  839. align-items: center;
  840. border-bottom: 1px solid #f5f5f5;
  841. &:last-child {
  842. border-bottom: none;
  843. }
  844. .col {
  845. flex-shrink: 0;
  846. height: 50px;
  847. display: flex;
  848. align-items: center;
  849. justify-content: center;
  850. padding: 0 10px;
  851. border-right: 1px solid #f5f5f5;
  852. &:last-child {
  853. border-right: none;
  854. }
  855. }
  856. .name {
  857. width: 11.1111%;
  858. min-width: 100px;
  859. font-size: 14px;
  860. text-align: center;
  861. }
  862. .input {
  863. width: 11.1111%;
  864. min-width: 100px;
  865. }
  866. .btn {
  867. width: 11.1111%;
  868. min-width: 80px;
  869. }
  870. }
  871. }
  872. .operation {
  873. flex-shrink: 0;
  874. width: 6%;
  875. min-width: 90px;
  876. padding: 0 10px;
  877. display: flex;
  878. align-items: center;
  879. justify-content: center;
  880. border-bottom: 1px solid #f5f5f5;
  881. border-right: 1px solid #f5f5f5;
  882. }
  883. }
  884. .empty-text {
  885. line-height: 60px;
  886. text-align: center;
  887. color: #909399;
  888. }
  889. }
  890. .dialog-container {
  891. .left {
  892. width: 140px;
  893. height: 350px;
  894. overflow-y: scroll;
  895. .group {
  896. margin-top: 10px;
  897. }
  898. .child {
  899. margin-top: 5px;
  900. .item {
  901. padding-left: 18px;
  902. }
  903. }
  904. .item {
  905. cursor: pointer;
  906. line-height: 24px;
  907. }
  908. }
  909. .right {
  910. width: calc(100% - 140px);
  911. height: 350px;
  912. box-sizing: border-box;
  913. padding-left: 20px;
  914. }
  915. }
  916. .page-footer {
  917. height: 70px;
  918. }
  919. .footer {
  920. position: fixed;
  921. bottom: 0;
  922. left: 0;
  923. z-index: 1;
  924. width: 100%;
  925. background: #fff;
  926. padding: 15px 40px;
  927. box-sizing: border-box;
  928. transition: all 0.28s;
  929. text-align: right;
  930. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
  931. &.hideSidebar {
  932. margin-left: 54px;
  933. width: calc(100vw - 54px);
  934. }
  935. &.openSidebar {
  936. margin-left: 210px;
  937. width: calc(100vw - 210px);
  938. }
  939. }
  940. ::v-deep input::-webkit-outer-spin-button,
  941. ::v-deep input::-webkit-inner-spin-button {
  942. -webkit-appearance: none;
  943. }
  944. ::v-deep input[type="number"] {
  945. -moz-appearance: textfield;
  946. }
  947. ::v-deep .el-form-item__label {
  948. margin-left: 0px !important;
  949. }
  950. </style>