| | |
| | | form: {}, |
| | | selection: [], |
| | | visible: false, |
| | | exportUrlTpl: '/api/blade-cps/check-project/excel/template', |
| | | uploadUrl: '/api/blade-cps/check-project/excel/import', |
| | | exportUrlTpl: '/api/smis/check-project/excel/template', |
| | | uploadUrl: '/api/smis/check-project/excel/import', |
| | | config: { |
| | | labelWidth: 120, |
| | | formItems: [ |
| | |
| | | ...data, |
| | | ...this.params |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/check-project/page`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/check-project/page`, {}, { params }).then(res => { |
| | | res.data.records = res?.data?.records.map(v => { |
| | | return { |
| | | ...v, |
| | |
| | | }, |
| | | submit() { |
| | | if (!this.form.id) { |
| | | this.$HTTP.post(`/api/blade-cps/check-project`, this.form).then(res => { |
| | | this.$HTTP.post(`/api/smis/check-project`, this.form).then(res => { |
| | | if (res.success) { |
| | | this.visible = false |
| | | this.search() |
| | | } |
| | | }) |
| | | } else { |
| | | this.$HTTP.put(`/api/blade-cps/check-project`, this.form).then(res => { |
| | | this.$HTTP.put(`/api/smis/check-project`, this.form).then(res => { |
| | | if (res.success) { |
| | | this.visible = false |
| | | this.search() |
| | |
| | | |
| | | }, |
| | | exportData() { |
| | | this.$HTTP.post(`/api/blade-cps/check-project/excel/export`, {}, { params: this.params }).then(res => { |
| | | this.$HTTP.post(`/api/smis/check-project/excel/export`, {}, { params: this.params }).then(res => { |
| | | if (res.success) { |
| | | window.open(res.data.link) |
| | | } |
| | |
| | | this.$refs.table.reload() |
| | | }, |
| | | table_del(selection, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/check-project?type=${type}`, {}, { |
| | | this.$HTTP.delete(`/api/smis/check-project?type=${type}`, {}, { |
| | | data: { |
| | | ids: selection.map(v => v.id), |
| | | } |
| | |
| | | }, |
| | | getList() { |
| | | let row = this.selectRow |
| | | return this.$HTTP.get(`/api/blade-cps/check-item/list?projectId=${row.id}`).then(res => { |
| | | return this.$HTTP.get(`/api/smis/check-item/list?projectId=${row.id}`).then(res => { |
| | | if (res.success) { |
| | | this.tabledata = res.data |
| | | } |
| | | }) |
| | | }, |
| | | del(row) { |
| | | this.$HTTP.delete(`/api/blade-cps/check-item`, {}, { |
| | | this.$HTTP.delete(`/api/smis/check-item`, {}, { |
| | | data: { |
| | | ids: [row.id] |
| | | } |
| | |
| | | }, |
| | | add(row) { |
| | | if (!row.id) { |
| | | this.$HTTP.post(`/api/blade-cps/check-item`, { |
| | | this.$HTTP.post(`/api/smis/check-item`, { |
| | | checkProjectId: this.selectRow.id, |
| | | items: [{ |
| | | ...row, |
| | |
| | | this.getList() |
| | | }) |
| | | } else { |
| | | this.$HTTP.put(`/api/blade-cps/check-item`, { |
| | | this.$HTTP.put(`/api/smis/check-item`, { |
| | | ...row, |
| | | name: row.name, |
| | | requirement: row.requirement, |