Merge branch 'master' of https://gitea.zianxin.com/zax/biz-pc-cloud
This commit is contained in:
commit
8ad80df805
6 files changed
+146
-44
No files matched your search
@@ -46,3 +46,11 @@ export function getScreenMaintenanceOrderList() {
|
||||
})
|
||||
}
|
||||
|
||||
export function handleObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/maintenanceOrder/handle',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<el-dialog title="开始处理" v-model="visible" :close-on-click-modal="false" draggable width="600px">
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
||||
<el-form-item label="处理情况" prop="handleRemark">
|
||||
<el-input
|
||||
v-model="form.handleRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入处理情况"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="处理图片" prop="handlePicUrl">
|
||||
<upload-imgs v-model="form.handlePicUrl" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认提交</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="MaintenanceOrderHandleDialog">
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { handleObj } from "/@/api/integrated/maintenanceOrder"
|
||||
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
handleRemark: "",
|
||||
handlePicUrl: "",
|
||||
status: "1", // 默认设置为已处理状态
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
handleRemark: [{ required: true, message: "处理情况不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = id
|
||||
form.handleRemark = ""
|
||||
form.handlePicUrl = ""
|
||||
form.status = "1" // 默认设置为已处理状态
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
await handleObj(form)
|
||||
useMessage().success("处理成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button icon="Check" text type="primary" v-if="scope.row.status != 1" @click="handleProcessed(scope.row)">
|
||||
标记为已处理
|
||||
开始处理
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -99,6 +99,9 @@
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 处理弹窗 -->
|
||||
<handle-dialog ref="handleDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -110,11 +113,13 @@ import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const HandleDialog = defineAsyncComponent(() => import("./handleDialog.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { maintenance_urgency, maintenance_status } = useDict("maintenance_urgency", "maintenance_status")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const handleDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
@@ -167,19 +172,8 @@ const handleDelete = async (ids: string[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 添加已处理操作
|
||||
const handleProcessed = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm("确定将该工单标记为已处理吗?")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await putObj({ ...row, status: 1 })
|
||||
useMessage().success("已处理")
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
// 开始处理操作
|
||||
const handleProcessed = (row: any) => {
|
||||
handleDialogRef.value.openDialog(row.id)
|
||||
}
|
||||
</script>
|
||||
@@ -81,7 +81,7 @@ const loading = ref(false)
|
||||
const {push_status, is_top} = useDict('push_status', 'is_top')
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
description: '',
|
||||
status: '',
|
||||
@@ -92,7 +92,8 @@ const form = reactive({
|
||||
isTop: '',
|
||||
viewCount: '',
|
||||
expireTime: '',
|
||||
});
|
||||
}
|
||||
const form = reactive({ ...defaultForm })
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
@@ -115,7 +116,7 @@ const disabledTime = () => {
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
Object.assign(form, defaultForm)
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="计量单位" prop="unit">-->
|
||||
<!-- <el-input v-model="form.unit" placeholder="请输入计量单位" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="8" class="mb20">
|
||||
<el-form-item label="商品性质" prop="productNature">
|
||||
<el-select v-model="form.productNature" placeholder="请选择商品性质">
|
||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in supermarket_nature" :key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="计量单位" prop="unit">-->
|
||||
<!-- <el-input v-model="form.unit" placeholder="请输入计量单位" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="8" class="mb20">
|
||||
<el-form-item label="商品性质" prop="productNature">
|
||||
<el-select v-model="form.productNature" placeholder="请选择商品性质">
|
||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in supermarket_nature" :key="index" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="轮播图" prop="carouselImages">
|
||||
<upload-img v-model:imageUrl="form.carouselImages" />
|
||||
<upload-imgs v-model="form.carouselImages" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<div class="sku-cell">
|
||||
<el-input-number
|
||||
v-model="scope.row.price"
|
||||
:precision="2"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
size="small"
|
||||
placeholder="0.00"
|
||||
@@ -170,13 +170,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="重量(克)" min-width="120" align="center">
|
||||
<!-- <el-table-column label="重量(克)" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<div class="sku-cell">
|
||||
<el-input-number v-model="scope.row.weightG" :min="0" size="small" placeholder="0" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="状态" min-width="100" align="center">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -68,19 +68,19 @@
|
||||
<el-table-column prop="packageNum" label="装数" show-overflow-tooltip min-width="80" align="right" />
|
||||
<el-table-column prop="purchasePrice" label="参考进价(元)" show-overflow-tooltip min-width="110" align="right" />
|
||||
<el-table-column prop="retailPrice" label="零售价(元)" show-overflow-tooltip min-width="110" align="right" />
|
||||
|
||||
|
||||
<el-table-column label="期初" align="center">
|
||||
<el-table-column prop="openingQty" label="期初库存" show-overflow-tooltip min-width="100" align="right" />
|
||||
<el-table-column prop="openingAmount" label="期初金额(元)" show-overflow-tooltip min-width="110" align="right" />
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="采购" align="center">
|
||||
<el-table-column prop="purchaseInQty" label="采购入库数量" show-overflow-tooltip min-width="120" align="right" />
|
||||
<el-table-column prop="purchaseInAmount" label="采购入库金额(元)" show-overflow-tooltip min-width="130" align="right" />
|
||||
<el-table-column prop="purchaseReturnQty" label="采购退货数量" show-overflow-tooltip min-width="120" align="right" />
|
||||
<el-table-column prop="purchaseReturnAmount" label="采购退货金额(元)" show-overflow-tooltip min-width="130" align="right" />
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="销售" align="center">
|
||||
<el-table-column prop="salesQty" label="销售数量" show-overflow-tooltip min-width="100" align="right" />
|
||||
<el-table-column prop="salesAmount" label="销售金额(元)" show-overflow-tooltip min-width="110" align="right" />
|
||||
@@ -89,18 +89,26 @@
|
||||
<el-table-column prop="actualSalesQty" label="实际销售数量" show-overflow-tooltip min-width="120" align="right" />
|
||||
<el-table-column prop="actualSalesAmount" label="实际销售金额(元)" show-overflow-tooltip min-width="130" align="right" />
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="成本与毛利" align="center">
|
||||
<el-table-column prop="salesCost" label="销售成本(元)" show-overflow-tooltip min-width="120" align="right" />
|
||||
<el-table-column prop="grossProfit" label="销售毛利(元)" show-overflow-tooltip min-width="120" align="right" />
|
||||
<el-table-column prop="salesCost" label="销售成本(元)" show-overflow-tooltip min-width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.salesCost.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="grossProfit" label="销售毛利(元)" show-overflow-tooltip min-width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.grossProfit.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="期末" align="center">
|
||||
<el-table-column prop="closingQty" label="期末数量" show-overflow-tooltip min-width="100" align="right" />
|
||||
<el-table-column prop="closingAmount" label="期末库存金额(元)" show-overflow-tooltip min-width="130" align="right" />
|
||||
<el-table-column prop="closingRetailAmount" label="期末库存售额(元)" show-overflow-tooltip min-width="130" align="right" />
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="firstPurchaseDate" label="首次进货日" show-overflow-tooltip min-width="120" />
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
@@ -157,7 +165,7 @@ const exportExcel = () => {
|
||||
params.endDate = params.dateRange[1]
|
||||
}
|
||||
delete params.dateRange
|
||||
|
||||
|
||||
downBlobFile("/supermarket/superMarketReport/inventory/export", params, "进销存报表.xlsx")
|
||||
}
|
||||
|
||||
@@ -187,4 +195,3 @@ onMounted(() => {
|
||||
getCategoryList()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user