批量删除等修复

master
yujialong 8 months ago
parent aa26695fd2
commit 1c4b5c617f
  1. 45
      src/views/Transaction.vue

@ -17,7 +17,7 @@
<el-button v-if="!isView"
type="primary"
size="mini"
@click="saveAll">保存</el-button>
@click="submit">保存</el-button>
</div>
</div>
@ -106,6 +106,10 @@
type="primary"
size="mini"
@click="batchDel">批量删除</el-button>
<el-button v-if="!isView"
type="primary"
size="mini"
@click="saveAll">一键保存</el-button>
<el-button v-if="!isView"
type="primary"
size="mini"
@ -156,7 +160,7 @@
<el-button circle
type="primary"
v-if="scope.row.isSubject"
:disabled="isView || scope.row.isDisabled"
:disabled="isSt || isView || scope.row.isDisabled"
@click="changeResult(scope.row)">
{{ scope.row.resultOperation === 0 ? "且" : "或" }}
</el-button>
@ -480,6 +484,7 @@
</el-card>
</div>
</div>
<el-backtop></el-backtop>
</div>
</template>
@ -769,11 +774,11 @@ export default {
const temp = item.emptyTwo.split('~')
if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const num = temp[0].match(/[\d\.]+/g)
const unit = temp[0].match(/[^<>=\d\.]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[\d\.]+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d\.]+/g) : ''
obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : ''
obj.value4 = unit ? unit[0] : ''
@ -837,11 +842,11 @@ export default {
const temp = item.emptyTwo.split('~')
if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const num = temp[0].match(/[\d\.]+/g)
const unit = temp[0].match(/[^<>=\d\.]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[\d\.]+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d\.]+/g) : ''
obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : ''
obj.value4 = unit ? unit[0] : ''
@ -980,7 +985,7 @@ export default {
}).catch(err => { });
}
},
saveAll () { //
submit () { //
const point = this.formData.lcJudgmentPoint
if (!point.name) {
this.$message.warning(`判分点名称不能为空`);
@ -1045,7 +1050,7 @@ export default {
} else if (i.type == 5) {
// obj.emptyOne = i.value1; //
obj.emptyOne = i.subjectId ? i.subjectId.toString() : "";
obj.emptyTwo = `${i.value2 || ''}${i.value3}${i.value4}${i.value5 ? '~' + i.value5 : ''}${i.value6}${i.value7 || ''}`;
obj.emptyTwo = `${i.value2 || ''}${i.value3 || ''}${i.value4 || ''}${i.value5 ? '~' + i.value5 : ''}${i.value6 || ''}${i.value7 || ''}`;
} else if (i.type == 6) {
const money = []
const { moneys } = this
@ -1172,10 +1177,6 @@ export default {
row.isSave = false;
},
handleSave (row, index) { //
// let keys = this.$refs[`tree-${index}`].getCheckedKeys();
// if(!row.operationIds){
// row.operationIds = keys[0]
// }
if (!row.operationIds) {
this.$message.warning(`请选择操作点`);
return;
@ -1288,10 +1289,11 @@ export default {
type: "warning",
center: true
}).then(() => {
const ids = this.multipleSelection.map(e => e.id)
const prop = this.isAdd ? 'index' : 'id'
const ids = this.multipleSelection.map(e => e[prop])
const list = this.tableData
ids.map((e, i) => {
const index = list.findIndex(j => j.id === e)
const index = list.findIndex(j => j[prop] === e)
if (index !== -1) {
this.tableData.splice(index === this.tableData.length - 1 ? index - 1 : index, 2)
}
@ -1310,6 +1312,13 @@ export default {
this.$message.error('请先选择数据 !')
}
},
//
saveAll () {
this.tableData.forEach(e => {
e.isDisabled = true
e.isSave = true
})
},
//
headClass () {
return "text-align: center;";

Loading…
Cancel
Save