|
|
|
@ -18,6 +18,60 @@
|
|
|
|
</el-radio>
|
|
|
|
</el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<!-- 商品分区下拉框 -->
|
|
|
|
|
|
|
|
<el-col
|
|
|
|
|
|
|
|
v-if="isAuth('prod:prod:updateZone')"
|
|
|
|
|
|
|
|
label="商品分区"
|
|
|
|
|
|
|
|
>商品分区
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="productType"
|
|
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
|
|
:model-value="productTypes[productType]"
|
|
|
|
|
|
|
|
@change="handleProductTypeChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="(type, index) in productTypes"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:label="type"
|
|
|
|
|
|
|
|
:value="index.toString()"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!-- 购买所需积分输入框 -->
|
|
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
|
|
v-if="isAuth('prod:prod:setScore')"
|
|
|
|
|
|
|
|
label="购买积分"
|
|
|
|
|
|
|
|
prop="payScore"
|
|
|
|
|
|
|
|
:rules="[
|
|
|
|
|
|
|
|
{ required: false, message: '请输入购买所需积分', trigger: 'blur' }
|
|
|
|
|
|
|
|
]"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="dataForm.payScore"
|
|
|
|
|
|
|
|
placeholder="请输入购买所需积分"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<!-- 购买赠送积分值输入框 -->
|
|
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
|
|
v-if="isAuth('prod:prod:setScore')"
|
|
|
|
|
|
|
|
label="赠送积分"
|
|
|
|
|
|
|
|
prop="giveScore"
|
|
|
|
|
|
|
|
:rules="[
|
|
|
|
|
|
|
|
{ required: false, message: '请输入购买赠送积分值', trigger: 'blur' }
|
|
|
|
|
|
|
|
]"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="dataForm.giveScore"
|
|
|
|
|
|
|
|
placeholder="请输入购买赠送积分值"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item
|
|
|
|
<el-form-item
|
|
|
|
label="产品分类"
|
|
|
|
label="产品分类"
|
|
|
|
:rules="[{ required: true, message: '请选择产品分类'}]"
|
|
|
|
:rules="[{ required: true, message: '请选择产品分类'}]"
|
|
|
|
@ -131,8 +185,8 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
import { treeDataTranslate, idList } from '@/utils'
|
|
|
|
import { idList, isAuth, treeDataTranslate } from '@/utils'
|
|
|
|
import ProdTransport from './components/prod-transport.vue'
|
|
|
|
import ProdTransport from './components/prod-transport.vue'
|
|
|
|
import SkuTag from './components/sku-tag.vue'
|
|
|
|
import SkuTag from './components/sku-tag.vue'
|
|
|
|
import SkuTable from './components/sku-table.vue'
|
|
|
|
import SkuTable from './components/sku-table.vue'
|
|
|
|
@ -149,6 +203,34 @@ const category = reactive({
|
|
|
|
label: 'categoryName'
|
|
|
|
label: 'categoryName'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
const handleProductTypeChange = () => {
|
|
|
|
|
|
|
|
// Your logic when product type changes
|
|
|
|
|
|
|
|
console.log('Product type changed:', productType.value)
|
|
|
|
|
|
|
|
ElMessageBox.confirm('确定进行[商品分区修改]操作?', '提示', {
|
|
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
http({
|
|
|
|
|
|
|
|
url: http.adornUrl('/prod/prod/prodZone'),
|
|
|
|
|
|
|
|
method: 'post',
|
|
|
|
|
|
|
|
data: http.adornData({
|
|
|
|
|
|
|
|
prodId: dataForm.value.prodId,
|
|
|
|
|
|
|
|
productType: productType.value
|
|
|
|
|
|
|
|
}, false)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
ElMessage({
|
|
|
|
|
|
|
|
message: '操作成功',
|
|
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
|
|
duration: 1500,
|
|
|
|
|
|
|
|
onClose: () => {
|
|
|
|
|
|
|
|
getDataList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
// 规格列表
|
|
|
|
// 规格列表
|
|
|
|
const dataForm = ref({
|
|
|
|
const dataForm = ref({
|
|
|
|
prodName: '',
|
|
|
|
prodName: '',
|
|
|
|
@ -165,13 +247,17 @@ const dataForm = ref({
|
|
|
|
hasShopDelivery: false,
|
|
|
|
hasShopDelivery: false,
|
|
|
|
hasUserPickUp: false
|
|
|
|
hasUserPickUp: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
deliveryTemplateId: null
|
|
|
|
deliveryTemplateId: null,
|
|
|
|
|
|
|
|
payScore: 0,
|
|
|
|
|
|
|
|
giveScore: 0
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
const productType = ref(0)
|
|
|
|
const tags = ref([])
|
|
|
|
const tags = ref([])
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
dataForm.value.prodId = useRoute().query.prodId
|
|
|
|
dataForm.value.prodId = useRoute().query.prodId
|
|
|
|
getDataList()
|
|
|
|
getDataList()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
const productTypes = ref(['普通商品', '会员商品', '积分商品'])
|
|
|
|
|
|
|
|
|
|
|
|
const skuTableRef = ref(null)
|
|
|
|
const skuTableRef = ref(null)
|
|
|
|
const skuTagRef = ref(null)
|
|
|
|
const skuTagRef = ref(null)
|
|
|
|
@ -195,6 +281,9 @@ const getDataList = () => {
|
|
|
|
skuTableRef.value?.init()
|
|
|
|
skuTableRef.value?.init()
|
|
|
|
category.selected = idList(category.list, dataForm.value.categoryId, 'categoryId', 'children').reverse()
|
|
|
|
category.selected = idList(category.list, dataForm.value.categoryId, 'categoryId', 'children').reverse()
|
|
|
|
dataForm.value.tagList = data.tagList
|
|
|
|
dataForm.value.tagList = data.tagList
|
|
|
|
|
|
|
|
productType.value = data.productType
|
|
|
|
|
|
|
|
dataForm.value.giveScore = data.giveScore
|
|
|
|
|
|
|
|
dataForm.value.payScore = data.payScore
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
nextTick(() => {
|
|
|
|
nextTick(() => {
|
|
|
|
|