| | |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 撤销发货 |
| | | export function cancelDelivery(query) { |
| | | return request({ |
| | | url: "/sales/product/cancelDelivery", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button @click="close()">取消</el-button> |
| | | <el-button type="primary" :disabled="multipleSelection.length === 0" @click="onConfirm"> |
| | | 确定 |
| | | </el-button> |
| | | <el-button @click="close()">取消</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | afterSalesServiceFileListPage, |
| | | afterSalesServiceFileAdd, |
| | | afterSalesServiceFileDel, |
| | | afterSalesServiceRepairListPage, |
| | | } from "@/api/customerService/index.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | }, |
| | | }, |
| | | // TODO 为写报告添加的 |
| | | { |
| | | name: "维修记录", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openRepairDialog(row); |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "维修记录", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // openRepairDialog(row); |
| | | // }, |
| | | // }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | :label="item.label" |
| | | :value="item.value"/> |
| | | </el-select> |
| | | <span class="search_title ml10">质检状态:</span> |
| | | <el-select v-model="searchForm.type" |
| | | style="width: 240px" |
| | | placeholder="请选择" |
| | | clearable> |
| | | <el-option label="合格" :value="0" /> |
| | | <el-option label="不合格" :value="1" /> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px" |
| | | >搜索</el-button |
| | | > |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button @click="handleOut">导出</el-button> |
| | |
| | | prop="stockOutNum" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="质检状态" |
| | | prop="type" |
| | | show-overflow-tooltip |
| | | width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small"> |
| | | {{ scope.row.type == 0 ? '合格' : '不合格' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="出库人" |
| | | prop="createBy" |
| | |
| | | |
| | | <script setup> |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import { ref } from "vue"; |
| | | import { ref, watch } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | |
| | | |
| | | const props = defineProps({ |
| | | type: { |
| | | type: String, |
| | | type: Number, |
| | | required: true, |
| | | default: '0' |
| | | default: 1 |
| | | } |
| | | }) |
| | | |
| | |
| | | supplierName: "", |
| | | timeStr: "", |
| | | recordType: "", |
| | | type: "", |
| | | } |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | /** 重置按钮操作 */ |
| | | const handleReset = () => { |
| | | searchForm.value.supplierName = ""; |
| | | searchForm.value.timeStr = ""; |
| | | searchForm.value.recordType = ""; |
| | | searchForm.value.type = ""; |
| | | handleQuery(); |
| | | }; |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | getStockOutPage({ ...searchForm.value, ...page, type: props.type }) |
| | | const params = { ...searchForm.value, ...page, productType: props.type }; |
| | | if (searchForm.value.type !== "") { |
| | | params.type = searchForm.value.type; |
| | | } |
| | | getStockOutPage(params) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | |
| | | |
| | | // 获取来源类型选项 |
| | | const fetchStockRecordTypeOptions = () => { |
| | | if (props.type === '0') { |
| | | if (props.type === 1 || props.type === 2) { |
| | | findAllQualifiedStockOutRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | return |
| | | } |
| | | findAllUnQualifiedStockOutRecordTypeOptions() |
| | | } else { |
| | | findAllUnQualifiedStockOutRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 表格选择数据 |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "合格出库台账.xlsx" : "不合格出库台账.xlsx"); |
| | | const fileNameMap = { |
| | | 1: '自制出库台账.xlsx', |
| | | 2: '外购出库台账.xlsx', |
| | | 3: '委外出库台账.xlsx' |
| | | }; |
| | | proxy.download("/stockOutRecord/exportStockOutRecord", {productType: props.type}, fileNameMap[props.type] || '出库台账.xlsx'); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | |
| | | watch(() => props.type, () => { |
| | | page.current = 1; |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | |
| | | <script setup> |
| | | import Record from "@/views/inventoryManagement/dispatchLog/Record.vue"; |
| | | const activeTab = ref('qualified') |
| | | const type = ref(0) |
| | | import { computed, ref } from "vue"; |
| | | |
| | | const activeTab = ref('selfMade') |
| | | const type = ref(1) |
| | | const tabs = computed(() => { |
| | | return [ |
| | | { |
| | | label: '合格出库', |
| | | name: 'qualified', |
| | | type: '0' |
| | | label: '自制', |
| | | name: 'selfMade', |
| | | type: 1 |
| | | }, |
| | | { |
| | | label: '不合格出库', |
| | | name: 'unqualified', |
| | | type: '1' |
| | | label: '外购', |
| | | name: 'purchase', |
| | | type: 2 |
| | | }, |
| | | { |
| | | label: '委外', |
| | | name: 'outsourcing', |
| | | type: 3 |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | const handleTabChange = (tabName) => { |
| | | activeTab.value = tabName; |
| | | type.value = tabName === 'qualified' ? 0 : 1 |
| | | const tab = tabs.value.find(t => t.name === tabName); |
| | | type.value = tab ? tab.type : 1; |
| | | } |
| | | </script> |
| | |
| | | :label="item.label" |
| | | :value="item.value"/> |
| | | </el-select> |
| | | <span class="search_title ml10">质检状态:</span> |
| | | <el-select v-model="searchForm.type" |
| | | style="width: 240px" |
| | | placeholder="请选择" |
| | | clearable> |
| | | <el-option label="合格" :value="0" /> |
| | | <el-option label="不合格" :value="1" /> |
| | | </el-select> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | | style="margin-left: 10px">搜索 |
| | | </el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button @click="handleOut">导出</el-button> |
| | |
| | | <el-table-column label="入库数量" |
| | | prop="stockInNum" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="质检状态" |
| | | prop="type" |
| | | show-overflow-tooltip |
| | | width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small"> |
| | | {{ scope.row.type == 0 ? '合格' : '不合格' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="库位" |
| | | prop="locationName" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="入库人" |
| | | prop="createBy" |
| | | show-overflow-tooltip/> |
| | |
| | | toRefs, |
| | | onMounted, |
| | | getCurrentInstance, |
| | | watch, |
| | | } from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { |
| | |
| | | |
| | | const props = defineProps({ |
| | | type: { |
| | | type: String, |
| | | type: Number, |
| | | required: true, |
| | | default: '0' |
| | | default: 1 |
| | | } |
| | | }) |
| | | |
| | |
| | | productName: "", |
| | | timeStr: "", |
| | | recordType: "", |
| | | type: "", |
| | | }, |
| | | }); |
| | | const {searchForm} = toRefs(data); |
| | | |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | /** 重置按钮操作 */ |
| | | const handleReset = () => { |
| | | searchForm.value.productName = ""; |
| | | searchForm.value.timeStr = ""; |
| | | searchForm.value.recordType = ""; |
| | | searchForm.value.type = ""; |
| | | handleQuery(); |
| | | }; |
| | | |
| | | const getRecordType = (recordType) => { |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = {...page, type: props.type}; |
| | | const params = {...page, productType: props.type}; |
| | | params.timeStr = searchForm.value.timeStr; |
| | | params.productName = searchForm.value.productName; |
| | | params.recordType = searchForm.value.recordType; |
| | | if (searchForm.value.type !== "") { |
| | | params.type = searchForm.value.type; |
| | | } |
| | | getStockInRecordListPage(params) |
| | | .then(res => { |
| | | tableData.value = res.data.records; |
| | |
| | | |
| | | // 获取来源类型选项 |
| | | const fetchStockRecordTypeOptions = () => { |
| | | if (props.type === '0') { |
| | | if (props.type === 1 || props.type === 2) { |
| | | findAllQualifiedStockInRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | return |
| | | } else { |
| | | findAllUnQualifiedStockInRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | } |
| | | findAllUnQualifiedStockInRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | } |
| | | |
| | | // 表格选择数据 |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // 根据不同的 tab 类型调用不同的导出接口 |
| | | proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "合格入库.xlsx" : "不合格入库.xlsx"); |
| | | const fileNameMap = { |
| | | 1: '自制入库.xlsx', |
| | | 2: '外购入库.xlsx', |
| | | 3: '委外入库.xlsx' |
| | | }; |
| | | proxy.download("/stockInRecord/exportStockInRecord", {productType: props.type}, fileNameMap[props.type] || '入库.xlsx'); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | |
| | | watch(() => props.type, () => { |
| | | page.current = 1; |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | |
| | | <script setup> |
| | | import Record from "@/views/inventoryManagement/receiptManagement/Record.vue"; |
| | | |
| | | const activeTab = ref('qualified') |
| | | const type = ref(0) |
| | | const activeTab = ref('selfMade') |
| | | const type = ref(1) |
| | | const tabs = ref([ |
| | | { |
| | | label: '合格入库', |
| | | name: 'qualified', |
| | | type: '0' |
| | | label: '自制', |
| | | name: 'selfMade', |
| | | type: 1 |
| | | }, |
| | | { |
| | | label: '不合格入库', |
| | | name: 'unqualified', |
| | | type: '1' |
| | | label: '外购', |
| | | name: 'purchase', |
| | | type: 2 |
| | | }, |
| | | { |
| | | label: '委外', |
| | | name: 'outsourcing', |
| | | type: 3 |
| | | } |
| | | ]) |
| | | |
| | | const handleTabChange = (tabName) => { |
| | | activeTab.value = tabName; |
| | | type.value = tabName === 'qualified' ? 0 : 1 |
| | | const tab = tabs.value.find(t => t.name === tabName); |
| | | type.value = tab ? tab.type : 1; |
| | | } |
| | | </script> |
| | |
| | | style="width: 240px" |
| | | placeholder="请输入" |
| | | clearable/> |
| | | <span class="search_title ml10">质检状态:</span> |
| | | <el-select v-model="searchForm.type" |
| | | style="width: 240px" |
| | | placeholder="请选择"> |
| | | <el-option label="合格" :value="0" /> |
| | | <el-option label="不合格" :value="1" /> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="isShowNewModal = true">新增库存</el-button> |
| | |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip /> |
| | | <el-table-column label="质检状态" |
| | | show-overflow-tooltip |
| | | width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="searchForm.type == 0 ? 'success' : 'danger'" size="small"> |
| | | {{ searchForm.type == 0 ? '合格' : '不合格' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="库存预警数量" prop="warnNum" show-overflow-tooltip /> |
| | | <el-table-column label="备注" prop="remark" show-overflow-tooltip /> |
| | |
| | | </div> |
| | | <new-stock-inventory v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | type="qualified" |
| | | :type="searchForm.type === 0 ? 'qualified' : 'unqualified'" |
| | | @completed="handleQuery" /> |
| | | |
| | | <subtract-stock-inventory v-if="isShowSubtractModal" |
| | | v-model:visible="isShowSubtractModal" |
| | | :record="record" |
| | | type="qualified" |
| | | :type="searchForm.type === 0 ? 'qualified' : 'unqualified'" |
| | | @completed="handleQuery" /> |
| | | <!-- 导入库存--> |
| | | <import-stock-inventory v-if="isShowImportModal" |
| | | v-model:visible="isShowImportModal" |
| | | type="qualified" |
| | | :type="searchForm.type === 0 ? 'qualified' : 'unqualified'" |
| | | @uploadSuccess="handleQuery" /> |
| | | <!-- 冻结/解冻库存--> |
| | | <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal" |
| | | v-model:visible="isShowFrozenAndThawModal" |
| | | :record="record" |
| | | :operation-type="operationType" |
| | | type="qualified" |
| | | :type="searchForm.type === 0 ? 'qualified' : 'unqualified'" |
| | | @completed="handleQuery" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance, watch, computed } from 'vue' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import { getStockInventoryListPage } from "@/api/inventoryManagement/stockInventory.js"; |
| | | import { getStockUninventoryListPage } from "@/api/inventoryManagement/stockUninventory.js"; |
| | | const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue")); |
| | | const SubtractStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Subtract.vue")); |
| | | const ImportStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Import.vue")); |
| | | const FrozenAndThawStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")); |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const props = defineProps({ |
| | | type: { |
| | | type: Number, |
| | | required: true, |
| | | default: 1 |
| | | } |
| | | }) |
| | | |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const record = ref({}) |
| | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | productName: '', |
| | | type: 0, |
| | | } |
| | | }) |
| | | const { searchForm } = toRefs(data) |
| | | |
| | | const qualityType = computed(() => { |
| | | return searchForm.value.type === 0 ? 'qualified' : 'unqualified'; |
| | | }) |
| | | |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const handleReset = () => { |
| | | searchForm.value.productName = ''; |
| | | searchForm.value.type = 0; |
| | | handleQuery(); |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | getStockInventoryListPage({ ...searchForm.value, ...page }).then(res => { |
| | | const params = { ...searchForm.value, ...page, productType: props.type }; |
| | | params.type = searchForm.value.type; |
| | | |
| | | const apiCall = searchForm.value.type === 0 ? getStockInventoryListPage : getStockUninventoryListPage; |
| | | const exportApi = searchForm.value.type === 0 ? "/stockInventory/exportStockInventory" : "/stockUninventory/exportStockUninventory"; |
| | | |
| | | apiCall(params).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.data.records |
| | | total.value = res.data.total |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/stockInventory/exportStockInventory", {}, '合格库存信息.xlsx') |
| | | const fileNameMap = { |
| | | 1: '自制库存信息.xlsx', |
| | | 2: '外购库存信息.xlsx', |
| | | 3: '委外库存信息.xlsx' |
| | | }; |
| | | const exportApi = searchForm.value.type === 0 ? "/stockInventory/exportStockInventory" : "/stockUninventory/exportStockUninventory"; |
| | | proxy.download(exportApi, {productType: props.type}, fileNameMap[props.type] || '库存信息.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | |
| | | watch(() => props.type, () => { |
| | | page.current = 1 |
| | | getList() |
| | | }) |
| | | |
| | | watch(() => searchForm.value.type, () => { |
| | | page.current = 1 |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | style="width: 240px" |
| | | placeholder="请输入" |
| | | clearable/> |
| | | <span class="search_title ml10">质检状态:</span> |
| | | <el-select v-model="searchForm.type" |
| | | style="width: 240px" |
| | | placeholder="请选择" |
| | | clearable> |
| | | <el-option label="合格" :value="0" /> |
| | | <el-option label="不合格" :value="1" /> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="isShowNewModal = true">新增库存</el-button> |
| | |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip /> |
| | | <el-table-column label="质检状态" |
| | | prop="type" |
| | | show-overflow-tooltip |
| | | width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.type == 0 ? 'success' : 'danger'" size="small"> |
| | | {{ scope.row.type == 0 ? '合格' : '不合格' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="备注" prop="remark" show-overflow-tooltip /> |
| | | <el-table-column label="最近更新时间" prop="updateTime" show-overflow-tooltip /> |
| | |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance, watch } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { getStockUninventoryListPage } from "@/api/inventoryManagement/stockUninventory.js"; |
| | | const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue")); |
| | |
| | | const FrozenAndThawStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")); |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const props = defineProps({ |
| | | type: { |
| | | type: Number, |
| | | required: true, |
| | | default: 3 |
| | | } |
| | | }) |
| | | |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const record = ref({}) |
| | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | productName: '', |
| | | type: '', |
| | | } |
| | | }) |
| | | const { searchForm } = toRefs(data) |
| | |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const handleReset = () => { |
| | | searchForm.value.productName = ''; |
| | | searchForm.value.type = ''; |
| | | handleQuery(); |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | getStockUninventoryListPage({ ...searchForm.value, ...page }).then(res => { |
| | | const params = { ...searchForm.value, ...page, productType: props.type }; |
| | | if (searchForm.value.type !== "") { |
| | | params.type = searchForm.value.type; |
| | | } |
| | | getStockUninventoryListPage(params).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.data.records |
| | | total.value = res.data.total |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/stockUninventory/exportStockUninventory", {}, '不合格库存信息.xlsx') |
| | | const fileNameMap = { |
| | | 1: '自制库存信息.xlsx', |
| | | 2: '外购库存信息.xlsx', |
| | | 3: '委外库存信息.xlsx' |
| | | }; |
| | | proxy.download("/stockUninventory/exportStockUninventory", {productType: props.type}, fileNameMap[props.type] || '库存信息.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | |
| | | watch(() => props.type, () => { |
| | | page.current = 1 |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | :key="tab.name"> |
| | | <component :is="tab.name === 'qualified' ? QualifiedRecord : UnqualifiedRecord" /> |
| | | <component :is="tab.component" :type="tab.type" v-if="activeTab === tab.name" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import QualifiedRecord from "@/views/inventoryManagement/stockManagement/Qualified.vue"; |
| | | import UnqualifiedRecord from "@/views/inventoryManagement/stockManagement/Unqualified.vue"; |
| | | import { markRaw } from 'vue'; |
| | | import StockRecord from "@/views/inventoryManagement/stockManagement/Qualified.vue"; |
| | | |
| | | const activeTab = ref('qualified') |
| | | const activeTab = ref('selfMade') |
| | | const tabs = ref([ |
| | | { |
| | | label: '合格库存', |
| | | name: 'qualified' |
| | | label: '自制', |
| | | name: 'selfMade', |
| | | type: 1, |
| | | component: markRaw(StockRecord) |
| | | }, |
| | | { |
| | | label: '不合格库存', |
| | | name: 'unqualified' |
| | | label: '外购', |
| | | name: 'purchase', |
| | | type: 2, |
| | | component: markRaw(StockRecord) |
| | | }, |
| | | { |
| | | label: '委外', |
| | | name: 'outsourcing', |
| | | type: 3, |
| | | component: markRaw(StockRecord) |
| | | } |
| | | ]) |
| | | |
| | |
| | | prop: "completeQuantity", |
| | | }, |
| | | { |
| | | label: "库存数量", |
| | | prop: "inventoryQuantity", |
| | | }, |
| | | { |
| | | dataType: "slot", |
| | | label: "完成进度", |
| | | prop: "completionStatus", |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="审核状态" prop="status" align="center" width="120"> |
| | | <el-table-column label="状态" prop="status" align="center" width="120"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusType(scope.row.status)"> |
| | | {{ getApprovalStatusText(scope.row.status) }} |
| | |
| | | link |
| | | type="primary" |
| | | size="small" |
| | | :disabled="(scope.row.waitShippingTotal || 0) <= 0" |
| | | :disabled="(scope.row.waitShippingTotal || 0) <= 0 || isRevoked(scope.row.status)" |
| | | @click="openForm('edit', scope.row)">分批发货</el-button> |
| | | <el-button |
| | | link |
| | |
| | | <div class="summary-value shipped">{{ currentShippingOrder.shippingSuccessTotal || 0 }}</div> |
| | | </div> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">已退货数量</div> |
| | | <div class="summary-value returned">{{ currentShippingOrder.returnedQuantity || 0 }}</div> |
| | | </div> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">待发货数量</div> |
| | | <div class="summary-value waiting">{{ currentShippingOrder.waitShippingTotal || 0 }}</div> |
| | | </div> |
| | |
| | | <span class="info-label">发货数量</span> |
| | | <span class="info-value quantity">{{ record.shippingNum }}</span> |
| | | </div> |
| | | <div class="info-row"> |
| | | <span class="info-label">退货数量</span> |
| | | <span class="info-value returned">{{ record.returnNum || 0 }}</span> |
| | | </div> |
| | | <div class="info-row" v-if="record.type === '货车'"> |
| | | <span class="info-label">车牌号</span> |
| | | <span class="info-value">{{ record.shippingCarNumber || '--' }}</span> |
| | |
| | | preview-teleported |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="record-actions" v-if="canRevokeShipping(record)"> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | @click="handleRevokeShipping(record)"> |
| | | 撤销发货 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | return; |
| | | } |
| | | |
| | | if (type === 'edit' && isRevoked(row.status)) { |
| | | proxy.$modal.msgWarning("已撤销状态不能分批发货"); |
| | | return; |
| | | } |
| | | |
| | | dialogMode.value = type === 'edit' ? 'edit' : 'view'; |
| | | currentShippingOrder.value = row; |
| | | showAddForm.value = false; |
| | |
| | | return waitShipping > 0; |
| | | }; |
| | | |
| | | // 是否可以撤销发货 |
| | | const canRevokeShipping = (record) => { |
| | | const shippingNum = record.shippingNum || 0; |
| | | const returnNum = record.returnNum || 0; |
| | | return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum; |
| | | }; |
| | | |
| | | // 撤销发货 |
| | | const handleRevokeShipping = (record) => { |
| | | ElMessageBox.confirm("此操作将撤销该发货记录,是否确认?", "撤销发货", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | updateShippingInfoDetail({ ...record, status: 3 }).then((res) => { |
| | | proxy.$modal.msgSuccess("撤销成功"); |
| | | loadShippingRecords(currentShippingOrder.value.id); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // 提交发货 |
| | | const submitShipping = () => { |
| | | proxy.$refs["shippingFormRef"].validate((valid) => { |
| | |
| | | } |
| | | const payload = { |
| | | shippingInfoId: currentShippingOrder.value.id, |
| | | salesLedgerId: currentShippingOrder.value.salesLedgerId, |
| | | salesLedgerProductId: currentShippingOrder.value.salesLedgerProductId, |
| | | shippingTotal: currentShippingOrder.value.shippingTotal, |
| | | shippingNum: shippingForm.value.shippingNum, |
| | | type: shippingForm.value.type, |
| | |
| | | '审核中': '审核中', |
| | | '审核拒绝': '审核拒绝', |
| | | '审核通过': '审核通过', |
| | | '已撤销': '已撤销', |
| | | '0': '待审核', |
| | | '1': '审核中', |
| | | '2': '审核拒绝', |
| | |
| | | '审核中': 'warning', |
| | | '审核拒绝': 'danger', |
| | | '审核通过': 'success', |
| | | '已撤销': 'warning', |
| | | '0': 'info', |
| | | '1': 'warning', |
| | | '2': 'danger', |
| | |
| | | } |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === '审核中' || statusStr === '1'; |
| | | }; |
| | | |
| | | // 检查状态是否为"已撤销" |
| | | const isRevoked = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | return false; |
| | | } |
| | | if (typeof status === 'number') { |
| | | return status === 3; |
| | | } |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === '已撤销' || statusStr === '3'; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | |
| | | &.shipped { |
| | | color: #67C23A; |
| | | } |
| | | |
| | | &.returned { |
| | | color: #F56C6C; |
| | | } |
| | | |
| | | &.waiting { |
| | |
| | | color: #409EFF; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | &.returned { |
| | | font-weight: bold; |
| | | color: #F56C6C; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .record-actions { |
| | | margin-top: 12px; |
| | | padding-top: 12px; |
| | | border-top: 1px solid #EBEEF5; |
| | | } |
| | | |
| | | .record-images { |
| | | display: flex; |
| | | gap: 8px; |
| | |
| | | <el-option label="待发货" value="待发货"></el-option> |
| | | <el-option label="已发货" value="已发货"></el-option> |
| | | <el-option label="已签收" value="已签收"></el-option> |
| | | <el-option label="已撤销" value="已撤销"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | <el-option label="待发货" value="待发货"></el-option> |
| | | <el-option label="已发货" value="已发货"></el-option> |
| | | <el-option label="已签收" value="已签收"></el-option> |
| | | <el-option label="已撤销" value="已撤销"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | const statusMap = { |
| | | '待发货': 'warning', |
| | | '已发货': 'primary', |
| | | '已签收': 'success' |
| | | '已签收': 'success', |
| | | '已撤销': 'warning' |
| | | } |
| | | return statusMap[status] || 'info' |
| | | } |
| | |
| | | {align: "center", label: "产品大类", prop: "productCategory"}, |
| | | {align: "center", label: "规格型号", prop: "specificationModel"}, |
| | | {align: "center", label: "单位", prop: "unit", width: 80}, |
| | | {align: "center", label: "总数量", prop: "quantity", width: 120}, |
| | | {align: "center", label: "总数量", prop: "shippingNum", width: 120}, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120}, |
| | | {align: "center", label: "未退货数量", prop: "unQuantity", width: 120}, |
| | | {align: "center", label: "退货数量", prop: "returnQuantity", width: 120}, |
| | |
| | | <el-table-column align="center" prop="productCategory" label="产品大类" /> |
| | | <el-table-column align="center" prop="specificationModel" label="规格型号" /> |
| | | <el-table-column align="center" prop="unit" label="单位" /> |
| | | <el-table-column align="center" prop="quantity" label="总数量" /> |
| | | <el-table-column align="center" prop="shippingNum" label="总数量" /> |
| | | <el-table-column align="center" prop="unQuantity" label="未退货数量" /> |
| | | <el-table-column align="center" label="已退货数量"> |
| | | <template #default="{ row }">{{ calcAlreadyReturned(row) }}</template> |
| | |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const calcAlreadyReturned = (row) => { |
| | | const total = Number(row?.quantity ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0); |
| | | const total = Number(row?.shippingNum ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0); |
| | | const un = Number(row?.unQuantity ?? 0); |
| | | if (!Number.isFinite(total) || !Number.isFinite(un)) return 0; |
| | | return Math.max(total - un, 0); |
| | |
| | | {align: "center", label: "产品大类", prop: "productCategory" }, |
| | | {align: "center", label: "规格型号", prop: "specificationModel" }, |
| | | {align: "center", label: "单位", prop: "unit", width: 80 }, |
| | | {align: "center", label: "总数量", prop: "quantity", width: 120 }, |
| | | {align: "center", label: "总数量", prop: "shippingNum", width: 120 }, |
| | | {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120 }, |
| | | {align: "center", label: "未退货数量", prop: "unQuantity", width: 120 }, |
| | | {align: "center", label: "退货数量", prop: "returnQuantity", dataType: "slot", slot: "returnQuantity", width: 120 }, |
| | |
| | | }; |
| | | |
| | | const calculateRowAmount = (row) => { |
| | | const quantity = Number(row.returnQuantity || 0); |
| | | const shippingNum = Number(row.returnQuantity || 0); |
| | | const price = Number(row.price || 0); |
| | | row.amount = (quantity * price).toFixed(2); |
| | | row.amount = (shippingNum * price).toFixed(2); |
| | | }; |
| | | |
| | | const calculateTotalRefund = () => { |
| | |
| | | productName: product.productName, |
| | | specificationModel: product.specificationModel, |
| | | unit: product.unit, |
| | | quantity: product.quantity, |
| | | shippingNum: product.shippingNum, |
| | | totalReturnNum: product.totalReturnNum, |
| | | unQuantity: product.unQuantity |
| | | }); |
| | |
| | | |
| | | const documentStatusOptions = ref([ |
| | | { label: "待处理", value: 0 }, |
| | | { label: "已处理", value: 1 } |
| | | { label: "已处理", value: 1 }, |
| | | { label: "已撤销", value: 2 } |
| | | ]); |
| | | |
| | | const defaultColumns = [ |
| | |
| | | { name: "编辑", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => openForm("edit", row) }, |
| | | { name: "退款处理", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowHandle(row) }, |
| | | { name: "详情", type: "text", clickFun: (row) => openDetail(row) }, |
| | | { name: "删除", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowDelete(row) }, |
| | | { name: "删除", disabled: (row) => row.status === 1 || row.status === 2, type: "text", clickFun: (row) => handleRowDelete(row) }, |
| | | ], |
| | | }, |
| | | ]; |
| | |
| | | const getStatusType = (status) => { |
| | | const statusMap = { |
| | | 0: "warning", |
| | | 1: "success" |
| | | 1: "success", |
| | | 2: "warning" |
| | | }; |
| | | return statusMap[status] || "info"; |
| | | }; |
| | |
| | | const getStatusText = (status) => { |
| | | const statusMap = { |
| | | 0: "待处理", |
| | | 1: "已处理" |
| | | 1: "已处理", |
| | | 2: "已撤销" |
| | | }; |
| | | return statusMap[status] || "未知"; |
| | | }; |
| | |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="快递公司" prop="expressCompany" show-overflow-tooltip /> |
| | | <el-table-column label="快递单号" prop="expressNumber" show-overflow-tooltip /> |
| | | <el-table-column label="发货车牌" minWidth="100px" align="center"> |
| | | <template #default="scope"> |
| | | <div> |
| | | <el-tag type="success" v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</el-tag> |
| | | <el-tag v-else type="info">-</el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="发货日期" |
| | | minWidth="100px" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <div> |
| | | <div v-if="scope.row.shippingDate">{{ scope.row.shippingDate }}</div> |
| | | <el-tag v-else |
| | | type="info">-</el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="已发货数量" prop="shippingNum" align="center" /> |
| | | <el-table-column label="已退货数量" prop="returnNum" align="center" /> |
| | | <el-table-column label="数量" prop="quantity" /> |
| | | <el-table-column label="税率(%)" prop="taxRate" /> |
| | | <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <!--操作--> |
| | | <el-table-column width="100" label="操作" align="center" fixed="right"> |
| | | <el-table-column width="150" label="操作" align="center" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | |
| | | :disabled="!canShip(scope.row)" |
| | | @click="openDeliveryForm(scope.row)"> |
| | | 发货 |
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="danger" |
| | | size="small" |
| | | :disabled="!canRevokeShipping(scope.row)" |
| | | @click="handleRevokeShipping(scope.row)"> |
| | | 撤销发货 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | delLedger, |
| | | addOrUpdateSalesLedgerProduct, |
| | | delProduct, |
| | | delLedgerFile, getProductInventory, |
| | | delLedgerFile, getProductInventory, cancelDelivery, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | |
| | | * @param row 行数据 |
| | | */ |
| | | const getShippingStatusText = (row) => { |
| | | // 如果已发货(有发货日期或车牌号),显示"已发货" |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return '已发货'; |
| | | } |
| | | |
| | | // 获取发货状态字段 |
| | | const status = row.shippingStatus; |
| | | |
| | |
| | | |
| | | // 状态是字符串 |
| | | const statusStr = String(status).trim(); |
| | | |
| | | // 如果状态是"已撤销",直接返回 |
| | | if (statusStr === '已撤销') { |
| | | return '已撤销'; |
| | | } |
| | | |
| | | // 如果已发货(有发货日期或车牌号),显示"已发货" |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return '已发货'; |
| | | } |
| | | |
| | | const statusTextMap = { |
| | | '待发货': '待发货', |
| | | '待审核': '待审核', |
| | | '审核中': '审核中', |
| | | '审核拒绝': '审核拒绝', |
| | | '审核通过': '审核通过', |
| | | '已发货': '已发货' |
| | | '已发货': '已发货', |
| | | '已撤销': '已撤销' |
| | | }; |
| | | return statusTextMap[statusStr] || '待发货'; |
| | | }; |
| | |
| | | * @param row 行数据 |
| | | */ |
| | | const getShippingStatusType = (row) => { |
| | | // 如果已发货(有发货日期或车牌号),显示绿色 |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return 'success'; |
| | | } |
| | | |
| | | // 获取发货状态字段 |
| | | const status = row.shippingStatus; |
| | | |
| | |
| | | |
| | | // 状态是字符串 |
| | | const statusStr = String(status).trim(); |
| | | |
| | | // 如果状态是"已撤销",显示橙色 |
| | | if (statusStr === '已撤销') { |
| | | return 'warning'; |
| | | } |
| | | |
| | | // 如果已发货(有发货日期或车牌号),显示绿色 |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return 'success'; |
| | | } |
| | | |
| | | const typeTextMap = { |
| | | '待发货': 'info', |
| | | '待审核': 'info', |
| | | '审核中': 'warning', |
| | | '审核拒绝': 'danger', |
| | | '已撤销': 'warning', |
| | | '审核通过': 'success', |
| | | '已发货': 'success' |
| | | }; |
| | |
| | | |
| | | /** |
| | | * 判断是否可以发货 |
| | | * 只有在产品状态是充足,发货状态是待发货和审核拒绝的时候才可以发货 |
| | | * 只有在产品状态是充足,发货状态是待发货、审核拒绝和已撤销的时候才可以发货 |
| | | * @param row 行数据 |
| | | */ |
| | | const canShip = (row) => { |
| | |
| | | // 获取发货状态 |
| | | const shippingStatus = row.shippingStatus; |
| | | |
| | | // 如果状态为空或未定义,默认为"待发货" |
| | | if (shippingStatus === null || shippingStatus === undefined || shippingStatus === '') { |
| | | return true; |
| | | } |
| | | |
| | | // 状态是字符串 |
| | | const statusStr = String(shippingStatus).trim(); |
| | | |
| | | // 如果状态是"已撤销",允许发货 |
| | | if (statusStr === '已撤销') { |
| | | return true; |
| | | } |
| | | |
| | | // 如果已发货(有发货日期或车牌号),不能再次发货 |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return false; |
| | | } |
| | | |
| | | // 发货状态必须是"待发货"或"审核拒绝" |
| | | const statusStr = shippingStatus ? String(shippingStatus).trim() : ''; |
| | | // 发货状态必须是"待发货"、"审核拒绝"或"已撤销" |
| | | return statusStr === '待发货' || statusStr === '审核拒绝'; |
| | | }; |
| | | |
| | | /** |
| | | * 判断是否可以撤销发货 |
| | | * 只有当发货数量等于退货数量且都不为0时才可以撤销 |
| | | * @param row 行数据 |
| | | */ |
| | | const canRevokeShipping = (row) => { |
| | | const shippingNum = row.shippingNum || 0; |
| | | const returnNum = row.returnNum || 0; |
| | | return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum; |
| | | }; |
| | | |
| | | /** |
| | | * 撤销发货 |
| | | * @param row 行数据 |
| | | */ |
| | | const handleRevokeShipping = (row) => { |
| | | ElMessageBox.confirm("此操作将撤销该发货记录,是否确认?", "撤销发货", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | cancelDelivery({ id: row.id }).then(() => { |
| | | proxy.$modal.msgSuccess("撤销成功"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | /** |
| | | * 下载文件 |
| | | * |
| | | * @param row 下载文件的相关信息对象 |