商户提交

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

@ -130,6 +130,26 @@ public class EquipmentController {
return ActionResult.fail("更新失败,数据不存在"); 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 * @param id

@ -1,10 +1,3 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
@ -12,9 +5,8 @@
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable <JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions" :props="typeProps"
:options="typeOptions" multiple>
:props="typeProps" multiple >
</JnpfSelect> </JnpfSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -61,128 +53,101 @@
@click="openSuperQuery()" /> @click="openSuperQuery()" />
</el-tooltip> </el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
@click="initData()" />
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
:span-method="arraySpanMethod" <el-table-column prop="code" label="设备编码" align="left">
>
<el-table-column
prop="code"
label="设备编码" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="name" label="设备名称" align="left">
prop="name"
label="设备名称" align="left"
>
</el-table-column> </el-table-column>
<el-table-column label="设备状态" prop="status" algin="left" <el-table-column label="设备状态" prop="status" algin="left">
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status}} {{ scope.row.status}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="batchNumber" label="批次号" align="left">
prop="batchNumber"
label="批次号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column label="设备类型" prop="type" algin="left" <el-table-column label="设备类型" prop="type" algin="left">
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.type}} {{ scope.row.type}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="brand" label="设备品牌" align="left">
prop="brand"
label="设备品牌" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="model" label="设备型号" align="left">
prop="model"
label="设备型号" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="supplier" label="供应商" align="left">
prop="supplier"
label="供应商" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="supplierPhone" label="供应商联系电话" align="left">
prop="supplierPhone"
label="供应商联系电话" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="warrantyStartTime" label="保修开始时间" align="left">
prop="warrantyStartTime"
label="保修开始时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="warrantyEndTime" label="保修结束时间" align="left">
prop="warrantyEndTime"
label="保修结束时间" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="defectsLiabilityPeriod" label="保修期" align="left">
prop="defectsLiabilityPeriod"
label="保修期" align="left"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="description" label="设备描述" align="left">
prop="description"
label="设备描述" align="left"
>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" fixed="right" width="200">
fixed="right" width="150" > <template slot-scope="scope">
<template slot-scope="scope" > <el-button type="text" @click="addOrUpdateHandle(scope.row)">
<el-button type="text" </el-button>
@click="addOrUpdateHandle(scope.row)" >编辑 <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row)">
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" @click="baofei(scope.row)">
</el-button> </el-button>
<el-button type="text" <el-button type="text" @click="goDetail(scope.row.id)">
@click="goDetail(scope.row.id)">详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </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>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" /> <ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" /> <ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" <SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
@superQuery="superQuery" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import {
import {getDictionaryDataSelector} from '@/api/systemData/dictionary' mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
import ExportBox from '@/components/ExportBox' import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail' import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import {
import { getConfigData } from '@/api/onlineDev/visualDev' getDataInterfaceRes
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user' } from '@/api/systemData/dataInterface'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize' import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList' import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index" import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery' import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson' import superQueryJson from './superQueryJson'
@ -190,19 +155,21 @@
components: { components: {
JNPFForm, JNPFForm,
Detail, Detail,
ExportBox,ToFormDetail , SuperQuery ExportBox,
ToFormDetail,
SuperQuery
}, },
data() { data() {
return { return {
keyword:'', keyword: '',
expandsTree: true, expandsTree: true,
refreshTree: true, refreshTree: true,
toFormDetailVisible:false, toFormDetailVisible: false,
expandObj:{}, expandObj: {},
columnOptions: [], columnOptions: [],
mergeList: [], mergeList: [],
exportList:[], exportList: [],
columnList, columnList,
showAll: false, showAll: false,
@ -211,10 +178,10 @@
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
type:undefined, type: undefined,
brand:undefined, brand: undefined,
name:undefined, name: undefined,
code:undefined, code: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -238,12 +205,32 @@
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
typeOptions:[{"fullName":"类型1","id":"10"},{"fullName":"类型2","id":"20"}], typeOptions: [{
typeProps:{"label":"fullName","value":"id" }, "fullName": "类型1",
statusOptions:[{"fullName":"可用","id":"1"},{"fullName":"已租","id":"2"},{"fullName":"报废","id":"3"}], "id": "10"
statusProps:{"label":"fullName","value":"id" }, }, {
interfaceRes: { "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: { computed: {
@ -286,9 +273,9 @@
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
const nodeData = node.data const nodeData = node.data
const config ={ const config = {
treeInterfaceId:"", treeInterfaceId: "",
treeTemplateJson:[] treeTemplateJson: []
} }
if (config.treeInterfaceId) { if (config.treeInterfaceId) {
// //
@ -349,7 +336,9 @@
this.getExportList(list) this.getExportList(list)
return list return list
}, },
arraySpanMethod({ column }) { arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) { for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) { if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan] return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
@ -367,7 +356,7 @@
} }
}) })
newList.forEach(item => { newList.forEach(item => {
if (item.children && item.children.length ) { if (item.children && item.children.length) {
item.children.forEach((child, index) => { item.children.forEach((child, index) => {
if (index == 0) { if (index == 0) {
this.mergeList.push({ this.mergeList.push({
@ -405,13 +394,17 @@
} }
this.exportList = exportList this.exportList = exportList
}, },
goDetail(id){ goDetail(id) {
this.detailVisible = true this.detailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({column, prop, order}) { sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -421,8 +414,7 @@
this.initData() this.initData()
}, },
// //
async initSearchData() { async initSearchData() {},
},
initData() { initData() {
this.listLoading = true; this.listLoading = true;
let _query = { let _query = {
@ -430,16 +422,16 @@
...this.query, ...this.query,
keyword: this.keyword, keyword: this.keyword,
dataType: 0, dataType: 0,
menuId:this.menuId, menuId: this.menuId,
moduleId:'582551166336897669', moduleId: '582551166336897669',
type:1, type: 1,
}; };
request({ request({
url: `/api/example/Equipment/getList`, url: `/api/example/Equipment/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
var _list =res.data.list; var _list = res.data.list;
this.list = _list.map(o => ({ this.list = _list.map(o => ({
...o, ...o,
...this.expandObj, ...this.expandObj,
@ -448,12 +440,44 @@
this.listLoading = false 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('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/example/Equipment/${id}`, url: `/api/example/Equipment/${row.id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -464,13 +488,12 @@
} }
}); });
}) })
}).catch(() => { }).catch(() => {});
});
}, },
handelUpload(){ handelUpload() {
this.uploadBoxVisible = true this.uploadBoxVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.UploadBox.init("","example/Equipment") this.$refs.UploadBox.init("", "example/Equipment")
}) })
}, },
openSuperQuery() { openSuperQuery() {
@ -485,10 +508,10 @@
this.initData() this.initData()
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
let id = row?row.id:"" let id = row ? row.id : ""
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list) this.$refs.JNPFForm.init(id, isDetail, this.list)
}) })
}, },
exportData() { exportData() {
@ -498,7 +521,12 @@
}) })
}, },
download(data) { download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId} let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/example/Equipment/Actions/Export`, url: `/api/example/Equipment/Actions/Export`,
method: 'post', method: 'post',
@ -511,10 +539,10 @@
}) })
}, },
search() { search() {
this.listQuery.currentPage=1 this.listQuery.currentPage = 1
this.listQuery.pageSize=20 this.listQuery.pageSize = 20
this.listQuery.sort="desc" this.listQuery.sort = "desc"
this.listQuery.sidx="" this.listQuery.sidx = ""
this.initData() this.initData()
}, },
refresh(isrRefresh) { refresh(isrRefresh) {

Loading…
Cancel
Save