no message
parent
30130f5111
commit
a83e1dc23e
|
|
@ -12,6 +12,7 @@ enum Api {
|
|||
deleteBatch = '/base/point/deleteBatch',
|
||||
importExcel = '/base/point/importExcel',
|
||||
exportXls = '/base/point/exportXls',
|
||||
queryOutWorkStation='/base/point/queryOutWorkStation',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -78,3 +79,9 @@ export const saveOrUpdate = (params, isUpdate) => {
|
|||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
||||
|
||||
export const queryOutWorkStation = (params) => defHttp.get(
|
||||
{ url: Api.queryOutWorkStation, params },
|
||||
{isTransformResponse: false,}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/count/countPlan/list',
|
||||
save='/count/countPlan/add',
|
||||
edit='/count/countPlan/edit',
|
||||
save = '/count/countPlan/add',
|
||||
edit = '/count/countPlan/edit',
|
||||
deleteOne = '/count/countPlan/delete',
|
||||
deleteBatch = '/count/countPlan/deleteBatch',
|
||||
importExcel = '/count/countPlan/importExcel',
|
||||
exportXls = '/count/countPlan/exportXls',
|
||||
queryDataById = '/count/countPlan/queryById',
|
||||
countDetailList = '/count/countPlan/queryCountDetailByMainId',
|
||||
countIssueTask = '/count/countPlan/countIssueTask',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
|
|
@ -28,24 +30,27 @@ export const getImportUrl = Api.importExcel;
|
|||
* 查询子表数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryCountDetailListByMainId = (id) => defHttp.get({url: Api.countDetailList, params:{ id }});
|
||||
export const queryCountDetailListByMainId = (id) =>
|
||||
defHttp.get({
|
||||
url: Api.countDetailList,
|
||||
params: { id },
|
||||
});
|
||||
|
||||
export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
|
||||
export const queryDataById = (id) => defHttp.get({ url: Api.queryDataById, params: { id } });
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) =>
|
||||
defHttp.get({url: Api.list, params});
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
|
|
@ -58,17 +63,40 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
return defHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
data: params,
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({url: url, params});
|
||||
}
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 任务下发
|
||||
* @param workStations
|
||||
*/
|
||||
export const countIssueTask = (workStations) =>
|
||||
defHttp.get(
|
||||
{
|
||||
url: Api.countIssueTask,
|
||||
params: { workStations },
|
||||
},
|
||||
{
|
||||
isTransformResponse: false,
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
import { BasicColumn } from '/@/components/Table';
|
||||
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { render } from '@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '库区',
|
||||
align: 'center',
|
||||
dataIndex: 'areaId_dictText',
|
||||
},
|
||||
{
|
||||
title: '盘点单号',
|
||||
align: 'center',
|
||||
|
|
@ -16,11 +22,18 @@ export const columns: BasicColumn[] = [
|
|||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status_dictText',
|
||||
},
|
||||
{
|
||||
title: '审核人',
|
||||
align: 'center',
|
||||
dataIndex: 'auditor',
|
||||
customRender: ({ text }) => {
|
||||
//盘点状态:1.已创建;2.已审核;3.盘点中;4.盘点完成;5.已取消;6.已关闭;
|
||||
const statusColorMap = {
|
||||
已创建: 'orange',
|
||||
盘点中: 'blue',
|
||||
盘点完成: 'green',
|
||||
已关闭: 'green',
|
||||
已取消: 'red',
|
||||
};
|
||||
const color = statusColorMap[text] || 'red';
|
||||
return render.renderTag(text, color);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
|
|
|||
|
|
@ -5,21 +5,29 @@
|
|||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="no">
|
||||
<template #label><span title="任务号">任务号</span></template>
|
||||
<JInput v-model:value="queryParam.no" :placeholder="'请输入任务号'" :type="JInputTypeEnum.JINPUT_RIGHT_LIKE" />
|
||||
<a-form-item name="orderNo">
|
||||
<template #label><span title="盘点单号">盘点单号</span></template>
|
||||
<JInput v-model:value="queryParam.orderNo" :placeholder="'请输入盘点单号'" :type="JInputTypeEnum.JINPUT_RIGHT_LIKE" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="orderType">
|
||||
<template #label><span title="单据类型">单据类型</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.orderType" placeholder="请选择" dictCode="asn_order_type" allowClear />
|
||||
<a-form-item name="countType">
|
||||
<template #label><span title="盘点类型">盘点类型</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.countType" placeholder="请选择" dictCode="count_type" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="status_MultiString" :labelCol="{ span: 2 }" :wrapperCol="{ span: 20 }">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="count_status" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="orderDate">
|
||||
<template #label><span title="订单日期">订单日期</span></template>
|
||||
<JRangeDate v-model:value="queryParam.orderDate" />
|
||||
<a-form-item name="createTime">
|
||||
<template #label><span title="订单日期">创建日期</span></template>
|
||||
<JRangeDate v-model:value="queryParam.createTime" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
|
@ -35,14 +43,6 @@
|
|||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="asn_status" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>-->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
|
|
@ -85,6 +85,7 @@
|
|||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CountPlanModal @register="registerModal" @success="handleSuccess"></CountPlanModal>
|
||||
<IssueTaskModal ref="registerIssueTaskModal" @success="handleSuccess"></IssueTaskModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -100,10 +101,15 @@
|
|||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
import { JInput, JDictSelectTag } from '@/components/Form';
|
||||
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
|
||||
import JSelectMultiple from '../../components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import ScanTrayModal from '@/views/receive/asn/components/scanTray/ScanTrayModal.vue';
|
||||
import IssueTaskModal from '@/views/count/components/issueTask/IssueTaskModal.vue';
|
||||
|
||||
const fieldPickers = reactive({});
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const queryParam = reactive<any>({
|
||||
status_MultiString: '1,3,4', // 默认查询已创建、盘点中、盘点完成
|
||||
});
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
|
|
@ -123,12 +129,12 @@
|
|||
const newQueryParam = { ...queryParam };
|
||||
|
||||
// 处理日期范围
|
||||
if (newQueryParam.orderDate) {
|
||||
if (newQueryParam.createTime) {
|
||||
try {
|
||||
const [begin, end] = newQueryParam.orderDate.split(',');
|
||||
if (begin !== undefined) newQueryParam.orderDate_begin = begin;
|
||||
if (end !== undefined) newQueryParam.orderDate_end = end;
|
||||
delete newQueryParam.orderDate;
|
||||
const [begin, end] = newQueryParam.createTime.split(',');
|
||||
if (begin !== undefined) newQueryParam.createTime_begin = begin;
|
||||
if (end !== undefined) newQueryParam.createTime_end = end;
|
||||
delete newQueryParam.createTime;
|
||||
} catch (error) {
|
||||
console.error('日期范围处理错误:', error);
|
||||
}
|
||||
|
|
@ -190,6 +196,16 @@
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发
|
||||
*/
|
||||
const registerIssueTaskModal = ref();
|
||||
|
||||
function handleIssueTask(record) {
|
||||
registerIssueTaskModal.value.disableSubmit = false;
|
||||
registerIssueTaskModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
|
|
@ -229,9 +245,14 @@
|
|||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
/*{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},*/
|
||||
{
|
||||
label: '下发',
|
||||
onClick: handleIssueTask.bind(null, record),
|
||||
auth: 'count:data_count_plan:countIssueTask',
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,153 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="IssueTaskForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
label="工作站"
|
||||
v-bind="validateInfos.workStation"
|
||||
id="IssueTaskForm-workStation"
|
||||
name="workStation"
|
||||
:labelCol="{ span: 3 }"
|
||||
:wrapperCol="{ span: 24 }"
|
||||
>
|
||||
<a-checkbox-group v-model:value="formData.workStation" style="width: 100%">
|
||||
<a-row>
|
||||
<a-col v-for="item in checkboxOptions" :key="item.value" :span="8">
|
||||
<a-checkbox :value="item.value">{{ item.label }}</a-checkbox>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { queryOutWorkStation } from '/@/views/base/point/Point.api';
|
||||
import { countIssueTask } from '/@/views/count/CountPlan.api';
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true },
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
workStation: [],
|
||||
areaId_dictText: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
/**
|
||||
* 获取出库工作站
|
||||
*/
|
||||
const checkboxOptions = ref([]);
|
||||
|
||||
async function getWorkStation() {
|
||||
try {
|
||||
const res = await queryOutWorkStation({ areaId_dictText: formData.areaId_dictText });
|
||||
if (res && res.code === 200) {
|
||||
checkboxOptions.value = res.result.map((item: any) => ({
|
||||
label: item,
|
||||
value: item,
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载工作站失败:', error);
|
||||
checkboxOptions.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key];
|
||||
}
|
||||
});
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
// 获取工作站数据
|
||||
getWorkStation();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
confirmLoading.value = true;
|
||||
try {
|
||||
console.log('checkboxOptions.value', formData.workStation);
|
||||
if (formData.workStation.length <= 0) {
|
||||
return createMessage.error('请选择工作站');
|
||||
}
|
||||
const res = await countIssueTask(formData.workStation);
|
||||
if (res && res.code === 200) {
|
||||
createMessage.success('操作成功');
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.error(res.message || '处理失败');
|
||||
}
|
||||
} catch (error) {
|
||||
createMessage.error('请求异常: ' + error);
|
||||
} finally {
|
||||
confirmLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<template>
|
||||
<j-modal :title="title" :maxHeight="500" :width="600" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<IssueTaskForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></IssueTaskForm>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
<a-button :class="{ 'jee-hidden': disableSubmit }" type="primary" @click="handleOk">确认</a-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import IssueTaskForm from './IssueTaskForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
const title = ref<string>('');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 托盘扫描
|
||||
*/
|
||||
function add() {
|
||||
title.value = '任务下发';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
function edit(record) {
|
||||
title.value = '任务下发';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
Loading…
Reference in New Issue