Commit a3b4caf9 by wusiyi

feat: 仓库预警新增修改自定义sku和修改款号

parent 5d1559bf
...@@ -4,6 +4,8 @@ import { ...@@ -4,6 +4,8 @@ import {
warehouseInfo, warehouseInfo,
warehouseInfoGetAll, warehouseInfoGetAll,
updateLocationApi, updateLocationApi,
updateProductNoApi,
updateCustomSkuApi,
LocationInfoGetAll, LocationInfoGetAll,
getWarehouseInventoryInfo, getWarehouseInventoryInfo,
factoryLogWarehouseLog, factoryLogWarehouseLog,
...@@ -11,7 +13,7 @@ import { ...@@ -11,7 +13,7 @@ import {
WarehouseWarning, WarehouseWarning,
factoryWarehouseInventoryPrint, factoryWarehouseInventoryPrint,
exportWarehouseInfo, exportWarehouseInfo,
loactionData loactionData,
} from '@/api/warehouse.ts' } from '@/api/warehouse.ts'
import { AnyObject } from '@/types/api/warehouse' import { AnyObject } from '@/types/api/warehouse'
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
...@@ -50,6 +52,10 @@ const isSameWarehouse = computed(() => { ...@@ -50,6 +52,10 @@ const isSameWarehouse = computed(() => {
) )
}) })
const modifyLocationDialog = ref(false) const modifyLocationDialog = ref(false)
const modifyProductNoDialog = ref(false)
const modifyCustomSkuDialog = ref(false)
/** 修改库位 */
const locationForm = ref({ const locationForm = ref({
warehouseId: '', warehouseId: '',
}) })
...@@ -76,6 +82,83 @@ const modifyStorageLocation = async () => { ...@@ -76,6 +82,83 @@ const modifyStorageLocation = async () => {
const { data } = await LocationInfoGetAll(selections.value[0]?.warehouseId) const { data } = await LocationInfoGetAll(selections.value[0]?.warehouseId)
LocationList.value = data LocationList.value = data
} }
/** 修改款号 */
const productNoForm = ref({
productNo: '',
})
const productNoRules = {
productNo: [{ required: true, message: '款号不能为空', trigger: 'change' }],
}
const productNoFormRef = ref()
const modifyProductNo = async () => {
productNoForm.value.productNo = ''
productNoFormRef.value?.resetFields()
modifyProductNoDialog.value = true
}
const submitProductNoForm = async () => {
productNoFormRef.value?.validate(async (valid: boolean) => {
if (!valid) return
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const idList = selections.value.map((el: WarehouseWarning) => Number(el.id))
await updateProductNoApi({
idList: idList,
productNo: productNoForm.value.productNo,
})
.then(() => {
modifyProductNoDialog.value = false
ElMessage.success('修改成功')
getData()
})
.finally(() => {
loading.close()
})
})
}
/** 修改自定义SKU */
const customSkuForm = ref({
customSku: '',
})
const customSkuRules = {
customSku: [
{ required: true, message: '自定义SKU不能为空', trigger: 'change' },
],
}
const customSkuFormRef = ref()
const modifyCustomSku = async () => {
customSkuForm.value.customSku = selections.value[0].customSku || ''
customSkuFormRef.value?.resetFields()
modifyCustomSkuDialog.value = true
}
const submitCustomSkuForm = async () => {
customSkuFormRef.value?.validate(async (valid: boolean) => {
if (!valid) return
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
const idList = selections.value.map((el: WarehouseWarning) => Number(el.id))
updateCustomSkuApi({
idList: idList,
customSku: customSkuForm.value.customSku,
})
.then(() => {
modifyCustomSkuDialog.value = false
ElMessage.success('修改成功')
getData()
})
.finally(() => {
loading.close()
})
})
}
const showPrintDialog = ref(false) const showPrintDialog = ref(false)
const exportLoading = ref(false) const exportLoading = ref(false)
const clickItem = (row: WarehouseWarning) => { const clickItem = (row: WarehouseWarning) => {
...@@ -372,6 +455,22 @@ getWarehouse() ...@@ -372,6 +455,22 @@ getWarehouse()
>修改库位</el-button >修改库位</el-button
> >
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 5px">
<el-button
type="warning"
:disabled="!selections.length"
@click="modifyProductNo"
>修改款号
</el-button>
</el-form-item>
<el-form-item style="margin-top: 5px">
<el-button
type="warning"
:disabled="selections.length !== 1"
@click="modifyCustomSku"
>修改自定义sku</el-button
>
</el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</template> </template>
...@@ -401,7 +500,7 @@ getWarehouse() ...@@ -401,7 +500,7 @@ getWarehouse()
align="center" align="center"
prop="warehouseName" prop="warehouseName"
label="图片" label="图片"
width="100" width="80"
> >
<template #default="scope"> <template #default="scope">
<el-image <el-image
...@@ -416,31 +515,37 @@ getWarehouse() ...@@ -416,31 +515,37 @@ getWarehouse()
align="center" align="center"
prop="warehouseName" prop="warehouseName"
label="仓库名称" label="仓库名称"
width="180" width="140"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="locationCode" prop="locationCode"
label="库位" label="库位"
width="160" width="100"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="warehouseSku" prop="warehouseSku"
label="库存SKU" label="库存SKU"
width="180" min-width="180"
></el-table-column>
<el-table-column
align="center"
prop="customSku"
label="自定义SKU"
min-width="180"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="skuName" prop="skuName"
label="商品名称" label="商品名称"
width="250" min-width="230"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="productNo" prop="productNo"
label="款号" label="款号"
width="150" width="180"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -451,32 +556,32 @@ getWarehouse() ...@@ -451,32 +556,32 @@ getWarehouse()
<el-table-column <el-table-column
align="center" align="center"
prop="price" prop="price"
label="商品成本价()" label="商品成本价($)"
width="160" width="140"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="usableInventory" prop="usableInventory"
label="可用数量" label="可用数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="inventory" prop="inventory"
label="库存数量" label="库存数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="occupyInventory" prop="occupyInventory"
label="占用数量" label="占用数量"
width="120" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="freezeInventory" prop="freezeInventory"
label="冻结数量" label="冻结数量"
width="120" width="90"
></el-table-column> ></el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -520,6 +625,8 @@ getWarehouse() ...@@ -520,6 +625,8 @@ getWarehouse()
</div> </div>
</template> </template>
</split-div> </split-div>
<!-- 导出 -->
<ElDialog <ElDialog
v-model="exportVisible" v-model="exportVisible"
title="导出选项" title="导出选项"
...@@ -542,6 +649,8 @@ getWarehouse() ...@@ -542,6 +649,8 @@ getWarehouse()
</span> </span>
</template> </template>
</ElDialog> </ElDialog>
<!-- 修改库位 -->
<ElDialog <ElDialog
v-model="modifyLocationDialog" v-model="modifyLocationDialog"
title="修改库位" title="修改库位"
...@@ -572,6 +681,68 @@ getWarehouse() ...@@ -572,6 +681,68 @@ getWarehouse()
</span> </span>
</template> </template>
</ElDialog> </ElDialog>
<!-- 修改款号 -->
<ElDialog
v-model="modifyProductNoDialog"
title="修改款号"
width="500px"
:close-on-click-modal="false"
>
<el-form
ref="productNoFormRef"
:model="productNoForm"
:rules="productNoRules"
label-width="80px"
@submit.prevent
>
<el-form-item label="款号" prop="productNo">
<el-input
v-model="productNoForm.productNo"
style="width: 100%"
placeholder="请输入款号"
clearable
></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="modifyProductNoDialog = false">取消</el-button>
<el-button type="primary" @click="submitProductNoForm">确认</el-button>
</span>
</template>
</ElDialog>
<!-- 修改自定义sku -->
<ElDialog
v-model="modifyCustomSkuDialog"
title="修改自定义sku"
width="500px"
:close-on-click-modal="false"
>
<el-form
ref="customSkuFormRef"
:model="customSkuForm"
:rules="customSkuRules"
label-width="100px"
@submit.prevent
>
<el-form-item label="自定义sku" prop="customSku">
<el-input
v-model="customSkuForm.customSku"
style="width: 100%"
placeholder="请输入自定义sku"
clearable
></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="modifyCustomSkuDialog = false">取消</el-button>
<el-button type="primary" @click="submitCustomSkuForm">确认</el-button>
</span>
</template>
</ElDialog>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment