商户提交

master
胡川虎 3 months ago
parent 6f07402e04
commit aac7a8f88b

@ -130,6 +130,26 @@ public class EquipmentController {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "报废")
@GetMapping("/baofei/{id}")
@Transactional
public ActionResult baofei(@PathVariable("id") String id){
EquipmentEntity entity= equipmentService.getInfo(id);
if(entity!=null && "1".equals(entity.getStatus())){
entity.setStatus("3");
equipmentService.update(id,entity);
}else {
return ActionResult.fail("该数据状态非可用或者不存在,请刷新列表");
}
return ActionResult.success("报废成功");
}
/**
*
* @param id

@ -1,10 +1,3 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
@ -12,9 +5,8 @@
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="设备类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable
:options="typeOptions"
:props="typeProps" multiple >
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions" :props="typeProps"
multiple>
</JnpfSelect>
</el-form-item>
</el-col>
@ -61,97 +53,58 @@
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod"
>
<el-table-column
prop="code"
label="设备编码" align="left"
>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<el-table-column prop="code" label="设备编码" align="left">
</el-table-column>
<el-table-column
prop="name"
label="设备名称" align="left"
>
<el-table-column prop="name" label="设备名称" align="left">
</el-table-column>
<el-table-column label="设备状态" prop="status" algin="left"
>
<el-table-column label="设备状态" prop="status" algin="left">
<template slot-scope="scope">
{{ scope.row.status}}
</template>
</el-table-column>
<el-table-column
prop="batchNumber"
label="批次号" align="left"
>
<el-table-column prop="batchNumber" label="批次号" align="left">
</el-table-column>
<el-table-column label="设备类型" prop="type" algin="left"
>
<el-table-column label="设备类型" prop="type" algin="left">
<template slot-scope="scope">
{{ scope.row.type}}
</template>
</el-table-column>
<el-table-column
prop="brand"
label="设备品牌" align="left"
>
<el-table-column prop="brand" label="设备品牌" align="left">
</el-table-column>
<el-table-column
prop="model"
label="设备型号" align="left"
>
<el-table-column prop="model" label="设备型号" align="left">
</el-table-column>
<el-table-column
prop="supplier"
label="供应商" align="left"
>
<el-table-column prop="supplier" label="供应商" align="left">
</el-table-column>
<el-table-column
prop="supplierPhone"
label="供应商联系电话" align="left"
>
<el-table-column prop="supplierPhone" label="供应商联系电话" align="left">
</el-table-column>
<el-table-column
prop="warrantyStartTime"
label="保修开始时间" align="left"
>
<el-table-column prop="warrantyStartTime" label="保修开始时间" align="left">
</el-table-column>
<el-table-column
prop="warrantyEndTime"
label="保修结束时间" align="left"
>
<el-table-column prop="warrantyEndTime" label="保修结束时间" align="left">
</el-table-column>
<el-table-column
prop="defectsLiabilityPeriod"
label="保修期" align="left"
>
<el-table-column prop="defectsLiabilityPeriod" label="保修期" align="left">
</el-table-column>
<el-table-column
prop="description"
label="设备描述" align="left"
>
<el-table-column prop="description" label="设备描述" align="left">
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope">
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" >编辑
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row)">
</el-button>
<el-button type="text"
@click="goDetail(scope.row.id)">详情
<el-button type="text" @click="baofei(scope.row)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
@ -163,26 +116,38 @@
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
@ -190,7 +155,9 @@
components: {
JNPFForm,
Detail,
ExportBox,ToFormDetail , SuperQuery
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
@ -238,12 +205,32 @@
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
typeOptions:[{"fullName":"类型1","id":"10"},{"fullName":"类型2","id":"20"}],
typeProps:{"label":"fullName","value":"id" },
statusOptions:[{"fullName":"可用","id":"1"},{"fullName":"已租","id":"2"},{"fullName":"报废","id":"3"}],
statusProps:{"label":"fullName","value":"id" },
interfaceRes: {
},
typeOptions: [{
"fullName": "类型1",
"id": "10"
}, {
"fullName": "类型2",
"id": "20"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
statusOptions: [{
"fullName": "可用",
"id": "1"
}, {
"fullName": "已租",
"id": "2"
}, {
"fullName": "报废",
"id": "3"
}],
statusProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {},
}
},
computed: {
@ -349,7 +336,9 @@
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
@ -411,7 +400,11 @@
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
@ -421,8 +414,7 @@
this.initData()
},
//
async initSearchData() {
},
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
@ -448,12 +440,44 @@
this.listLoading = false
})
},
handleDel(id) {
baofei(row){
if(row.status != '可用'){
this.$message({
type: 'error',
message: '该设备非可用状态,不允许报废,请确认!'
});
return
}
this.$confirm('此操作将报废该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Equipment/baofei/${row.id}`,
method: 'GET'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
handleDel(row) {
if(row.status == '已租'){
this.$message({
type: 'error',
message: '该设备已租,不允许删除,请确认!'
});
return
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Equipment/${id}`,
url: `/api/example/Equipment/${row.id}`,
method: 'DELETE'
}).then(res => {
this.$message({
@ -464,8 +488,7 @@
}
});
})
}).catch(() => {
});
}).catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true
@ -498,7 +521,12 @@
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/example/Equipment/Actions/Export`,
method: 'post',

Loading…
Cancel
Save