Merge branch 'ma'

master
mabo 2021-06-28 18:54:09 +08:00
commit 5ea61a160e
3 changed files with 34 additions and 40 deletions

View File

@ -344,6 +344,7 @@ export default {
callback(val, index) { callback(val, index) {
this.$set(val, "___selected", !val.___selected); this.$set(val, "___selected", !val.___selected);
console.log(val.___selected); console.log(val.___selected);
console.log(this.selectMember);
let findUser = this.selectMember.find((item) => { let findUser = this.selectMember.find((item) => {
return item.id == val.id; return item.id == val.id;
}); });

View File

@ -423,7 +423,7 @@ div.base-info-item {
display:flex; display:flex;
} }
.demo-upload-list-cover div { .demo-upload-list-cover div {
margin: 10% 0; margin-top: 50px;
width: 100%; width: 100%;
> i { > i {

View File

@ -137,27 +137,33 @@
<Input type="text" v-model="baseInfoForm.cost" placeholder="市场价格" clearable style="width: 260px"/> <Input type="text" v-model="baseInfoForm.cost" placeholder="市场价格" clearable style="width: 260px"/>
</FormItem> </FormItem>
<FormItem class="form-item-view-el required" label="商品图片" prop="goodsGalleryFiles"> <FormItem class="form-item-view-el required" label="商品图片" prop="goodsGalleryFiles">
<div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index"> <vuedraggable
<template v-if="item.status === 'finished'"> :list="baseInfoForm.goodsGalleryFiles"
<img :src="item.url"/> :animation="200"
style="display:inline-block;"
<div class="demo-upload-list-cover"> ghost-class="thumb-ghost"
<div> >
<Icon type="ios-eye-outline" @click.native="handleViewGoodsPicture(item.url)"></Icon> <div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index">
<Icon type="ios-trash-outline" @click.native="handleRemoveGoodsPicture(item)"></Icon> <template v-if="item.status === 'finished'">
<img :src="item.url"/>
<div class="demo-upload-list-cover">
<div>
<Icon type="ios-eye-outline" size="30" @click.native="handleViewGoodsPicture(item.url)"></Icon>
<Icon type="ios-trash-outline" size="30" @click.native="handleRemoveGoodsPicture(item)"></Icon>
</div>
<!-- <div>
<Icon type="ios-arrow-dropleft" @click.native="
handleGoodsPicRemoteUp(baseInfoForm.goodsGalleryFiles,__index)"/>
<Icon type="ios-arrow-dropright" @click.native="
handleGoodsPicRemoteDown(baseInfoForm.goodsGalleryFiles,__index)"/>
</div> -->
</div> </div>
<div> </template>
<Icon type="ios-arrow-dropleft" @click.native=" <template v-else>
handleGoodsPicRemoteUp(baseInfoForm.goodsGalleryFiles,__index)"/> <Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
<Icon type="ios-arrow-dropright" @click.native=" </template>
handleGoodsPicRemoteDown(baseInfoForm.goodsGalleryFiles,__index)"/> </div>
</div> </vuedraggable>
</div>
</template>
<template v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</template>
</div>
<Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles" <Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles"
:on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']" :on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
@ -167,6 +173,7 @@
<Icon type="ios-camera" size="20"></Icon> <Icon type="ios-camera" size="20"></Icon>
</div> </div>
</Upload> </Upload>
<!-- <upload-pic-thumb v-model="baseInfoForm.goodsGalleryFiles" :multiple="true"></upload-pic-thumb> -->
<Modal title="View Image" v-model="goodsPictureVisible"> <Modal title="View Image" v-model="goodsPictureVisible">
<img :src="previewGoodsPicture" v-if="goodsPictureVisible" style="width: 100%"/> <img :src="previewGoodsPicture" v-if="goodsPictureVisible" style="width: 100%"/>
@ -371,7 +378,7 @@
<Select v-model="params.paramValue" placeholder="请选择" style="width: 200px" clearable <Select v-model="params.paramValue" placeholder="请选择" style="width: 200px" clearable
@on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.paramValue)"> @on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.paramValue)">
<Option v-for="option in params.options.split(',')" :label="option" <Option v-for="option in params.options.split(',')" :label="option"
:value="option"></Option> :value="option" :key="option"></Option>
</Select> </Select>
</FormItem> </FormItem>
</p> </p>
@ -428,18 +435,17 @@
<script> <script>
import {regular} from "@/utils"; import {regular} from "@/utils";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
import editor from "@/views/my-components/lili/editor"; import editor from "@/views/my-components/lili/editor";
import * as API_GOODS from "@/api/goods"; import * as API_GOODS from "@/api/goods";
import * as API_Shop from "@/api/shops"; import * as API_Shop from "@/api/shops";
import cloneObj from "@/utils/index"; import cloneObj from "@/utils/index";
import vuedraggable from "vuedraggable";
export default { export default {
name: "addGoods", name: "addGoods",
components: { components: {
uploadPicThumb,
editor, editor,
vuedraggable
}, },
watch: { watch: {
selectGoodsType: { selectGoodsType: {
@ -838,7 +844,6 @@ export default {
* @value 参数选项值 * @value 参数选项值
*/ */
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) { selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
console.log(params.id);
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) { if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
this.baseInfoForm.goodsParamsDTOList[groupIndex] = { this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId:'', groupId:'',
@ -872,14 +877,13 @@ export default {
// sku // sku
editSkuPicture(row) { editSkuPicture(row) {
console.log(row);
if (row.images && row.images.length > 0) { if (row.images && row.images.length > 0) {
this.previewPicture = row.images[0].url; this.previewPicture = row.images[0].url;
} }
this.selectedSku = row; this.selectedSku = row;
this.showSkuPicture = true; this.showSkuPicture = true;
}, },
handleView(url) { handleView (url) {
this.previewPicture = url; this.previewPicture = url;
this.visible = true; this.visible = true;
}, },
@ -938,7 +942,6 @@ export default {
}); });
}, },
handleBeforeUploadGoodsPicture() { handleBeforeUploadGoodsPicture() {
console.log(this.baseInfoForm);
const check = this.baseInfoForm.goodsGalleryFiles.length < 5; const check = this.baseInfoForm.goodsGalleryFiles.length < 5;
if (!check) { if (!check) {
this.$Notice.warning({ this.$Notice.warning({
@ -1017,7 +1020,6 @@ export default {
...this.baseInfoForm, ...this.baseInfoForm,
...response.result, ...response.result,
}; };
// console.warn(this.baseInfoForm);
this.baseInfoForm.release = "true"; this.baseInfoForm.release = "true";
this.baseInfoForm.recommend = this.baseInfoForm.recommend this.baseInfoForm.recommend = this.baseInfoForm.recommend
@ -1141,7 +1143,6 @@ export default {
group.goodsParamsItemDTOList.forEach(param => { group.goodsParamsItemDTOList.forEach(param => {
param.groupId = group.groupId param.groupId = group.groupId
paramsArr.push(param) paramsArr.push(param)
console.log(param);
}) })
}) })
// //
@ -1155,7 +1156,6 @@ export default {
}) })
}) })
}); });
console.log(this.goodsParams);
} else { } else {
this.baseInfoForm.goodsParamsDTOList = [] this.baseInfoForm.goodsParamsDTOList = []
} }
@ -1184,10 +1184,7 @@ export default {
}, },
// //
async skuValueChange(val, index, item) { async skuValueChange(val, index, item) {
/** 更新skuInfo数据 */
// let _arr = cloneObj(item);
// this.$set(item, "name", _arr.name);
// this.$set(this.skuInfo, index, _arr);
/** /**
* 渲染规格详细表格 * 渲染规格详细表格
*/ */
@ -1309,7 +1306,6 @@ export default {
); );
this.skuTableColumn = pushData; this.skuTableColumn = pushData;
console.log(this.skuTableColumn);
// //
let cloneTemp = cloneObj(this.skuInfo); let cloneTemp = cloneObj(this.skuInfo);
@ -1329,7 +1325,6 @@ export default {
cloneTemp.splice(0, 1); cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp); result = this.specIterator(result, cloneTemp);
this.skuTableData = result; this.skuTableData = result;
console.log(this.skuTableData);
} }
}, },
/** /**
@ -1459,7 +1454,6 @@ export default {
this.GET_GoodData(); this.GET_GoodData();
return; return;
} }
console.log(this.baseInfoForm);
this.GET_GoodsParams(); this.GET_GoodsParams();
/** 1级校验 */ /** 1级校验 */
this.loading = true; this.loading = true;
@ -1582,7 +1576,6 @@ export default {
} }
/** 参数校验 **/ /** 参数校验 **/
/* Object.keys(this.baseInfoForm.goodsParamsList).forEach((item) => { /* Object.keys(this.baseInfoForm.goodsParamsList).forEach((item) => {
console.warn(item.paramName)
});*/ });*/
if (this.goodsId) { if (this.goodsId) {