|
@@ -47,8 +47,7 @@
|
|
:disabled="!selectedRowKeys.length"
|
|
:disabled="!selectedRowKeys.length"
|
|
@click="handleOperate('RECEIVE')"
|
|
@click="handleOperate('RECEIVE')"
|
|
>
|
|
>
|
|
- <template #icon><svg-icon name="delete" color="#262626" /></template
|
|
|
|
- >批量签收
|
|
|
|
|
|
+ <template #icon><MarkAsUnreadIcon /></template>批量签收
|
|
</t-button>
|
|
</t-button>
|
|
<t-button
|
|
<t-button
|
|
v-if="perm.BUTTON_BatchCancel"
|
|
v-if="perm.BUTTON_BatchCancel"
|
|
@@ -56,8 +55,14 @@
|
|
:disabled="!selectedRowKeys.length"
|
|
:disabled="!selectedRowKeys.length"
|
|
@click="handleOperate('CANCEL')"
|
|
@click="handleOperate('CANCEL')"
|
|
>
|
|
>
|
|
- <template #icon><svg-icon name="delete" color="#262626" /></template
|
|
|
|
- >批量作废
|
|
|
|
|
|
+ <template #icon><CloseOctagonIcon /></template>批量作废
|
|
|
|
+ </t-button>
|
|
|
|
+ <t-button
|
|
|
|
+ v-if="perm.BUTTON_BatchReturn"
|
|
|
|
+ variant="outline"
|
|
|
|
+ @click="handleReturn(selectedRowKeys)"
|
|
|
|
+ >
|
|
|
|
+ <template #icon><RollfrontIcon /></template>批量返还
|
|
</t-button>
|
|
</t-button>
|
|
</t-space>
|
|
</t-space>
|
|
</div>
|
|
</div>
|
|
@@ -155,6 +160,19 @@
|
|
>
|
|
>
|
|
签收
|
|
签收
|
|
</t-link>
|
|
</t-link>
|
|
|
|
+ <t-link
|
|
|
|
+ theme="primary"
|
|
|
|
+ hover="color"
|
|
|
|
+ v-if="
|
|
|
|
+ row.status == 'RECEIVE' &&
|
|
|
|
+ row.usageType === 'OTHER' &&
|
|
|
|
+ row.deliveryType === 'OUT' &&
|
|
|
|
+ perm.LINK_Return
|
|
|
|
+ "
|
|
|
|
+ @click="handleReturn([row.id], true)"
|
|
|
|
+ >
|
|
|
|
+ 返还
|
|
|
|
+ </t-link>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</t-table>
|
|
</t-table>
|
|
@@ -164,6 +182,12 @@
|
|
:curRow="curRow"
|
|
:curRow="curRow"
|
|
@success="fetchData"
|
|
@success="fetchData"
|
|
></EditDeviceInfoDialog>
|
|
></EditDeviceInfoDialog>
|
|
|
|
+
|
|
|
|
+ <DeviceTableDialog
|
|
|
|
+ :data="waitReturnData"
|
|
|
|
+ v-model:visible="showWaiReturnDataDialog"
|
|
|
|
+ @success="returnSuccess"
|
|
|
|
+ ></DeviceTableDialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -172,18 +196,25 @@ import { ref, reactive, computed, onMounted } from 'vue';
|
|
import { omit } from 'lodash';
|
|
import { omit } from 'lodash';
|
|
|
|
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
-import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
|
|
|
|
|
|
+import {
|
|
|
|
+ ErrorCircleFilledIcon,
|
|
|
|
+ RollfrontIcon,
|
|
|
|
+ CloseOctagonIcon,
|
|
|
|
+ MarkAsUnreadIcon,
|
|
|
|
+} from 'tdesign-icons-vue-next';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import {
|
|
import {
|
|
deviceSendStatusUpdateApi,
|
|
deviceSendStatusUpdateApi,
|
|
deviceSendListApi,
|
|
deviceSendListApi,
|
|
deviceSendExportApi,
|
|
deviceSendExportApi,
|
|
|
|
+ deviceSendReturn,
|
|
} from '@/api/resource-guard';
|
|
} from '@/api/resource-guard';
|
|
import { DEVICE_SEND_STATUS, DEVICE_USAGE_TYPE } from '@/config/constants';
|
|
import { DEVICE_SEND_STATUS, DEVICE_USAGE_TYPE } from '@/config/constants';
|
|
import usePermission from '@/hooks/usePermission';
|
|
import usePermission from '@/hooks/usePermission';
|
|
import EditDeviceInfoDialog from './edit-device-info-dialog.vue';
|
|
import EditDeviceInfoDialog from './edit-device-info-dialog.vue';
|
|
import { dictToOptionList } from '@/utils/tool';
|
|
import { dictToOptionList } from '@/utils/tool';
|
|
import { downloadImportTemplate } from '@/api/common';
|
|
import { downloadImportTemplate } from '@/api/common';
|
|
|
|
+import DeviceTableDialog from '@/views/sop/sop-manage/device-out-in/add-device-dialog.vue';
|
|
const { perm } = usePermission();
|
|
const { perm } = usePermission();
|
|
const tableKey = ref(Date.now() + '');
|
|
const tableKey = ref(Date.now() + '');
|
|
const curRow = ref(null);
|
|
const curRow = ref(null);
|
|
@@ -449,6 +480,28 @@ const handleEdit = (row) => {
|
|
curRow.value = row;
|
|
curRow.value = row;
|
|
showEditDeviceDialog.value = true;
|
|
showEditDeviceDialog.value = true;
|
|
};
|
|
};
|
|
|
|
+const waitReturnData = ref([]);
|
|
|
|
+const showWaiReturnDataDialog = ref(false);
|
|
|
|
+const handleReturn = (ids = [], single) => {
|
|
|
|
+ let confirmBody = !ids.length
|
|
|
|
+ ? `确定要返还当所有记录吗?`
|
|
|
|
+ : `确定要返还当前${single ? '' : '选中的'}记录吗?`;
|
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
|
+ header: '操作提示',
|
|
|
|
+ body: confirmBody,
|
|
|
|
+ confirmBtn: '确定',
|
|
|
|
+ cancelBtn: '取消',
|
|
|
|
+ onConfirm: async () => {
|
|
|
|
+ confirmDia.hide();
|
|
|
|
+ const res = await deviceSendReturn({
|
|
|
|
+ idList: ids,
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (!res) return;
|
|
|
|
+ Array.isArray(res) && (waitReturnData.value = res);
|
|
|
|
+ showWaiReturnDataDialog.value = true;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
const handleOperate = (status, ids) => {
|
|
const handleOperate = (status, ids) => {
|
|
let str =
|
|
let str =
|
|
status === 'DELIVER'
|
|
status === 'DELIVER'
|
|
@@ -497,4 +550,8 @@ const multExport = () => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+const returnSuccess = () => {
|
|
|
|
+ showWaiReturnDataDialog.value = false;
|
|
|
|
+ fetchData();
|
|
|
|
+};
|
|
</script>
|
|
</script>
|