| | |
| | | <div class="filter-card"> |
| | | <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch"> |
| | | <template slot="leftButton"> |
| | | <el-button size="small" type="primary" @click="addBtnClick" :disabled="!isEdit">新增</el-button> |
| | | <el-button size="small" type="primary" @click="addBtnClick">新增</el-button> |
| | | <el-button size="small" type="primary" @click="refreshClick">刷新</el-button> |
| | | <el-button size="small" type="primary" @click="printClick" disabled>打印</el-button> |
| | | </template> |
| | | </CommonSearch> |
| | | </div> |
| | | <div class="body-card"> |
| | | <div class="edit-save"> |
| | | <div class="edit-save-icon" @click="editSaveClick"> |
| | | <div class="edit-save" @click="editSaveClick"> |
| | | <div class="edit-save-icon"> |
| | | <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i> |
| | | </div> |
| | | <div class="edit-sace-label">{{ isEdit ? "锁定保存" : "界面设计" }}</div> |
| | |
| | | projectOptions: getDataByType("projectOptions"), |
| | | rankObj: {}, |
| | | columnInputList: [], |
| | | dynamicsRanks: [] |
| | | dynamicsRanks: [], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.silkTableList = { |
| | | tableData: this.tableData, |
| | | isReturn: false, |
| | | tableColumn: this.tableColumn |
| | | tableColumn: [ |
| | | { label: "检查项目名称", prop: "projectName", projectName: true }, |
| | | { label: "开始纤度", prop: "start", inputFloat: true }, |
| | | { label: "结束纤度", prop: "end", inputFloat: true }, |
| | | { label: "野纤", prop: "price1", inputFloat: true }, |
| | | { label: "大野", prop: "price2", inputFloat: true }, |
| | | { label: "特野", prop: "price3", inputFloat: true } |
| | | ] |
| | | } |
| | | }, |
| | | // 搜索 |
| | |
| | | }, |
| | | // 新增 |
| | | addBtnClick() { |
| | | this.tableData.push(this.dataObj) |
| | | if(this.isEdit){ |
| | | this.tableData.push({ |
| | | projectName: "", |
| | | start: 0, |
| | | end: 0, |
| | | price1: 0, |
| | | price2: 0, |
| | | price3: 0 |
| | | }) |
| | | }else{ |
| | | this.$message.error('请先解锁再新增!') |
| | | } |
| | | |
| | | }, |
| | | // 刷新 |
| | | refreshClick() { |
| | |
| | | // 保存编辑按钮切换 |
| | | editSaveClick() { |
| | | this.isEdit = !this.isEdit |
| | | let tableData=JSON.parse( |
| | | JSON.stringify(this.silkTableList.tableData) |
| | | ); |
| | | if(tableData.length==0&&!this.isEdit){ |
| | | this.$message.error('请先新增再保存!') |
| | | return true; |
| | | } |
| | | if (!this.isEdit) { |
| | | let params = this.saveParam() |
| | | let params = this.saveParam(tableData) |
| | | saveRankStandard({ |
| | | rankStandard: params |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.$message.success("保存成功") |
| | | this.getData() |
| | |
| | | }) |
| | | } |
| | | }, |
| | | saveParam() { |
| | | let saveList = this.tableData.map((item) => { |
| | | saveParam(tableData) { |
| | | for(let i in tableData){ |
| | | tableData[i].dynamicsRanks=[] |
| | | for(let j in this.columnInputList){ |
| | | tableData[i].dynamicsRanks.push({ |
| | | rankName:this.columnInputList[j].rankName, |
| | | rankProp:this.columnInputList[j].rankProp, |
| | | rankValue:tableData[i][this.columnInputList[j].rankProp] |
| | | }) |
| | | } |
| | | } |
| | | let saveList = tableData.map((item) => { |
| | | return { |
| | | checkItem: item.checkItem, |
| | | dynamicsRanks: item.dynamicsRanks, |
| | |
| | | item.rankName = val |
| | | } |
| | | }) |
| | | console.log(this.columnInputList, "888") |
| | | }, |
| | | getCheckItemName(val) { |
| | | if (val) { |
| | |
| | | height: calc(100% - 180px); |
| | | border-radius: 4px; |
| | | .edit-save { |
| | | width:100px; |
| | | padding:0 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | cursor: pointer; |
| | | .edit-save-icon { |
| | | font-size: 24px; |
| | | color: #5582f3; |
| | | cursor: pointer; |
| | | } |
| | | .edit-sace-label { |
| | | margin-left: 10px; |