From 3bada36496edc701f37daf59cd7fe1020b155f38 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期一, 17 二月 2025 13:22:00 +0800 Subject: [PATCH] 标准库调整 --- src/views/standard/standardLibrary/index.vue | 482 ---------------------------------------------------- 1 files changed, 6 insertions(+), 476 deletions(-) diff --git a/src/views/standard/standardLibrary/index.vue b/src/views/standard/standardLibrary/index.vue index d57f377..c30d290 100644 --- a/src/views/standard/standardLibrary/index.vue +++ b/src/views/standard/standardLibrary/index.vue @@ -1,7 +1,8 @@ <style scoped> .standard { - padding: 10px 0; + padding-top: 10px; display: flex; + height: calc(100vh - 90px); } .left { @@ -43,7 +44,7 @@ .right { margin-left: 5px; - width: calc(100% - 365px); + width: calc(100% - 350px); height: calc(100% - 40px); } @@ -306,7 +307,7 @@ <el-button v-if="isShowCopy" size="small" - style="position: absolute; right: 50px; top: 1px" + style="position: absolute; right: 20px; top: 1px" type="primary" @click="openCopyDia" >鎵归噺澶嶅埗</el-button @@ -596,6 +597,7 @@ </el-pagination> </el-row> </div> + <el-dialog :visible.sync="addDia" title="鍒嗙被娣诲姞" width="400px"> <div class="body"> <el-row style="line-height: 50px"> @@ -646,305 +648,6 @@ >纭� 瀹�</el-button > </span> - </el-dialog> - <el-dialog - :visible.sync="moreEdit" - class="more-edit" - title="鎵归噺缂栬緫" - width="90%" - > - <div - class="body" - style="display: flex; flex-direction: column; height: 85vh" - > - <div class="search"> - <div class="search-item"> - <el-row style="width: 25%; margin-bottom: 16px"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 瑕佹眰鍊硷細</el-col - > - <el-col :span="16"> - <el-input - v-model="moreInfo.ask" - :disabled="moreSelects.length == 0" - clearable - size="small" - ></el-input> - </el-col> - </el-row> - <el-row style="width: 25%; margin-bottom: 16px"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 瑕佹眰鎻忚堪锛�</el-col - > - <el-col - :span="16" - style="display: flex; align-items: flex-start; height: 100%" - > - <el-input - v-model="moreInfo.tell" - :autosize="{ minRows: 1, maxRows: 3 }" - :disabled="moreSelects.length == 0" - clearable - size="small" - type="textarea" - ></el-input> - </el-col> - </el-row> - <el-row style="width: 25%; margin-bottom: 16px"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 璇曢獙鏂规硶锛�</el-col - > - <el-col :span="16"> - <el-select - v-model="moreInfo.methodS" - :disabled="moreSelects.length == 0" - clearable - filterable - size="small" - style="width: 100%" - > - <el-option - v-for="(a, ai) in methodList" - :key="ai" - :label="a.label" - :value="a.value" - ></el-option> - </el-select> - </el-col> - </el-row> - <el-row style="width: 25%; margin-bottom: 16px"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 鍗曚环(鍏�)锛�</el-col - > - <el-col :span="16"> - <el-input - v-model="moreInfo.price" - :disabled="moreSelects.length == 0" - clearable - size="small" - ></el-input> - </el-col> - </el-row> - <el-row style="width: 25%"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 宸ユ椂绯绘暟锛�</el-col - > - <el-col :span="16"> - <el-input - v-model="moreInfo.manHour" - :disabled="moreSelects.length == 0" - clearable - size="small" - ></el-input> - </el-col> - </el-row> - <el-row style="width: 25%"> - <el-col :span="6" style="text-align: right"> - <!-- <span class="required-span">* </span> --> - 妯℃澘锛�</el-col - > - <el-col :span="16"> - <el-select - v-model="moreInfo.templateId" - :disabled="moreSelects.length == 0" - filterable - placeholder="妯℃澘" - size="small" - style="width: 100%" - > - <el-option - v-for="(a, ai) in templateList" - :key="ai" - :label="a.name" - :value="a.id" - ></el-option> - </el-select> - </el-col> - </el-row> - <el-row style="width: 25%"> - <el-col :span="6" style="text-align: right"> 鏄惁鍚敤锛�</el-col> - <el-col :span="16"> - <el-select - v-model="moreInfo.state" - :disabled="moreSelects.length == 0" - clearable - filterable - placeholder="妯℃澘" - size="small" - style="width: 100%" - > - <el-option :value="1" label="鍚敤"></el-option> - <el-option :value="0" label="涓嶅惎鐢�"></el-option> - </el-select> - </el-col> - </el-row> - <el-row style="width: 100%; margin-top: 8px"> - <el-col - :span="24" - style="display: flex; align-items: center; justify-content: end" - > - <el-button size="small" type="danger" @click="clearProduct(1)" - >閲嶇疆鍗曚环</el-button - > - <el-button size="small" type="danger" @click="clearProduct(2)" - >閲嶇疆宸ユ椂绯绘暟</el-button - > - <el-button - size="small" - type="primary" - @click="sectionUp(moreSelects)" - >璁剧疆鍖洪棿</el-button - > - <el-button size="small" @click="moreEdit = false" - >鍙� 娑�</el-button - > - <el-button - :loading="moreEditLoad" - size="small" - type="primary" - @click="subMoreEdit" - >淇� 瀛�</el-button - > - </el-col> - </el-row> - </div> - </div> - <div v-loading="productTableLoading0" style="flex: 1; overflow-y: auto"> - <el-table - ref="productTable0" - :data="productList0" - :fit="true" - :row-key="(row) => row.id" - border - header-row-class-name="header-class" - height="96%" - highlight-current-row - stripe - style="width: 100%" - tooltip-effect="dark" - @select="handleSelectionChange0" - @select-all="handleSelectAll0" - @filter-change="filterHandler" - > - <el-table-column type="selection" width="50"> </el-table-column> - <el-table-column - label="浜у搧" - min-width="100" - prop="sample" - show-overflow-tooltip - ></el-table-column> - <el-table-column - label="鍨嬪彿" - min-width="100" - prop="model" - show-overflow-tooltip - ></el-table-column> - <el-table-column - :filter-multiple="false" - :filters="filters0" - column-key="inspectionItem" - filter-placement="bottom-start" - label="妫�楠岄」" - min-width="140" - prop="inspectionItem" - show-overflow-tooltip - ></el-table-column> - <el-table-column - :filter-multiple="false" - :filters="filters1" - column-key="inspectionItemSubclass" - filter-placement="bottom-start" - label="妫�楠岄」瀛愰」" - min-width="140" - prop="inspectionItemSubclass" - show-overflow-tooltip - ></el-table-column> - <el-table-column - :filter-multiple="false" - :filters="filters" - column-key="sonLaboratory" - filter-placement="bottom-start" - label="瀛愬疄楠屽" - prop="sonLaboratory" - show-overflow-tooltip - width="130" - ></el-table-column> - <el-table-column - label="瑕佹眰鍊�" - min-width="200px" - prop="ask" - ></el-table-column> - <el-table-column - label="瑕佹眰鎻忚堪" - min-width="220px" - prop="tell" - ></el-table-column> - <el-table-column - label="璇曢獙鏂规硶" - prop="methodS" - width="200" - ></el-table-column> - <el-table-column - label="鏉′欢" - prop="radius" - width="200" - ></el-table-column> - <el-table-column - label="璁¢噺鍗曚綅" - prop="unit" - show-overflow-tooltip - width="100" - ></el-table-column> - <el-table-column - label="鍗曚环(鍏�)" - prop="price" - width="120" - ></el-table-column> - <el-table-column - label="宸ユ椂绯绘暟" - prop="manHour" - width="120" - ></el-table-column> - <el-table-column - label="宸ユ椂鍒嗙粍" - prop="manHourGroup" - show-overflow-tooltip - width="100" - ></el-table-column> - <el-table-column label="妯℃澘" prop="templateId" width="200"> - <template slot-scope="scope"> - {{ - templateList.find((item) => item.id == scope.row.templateId) - ? templateList.find( - (item) => item.id == scope.row.templateId - ).name - : "" - }} - </template> - </el-table-column> - <el-table-column - label="鍖洪棿" - prop="section" - show-overflow-tooltip - width="120" - ></el-table-column> - </el-table> - <el-pagination - :current-page="currentPage0" - :page-size="100" - :total="total0" - layout="total, prev, pager, next, jumper" - style="position: absolute; right: 16px; bottom: 4px" - @current-change="handleCurrentChange0" - > - </el-pagination> - </div> - </div> </el-dialog> <el-dialog :close-on-click-modal="false" @@ -1053,35 +756,6 @@ ></el-button> </span> </el-dialog> - <el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px"> - <div style="margin: 0 auto"> - <el-upload - ref="upload" - :action=" - VUE_APP_BASE_API + '/standardTree/inExcelOfTree/' + isEquipment - " - :auto-upload="false" - :file-list="fileList" - :headers="token" - :limit="1" - :on-change="beforeUpload" - :on-error="onError" - :on-success="onSuccess" - accept=".xlsx" - drag - name="file" - > - <i class="el-icon-upload"></i> - <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div> - </el-upload> - </div> - <span slot="footer" class="dialog-footer"> - <el-button @click="uploadDia = false">鍙� 娑�</el-button> - <el-button :loading="uploading" type="primary" @click="submitUpload()" - >涓� 浼�</el-button - > - </span> - </el-dialog> <!-- <bindSupplierDensityDialogAsk v-if="bindSupplierDensityDialog" :bindSupplierDensityDialog="bindSupplierDensityDialog" :currentRow="currentSupplierDensityRow" @@ -1176,21 +850,9 @@ total: 0, currentPage: 1, standardId: 0, - moreEdit: false, - moreEditLoad: false, - moreSelects: [], total0: 0, currentPage0: 1, productList0: [], - moreInfo: { - ask: "", - tell: "", - methodS: "", - price: "", - manHour: "", - templateId: "", - state: null, - }, methodList: [], productTableLoading0: false, filters0: [], @@ -1199,7 +861,6 @@ inspectionItem: null, inspectionItemSubclass: null, sonLaboratory: null, - uploadDia: false, token: null, fileList: [], uploading: false, @@ -1211,25 +872,8 @@ isShowCopy: false, batchCopyDia: false, VUE_APP_BASE_API: process.env.VUE_APP_BASE_API, + moreSelects: [], }; - }, - watch: { - moreEdit(val) { - if (!val) { - this.$refs.productTable0.clearSelection(); - this.moreSelects = []; - this.currentPage0 = 1; - this.productList0 = []; - this.moreInfo = { - ask: "", - tell: "", - methodS: "", - price: "", - manHour: "", - templateId: "", - }; - } - }, }, mounted() { this.selectEnumByCategoryForFactory(); @@ -2061,16 +1705,6 @@ this.$refs.BatchCopy.getList(); }); }, - async handleMore() { - if ( - (!this.standardId && this.standardId != 0) || - this.standardList.length == 0 - ) { - return this.$message.error("璇烽�夋嫨瀹為獙瀹ゃ�佹牱鍝�"); - } - await this.getList(); - this.moreEdit = true; - }, selectStandardMethodsSec() { selectStandardMethods().then((res) => { let data = []; @@ -2081,33 +1715,6 @@ }); }); this.methodList = data; - }); - }, - subMoreEdit() { - if (this.moreSelects.length === 0) { - return this.$message.error("璇烽�夋嫨妫�楠岄」"); - } - this.moreEditLoad = true; - for (let a in this.moreInfo) { - if (this.moreInfo[a] == "") { - delete this.moreInfo[a]; - } - } - upStandardProducts({ - ids: JSON.stringify(this.moreSelects.map((a) => a.id)), - standardProductList: this.moreInfo, - }).then((res) => { - this.moreEditLoad = false; - if (res.code == 201) { - this.$message.error("鏈繚瀛�"); - return; - } - this.$message.success("宸蹭繚瀛�"); - this.currentPage0 = 1; - this.getList(); - this.rowClick({ - id: this.standardId, - }); }); }, handleSelectAll0(rows) { @@ -2184,83 +1791,6 @@ } }); }); - }, - beforeUpload(file, fileList) { - if ( - file.raw.type != - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - ) { - this.$message.error("涓婁紶鏂囦欢鏍煎紡涓嶆纭�"); - this.$refs.upload.clearFiles(); - return false; - } - }, - submitUpload() { - if (this.$refs.upload.uploadFiles.length == 0) { - this.$message.error("鏈�夋嫨鏂囦欢"); - return; - } - this.uploading = true; - this.$refs.upload.submit(); - }, - onSuccess(response, file, fileList) { - this.$refs.upload.clearFiles(); - this.uploadDia = false; - this.uploading = false; - if (response.code == 201) { - this.$message.error(response.message); - return; - } - this.$message.success("涓婁紶鎴愬姛"); - this.standardList = []; - this.productList = []; - this.selectStandardTreeList(); - }, - onError(err, file, fileList) { - this.$message.error("涓婁紶澶辫触"); - this.$refs.upload.clearFiles(); - this.uploading = false; - }, - clearProduct(type) { - this.$confirm("鏄惁娓呯┖?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning", - }) - .then(() => { - if (type === 1) { - resetTreeOfPrice({ - tree: this.selectTree, - standardId: this.standardId, - }).then((res) => { - if (res.code == 201) { - return; - } - this.$message.success("宸叉竻绌�"); - this.currentPage0 = 1; - this.getList(); - this.rowClick({ - id: this.standardId, - }); - }); - } else if (type === 2) { - resetTreeOfHour({ - tree: this.selectTree, - standardId: this.standardId, - }).then((res) => { - if (res.code == 201) { - return; - } - this.$message.success("宸叉竻绌�"); - this.currentPage0 = 1; - this.getList(); - this.rowClick({ - id: this.standardId, - }); - }); - } - }) - .catch(() => {}); }, }, }; -- Gitblit v1.9.3