This commit is contained in:
parent
b6971f78ca
commit
d0404d7521
|
@ -6,6 +6,6 @@ VITE_NOW_TYPE = 'dist'
|
|||
# VITE_APP_BASE_URL='http://192.168.1.10:8546'
|
||||
# VITE_APP_BASE_URL='https://test-multi-store.lihaink.cn'
|
||||
# VITE_APP_BASE_URL='https://multi-store.lihaink.cn'
|
||||
VITE_APP_BASE_URL='http://192.168.1.22:8545'
|
||||
VITE_APP_BASE_URL='http://192.168.1.7:8545'
|
||||
# VITE_APP_BASE_URL='https://ceshi-multi-store.lihaink.cn'
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="`${item.nickname} (ID:${item.id})`"
|
||||
:label="`${item.real_name}|${item.mobile} (ID:${item.id})`"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
|
@ -55,12 +55,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['system_store.system_store/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
<el-button type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -109,7 +104,11 @@
|
|||
prop="price"
|
||||
min-width="100"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.price" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="库存"
|
||||
prop="stock"
|
||||
|
@ -118,13 +117,12 @@
|
|||
/>
|
||||
<el-table-column label="需求量" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.new_stock" :min="1" />
|
||||
<el-input v-model="row.new_stock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['system_store.system_store/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDeleteProdut(row.id)"
|
||||
|
@ -142,10 +140,14 @@
|
|||
</el-form>
|
||||
</div>
|
||||
<el-dialog v-model="showStore" title="选择门店" width="70%">
|
||||
<store-pop @onBindStore="onBindStore"></store-pop>
|
||||
<store-pop @onBindStore="onBindStore" :is_selection="0"></store-pop>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showProduct" title="选择商品" width="70%">
|
||||
<product-pop @onBindStore="onBindProduct"></product-pop>
|
||||
<product-pop
|
||||
@onBindStore="onBindProduct"
|
||||
:store_id="store_id"
|
||||
:is_branch="1"
|
||||
></product-pop>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -153,13 +155,10 @@
|
|||
<script lang="ts" setup name="storeProductEdit">
|
||||
import { ElMessage, type FormInstance } from 'element-plus'
|
||||
import useMultipleTabs from '@/hooks/useMultipleTabs'
|
||||
import { apiStoreProductImport } from '@/api/store_product'
|
||||
import { apiStoreOrderAdd } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { apiStoreCategoryLists } from '@/api/store_category'
|
||||
import { apiStoreProductUnitLists } from '@/api/store_product_unit'
|
||||
import { apiUserLists } from '@/api/user'
|
||||
|
||||
|
@ -173,8 +172,7 @@ defineProps({
|
|||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const { removeTab } = useMultipleTabs()
|
||||
const mode = ref('add')
|
||||
const stock = ref(0)
|
||||
const store_id = ref(0)
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
@ -191,8 +189,10 @@ const handleDelete = (id: number) => {
|
|||
}
|
||||
// 选择门店
|
||||
const onBindStore = (e: any[]) => {
|
||||
storeList.value = [e[0]]
|
||||
formData.store_id = e[0].id
|
||||
storeList.value = []
|
||||
storeList.value.push(e)
|
||||
formData.store_id = e.id
|
||||
store_id.value = e.id
|
||||
showStore.value = false
|
||||
}
|
||||
|
||||
|
@ -247,6 +247,7 @@ const handleSubmit = async () => {
|
|||
const product_arr = productList.value.map((item: any) => {
|
||||
return {
|
||||
id: item.id,
|
||||
product_id: item.product_id,
|
||||
stock: item.new_stock || 0
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue