| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:record:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:record:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:record:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:record:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:record:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/platform/calculate-record"; |
| | | import { getCalculateRecords, getCalculateRecordById,deleteCalculateRecordByIds, addCalculateRecord, editCalculateRecord } from "@/api/platform/calculate-record"; |
| | | import {unitSelect} from "@/api/platform/unit"; |
| | | export default { |
| | | name: "Record", |
| | |
| | | /** 查询核算记录列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listRecord(this.queryParams).then(response => { |
| | | getCalculateRecords(this.queryParams).then(response => { |
| | | this.recordList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getRecord(id).then(response => { |
| | | getCalculateRecordById(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "修改核算记录"; |
| | |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateRecord(this.form).then(response => { |
| | | editCalculateRecord(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addRecord(this.form).then(response => { |
| | | addCalculateRecord(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除核算记录编号为"' + ids + '"的数据项?').then(function() { |
| | | return delRecord(ids); |
| | | return deleteCalculateRecordByIds(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |