多规则生成问题

main
wangdong 3 months ago
commit b70702431f
  1. 10
      src/common/model/goods/MultiSpec.js
  2. 1
      src/views/goods/Index.vue
  3. 3
      src/views/goods/modules/MultiSpec.vue
  4. 30
      src/views/market/settle/modules/details.vue

@ -213,21 +213,20 @@ export default class MultiSpec {
this.multiSpecData.skuList = this.oldSkuList(newSkuList) this.multiSpecData.skuList = this.oldSkuList(newSkuList)
} }
// 合并已存在的sku数据 // 合并已存在的sku数据
oldSkuList (newSkuList) { oldSkuList (newSkuList) {
// const oldSkuList = _.cloneDeep(this.multiSpecData.skuList) // const oldSkuList = _.cloneDeep(this.multiSpecData.skuList)
const oldSkuList = this.multiSpecData.skuList.concat() const oldSkuList = this.multiSpecData.skuList.concat()
if (!oldSkuList.length || !newSkuList.length) { if (!oldSkuList.length || !newSkuList.length) {
return newSkuList return newSkuList
} }
console.log(oldSkuList, newSkuList)
for (const index in newSkuList) { for (const index in newSkuList) {
// 查找符合的旧记录 // 查找符合的旧记录
let oldSkuItem = {} let oldSkuItem = {}
// if (oldSkuList.length === newSkuList.length) { // if (oldSkuList.length === newSkuList.length) {
// oldSkuItem = _.cloneDeep(oldSkuList[index]) // oldSkuItem = _.cloneDeep(oldSkuList[index])
// } else { // } else {
oldSkuItem = oldSkuList.find( oldSkuItem = oldSkuList.find(
(item) => (item) =>
newSkuList[index].tempId === newSkuList[index].tempId ===
((item.goods_props && item.goods_props.length > 0) ? item.goods_props.map((v) => v.value.name).join('_') : item.tempId) ((item.goods_props && item.goods_props.length > 0) ? item.goods_props.map((v) => v.value.name).join('_') : item.tempId)
@ -262,7 +261,6 @@ export default class MultiSpec {
} }
return newSkuList return newSkuList
} }
// 生成sku表格字段名 // 生成sku表格字段名
buildSkuColumns (rowSpanArr) { buildSkuColumns (rowSpanArr) {
const specList = this.multiSpecData.specList const specList = this.multiSpecData.specList

@ -236,7 +236,6 @@ const columns = [
width: '90px', width: '90px',
dataIndex: 'spec_type', dataIndex: 'spec_type',
scopedSlots: { customRender: 'spec_type' }, scopedSlots: { customRender: 'spec_type' },
sorter: true,
}, },
{ {
title: '商品价格', title: '商品价格',

@ -134,7 +134,7 @@
<!-- <router-link v-if="item.goods_id" :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }" <!-- <router-link v-if="item.goods_id" :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }"
>去修改</router-link >去修改</router-link
> --> > -->
<a @click="handleEdit(index, item)" v-if="item.goods_id" style="margin-left: 10px">去修改</a> <a @click="handleEdit(item)" v-if="item.goods_id" style="margin-left: 10px">去修改</a>
<a @click="handleCancel(index)" v-if="item.goods_id" style="margin-left: 10px">取消选择</a> <a @click="handleCancel(index)" v-if="item.goods_id" style="margin-left: 10px">取消选择</a>
</template> </template>
</a-table> </a-table>
@ -194,7 +194,6 @@ export default {
created() { created() {
// SKU // SKU
this.getData() this.getData()
console.log(this.multiSpecData)
}, },
methods: { methods: {
handleEdit(item) { handleEdit(item) {

@ -109,20 +109,23 @@
</a-form-item></a-col </a-form-item></a-col
> </a-row > </a-row
><a-row> ><a-row>
<a-col :span="12" style="margin-bottom:50px"> <a-col :span="12" style="margin-bottom: 50px">
<a-form-item label="身份证信息" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="身份证信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<SelectImage <SelectImage
v-if="idCardShow"
ref="childComponent" ref="childComponent"
:type='1' :type="1"
multiple multiple
:source="1" :source="1"
:maxNum="10" :maxNum="10"
:defaultList="record.idCardUrl" :defaultList="record.idCardUrl"
/> </a-form-item /> </a-form-item
></a-col> ></a-col>
<a-col :span="12" style="margin-bottom:50px"> <a-col :span="12" style="margin-bottom: 50px">
<a-form-item label="营业执照信息" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="营业执照信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<SelectImage :type='1' <SelectImage
v-if="businesShow"
:type="1"
ref="childComponent" ref="childComponent"
multiple multiple
:source="1" :source="1"
@ -202,29 +205,32 @@ export default {
form: this.$form.createForm(this), form: this.$form.createForm(this),
// //
record: {}, record: {},
idCardShow: false,
businesShow: false,
} }
}, },
created() {}, created() {},
methods: { methods: {
details(info) { details(info) {
this.visible = true this.visible = true
this.idCardShow = false
this.businesShow = false
this.record = {}
this.record.idCardUrl = []
this.record.businessCareUrl = []
Api.detail({ id: info }) Api.detail({ id: info })
.then((result) => { .then((result) => {
this.idCardShow = true
this.businesShow = true
this.record = result.data.detail this.record = result.data.detail
}) })
.finally(() => (this.isLoading = false)) .finally(() => (this.isLoading = false))
}, },
//
show(record) {
//
this.visible = true
//
this.record = record
},
// //
handleCancel() { handleCancel() {
this.visible = false this.visible = false
this.idCardShow = false
this.businesShow = false
this.form.resetFields() this.form.resetFields()
}, },
}, },

Loading…
Cancel
Save