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