Commit 592f830c by sunhaiwei

Merge remote-tracking branch 'origin/hongshun' into hongshun

parents a44a3de4 6fab0c74
......@@ -8,7 +8,7 @@ enum Api {
List = '/chaiche/ccbg/list',
Info = '/chaiche/ccbg/info',
MesCheliangBg = '/chaiche/ccbg',
InWarehouse = '/chaiche/ccbg/in-warehouse',
}
......@@ -88,6 +88,19 @@ export async function deleteMesCheliangBg(ids: string[], mode: ErrorMessageMode
);
}
/**
* @description: 拆车物料入库
*/
export async function inWarehouse(wlList: Recordable[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.InWarehouse,
params: wlList,
},
{
errorMessageMode: mode,
},
);
}
......@@ -6,7 +6,7 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesCheliangBgPageParams extends BasicPageParams {
banzu: string;
cllx: string;
cphm: string;
clys: string;
......@@ -14,12 +14,12 @@ export interface MesCheliangBgPageParams extends BasicPageParams {
gzr: string;
cllx: string;
wlzt: string;
gzxm: string;
cphm: string;
clppxh: string;
gzkssj: string;
......
......@@ -4,17 +4,17 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: MesCheliangBg分页参数 模型
*/
export interface MesCheliangBgPageParams extends BasicPageParams {
banzu: string;
cphm: string;
gzr: string;
gzkssj: string;
cllx: string;
gzr: string;
gzxm: string;
gzjssj: string;
gzxm: string;
}
/**
......@@ -38,8 +38,6 @@ export interface MesCheliangBgPageModel {
gzjssj: string;
clls: string;
banzu: string;
}
/**
......
......@@ -8,6 +8,8 @@ enum Api {
List = '/scgl/qclywccmx/list',
Info = '/scgl/qclywccmx/info',
MesQclbgRecordOutput = '/scgl/qclywccmx',
Rksq = '/scgl/qclywccmx/commitRk',
Zjsq = '/scgl/qclywccmx/commitZj',
......@@ -88,6 +90,34 @@ export async function deleteMesQclbgRecordOutput(ids: string[], mode: ErrorMessa
);
}
/**
* @description: 入库
*/
export async function rksqMesProductOutput(params: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Rksq,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 质检
*/
export async function zjsqMesProductOutput(params: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Zjsq,
params,
},
{
errorMessageMode: mode,
},
);
}
......@@ -135,4 +135,3 @@
</script>
\ No newline at end of file
<template>
<BasicModal
:height="600"
:width="900"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<div style="margin: 20px;">
<a-button type="primary" style="margin-bottom: 10px; margin-right: 10px;" @click="handleAllInWarehouse">全部入库</a-button>
<a-button type="primary" style="margin-bottom: 10px;" @click="handleCancelInWarehouse">取消全部入库</a-button>
<a-table bordered :data-source="dataSource" :columns="columns" :pagination="false" >
<template #bodyCell="{ column, text, record, index }">
<template v-if="column.key === 'index'">
{{ index + 1 }}
</template>
<template v-if="column.dataIndex === 'bcrksl'">
<a-input-number v-model:value="record.bcrksl" :min="0" :max="record.sl - record.yrlsl" />
</template>
</template>
</a-table>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { getMesCheliangBg, inWarehouse } from '/@/api/chaiche/ccbg';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
rowId: '',
});
provide<Ref<boolean>>('isCopy', isCopy);
const [registerModal, { closeModal }] = useModalInner(async () => {
});
const props = defineProps(['recordId'])
const getTitle = computed(() => ('拆车物料入库'));
const dataSource = ref([]);
const columns = reactive([
{
title: '序号',
dataIndex: 'index',
key: 'index',
align: 'center',
},
{
title: '物料名称',
dataIndex: 'cpmc',
key: 'cpmc',
},
{
title: '物料编码',
dataIndex: 'cpbh',
key: 'cpbh',
},
{
title: '单位',
dataIndex: 'dw',
key: 'dw',
},
{
title: '总数量',
dataIndex: 'sl',
key: 'sl',
},
{
title: '已入库数量',
dataIndex: 'yrlsl',
key: 'yrlsl',
},
{
title: '本次入库数量',
dataIndex: 'bcrksl',
key: 'bcrksl',
},
]);
onMounted(async () => {
const recordInfo = await getMesCheliangBg(props.recordId);
recordInfo.mesCheliangBgCpList.forEach(item => {
item.bcrksl = 0;
})
dataSource.value = recordInfo.mesCheliangBgCpList;
})
function handleAllInWarehouse() {
dataSource.value.forEach(item => {
item.bcrksl = item.sl - item.yrlsl;
});
}
function handleCancelInWarehouse() {
dataSource.value.forEach(item => {
item.bcrksl = 0;
});
}
async function handleSubmit() {
await inWarehouse(dataSource.value);
notification.success({
message: 'Tip',
description: '入库成功',
});
handleClose();
}
function handleClose() {
emit('success')
}
</script>
......@@ -39,12 +39,12 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车辆类型',
fieldId: 'cllx',
fieldName: '车牌号码',
fieldId: 'cphm',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'e17f3687f30f4a2995ea2b07348150b5',
type: 'associate-popup',
key: 'f89a9cedaa7a4f98958d46860ac84ad6',
children: [],
options: {},
},
......@@ -123,15 +123,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车辆重量(kg)',
fieldId: 'clzl',
fieldName: '车辆类型',
fieldId: 'cllx',
isSubTable: false,
showChildren: true,
type: 'number',
key: '059de967d74b44bba170351aff279c63',
type: 'select',
key: 'e17f3687f30f4a2995ea2b07348150b5',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -223,14 +222,15 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车牌号码',
fieldId: 'cphm',
fieldName: '车辆重量(kg)',
fieldId: 'clzl',
isSubTable: false,
showChildren: true,
type: 'associate-popup',
key: 'f89a9cedaa7a4f98958d46860ac84ad6',
type: 'number',
key: '059de967d74b44bba170351aff279c63',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......
......@@ -50,6 +50,8 @@
<CcbgModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
<InWarehouse v-if="showInWarehouse" :visible="showInWarehouse" :recordId="recordId"
@success="handleInWarehouseSuccess" @cancel="handleInWarehouseCancel"/>
......@@ -84,6 +86,7 @@
import CcbgModal from './components/CcbgModal.vue';
import InWarehouse from './components/InWarehouse.vue';
......@@ -103,7 +106,8 @@
const showInWarehouse = ref(false);
const recordId = ref(null);
const listSpliceNum = ref(3); //操作列最先展示几个
......@@ -133,7 +137,7 @@
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","inWarehouse","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2018972431831822336","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2018972431831822337","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2019669737161912320","name":"入库","code":"inWarehouse","icon":"ant-design:home-twotone","isDefault":false,"isUse":true,"setting":[],"showType":"inline","buttonType":"modal"},{"buttonId":"2018972431831822339","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
const list = [{"buttonId":"2018972431831822336","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2018972431831822337","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2019669737161912320","name":"入库","code":"inWarehouse","icon":"ant-design:home-twotone","isDefault":false,"isUse":true,"setting":[],"showType":"inline","buttonType":"primary"},{"buttonId":"2018972431831822339","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......@@ -145,7 +149,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,delete : handleDelete,}
const btnEvent = {view : handleView,add : handleAdd,delete : handleDelete,inWarehouse : handleInWarehouse}
const { currentRoute } = useRouter();
......@@ -262,7 +266,10 @@
});
}
function handleInWarehouse(record: Recordable) {
showInWarehouse.value = true;
recordId.value = record.id;
}
......@@ -310,6 +317,13 @@
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleInWarehouseSuccess() {
showInWarehouse.value = false;
}
function handleInWarehouseCancel() {
showInWarehouse.value = false;
}
function handleView(record: Recordable) {
let info={
......
......@@ -39,14 +39,15 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '班组',
fieldId: 'banzu',
fieldName: '排液人',
fieldId: 'gzr',
isSubTable: false,
showChildren: true,
type: 'radio',
key: '362f762c817749469f47af55832b3363',
type: 'user',
key: 'b8e63f39708d46cdb64fd9b5e9079dd4',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -105,15 +106,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '排液人',
fieldId: 'gzr',
fieldName: '工作项目',
fieldId: 'gzxm',
isSubTable: false,
showChildren: true,
type: 'user',
key: 'b8e63f39708d46cdb64fd9b5e9079dd4',
type: 'associate-popup',
key: '16549fa420014b3f871e74e4274df5b3',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -156,22 +156,6 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工作项目',
fieldId: 'gzxm',
isSubTable: false,
showChildren: true,
type: 'associate-popup',
key: '16549fa420014b3f871e74e4274df5b3',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '处理辆数',
fieldId: 'clls',
isSubTable: false,
......
......@@ -66,7 +66,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesQclbgRecordOutputPage, deleteMesQclbgRecordOutput} from '/@/api/scgl/qclywccmx';
import { getMesQclbgRecordOutputPage, deleteMesQclbgRecordOutput, rksqMesProductOutput, zjsqMesProductOutput } from '/@/api/scgl/qclywccmx';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -145,7 +145,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,delete : handleDelete,}
const btnEvent = {view : handleView,delete : handleDelete,ruku: handleRksq, zhijian: handleZjsq}
const { currentRoute } = useRouter();
......@@ -226,7 +226,59 @@
/**
* @description: 入库
*/
async function handleRksq(record: Recordable) {
try {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否提交入库申请?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
await rksqMesProductOutput({ id: record.id });
notification.success({
message: t('成功'),
description: '入库申请成功',
});
handleSuccess();
reload();
},
onCancel() {},
});
} catch (error) {
console.error('入库申请失败:', error);
}
}
/**
* @description: 质检
*/
async function handleZjsq(record: Recordable) {
try {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否提交质检申请?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
await zjsqMesProductOutput({ id: record.id });
notification.success({
message: t('成功'),
description: '质检申请成功',
});
handleSuccess();
reload();
},
onCancel() {},
});
} catch (error) {
console.error('质检申请失败:', error);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment