Compare commits

..

2 Commits

Author SHA1 Message Date
吴普建 3cb9ce0a96 first 9 months ago
吴普建 a96820c47c first 10 months ago

@ -235,7 +235,6 @@ export function useDelBtn(
size={size} size={size}
onClick={throttle(delDialog, 500)} onClick={throttle(delDialog, 500)}
class="mr-5px" class="mr-5px"
v-permission={permission}
> >
<NIcon size="15" component={TrashOutline} class="mr-5px" /> <NIcon size="15" component={TrashOutline} class="mr-5px" />
{value} {value}

@ -172,6 +172,8 @@ declare namespace wms {
salseBy?: string | null; // 业务员 salseBy?: string | null; // 业务员
salseByNick?: string | null; // 业务员名称 salseByNick?: string | null; // 业务员名称
checkedBy?: string; // 审批人
checkedTime?: number; // 审批时间
} }
} }
namespace recptLineRawType { namespace recptLineRawType {

@ -26,6 +26,9 @@ export function getWmsItemRecpt(id: string | number) {
export function addWmsItemRecpt(data: any) { export function addWmsItemRecpt(data: any) {
return request.post(`${prefix}add`, data); return request.post(`${prefix}add`, data);
} }
export function approveWmsItemRecpt(data: any) {
return request.post(`${prefix}approve`, data);
}
// 编辑 // 编辑
export function editWmsItemRecpt(data: any) { export function editWmsItemRecpt(data: any) {

@ -6,6 +6,7 @@ declare namespace workOrderArrange {
pageSize: number; pageSize: number;
total: number; total: number;
wiredrawingCode: string; wiredrawingCode: string;
orderCode?: string;
specification: string; specification: string;
equipmentCode: string; equipmentCode: string;
enamellingCode: string; enamellingCode: string;

@ -66,6 +66,9 @@
<n-form-item label="机台名称"> <n-form-item label="机台名称">
<n-input v-model:value="searchForm.equipmentCode" type="text" placeholder="请输入机台名称" /> <n-input v-model:value="searchForm.equipmentCode" type="text" placeholder="请输入机台名称" />
</n-form-item> </n-form-item>
<n-form-item label="订单编号">
<n-input v-model:value="searchForm.orderCode" type="text" placeholder="请输入订单编号" />
</n-form-item>
</n-form> </n-form>
</my-card> </my-card>
<my-card v-show="workOrderTypeValue === 0" :title="title"> <my-card v-show="workOrderTypeValue === 0" :title="title">
@ -154,6 +157,7 @@ const searchForm = ref<workOrderArrange.searchForm>({
total: 0, total: 0,
workOrderType: 1, workOrderType: 1,
wiredrawingCode: '', wiredrawingCode: '',
orderCode: '',
specification: '', specification: '',
equipmentCode: '', equipmentCode: '',
enamellingCode: '' enamellingCode: ''
@ -242,10 +246,10 @@ const lsColumns: Ref<DataTableColumns<workOrderArrange.lsTabelList>> = ref([
} }
}, },
{ {
title: '开始机台', title: '订单编号',
align: 'center', align: 'center',
width: 160, width: 160,
key: 'equipmentCode', key: 'orderCode',
ellipsis: { ellipsis: {
tooltip: true tooltip: true
} }
@ -415,6 +419,15 @@ const qbColumns: Ref<DataTableColumns<workOrderArrange.qbTabelList>> = ref([
tooltip: true tooltip: true
} }
}, },
{
title: '订单编号',
align: 'center',
width: 160,
key: 'orderCode',
ellipsis: {
tooltip: true
}
},
// { // {
// title: '', // title: '',
// align: 'center', // align: 'center',
@ -581,6 +594,7 @@ function reset(): void {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
orderCode: '',
workOrderType: 0, workOrderType: 0,
wiredrawingCode: '', wiredrawingCode: '',
specification: '', specification: '',

@ -557,7 +557,13 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
'2': { label: '已排产', type: 'success' }, '2': { label: '已排产', type: 'success' },
'3': { label: '生产中', type: 'warning' }, '3': { label: '生产中', type: 'warning' },
'4': { label: '已完成', type: 'success' }, '4': { label: '已完成', type: 'success' },
'6': { label: '已驳回', type: 'error' } '5': { label: '已发货', type: 'success' },
'6': { label: '已驳回', type: 'error' },
'8': { label: '申请发货中', type: 'primary' },
'9': { label: '已通过待发货', type: 'success' },
'10': { label: '发货申请未通过', type: 'error' },
'11': { label: '出库中', type: 'success' },
'12': { label: '已发货', type: 'success' }
}; };
const { label, type } = statusMap[row.status || '0']; const { label, type } = statusMap[row.status || '0'];
return <NTag type={type}>{label}</NTag>; return <NTag type={type}>{label}</NTag>;
@ -594,6 +600,7 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
title: '操作', title: '操作',
align: 'center', align: 'center',
key: 'actions', key: 'actions',
fixed: 'right',
width: 220, width: 220,
render: row => { render: row => {
const actions:any[] = []; const actions:any[] = [];
@ -644,6 +651,13 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
}, 'small') }, 'small')
) )
} }
if(row.status === '4' || row.status === '5'){
actions.push(
<n-button size="small" type="primary" onClick={() => handleSend(row)}>申请发货
</n-button>
)
}
// //
actions.push( actions.push(
useDelBtn(() => { useDelBtn(() => {
@ -734,6 +748,33 @@ const workorderHandleCancel = () => {
workorderFlag.value = false; workorderFlag.value = false;
addWorkorderForm.value.orderId = null; addWorkorderForm.value.orderId = null;
}; };
function handleSend(row){
return dialog.warning({
title: '提示',
content:"申请后需仓管审核后发货,确认申请?",
style: {
borderRadius: '10px'
},
positiveText: '确定',
negativeText: '取消',
maskClosable: false,
onClose: () => {
console.log(1);
},
onPositiveClick: () => {
editSaleOrder({id: row.id, status: '8', attr1:'send'}).then((res: any) => {
if (res.code === 200) {
message.success('申请成功');
init();
}
});
},
onNegativeClick: () => {
console.log(1);
}
});
}
function handleInfo(row) { function handleInfo(row) {
if (row.status !== '0') { if (row.status !== '0') {
message.warning('请先完成订单审批'); message.warning('请先完成订单审批');
@ -942,7 +983,6 @@ onMounted(() => {
<style scoped> <style scoped>
:deep(.n-space){ :deep(.n-space){
margin-right: 5px; margin-right: 5px;
} }

File diff suppressed because it is too large Load Diff

@ -38,7 +38,7 @@
:columns="columns" :columns="columns"
:data="data" :data="data"
:loading="loading" :loading="loading"
:scroll-x="1000" :scroll-x="dataTableConfig.scrollWidth(columns)"
@update-checked-row-keys="handleSelect" @update-checked-row-keys="handleSelect"
/> />
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination> <my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
@ -50,18 +50,107 @@
:get-list="getWmsItemRecptData" :get-list="getWmsItemRecptData"
/> />
</my-card> </my-card>
<!-- 审批模态框 -->
<n-modal
v-model:show="approveModalVisible"
preset="dialog"
title="审批采购入库单"
style="width: 950px; height: 680px;"
:mask-closable="false"
@positive-click="handleApproveSubmit"
@negative-click="handleApproveCancel"
>
<div class="grid grid-cols-1 gap-4 p-4">
<!-- 详情展示 -->
<div >
<h3 class="text-lg font-semibold mb-3">入库单详情</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<p class="text-sm text-gray-500">入库单编号</p>
<p>{{ currentOrder?.recptCode || '-' }}</p>
</div>
<div>
<p class="text-sm text-gray-500">供应商名称</p>
<p>{{ currentOrder?.vendorName || '-' }}</p>
</div>
<div>
<p class="text-sm text-gray-500">采购单编号</p>
<p>{{ currentOrder?.fromBillCode || '-' }}</p>
</div>
<div>
<p class="text-sm text-gray-500">销售订单号</p>
<p>{{ currentOrder?.poCode || '-' }}</p>
</div>
<div>
<p class="text-sm text-gray-500">数量</p>
<p>{{ currentOrder?.quantityRecived || '-' }}</p>
</div>
<div>
<p class="text-sm text-gray-500">当前状态</p>
<dict-tag
:options="wms_item_recpt_status"
:value="currentOrder?.status"
/>
</div>
</div>
</div>
<n-data-table
:columns="columns2"
:data="data2"
/>
<!-- 审批操作 -->
<div v-if="viewType === 'APPROVE'">
<h3 class="text-lg font-semibold mb-3">审批操作</h3>
<n-form
ref="approveFormRef"
:model="approveForm"
:rules="approveRules"
>
<n-form-item label="审批意见" path="remark" style="width: 100%;">
<n-input
type="textarea"
placeholder="请输入审批意见"
v-model:value="approveForm.remark"
rows="3"
/>
</n-form-item>
</n-form>
<div class="mt-6 flex justify-end gap-4">
<n-button
type="error"
@click="handleAudit(currentOrder, 'REJECT')"
>
驳回
</n-button>
<n-button
type="success"
@click="handleAudit(currentOrder, 'APPROVE')"
>
通过
</n-button>
</div>
</div>
</div>
</n-modal>
</div> </div>
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { ref, getCurrentInstance } from 'vue'; import { ref, getCurrentInstance, computed } from 'vue';
import type { Ref } from 'vue'; import type { Ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import type { DataTableColumns, DataTableRowKey } from 'naive-ui'; import type { DataTableColumns, DataTableRowKey } from 'naive-ui';
import { useLoading, useBoolean } from '@/hooks'; import { useLoading, useBoolean } from '@/hooks';
import { useAuthStore } from '@/store';
// import { deepClone } from '@/utils'; // import { deepClone } from '@/utils';
import { selectWmsItemRecptList, delWmsItemRecpt } from '@/service/api/wms/recpt'; import { selectWmsItemRecptList, delWmsItemRecpt , approveWmsItemRecpt} from '@/service/api/wms/recpt';
import { import {
useSearchBtn, useSearchBtn,
useDelBtn, useDelBtn,
@ -72,9 +161,11 @@ import {
import { useSocketStore } from '@/store/modules/socket/index'; import { useSocketStore } from '@/store/modules/socket/index';
import type { ModalType } from './components/table-action-modal.vue'; import type { ModalType } from './components/table-action-modal.vue';
import TableActionModal from './components/table-action-modal.vue'; import TableActionModal from './components/table-action-modal.vue';
import {dataTableConfig} from "@/config/dataTableConfig";
import {selectWmsItemRecptLineList} from "@/service/api/wms/recptLine";
const socketStore = useSocketStore(); const socketStore = useSocketStore();
const authStore = useAuthStore();
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance() as any; const { proxy } = getCurrentInstance() as any;
const { wms_item_recpt_status } = proxy.useDict('wms_item_recpt_status', 'wms_item_recpt_type'); const { wms_item_recpt_status } = proxy.useDict('wms_item_recpt_status', 'wms_item_recpt_type');
@ -85,6 +176,87 @@ const modalType = ref<ModalType>('add');
// const menuOptions = ref(); // const menuOptions = ref();
const message = useMessage(); const message = useMessage();
//
const viewType = ref('');
const approveFormRef = ref<any | null>(null);
const currentOrder = ref<any | null>(null);
const data2 = ref<any[]>([]);
const approveModalVisible = ref(false);
const approveForm = ref<{
id: number | string | null; // IDID()
status: string;
remark: string;
}>({
id: null,
status: '',
remark: ''
});
const approveRules = {
remark: [{ required: true, message: '请输入审批意见' }]
};
//
function handleApprove(row: any, type: 'view' | 'APPROVE') {
viewType.value = type;
currentOrder.value = { ...row }; //
if (type === 'APPROVE') {
approveForm.value = {
id: row.recptId,
status: 'APPROVE',
remark: ''
};
}
selectWmsItemRecptLineList({params:{recptId: currentOrder?.value.recptId} }).then(res => {
data2.value = res.rows;
// list.value.data = res.rows;
approveModalVisible.value = true;
});
}
function handleAudit(row: any, status: 'APPROVE' | 'REJECT') {
if (!row.recptId) return;
approveForm.value = {
id: row.recptId,
status: status,
remark: approveForm.value.remark
};
handleApproveSubmit();
}
async function handleApproveSubmit() {
if (!approveFormRef.value) return;
await approveFormRef.value.validate(errors => {
if (errors) return;
const params = {
recptId: approveForm.value.id,
status: approveForm.value.status,
remark: approveForm.value.remark
};
approveWmsItemRecpt(params)
.then(res => {
if (res.code === 200) {
message.success(`审批${params.status === 'APPROVE' ? '通过' : '驳回'}成功`);
approveModalVisible.value = false;
getWmsItemRecptData();
} else {
message.error(res.msg || '审批失败');
}
})
.catch(() => message.error('网络请求失败'));
});
}
function handleApproveCancel() {
approveModalVisible.value = false;
approveForm.value = { id: null, status: '', remark: '' };
currentOrder.value = null;
}
// const delIds = ref(); // const delIds = ref();
// const show = ref(false); // const show = ref(false);
const total = ref(); const total = ref();
@ -150,7 +322,61 @@ const selectKeys = ref<DataTableRowKey[]>([]);
function handleSelect(keys: DataTableRowKey[]) { function handleSelect(keys: DataTableRowKey[]) {
selectKeys.value = keys; selectKeys.value = keys;
} }
//
const hasApprovePermission = computed(() =>
authStore.userInfo.roles.includes('CKGL') || authStore.userInfo.userName === 'admin'
);
const data = ref<wms.recptRawType.columns[]>([]); const data = ref<wms.recptRawType.columns[]>([]);
const columns2: Ref<any> = ref([
{
title: '物料类型',
key: 'itemTypeName',
width: 120,
ellipsis: {
tooltip: true
}
},
{
title: '物料编码',
key: 'itemCode',
width: 120,
ellipsis: {
tooltip: true
}
},
{
title: '物料名称',
key: 'itemName',
width: 120,
ellipsis: {
tooltip: true
}
},
{
title: '规格型号',
key: 'specification',
width: 120
},
{
title: '颜色',
key: 'colorName',
width: 120
},
{
title: '单位',
key: 'unitOfMeasure',
width: 120
},
{
title: '数量',
key: 'quantityRecived',
width: 120
},
])
const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([ const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([
{ {
type: 'selection', type: 'selection',
@ -252,6 +478,24 @@ const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([
tooltip: true tooltip: true
} }
}, },
{
title: '审批人',
align: 'center',
width: 150,
key: 'checkedBy',
render: (row) => {
return row.checkedBy || '-';
}
},
{
title: '审批时间',
align: 'center',
key: 'checkedTime',
width: 150,
render: (row) => {
return row.checkedTime ? new Date(row.checkedTime).toLocaleDateString() : '-';
}
},
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
@ -267,7 +511,18 @@ const columns: Ref<DataTableColumns<wms.recptRawType.columns>> = ref([
); );
} }
const Btn: JSX.Element[] = []; const Btn: JSX.Element[] = [];
if (row.status !== 'FINISHED') { if (row.status === 'PREPARE' && hasApprovePermission.value) {
Btn.push(
<n-button
size="small"
type="warning"
onClick={() => handleApprove(row, 'APPROVE')}
>
审批
</n-button>
);
}
if (row.status == 'APPROVE') {
Btn.push( Btn.push(
useEditBtn( useEditBtn(
() => { () => {

@ -200,11 +200,11 @@ const columns: Ref<DataTableColumns<LoginManagement.LoginType>> = ref([
align: 'center' align: 'center'
}, },
{ // {
title: '地址', // title: '',
key: 'ipaddr', // key: 'ipaddr',
align: 'center' // align: 'center'
}, // },
{ {
title: '描述', title: '描述',

@ -275,12 +275,12 @@ const columns: Ref<DataTableColumns<OperaManagement.OperaType>> = ref([
align: 'center', align: 'center',
width: 100 width: 100
}, },
{ // {
title: '主机', // title: '',
key: 'operIp', // key: 'operIp',
align: 'center', // align: 'center',
width: 140 // width: 140
}, // },
{ {
title: '操作状态', title: '操作状态',
key: 'status', key: 'status',

@ -281,12 +281,12 @@ const columns: Ref<DataTableColumns<UserManagement.User>> = ref([
align: 'center', align: 'center',
width: 60 width: 60
}, },
{ // {
title: '用户编号', // title: '',
key: 'id', // key: 'id',
align: 'center', // align: 'center',
width: 120 // width: 120
}, // },
{ {
title: '用户名称', title: '用户名称',
key: 'name', key: 'name',

Loading…
Cancel
Save