|
@@ -1,11 +1,520 @@
|
|
|
<script setup lang="ts">
|
|
|
+import {validation_add, validation_del, validation_List,readvaildation,updatevaildation,validation_update } from '@/api/storehouse'
|
|
|
+import TableBase from '@/components/TableBase/index.vue'
|
|
|
+import { computed, reactive, ref } from 'vue'
|
|
|
+import { GlobalStore } from '@/stores'
|
|
|
+import type { ColumnProps } from '@/components/TableBase/interface'
|
|
|
+import { Delete, Edit } from '@element-plus/icons-vue'
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import type { FormInstance } from 'element-plus'
|
|
|
+// import { pa } from 'element-plus/es/locale'
|
|
|
|
|
|
-</script>
|
|
|
+const globalStore = GlobalStore()
|
|
|
+const TableRef = ref<InstanceType<typeof TableBase> | null>(null)
|
|
|
|
|
|
-<template>
|
|
|
+const initParam = reactive({
|
|
|
+ User_tokey: globalStore.GET_User_tokey,
|
|
|
+ Validationnumber: '',
|
|
|
+ T_state: '',
|
|
|
+ T_sn: '',
|
|
|
+ T_imei: '',
|
|
|
+ T_iccid: '',
|
|
|
+ LendUser:'',
|
|
|
+ T_project: '',
|
|
|
+})
|
|
|
+const columns: ColumnProps[] = [
|
|
|
+ { type: 'index', label: '序号', width: 80 },
|
|
|
+ { prop: 'Validationnumber', label: '设备编号', ellipsis: true },
|
|
|
+ { prop: 'T_sn', label: '设备SN', ellipsis: true },
|
|
|
+ { prop: 'T_sn', label: '设备SN', ellipsis: true },
|
|
|
+ { prop: 'T_imei', label: '模组imei', ellipsis: true },
|
|
|
+ { prop: 'T_iccid', label: '物联网卡号', ellipsis: true },
|
|
|
+ { prop: 'T_state', label: '状态', name: 'T_state' },
|
|
|
+ { prop: 'LendUser', label: '借出人', ellipsis: true },
|
|
|
+ { prop: 'T_project', label: '借出项目', ellipsis: true },
|
|
|
+ { prop: 'T_remark', label: '备注', name: 'T_remark', ellipsis: true },
|
|
|
+ { prop: 'operation', label: '操作', width: 260, fixed: 'right' }
|
|
|
+]
|
|
|
+// 搜索
|
|
|
+const options = reactive([
|
|
|
+ { name: '已出库', id: 1 },
|
|
|
+ { name: '未出库', id: 2 },
|
|
|
+ { name: '已损坏', id: 3 }
|
|
|
+])
|
|
|
+const searchHandle = () => {
|
|
|
+ TableRef.value?.searchTable()
|
|
|
+}
|
|
|
+/**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+const deleteFun = (row: any) => {
|
|
|
+ ElMessageBox.confirm('删除操作,是否立即删除?', '删除', {
|
|
|
+ confirmButtonText: '立即删除',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ const result: any = await validation_del({ t_sn: row })
|
|
|
+ if (result.Code == 200) {
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ TableRef.value?.searchTable()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
|
+ .catch(() => {})
|
|
|
+}
|
|
|
+
|
|
|
+const showInStorageForm = ref(false)
|
|
|
+
|
|
|
+const inStorageFormRef = ref<FormInstance | null>(null)
|
|
|
+const inStorageForm = reactive({
|
|
|
+ T_sn: '',
|
|
|
+ Validationnumber: '',
|
|
|
+ T_remark: ''
|
|
|
+})
|
|
|
+interface InStorageItem {
|
|
|
+ T_sn: string;
|
|
|
+ Validationnumber: string;
|
|
|
+ T_remark: string;
|
|
|
+}
|
|
|
+
|
|
|
+const pendingItems = ref<InStorageItem[]>([])
|
|
|
+const pageSize = ref(8)
|
|
|
+const currentPage = ref(1)
|
|
|
+
|
|
|
+const paginatedPendingItems = computed(() => {
|
|
|
+ const start = (currentPage.value - 1) * pageSize.value
|
|
|
+ const end = start + pageSize.value
|
|
|
+ return pendingItems.value.slice(start, end)
|
|
|
+})
|
|
|
+const rules = reactive({
|
|
|
+ T_sn: [{ required: true, message: '请输入SN', trigger: 'blur' }],
|
|
|
+ Validationnumber: [{ required: true, message: '请输入设备编号', trigger: 'blur' }]
|
|
|
+})
|
|
|
+
|
|
|
+const extractSN = (fullSN: string): string => {
|
|
|
+ if (fullSN.length === 24 && fullSN.startsWith('03') && fullSN.endsWith('000001')) {
|
|
|
+ return fullSN.substring(2, 18)
|
|
|
+ }
|
|
|
+ return fullSN
|
|
|
+}
|
|
|
+
|
|
|
+const submitInStorageForm = () => {
|
|
|
+ inStorageFormRef.value?.validate((valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ const extractedSN = extractSN(inStorageForm.T_sn)
|
|
|
+ if (pendingItems.value.some((item: any) => item.T_sn === extractedSN)) {
|
|
|
+ ElMessage.warning('已存在相同的SN,不能添加')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ pendingItems.value.push({ ...inStorageForm, T_sn: extractedSN })
|
|
|
+ inStorageForm.T_sn = ''
|
|
|
+ inStorageForm.Validationnumber = ''
|
|
|
+ inStorageForm.T_remark = ''
|
|
|
+ ElMessage.success('已添加到待提交列表')
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const removePendingItem = (index: number) => {
|
|
|
+ pendingItems.value.splice(index, 1)
|
|
|
+ ElMessage.success('已从待提交列表中移除')
|
|
|
+}
|
|
|
+
|
|
|
+const submitInStoragePendingItems = async () => {
|
|
|
+ if (pendingItems.value.length === 0) {
|
|
|
+ ElMessage.warning('暂无数据可提交');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const rest=JSON.parse(JSON.stringify(pendingItems.value));
|
|
|
+ console.log("待提交的数据:", rest);
|
|
|
+ try {
|
|
|
+ const result:any = await validation_add(rest);
|
|
|
+ if (result.Code === 200) {
|
|
|
+ ElMessage.success('提交成功');
|
|
|
+ pendingItems.value = [];
|
|
|
+ inStorageForm.T_sn = '';
|
|
|
+ inStorageForm.Validationnumber = '';
|
|
|
+ inStorageForm.T_remark = '';
|
|
|
+ searchHandle();
|
|
|
+ } else {
|
|
|
+ ElMessage.error('提交失败');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('提交失败,请检查网络连接');
|
|
|
+ }
|
|
|
+};
|
|
|
+const handlePageChange = (page: number) => {
|
|
|
+ currentPage.value = page
|
|
|
+}
|
|
|
+
|
|
|
+const showLendForm = ref(false)
|
|
|
+const lendFormRef = ref<FormInstance | null>(null)
|
|
|
+const lendForm = reactive({
|
|
|
+ T_sn: '',
|
|
|
+ Validationnumber: '',
|
|
|
+ T_remark: '',
|
|
|
+ LendUser: '',
|
|
|
+ T_project: ''
|
|
|
+})
|
|
|
+interface LendItem {
|
|
|
+ T_sn: string;
|
|
|
+ Validationnumber: string;
|
|
|
+ T_remark: string;
|
|
|
+ LendUser: string;
|
|
|
+ T_project: string;
|
|
|
+}
|
|
|
+
|
|
|
+const pendingLendItems = ref<LendItem[]>([])
|
|
|
+const lendPageSize = ref(8)
|
|
|
+const lendCurrentPage = ref(1)
|
|
|
|
|
|
+const paginatedPendingLendItems = computed(() => {
|
|
|
+ const start = (lendCurrentPage.value - 1) * lendPageSize.value
|
|
|
+ const end = start + lendPageSize.value
|
|
|
+ return pendingLendItems.value.slice(start, end)
|
|
|
+})
|
|
|
+
|
|
|
+const lendRules = reactive({
|
|
|
+ T_sn: [{ required: true, message: '请输入SN', trigger: 'blur' }],
|
|
|
+ Validationnumber: [{ required: true, message: '请输入设备编号', trigger: 'blur' }],
|
|
|
+ LendUser: [{ required: true, message: '请输入借出人', trigger: 'blur' }],
|
|
|
+ T_project: [{ required: true, message: '请输入借出项目', trigger: 'blur' }]
|
|
|
+})
|
|
|
+
|
|
|
+const submitLendForm = () => {
|
|
|
+ lendFormRef.value?.validate((valid: boolean): void => {
|
|
|
+ if (valid) {
|
|
|
+ const extractedSN = extractSN(lendForm.T_sn)
|
|
|
+ if (pendingLendItems.value.some((item: any) => item.T_sn === extractedSN)) {
|
|
|
+ ElMessage.warning('已存在相同的SN,不能添加')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ pendingLendItems.value.push({
|
|
|
+ T_sn: extractedSN,
|
|
|
+ Validationnumber: lendForm.Validationnumber,
|
|
|
+ T_remark: lendForm.T_remark,
|
|
|
+ LendUser: lendForm.LendUser,
|
|
|
+ T_project: lendForm.T_project
|
|
|
+ })
|
|
|
+ lendForm.T_sn = ''
|
|
|
+ lendForm.Validationnumber = ''
|
|
|
+ lendForm.T_remark = ''
|
|
|
+ lendForm.LendUser = ''
|
|
|
+ lendForm.T_project = ''
|
|
|
+ ElMessage.success('已添加到待提交列表')
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const removePendingLendItem = (index: number) => {
|
|
|
+ pendingLendItems.value.splice(index, 1)
|
|
|
+ ElMessage.success('已从待提交列表中移除')
|
|
|
+}
|
|
|
+
|
|
|
+const submitLendPendingItems = async () => {
|
|
|
+ if (pendingLendItems.value.length === 0) {
|
|
|
+ ElMessage.warning('暂无数据可提交')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 封装成数组对象以 JSON 的方式提交
|
|
|
+ // const requestData = JSON.stringify(pendingLendItems.value)
|
|
|
+ // 假设有一个API用于提交待借出的数据
|
|
|
+ // console.log(requestData)
|
|
|
+ const rest=JSON.parse(JSON.stringify(pendingLendItems.value));
|
|
|
+
|
|
|
+ const result:any = await validation_update(rest)
|
|
|
+ if (result.Code == 200) {
|
|
|
+ ElMessage.success('提交成功')
|
|
|
+ pendingLendItems.value = []
|
|
|
+ lendForm.T_sn = ''
|
|
|
+ lendForm.T_remark = ''
|
|
|
+ lendForm.LendUser = ''
|
|
|
+ lendForm.T_project = ''
|
|
|
+ searchHandle()
|
|
|
+ } else {
|
|
|
+ ElMessage.error('提交失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleLendPageChange = (page: number) => {
|
|
|
+ lendCurrentPage.value = page
|
|
|
+}
|
|
|
+
|
|
|
+const showEditForm = ref(false)
|
|
|
+const editFormRef = ref<FormInstance | null>(null)
|
|
|
+const editForm = reactive({
|
|
|
+ T_sn: '',
|
|
|
+ Validationnumber: '',
|
|
|
+ T_remark: '',
|
|
|
+ T_state:'',
|
|
|
+})
|
|
|
+
|
|
|
+const previewEdit = async (row: any) => {
|
|
|
+ showEditForm.value = true
|
|
|
+ const result: any = await readvaildation({ sn: row.T_sn })
|
|
|
+ if (result.Code === 200) {
|
|
|
+ Object.assign(editForm, result.Data)
|
|
|
+ } else {
|
|
|
+ ElMessage.error('获取数据失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const submitEditForm = () => {
|
|
|
+ editFormRef.value?.validate(async (valid: boolean): Promise<void> => {
|
|
|
+ if (valid) {
|
|
|
+ console.log("editForm",editForm)
|
|
|
+ const result:any = await updatevaildation(editForm)
|
|
|
+ if (result.Code === 200) {
|
|
|
+ ElMessage.success('编辑成功')
|
|
|
+ showEditForm.value = false
|
|
|
+ searchHandle()
|
|
|
+ } else {
|
|
|
+ ElMessage.error('编辑失败')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // do nothing
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<template>
|
|
|
+ <div class="list">
|
|
|
+ <TableBase ref="TableRef" :columns="columns" :requestApi="validation_List" :initParam="initParam" :pagination="true">
|
|
|
+ <template #table-header>
|
|
|
+ <div class="input-suffix">
|
|
|
+ <el-row :gutter="20" style="margin-bottom: 0">
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">设备编号:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="initParam.Validationnumber"
|
|
|
+ class="w-50 m-2"
|
|
|
+ type="text"
|
|
|
+ placeholder="设备编号搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">状态:</span>
|
|
|
+ <el-select v-model="initParam.T_state" class="w-50 m-2" clearable placeholder="请选择状态~">
|
|
|
+ <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">SN:</span>
|
|
|
+ <el-input
|
|
|
+ class="w-50 m-2"
|
|
|
+ v-model="initParam.T_sn"
|
|
|
+ type="text"
|
|
|
+ placeholder="按SN搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">模组imei:</span>
|
|
|
+ <el-input
|
|
|
+ class="w-50 m-2"
|
|
|
+ v-model="initParam.T_imei"
|
|
|
+ type="text"
|
|
|
+ placeholder="按模组imei搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">借出人</span>
|
|
|
+ <el-input
|
|
|
+ class="w-50 m-2"
|
|
|
+ v-model="initParam.LendUser"
|
|
|
+ type="text"
|
|
|
+ placeholder="按借出人搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">借出项目</span>
|
|
|
+ <el-input
|
|
|
+ class="w-50 m-2"
|
|
|
+ v-model="initParam.T_project"
|
|
|
+ type="text"
|
|
|
+ placeholder="按借出项目搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6">
|
|
|
+ <span class="inline-flex items-center">物联网卡号:</span>
|
|
|
+ <el-input
|
|
|
+ class="w-50 m-2"
|
|
|
+ v-model="initParam.T_iccid"
|
|
|
+ type="text"
|
|
|
+ placeholder="按物联网卡号搜索"
|
|
|
+ clearable
|
|
|
+ @change="searchHandle"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xl="6" :lg="6" :md="6" style="margin-top: auto;">
|
|
|
+ <el-button type="primary" @click="searchHandle">搜索</el-button>
|
|
|
+ <el-button type="primary" @click="showInStorageForm = true">入库</el-button>
|
|
|
+ <el-button type="primary" @click="showLendForm = true">借出</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #T_state="{ row }">
|
|
|
+ <el-tag v-if="row.T_state == 1" type="success" effect="dark"> 已出库</el-tag>
|
|
|
+ <el-tag v-if="row.T_state == 2" effect="dark">未出库</el-tag>
|
|
|
+ <el-tag v-if="row.T_state == 3" effect="dark" type="danger">已损坏</el-tag>
|
|
|
+ </template>
|
|
|
+ <template #right="{ row }">
|
|
|
+ <el-button link type="success" size="small" :icon="Edit" @click="previewEdit(row)">编辑</el-button>
|
|
|
+ <el-button link type="danger" size="small" :icon="Delete" @click="deleteFun(row.T_sn)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </TableBase>
|
|
|
+</div>
|
|
|
+ <!-- <InStorageForm ref="InStorageFormRef" :options="options" @onUpdateList="searchHandle" /> -->
|
|
|
+ <!-- <InStorageEdit ref="InStorageRef" :options="options" @onUpdateList="searchHandle" /> -->
|
|
|
+ <!-- 新增入库表单 -->
|
|
|
+ <el-dialog title="入库" v-model="showInStorageForm" width="50%">
|
|
|
+ <el-form :model="inStorageForm" :rules="rules" ref="inStorageFormRef">
|
|
|
+ <el-form-item label="SN" prop="T_sn">
|
|
|
+ <el-input v-model="inStorageForm.T_sn" placeholder="请输入SN"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备编号" prop="Validationnumber">
|
|
|
+ <el-input v-model="inStorageForm.Validationnumber" placeholder="请输入设备编号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="inStorageForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <!-- 新增数据条数提示 -->
|
|
|
+ <div style="margin: 10px 0">
|
|
|
+ <span>当前待提交数据条数: {{ pendingItems.length }}</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="paginatedPendingItems" style="width: 100%; margin-top: 20px">
|
|
|
+ <el-table-column type="index" label="序号" width="80"></el-table-column>
|
|
|
+ <!-- 添加序号列 -->
|
|
|
+ <el-table-column prop="T_sn" label="SN"></el-table-column>
|
|
|
+ <el-table-column prop="Validationnumber" label="设备编号"></el-table-column>
|
|
|
+ <el-table-column prop="T_remark" label="备注"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="danger" size="small" @click="removePendingItem(scope.$index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="pendingItems.length"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :current-page="currentPage"
|
|
|
+ @current-change="handlePageChange"
|
|
|
+ style="margin-top: 20px; text-align: right"
|
|
|
+ />
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="showInStorageForm = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitInStorageForm">添加到暂存</el-button>
|
|
|
+ <!-- 新增提交按钮 -->
|
|
|
+ <el-button type="primary" @click="submitInStoragePendingItems">提交</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 新增借出表单 -->
|
|
|
+ <el-dialog title="借出" v-model="showLendForm" width="50%">
|
|
|
+ <el-form :model="lendForm" :rules="lendRules" ref="lendFormRef">
|
|
|
+ <el-form-item label="SN" prop="T_sn">
|
|
|
+ <el-input v-model="lendForm.T_sn" placeholder="请输入SN"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="lendForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 新增借出人和借出项目 -->
|
|
|
+ <el-form-item label="借出人" prop="borrower">
|
|
|
+ <el-input v-model="lendForm.LendUser" placeholder="请输入借出人"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="借出项目" prop="project">
|
|
|
+ <el-input v-model="lendForm.T_project" placeholder="请输入借出项目"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <!-- 新增数据条数提示 -->
|
|
|
+ <div style="margin: 10px 0">
|
|
|
+ <span>当前待提交数据条数: {{ pendingLendItems.length }}</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="paginatedPendingLendItems" style="width: 100%; margin-top: 20px">
|
|
|
+ <el-table-column type="index" label="序号" width="80"></el-table-column>
|
|
|
+ <!-- 添加序号列 -->
|
|
|
+ <el-table-column prop="T_sn" label="SN"></el-table-column>
|
|
|
+ <el-table-column prop="Validationnumber" label="设备编号"></el-table-column>
|
|
|
+ <el-table-column prop="T_remark" label="备注"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="danger" size="small" @click="removePendingLendItem(scope.$index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="pendingLendItems.length"
|
|
|
+ :page-size="lendPageSize"
|
|
|
+ :current-page="lendCurrentPage"
|
|
|
+ @current-change="handleLendPageChange"
|
|
|
+ style="margin-top: 20px; text-align: right"
|
|
|
+ />
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="showLendForm = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitLendForm">添加到暂存</el-button>
|
|
|
+ <!-- 新增提交按钮 -->
|
|
|
+ <el-button type="primary" @click="submitLendPendingItems">提交</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="编辑" v-model="showEditForm" width="50%">
|
|
|
+ <el-form :model="editForm" ref="editFormRef">
|
|
|
+ <el-form-item label="SN" prop="T_sn">
|
|
|
+ <el-input v-model="editForm.T_sn" placeholder="请输入SN"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备编号" prop="Validationnumber">
|
|
|
+ <el-input v-model="editForm.Validationnumber" placeholder="请输入设备编号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-select v-model="editForm.T_state" class="w-50 m-2" clearable placeholder="请选择状态~">
|
|
|
+ <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input v-model="editForm.T_remark" type="textarea" placeholder="请输入备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="showEditForm = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitEditForm">提交</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+@import '@/styles/var.scss';
|
|
|
|
|
|
+.list {
|
|
|
+ @include f-direction;
|
|
|
+}
|
|
|
+// .input-suffix {
|
|
|
+// width: 100%;
|
|
|
+// .w-50 {
|
|
|
+// width: 33.33%;
|
|
|
+// }
|
|
|
+// }
|
|
|
</style>
|