| | |
| | | <!-- |
| | | * @Date: 2024-06-16 19:47:41 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-23 19:59:13 |
| | | * @LastEditTime: 2024-06-23 21:32:29 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/tpm-data.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-header> |
| | | <Header key="1" ref="header1" :config="config1" v-model="params" :rules="rules1" |
| | | @search="search1" @submit="submit1" :formData="form1" :selection="selection1" |
| | | exportUrlTpl="/api/blade-cps/maintain-item/export/template" |
| | | exportUrl="/api/blade-cps/maintain-item/export" |
| | | uploadUrl="/api/blade-cps/maintain-item/import-maintain-item" @del="del1" /> |
| | | exportUrlTpl="/api/smis/maintain-item/export/template" |
| | | exportUrl="/api/smis/maintain-item/export" |
| | | uploadUrl="/api/smis/maintain-item/import-maintain-item" @del="del1" /> |
| | | </el-header> |
| | | <el-main> |
| | | <TpmData1 key="1" ref="tpmData1" :apiObj="apiObj1" :params="params" :cols="cols1" |
| | |
| | | <el-header> |
| | | <Header key="2" ref="header2" :config="config2" v-model="params" :rules="rules2" |
| | | @search="search2" @submit="submit2" :formData="form2" :selection="selection2" |
| | | exportUrlTpl="/api/blade-cps/malfunction/export-template" |
| | | exportUrl="/api/blade-cps/malfunction/export-malfunctionType" |
| | | uploadUrl="/api/blade-cps/malfunction/import-malfunctionType" @del="del2" /> |
| | | exportUrlTpl="/api/smis/malfunction/export-template" |
| | | exportUrl="/api/smis/malfunction/export-malfunctionType" |
| | | uploadUrl="/api/smis/malfunction/import-malfunctionType" @del="del2" /> |
| | | </el-header> |
| | | <el-main> |
| | | <TpmData1 key="2" ref="tpmData2" :apiObj="apiObj2" :params="params" :cols="cols2" |
| | |
| | | </el-container> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="机器类型" name="4"> |
| | | |
| | | <tpmComp2 /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | |
| | | import Header from './tpm-data-header.vue' |
| | | import TpmData1 from './tpm-data1.vue' |
| | | import tpmComp1 from './tpmComp1.vue' |
| | | import tpmComp2 from './tpmComp2.vue' |
| | | export default { |
| | | components: { |
| | | Header, |
| | | TpmData1, |
| | | tpmComp1 |
| | | tpmComp1, |
| | | tpmComp2 |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | ...data, |
| | | ...this.params |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/maintain-item/page`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/maintain-item/page`, {}, { params }).then(res => { |
| | | res.data.records = res?.data?.records.map(v => { |
| | | return { |
| | | ...v, |
| | |
| | | ...this.params, |
| | | malfunctionTypeCodeOrName: this.params.keyWord |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/malfunction/page`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/malfunction/page`, {}, { params }).then(res => { |
| | | res.data.records = res?.data?.records.map(v => { |
| | | return { |
| | | ...v, |
| | |
| | | submit1(val) { |
| | | console.log(val) |
| | | if (!val.id) { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-item/create-maintain-item`, val).then(res => { |
| | | this.$HTTP.post(`/api/smis/maintain-item/create-maintain-item`, val).then(res => { |
| | | if (res.success) { |
| | | this.search1() |
| | | } else { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-item/edit-maintain-item`, val).then(res => { |
| | | this.$HTTP.post(`/api/smis/maintain-item/edit-maintain-item`, val).then(res => { |
| | | if (res.success) { |
| | | this.search1() |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | del1(selection, type) { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-item/delete-maintain-item`, {}, { |
| | | this.$HTTP.post(`/api/smis/maintain-item/delete-maintain-item`, {}, { |
| | | params: { |
| | | ids: selection.map(v => v.id).toString(), |
| | | type |
| | |
| | | submit2(val) { |
| | | console.log(val) |
| | | // if (!val.id) { |
| | | this.$HTTP.post(`/api/blade-cps/malfunction/save`, val).then(res => { |
| | | this.$HTTP.post(`/api/smis/malfunction/save`, val).then(res => { |
| | | if (res.success) { |
| | | this.search2() |
| | | } else { |
| | |
| | | }) |
| | | // } |
| | | // else { |
| | | // this.$HTTP.post(`/api/blade-cps/malfunction/save`, val).then(res => { |
| | | // this.$HTTP.post(`/api/smis/malfunction/save`, val).then(res => { |
| | | // if (res.success) { |
| | | // this.search2() |
| | | // } else { |
| | |
| | | // } |
| | | }, |
| | | del2(selection, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/malfunction/delete`, {}, { |
| | | this.$HTTP.delete(`/api/smis/malfunction/delete`, {}, { |
| | | params: { |
| | | malfunctionTypeIds: selection.map(v => v.id).toString(), |
| | | type |