From f90fbbc76d23340e4568dd4dadbab5f7f02a030f Mon Sep 17 00:00:00 2001 From: pengwei <2071057782@qq.com> Date: 星期一, 24 三月 2025 14:49:24 +0800 Subject: [PATCH] 3.24功能新增 --- 项目代码/client/src/views/tts/BasicInformation/Basicinformation.vue | 719 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 554 insertions(+), 165 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" index e02c1bb..af304b1 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" @@ -12,7 +12,7 @@ :class="['item', isactive == 2 ? 'isactive' : '']" @click="changeactive(2)" > - 淇℃伅鍒嗙被 + 宸ュ叿鍒楄〃 </div> </div> <div class="serch"> @@ -40,9 +40,23 @@ /> </div> <div class="serch_box"> - <div class="serchb">鍏ㄥ眬鎼滅储</div> + <div class="serchb"> + <el-select + v-model="queryForm.selectType" + placeholder="璇烽�夋嫨" + size="small" + style="width: 100%; height: 100%; font-size: 0.15rem" + > + <el-option + v-for="item in selectoptions" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + </div> <input - v-model="queryForm.selectName" + v-model="queryForm.selectInput" placeholder="璇疯緭鍏ュ叧閿瘝鎼滅储" style="border-left: 0.06rem solid #e2e2e2" /> @@ -51,9 +65,12 @@ type="primary" size="small" style="margin-left: 0.98rem; height: 2rem" + @click="handleQuery" >鏌ヨ</el-button > - <el-button size="small" style="height: 2rem">閲嶇疆</el-button> + <el-button size="small" style="height: 2rem" @click="resetQuery" + >閲嶇疆</el-button + > </div> <div class="btns"> <div style="display: flex; align-items: center"> @@ -62,7 +79,7 @@ v-if="isactive == 1" type="primary" size="small" - @click="dialogVisible = true" + @click="Useradd" style=" width: 5.5rem; height: 2rem; @@ -70,15 +87,15 @@ display: flex; align-items: center; " - ><el-icon style="margin-right: 0.2rem"><Plus /></el-icon + ><el-icon style="margin-right: 0.2rem"> <Plus /> </el-icon >鏂板缓</el-button > - <!-- 鐢ㄦ埛瑙掕壊鏂板缓 --> + <!-- 宸ュ叿鍒楄〃鏂板缓 --> <el-button v-if="isactive == 2" type="primary" size="small" - @click="dialogVisible1 = true" + @click="addTool" style=" width: 5.5rem; height: 2rem; @@ -86,10 +103,10 @@ display: flex; align-items: center; " - ><el-icon style="margin-right: 0.2rem"><Plus /></el-icon + ><el-icon style="margin-right: 0.2rem"> <Plus /> </el-icon >鏂板缓</el-button > - <el-button + <!-- <el-button size="small" style="width: 5.5rem; height: 2rem; font-size: 0.88rem" >鎵归噺瀵煎叆</el-button @@ -97,9 +114,11 @@ <el-button size="small" style="width: 5.5rem; height: 2rem; font-size: 0.88rem" + @click="printExcel" >鎵归噺瀵煎嚭</el-button - > + > --> <el-button + @click="deleteAll" size="small" style="width: 5.5rem; height: 2rem; font-size: 0.88rem" >鎵归噺鍒犻櫎</el-button @@ -109,6 +128,7 @@ <div style="margin-top: 1rem; height: 100%"> <!-- 淇℃伅鍒楄〃 --> <el-table + empty-text="鏆傛棤鏁版嵁" v-if="isactive == 1" :data="tableData" style="width: 100%" @@ -124,24 +144,28 @@ fontSize: '0.88rem', height: '3rem', }" + @select="InfoSelectionChange" > <el-table-column type="selection" align="center" /> - <el-table-column prop="address" label="淇℃伅鍚嶇О" align="center" /> - <el-table-column prop="name" label="瑙勬牸鍨嬪彿" align="center" /> - <el-table-column prop="address" label="鍗曚綅" align="center" /> - <el-table-column prop="address" label="鎵�灞炲垎绫�" align="center" /> - <el-table-column prop="address" label="鍒涘缓鏃ユ湡" align="center" /> - <el-table-column prop="address" label="鎿嶄綔" align="center"> - <template #default=""> - <el-button size="small" type="text" @click="Edit">缂栬緫</el-button> + <el-table-column prop="articleName" label="淇℃伅鍚嶇О" align="center" /> + <el-table-column prop="articleType" label="瑙勬牸鍨嬪彿" align="center" /> + <el-table-column prop="articleUnit" label="鍗曚綅" align="center" /> + <!-- <el-table-column prop="category" label="鎵�灞炲垎绫�" align="center" /> --> + <el-table-column prop="createDate" label="鍒涘缓鏃ユ湡" align="center" /> + <el-table-column label="鎿嶄綔" align="center"> + <template #default="scope"> + <el-button size="small" type="text" @click="Useredit(scope.row)" + >缂栬緫</el-button + > </template> </el-table-column> </el-table> - <!-- 淇℃伅鍒嗙被 --> + <!-- 宸ュ叿鍒楄〃 --> <el-table + empty-text="鏆傛棤鏁版嵁" v-if="isactive == 2" - :data="tableData" + :data="toolList" style="width: 100%" :header-cell-style="{ background: 'rgba(250,250,250,1)', @@ -155,16 +179,24 @@ fontSize: '0.88rem', height: '3rem', }" + @select="ToolSelectionChange" > <el-table-column type="selection" align="center" /> - <el-table-column prop="address" label="鍒嗙被鍚嶇О" align="center" /> - <el-table-column prop="address" label="澶囨敞" align="center" /> - <el-table-column prop="address" label="鍒涘缓鏃ユ湡" align="center" /> + <el-table-column prop="toolName" label="宸ュ叿鍚嶇О" align="center" /> + <el-table-column + prop="specification" + label="瑙勬牸鍨嬪彿" + align="center" + /> + <el-table-column prop="toolUnit" label="鍗曚綅" align="center" /> + <!-- <el-table-column prop="" label="鎵�灞炲垎绫�" align="center" /> --> + <el-table-column prop="toolremark" label="澶囨敞" align="center" /> + <el-table-column prop="createtime" label="鍒涘缓鏃ユ湡" align="center" /> <el-table-column prop="address" label="鎿嶄綔" align="center"> - <template #default=""> + <template #default="scope"> <span style="color: blue; font-size: 0.88rem; cursor: pointer" - @click="Findtorque" + @click="editTool(scope.row)" >缂栬緫</span > </template></el-table-column @@ -184,7 +216,11 @@ size="small" background layout="prev, pager, next" - :total="1" + :current-page="pageQuery.page" + :page-size="pageQuery.rows" + :total="pageTotal" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" /> </div> </div> @@ -197,6 +233,7 @@ :before-close="handleClose" :show-close="false" :align-center="true" + @close="resetForm(formRef)" > <template #title> <div @@ -212,10 +249,17 @@ > </div> </template> - <el-form :model="form" label-width="auto" label-position="top"> + <el-form + :model="forminfo" + label-width="auto" + label-position="top" + :rules="rules" + ref="formRef" + :hide-required-asterisk="true" + > <el-row :gutter="20"> <el-col :span="8"> - <el-form-item> + <el-form-item prop="articleName"> <template #label> <div style="display: flex; align-items: flex-end"> <span style="color: red; margin-right: 0.2rem">*</span> @@ -225,11 +269,15 @@ > </div> </template> - <el-input size="small" v-model="form.name" placeholder="璇疯緭鍏�" /> + <el-input + size="small" + v-model="forminfo.articleName" + placeholder="璇疯緭鍏�" + /> </el-form-item> </el-col> <el-col :span="8"> - <el-form-item> + <el-form-item prop="articleType"> <template #label> <div style="display: flex; align-items: flex-end"> <span style="color: red; margin-right: 0.2rem">*</span> @@ -239,11 +287,15 @@ > </div> </template> - <el-input size="small" v-model="form.name" placeholder="璇疯緭鍏�" /> + <el-input + size="small" + v-model="forminfo.articleType" + placeholder="璇疯緭鍏�" + /> </el-form-item> </el-col> <el-col :span="8"> - <el-form-item> + <el-form-item prop="articleUnit"> <template #label> <div style="display: flex; align-items: flex-end"> <span style="color: red; margin-right: 0.2rem">*</span> @@ -253,44 +305,30 @@ > </div> </template> - <el-input size="small" v-model="form.name" placeholder="璇疯緭鍏�" /> + <el-input + size="small" + v-model="forminfo.articleUnit" + placeholder="璇疯緭鍏�" + /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> - <el-col :span="8"> - <el-form-item> - <template #label> - <div style="display: flex; align-items: flex-end"> - <span style="color: red; margin-right: 0.2rem">*</span> - <span - style="font-size: 0.88rem; color: black; font-weight: bold" - >鎵�灞炲垎绫�</span - > - </div> - </template> - <el-select v-model="value" placeholder="璇烽�夋嫨" size="small"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - /> - </el-select> - </el-form-item> - </el-col> <el-col :span="16"> - <el-form-item> + <el-form-item prop="articleRemark"> <template #label> <div style="display: flex; align-items: flex-end"> - <span style="color: red; margin-right: 0.2rem">*</span> <span style="font-size: 0.88rem; color: black; font-weight: bold" >澶囨敞</span > </div> </template> - <el-input size="small" v-model="form.name" placeholder="璇疯緭鍏�" /> + <el-input + size="small" + v-model="forminfo.articleremark" + placeholder="璇疯緭鍏�" + /> </el-form-item> </el-col> </el-row> @@ -307,7 +345,7 @@ <el-button size="small" type="primary" - @click="dialogVisible = false" + @click="CreateInformation(formRef)" style="height: 2rem; font-size: 0.88rem" > 淇濆瓨 @@ -316,14 +354,15 @@ </template> </el-dialog> - <!-- 淇℃伅鍒嗙被鏂板缓/缂栬緫 --> + <!-- 鏂板缓宸ュ叿/缂栬緫宸ュ叿 --> <el-dialog v-model="dialogVisible1" title="" - width="20%" + width="60%" :before-close="handleClose" :show-close="false" :align-center="true" + @close="resetForm(ruleFormRef)" > <template #title> <div @@ -335,43 +374,93 @@ > <span style="color: rgb(16, 16, 16); font-size: 1rem; font-weight: bold" - >淇℃伅鍒嗙被</span + >宸ュ叿淇℃伅</span > </div> </template> - <el-form :model="form" label-width="auto" label-position="top"> - <el-form-item> - <template #label> - <div style="display: flex; align-items: flex-end"> - <span style="color: red; margin-right: 0.2rem">*</span> - <span style="font-size: 0.88rem; color: black; font-weight: bold" - >鍒嗙被鍚嶇О</span - > - </div> - </template> - <el-input - style="height: 2rem" - size="small" - v-model="form.name" - placeholder="璇疯緭鍏�" - /> - </el-form-item> - <el-form-item> - <template #label> - <div style="display: flex; align-items: flex-end"> - <span style="font-size: 0.88rem; color: black; font-weight: bold" - >澶囨敞</span - > - </div> - </template> - <el-input - type="textarea" - :rows="5" - size="small" - v-model="form.name" - placeholder="璇疯緭鍏�" - /> - </el-form-item> + <el-form + :model="formtool" + label-width="auto" + label-position="top" + ref="ruleFormRef" + :rules="toolRules" + :hide-required-asterisk="true" + > + <el-row :gutter="20"> + <el-col :span="8"> + <el-form-item prop="toolName"> + <template #label> + <div style="display: flex; align-items: flex-end"> + <span style="color: red; margin-right: 0.2rem">*</span> + <span + style="font-size: 0.88rem; color: black; font-weight: bold" + >宸ュ叿鍚嶇О</span + > + </div> + </template> + <el-input + size="small" + v-model="formtool.toolName" + placeholder="璇疯緭鍏�" + /> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item prop="specification"> + <template #label> + <div style="display: flex; align-items: flex-end"> + <span style="color: red; margin-right: 0.2rem">*</span> + <span + style="font-size: 0.88rem; color: black; font-weight: bold" + >瑙勬牸鍨嬪彿</span + > + </div> + </template> + <el-input + size="small" + v-model="formtool.specification" + placeholder="璇疯緭鍏�" + /> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item prop="toolUnit"> + <template #label> + <div style="display: flex; align-items: flex-end"> + <span style="color: red; margin-right: 0.2rem">*</span> + <span + style="font-size: 0.88rem; color: black; font-weight: bold" + >鍗曚綅</span + > + </div> + </template> + <el-input + size="small" + v-model="formtool.toolUnit" + placeholder="璇疯緭鍏�" + /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="20"> + <el-col :span="16"> + <el-form-item prop="toolremark"> + <template #label> + <div style="display: flex; align-items: flex-end"> + <span + style="font-size: 0.88rem; color: black; font-weight: bold" + >澶囨敞</span + > + </div> + </template> + <el-input + size="small" + v-model="formtool.toolremark" + placeholder="璇疯緭鍏�" + /> + </el-form-item> + </el-col> + </el-row> </el-form> <template #footer> <div class="dialog-footer" style="text-align: center"> @@ -385,7 +474,7 @@ <el-button size="small" type="primary" - @click="dialogVisible1 = false" + @click="addToolApi(ruleFormRef)" style="height: 2rem; font-size: 0.88rem" > 淇濆瓨 @@ -396,104 +485,391 @@ </div> </template> <script setup> -import { ref, reactive } from "vue"; +import { ref, reactive, onMounted, toRef } from "vue"; import { ElMessage, ElMessageBox } from "element-plus"; -const queryForm = reactive({ +import { formatTime } from "@/utils/index.js"; +import { + getBasicinformation, + addBasicinformation, + editBasicinformation, + getToolData, + addToolData, + editToolData, + deleteToolData, + deleteBasicinformation, + ExportApi, + ExportTool, +} from "@/api/newapi/Basicinformation.js"; +// 鍒濆鍖栨暟鎹� +const obj = { selectName: "", selectTime: [], // 鏃堕棿鑼冨洿 -}); - + selectType: "", //閫夋嫨鐨勭被鍨� + selectInput: "", //杈撳叆鐨勬暟鎹� +}; +//鎼滅储浼犵殑鏁版嵁 +const queryForm = toRef({ ...obj }); const tableData = ref([]); +const toolList = ref([]); -const options = ref([]); -const props = { multiple: true }; - -const table = ref(false); -const form = reactive({}); const isactive = ref(1); -const claimdialogVisible = ref(false); const dialogVisible = ref(false); const dialogVisible1 = ref(false); -const TorquedialogVisible = ref(false); -const activities = [ - { - content: "1.1宸ュ墠鍑嗗", - timestamp: "2018-04-15", - }, - { - content: "2.1鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-13", - }, - { - content: "2.2鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.3鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, - { - content: "2.4鐗靛紩鐢垫満鐢电紗瀹夎锛堜粎鍔ㄨ溅杞悜鏋讹級", - timestamp: "2018-04-11", - }, -]; +const selectoptions = ref([]); +const infoOpitions = ref([ + { + value: "articleName", + label: "淇℃伅鍚嶇О", + }, + { + value: "articleType", + label: "瑙勬牸鍨嬪彿", + }, +]); + +const toolsOpitions = ref([ + { + value: "toolName", + label: "宸ュ叿鍚嶇О", + }, + { + value: "specification", + label: "瑙勬牸鍨嬪彿", + }, +]); + +const forminfo = ref({ + articleName: "", + articleType: "", + articleUnit: "", + articleremark: "", + createDate: formatTime(new Date()), //鍒涘缓鏃堕棿 + creater: JSON.parse(localStorage.getItem("user")).userName, //鍒涘缓浜� +}); +const formtool = ref({ + toolName: "", + specification: 0, + toolUnit: "", + toolremark: "", + createDate: formatTime(new Date()), //鍒涘缓鏃堕棿 + creater: JSON.parse(localStorage.getItem("user")).userName, //鍒涘缓浜� + modifier: JSON.parse(localStorage.getItem("user")).userName, //淇敼浜� + modifyDate: formatTime(new Date()), //淇敼鏃堕棿 +}); + +const toolRules = reactive({ + toolName: [{ required: true, message: "璇疯緭鍏ュ伐鍏峰悕绉�", trigger: "blur" }], + specification: [{ required: true, message: "璇疯緭鍏ヨ鏍�", trigger: "blur" }], + toolUnit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: "blur" }], + toolremark: [{ required: true, message: "璇疯緭鍏ュ娉�", trigger: "blur" }], +}); +const rules = reactive({ + articleName: [{ required: true, message: "璇疯緭鍏ュ伐鍏峰悕绉�", trigger: "blur" }], + articleType: [{ required: true, message: "璇疯緭鍏ヨ鏍�", trigger: "blur" }], + articleUnit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: "blur" }], + articleremark: [{ required: true, message: "璇疯緭鍏ュ娉�", trigger: "blur" }], +}); +const ruleFormRef = ref(); +const formRef = ref(); +//鏀瑰彉鐘舵�� +selectoptions.value = infoOpitions.value; const changeactive = (index) => { isactive.value = index; + if (isactive.value == 1) { + selectoptions.value = infoOpitions.value; + } else { + selectoptions.value = toolsOpitions.value; + } + initData(); }; -function cancelClick() { - table.value = false; -} -function confirmClick() { - table.value = false; -} -// 鏌ョ湅璇︽儏 -const Findmore = () => { +const infoType = ref("鏂板缓"); + +const Useradd = () => { + infoType.value = "鏂板缓"; dialogVisible.value = true; }; -// 鏌ョ湅鍔涚煩 -const Findtorque = () => { - TorquedialogVisible.value = true; +const Useredit = (val) => { + let data = Object.assign({}, val); + forminfo.value = data; + infoType.value = "缂栬緫"; + dialogVisible.value = true; }; + +//鏂板缓淇℃伅鍒楄〃 +const CreateInformation = async (formEl) => { + if (!formEl) return; + await formEl.validate((valid, fields) => { + if (valid) { + if (infoType.value == "鏂板缓") { + addBasicinformation(forminfo.value).then((res) => { + ElMessage({ + message: "鏂板缓鎴愬姛", + type: "success", + }); + dialogVisible.value = false; + initData(); + }); + } else { + editBasicinformation(forminfo.value).then((res) => { + ElMessage({ + message: "淇敼鎴愬姛", + type: "success", + }); + dialogVisible.value = false; + initData(); + }); + } + } else { + console.log("error submit!", fields); + } + }); +}; + +const toolType = ref("鏂板缓"); +const addTool = () => { + toolType.value = "鏂板缓"; + dialogVisible1.value = true; +}; +const editTool = (val) => { + let data = Object.assign({}, val); + formtool.value = data; + toolType.value = "缂栬緫"; + dialogVisible1.value = true; +}; +//鏂板缓宸ュ叿 +const addToolApi = async (formEl) => { + if (!formEl) return; + await formEl.validate((valid, fields) => { + if (valid) { + if (toolType.value == "鏂板缓") { + addToolData(formtool.value).then((res) => { + ElMessage({ + message: "鏂板缓鎴愬姛", + type: "success", + }); + dialogVisible1.value = false; + initData(); + }); + } else { + editToolData(formtool.value).then((res) => { + ElMessage({ + message: "淇敼鎴愬姛", + type: "success", + }); + dialogVisible1.value = false; + initData(); + }); + } + } else { + console.log("error submit!", fields); + } + }); +}; + +//鑾峰彇宸ュ叿琛ㄤ俊鎭� +// const getTool = () => { +// const startTime = formatTime(queryForm.value.selectTime[0]); +// const endTime = formatTime(queryForm.value.selectTime[1]); +// const filter = [ +// { name: "dispatchtime", value: startTime, displayType: "ThanOrEqual" }, +// { name: "dispatchtime", value: endTime, displayType: "LessOrEqual" }, +// ]; +// getToolData({ +// ...pageQuery.value, +// filter, +// }).then((res) => { +// toolList.value = res.rows; +// pageTotal.value = res.total; +// }); +// }; +//鎵归噺鍒犻櫎 +const ids = ref([]); +const InfoSelectionChange = (val) => { + ids.value = []; + ids.value = val.map((item) => item.id); +}; +const ToolSelectionChange = (val) => { + ids.value = []; + ids.value = val.map((item) => item.id); +}; +const deleteAll = () => { + if (ids.value.length == 0) { + ElMessage({ message: "璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁", type: "error" }); + return; + } + if (isactive.value == 1) { + deleteBasicinformation(ids.value).then((res) => { + ElMessage({ message: "鍒犻櫎鎴愬姛", type: "success" }); + initData(); + }); + } else { + deleteToolData(ids.value).then((res) => { + ElMessage({ message: "鍒犻櫎鎴愬姛", type: "success" }); + initData(); + }); + } +}; + +const printExcel = () => { + // 鏌ヨ鏉′欢 + const startTime = formatTime(queryForm.value.selectTime[0]); + const endTime = formatTime(queryForm.value.selectTime[1]); + const filter = [ + { + name: queryForm.value.selectType, + value: queryForm.value.selectInput, + displayType: "like", + }, + { + name: "pustatus", + value: queryForm.value.selectName, + displayType: "String", + }, + { name: "createDate", value: startTime, displayType: "ThanOrEqual" }, + { name: "createDate", value: endTime, displayType: "LessOrEqual" }, + ]; + if (isactive.value == 1) { + ExportApi({ + ...pageQuery.value, + filter, + }); + } + if (isactive.value == 2) { + ExportTool({ + ...pageQuery.value, + filter, + }); + } +}; + +//鍒嗛〉璇锋眰鍙傛暟 +const pageQuery = ref({ + page: 1, //褰撳墠椤甸潰 + rows: 10, //姣忛〉鏄剧ず鏉℃暟 + order: "desc", //鎺掑簭鏂瑰紡 + sort: "", //鎺掑簭瀛楁 + wheres: "", //鏉′欢鏌ヨ +}); + +//鍒嗛〉椤甸潰澶у皬鏀瑰彉 +const handleSizeChange = (val) => { + pageQuery.value.rows = val; + initData(); +}; + +//鍒嗛〉椤甸潰鏀瑰彉 +const handleCurrentChange = (val) => { + pageQuery.value.page = val; + initData(); +}; +const pageTotal = ref(0); +//鍒濆鍖栨暟鎹� +const initData = () => { + // 鏌ヨ鏉′欢 + const startTime = formatTime(queryForm.value.selectTime[0]); + const endTime = formatTime(queryForm.value.selectTime[1]); + const filter = [ + { + name: "grouptype", + value: queryForm.value.selectType, + displayType: "String", + }, + { + name: queryForm.value.selectType, + value: queryForm.value.selectInput, + displayType: "like", + }, + { + name: "pustatus", + value: queryForm.value.selectName, + displayType: "String", + }, + { name: "dispatchtime", value: startTime, displayType: "ThanOrEqual" }, + { name: "dispatchtime", value: endTime, displayType: "LessOrEqual" }, + ]; + if (isactive.value == 1) { + getBasicinformation({ + ...pageQuery.value, + filter, + }).then((res) => { + tableData.value = res.rows; + pageTotal.value = res.total; + }); + } else { + getToolData({ + ...pageQuery.value, + filter, + }).then((res) => { + toolList.value = res.rows; + pageTotal.value = res.total; + }); + } +}; + +//鏁版嵁妫�绱簨浠� +const handleQuery = () => { + pageQuery.value.page = 1; + initData(); +}; +//閲嶇疆鏂规硶 +const resetQuery = () => { + queryForm.value = Object.assign({}, obj); + pageQuery.value.page = 1; + initData(); +}; + +//閲嶇疆琛ㄥ崟 +const resetForm = (formEl) => { + if (!formEl) return; + formEl.resetFields(); + forminfo.value = Object.assign( + {}, + { + articleName: "", + articleType: "", + articleUnit: "", + articleremark: "", + createDate: formatTime(new Date()), //鍒涘缓鏃堕棿 + creater: JSON.parse(localStorage.getItem("user")).userName, //鍒涘缓浜� + } + ); + formtool.value = Object.assign( + {}, + { + toolName: "", + specification: 0, + toolUnit: "", + toolremark: "", + createDate: formatTime(new Date()), //鍒涘缓鏃堕棿 + creater: JSON.parse(localStorage.getItem("user")).userName, //鍒涘缓浜� + modifier: JSON.parse(localStorage.getItem("user")).userName, //淇敼浜� + modifyDate: formatTime(new Date()), //淇敼鏃堕棿 + } + ); +}; + +onMounted(() => { + initData(); +}); </script> <style lang="scss" scoped> .Basicinformation { display: flex; background-color: #fff; + .content { width: 100%; display: flex; flex-direction: column; + .checkbox { width: 11rem; display: flex; justify-content: space-between; margin-top: 1rem; margin-left: 1.31rem; + .item { width: 5rem; height: 1.88rem; @@ -505,20 +881,24 @@ line-height: 1.88rem; cursor: pointer; } + .isactive { background-color: rgba(16, 16, 16, 1); color: rgba(255, 255, 255, 1); } } + .serch { display: flex; margin-top: 1.31rem; align-items: center; + .time_box { display: flex; align-items: center; text-align: center; margin-left: 0.98rem; + .time { box-sizing: border-box; width: 6.88rem; @@ -532,24 +912,26 @@ justify-content: center; } } + .serch_box { display: flex; align-items: center; text-align: center; margin-left: 0.98rem; border-radius: 0.38rem; + .serchb { box-sizing: border-box; width: 6.88rem; height: 2rem; text-align: center; - border: 0.06rem solid rgba(222, 222, 222, 1); border-radius: 0.25rem 0 0 0.25rem; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; } + input { box-sizing: border-box; outline: none; @@ -562,6 +944,7 @@ } } } + .btns { display: flex; justify-content: space-between; @@ -572,17 +955,20 @@ box-sizing: border-box; } } + .my-header { height: 3.84rem; display: flex; justify-content: space-between; border-bottom: 0.06rem solid rgba(233, 233, 233, 1); } + .avatar-uploader .avatar { width: 7rem; height: 7rem; display: block; } + :deep(.avatar-uploader .el-upload) { width: 7rem; height: 7rem; @@ -593,10 +979,12 @@ overflow: hidden; transition: var(--el-transition-duration-fast); } + :deep(.el-upload-list__item) { width: 7rem; height: 7rem; } + .avatar-uploader .el-upload:hover { border-color: var(--el-color-primary); } @@ -614,6 +1002,7 @@ .confirmButtonClass { margin-right: 10px; } + .el-message-box .el-message-box__btns { flex-direction: row-reverse !important; justify-content: normal !important; -- Gitblit v1.9.3