|
@@ -5,39 +5,43 @@
|
|
|
style="line-height: 60px"
|
|
style="line-height: 60px"
|
|
|
>
|
|
>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-col :span="18">
|
|
|
|
|
|
|
+ <el-col :span="19">
|
|
|
<el-form
|
|
<el-form
|
|
|
inline
|
|
inline
|
|
|
style="margin-top: 10px"
|
|
style="margin-top: 10px"
|
|
|
>
|
|
>
|
|
|
<el-form-item label="名称">
|
|
<el-form-item label="名称">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="searchCommodity.name"
|
|
|
|
|
|
|
+ v-model="queryGoodsData.name"
|
|
|
placeholder="请输入名称"
|
|
placeholder="请输入名称"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="类型">
|
|
<el-form-item label="类型">
|
|
|
<el-cascader
|
|
<el-cascader
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @clear="queryGoodsData.genre = 0"
|
|
|
:options="goodsTypeData"
|
|
:options="goodsTypeData"
|
|
|
|
|
+ @change="changeQueryGoodsType"
|
|
|
:props="goodsTypeProps"/>
|
|
:props="goodsTypeProps"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="特征">
|
|
<el-form-item label="特征">
|
|
|
<el-input
|
|
<el-input
|
|
|
placeholder="请输入特征"
|
|
placeholder="请输入特征"
|
|
|
|
|
+ v-model="queryGoodsData.characteristic"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="特征">
|
|
|
|
|
|
|
+ <el-form-item label="规格">
|
|
|
<el-input
|
|
<el-input
|
|
|
- placeholder="请输入特征"
|
|
|
|
|
|
|
+ placeholder="请输入规格"
|
|
|
|
|
+ v-model="queryGoodsData.specifications"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button @click="getData" type="primary" icon="Search">搜索</el-button>
|
|
|
|
|
|
|
+ <el-button @click="searchData" type="primary" icon="Search">搜索</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
-
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
|
|
|
|
+ <el-col :span="5">
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="inboundDialog = true"
|
|
@click="inboundDialog = true"
|
|
|
>入库</el-button>
|
|
>入库</el-button>
|
|
@@ -85,19 +89,14 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="openGoodsEdit(scope.row)"
|
|
@click="openGoodsEdit(scope.row)"
|
|
|
>编辑</el-button>
|
|
>编辑</el-button>
|
|
|
- <el-button
|
|
|
|
|
- size="small"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- @click="goodsDelete(scope.row)"
|
|
|
|
|
- >删除</el-button>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<!-- 分页-->
|
|
<!-- 分页-->
|
|
|
<div class="gva-pagination">
|
|
<div class="gva-pagination">
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
- :current-page="searchCommodity.pageInfo.page"
|
|
|
|
|
- :page-size="searchCommodity.pageInfo.pageSize"
|
|
|
|
|
|
|
+ :current-page="queryGoodsData.pageInfo.page"
|
|
|
|
|
+ :page-size="queryGoodsData.pageInfo.pageSize"
|
|
|
:page-sizes="[10, 30, 50, 100]"
|
|
:page-sizes="[10, 30, 50, 100]"
|
|
|
:total="total"
|
|
:total="total"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
@@ -458,17 +457,17 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
<!-- 出库-->
|
|
<!-- 出库-->
|
|
|
- <el-drawer v-model="outboundDialog">
|
|
|
|
|
|
|
+ <el-drawer v-model="outboundDialog" size="50%" title="新建出库单">
|
|
|
<el-header
|
|
<el-header
|
|
|
class="gva-search-box"
|
|
class="gva-search-box"
|
|
|
style="height: 30px;line-height: 30px;"
|
|
style="height: 30px;line-height: 30px;"
|
|
|
>
|
|
>
|
|
|
- <el-button type="primary" @click="addGoods">添加货品</el-button>
|
|
|
|
|
- <el-button type="danger" @click="reduceGoods">减少货品</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="outAddGoods">添加货品</el-button>
|
|
|
|
|
+ <el-button type="danger" @click="outReduceGoods">减少货品</el-button>
|
|
|
</el-header>
|
|
</el-header>
|
|
|
<el-main>
|
|
<el-main>
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="storeData.cargos"
|
|
|
|
|
|
|
+ :data="outboundData.cargos"
|
|
|
height="500"
|
|
height="500"
|
|
|
border
|
|
border
|
|
|
style="width: 100%;margin-bottom: 20px"
|
|
style="width: 100%;margin-bottom: 20px"
|
|
@@ -500,6 +499,11 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="购买价格">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-input v-model.number="row.buyingPrice" type="number"/>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<el-form inline>
|
|
<el-form inline>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -507,7 +511,7 @@
|
|
|
prop="title"
|
|
prop="title"
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="storeData.title"
|
|
|
|
|
|
|
+ v-model="outboundData.title"
|
|
|
style="width: 200px;"
|
|
style="width: 200px;"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -516,7 +520,7 @@
|
|
|
prop="custodian"
|
|
prop="custodian"
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="storeData.custodian"
|
|
|
|
|
|
|
+ v-model="outboundData.custodian"
|
|
|
style="width: 200px;"
|
|
style="width: 200px;"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -525,15 +529,15 @@
|
|
|
prop="custodian"
|
|
prop="custodian"
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="storeData.remarks"
|
|
|
|
|
|
|
+ v-model="outboundData.remarks"
|
|
|
style="width: 200px;"
|
|
style="width: 200px;"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- @click="submitInboundForm"
|
|
|
|
|
- >提交入库</el-button>
|
|
|
|
|
|
|
+ @click="submitOutboundForm"
|
|
|
|
|
+ >提交出库</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-main>
|
|
</el-main>
|
|
@@ -543,28 +547,22 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted, computed, reactive } from 'vue'
|
|
|
|
|
|
|
+import { ref, onMounted, reactive } from 'vue'
|
|
|
import {
|
|
import {
|
|
|
- createCommodity,
|
|
|
|
|
- createCommodityGenre, deleteCommodity,
|
|
|
|
|
- deleteCommodityGenre,
|
|
|
|
|
- queryAllCommodityGenre,
|
|
|
|
|
- queryGoodsType, updateCommodity,deleteGoodsType,
|
|
|
|
|
- updateCommodityGenre,
|
|
|
|
|
|
|
+ queryGoodsType,deleteGoodsType,
|
|
|
createGoodsType,
|
|
createGoodsType,
|
|
|
updateGoodsType,
|
|
updateGoodsType,
|
|
|
- queryAllGoods,
|
|
|
|
|
createGoods,
|
|
createGoods,
|
|
|
queryGoodsList,
|
|
queryGoodsList,
|
|
|
updateGoods,
|
|
updateGoods,
|
|
|
- deleteGoods,
|
|
|
|
|
- createInboundManifest
|
|
|
|
|
|
|
+ createInboundManifest,
|
|
|
|
|
+ createOutboundManifest
|
|
|
} from '@/api/storehouse'
|
|
} from '@/api/storehouse'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
|
const goodsTypeProps = {
|
|
const goodsTypeProps = {
|
|
|
label: 'name',
|
|
label: 'name',
|
|
|
- value: 'ID'
|
|
|
|
|
|
|
+ value: 'ID',
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleChange = (value) => {
|
|
const handleChange = (value) => {
|
|
@@ -599,7 +597,7 @@ const storeData = reactive({
|
|
|
remarks: ''
|
|
remarks: ''
|
|
|
})
|
|
})
|
|
|
const submitInboundForm = async () => {
|
|
const submitInboundForm = async () => {
|
|
|
- if (!validateInboundForm()) return
|
|
|
|
|
|
|
+ if (!validateInboundForm(storeData)) return
|
|
|
await createInboundManifest(storeData).then(res => {
|
|
await createInboundManifest(storeData).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('添加成功')
|
|
ElMessage.success('添加成功')
|
|
@@ -612,6 +610,18 @@ const submitInboundForm = async () => {
|
|
|
//出库
|
|
//出库
|
|
|
const outboundDialog = ref(false)
|
|
const outboundDialog = ref(false)
|
|
|
|
|
|
|
|
|
|
+const outAddGoods = () => {
|
|
|
|
|
+ outboundData.cargos.push({goodsId: null, number: 1, buyingPrice: 0})
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const outReduceGoods = () => {
|
|
|
|
|
+ if (outboundData.cargos.length > 1) {
|
|
|
|
|
+ outboundData.cargos.pop()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log('只剩一项')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const outboundData = reactive({
|
|
const outboundData = reactive({
|
|
|
manifestGenre: '出库',
|
|
manifestGenre: '出库',
|
|
|
title: '',
|
|
title: '',
|
|
@@ -623,21 +633,19 @@ const outboundData = reactive({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const submitOutboundForm = async () => {
|
|
const submitOutboundForm = async () => {
|
|
|
- if (!validateInboundForm()) return
|
|
|
|
|
- await createInboundManifest(storeData).then(res => {
|
|
|
|
|
|
|
+ if (!validateInboundForm(outboundData)) return
|
|
|
|
|
+ await createOutboundManifest(outboundData).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- ElMessage.success('添加成功')
|
|
|
|
|
|
|
+ ElMessage.success('出库成功')
|
|
|
getData()
|
|
getData()
|
|
|
- inboundDialog.value = false
|
|
|
|
|
|
|
+ outboundDialog.value = false
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const validateInboundForm = () => {
|
|
|
|
|
- const data = storeData
|
|
|
|
|
-
|
|
|
|
|
|
|
+const validateInboundForm = (data) => {
|
|
|
if (!data.title.trim()) {
|
|
if (!data.title.trim()) {
|
|
|
- ElMessage.warning('请输入入库单标题')
|
|
|
|
|
|
|
+ ElMessage.warning('请输入标题')
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -671,17 +679,9 @@ const validateInboundForm = () => {
|
|
|
|
|
|
|
|
const goodsListData = reactive([])
|
|
const goodsListData = reactive([])
|
|
|
|
|
|
|
|
-const searchCommodity = ref({
|
|
|
|
|
- pageInfo: {
|
|
|
|
|
- page: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- },
|
|
|
|
|
- name: ''
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
const total = ref(0)
|
|
const total = ref(0)
|
|
|
// 货物类型
|
|
// 货物类型
|
|
|
-const goodsTypeData = reactive([])
|
|
|
|
|
|
|
+const goodsTypeData = ref([])
|
|
|
// 新增货物类型
|
|
// 新增货物类型
|
|
|
const createGoodsTypeData = reactive({
|
|
const createGoodsTypeData = reactive({
|
|
|
name: "",
|
|
name: "",
|
|
@@ -757,9 +757,7 @@ const omitGoodsType = (val) => {
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
.then(async() => {
|
|
.then(async() => {
|
|
|
- console.log('删除id', val.ID)
|
|
|
|
|
await deleteGoodsType(val.ID).then(res => {
|
|
await deleteGoodsType(val.ID).then(res => {
|
|
|
- console.log(res)
|
|
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('删除成功')
|
|
ElMessage.success('删除成功')
|
|
|
getData()
|
|
getData()
|
|
@@ -794,7 +792,6 @@ const goodsAddSubmit = async() => {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
await createGoods(goodsAddDate).then(res => {
|
|
await createGoods(goodsAddDate).then(res => {
|
|
|
- console.log(res)
|
|
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('新增成功')
|
|
ElMessage.success('新增成功')
|
|
|
isOpenGoodsAdd.value = false
|
|
isOpenGoodsAdd.value = false
|
|
@@ -817,26 +814,38 @@ const queryGoodsData = reactive({
|
|
|
specifications: ""
|
|
specifications: ""
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const changeQueryGoodsType = (val) => {
|
|
|
|
|
+ queryGoodsData.genre= val[1]
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 分页
|
|
// 分页
|
|
|
const handleSizeChange = (val) => {
|
|
const handleSizeChange = (val) => {
|
|
|
- searchCommodity.value.pageSize = val
|
|
|
|
|
|
|
+ queryGoodsData.pageSize = val
|
|
|
getData()
|
|
getData()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleCurrentChange = (val) => {
|
|
const handleCurrentChange = (val) => {
|
|
|
- searchCommodity.value.page = val
|
|
|
|
|
|
|
+ queryGoodsData.page = val
|
|
|
getData()
|
|
getData()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const searchData = async () => {
|
|
|
|
|
+ queryGoodsData.page = 1
|
|
|
|
|
+ queryGoodsData.pageSize = 10
|
|
|
|
|
+ await queryGoodsList(queryGoodsData).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ goodsListData.length = 0
|
|
|
|
|
+ goodsListData.push(...res.data.list)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 获取数据
|
|
// 获取数据
|
|
|
const getData = async() => {
|
|
const getData = async() => {
|
|
|
- // await queryAllCommodityGenre().then(res => {
|
|
|
|
|
- // commodityGenreAllData.value = res.data
|
|
|
|
|
- // })
|
|
|
|
|
await queryGoodsType().then(res => {
|
|
await queryGoodsType().then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- goodsTypeData.length = 0
|
|
|
|
|
- goodsTypeData.push(...res.data)
|
|
|
|
|
|
|
+ goodsTypeData.value.length = 0
|
|
|
|
|
+ goodsTypeData.value = res.data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
await queryGoodsList(queryGoodsData).then(res => {
|
|
await queryGoodsList(queryGoodsData).then(res => {
|
|
@@ -891,34 +900,6 @@ const editGoodsSubmit = async() => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const goodsDelete = async(val) => {
|
|
|
|
|
- ElMessageBox.confirm(
|
|
|
|
|
- '将永久删除该信息。是否继续?',
|
|
|
|
|
- '删除',
|
|
|
|
|
- {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
- .then(async() => {
|
|
|
|
|
- await deleteGoods(val.ID).then(res => {
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- ElMessage.success('删除成功')
|
|
|
|
|
- getData()
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('删除失败')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'info',
|
|
|
|
|
- message: '删除已取消',
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getData()
|
|
getData()
|
|
|
})
|
|
})
|