Browse Source

设备基本信息更新

lamphua 1 year ago
parent
commit
01d2c2b235

+ 0
- 97
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSupplyController.java View File

1
-package com.ruoyi.web.controller.oa;
2
-
3
-import java.util.List;
4
-import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.beans.factory.annotation.Autowired;
6
-import org.springframework.web.bind.annotation.GetMapping;
7
-import org.springframework.web.bind.annotation.PostMapping;
8
-import org.springframework.web.bind.annotation.PutMapping;
9
-import org.springframework.web.bind.annotation.DeleteMapping;
10
-import org.springframework.web.bind.annotation.PathVariable;
11
-import org.springframework.web.bind.annotation.RequestBody;
12
-import org.springframework.web.bind.annotation.RequestMapping;
13
-import org.springframework.web.bind.annotation.RestController;
14
-import com.ruoyi.common.annotation.Log;
15
-import com.ruoyi.common.core.controller.BaseController;
16
-import com.ruoyi.common.core.domain.AjaxResult;
17
-import com.ruoyi.common.enums.BusinessType;
18
-import com.ruoyi.oa.domain.CmcSupply;
19
-import com.ruoyi.oa.service.ICmcSupplyService;
20
-import com.ruoyi.common.utils.poi.ExcelUtil;
21
-import com.ruoyi.common.core.page.TableDataInfo;
22
-
23
-/**
24
- * cmc用品信息Controller
25
- * 
26
- * @author cmc
27
- * @date 2024-04-25
28
- */
29
-@RestController
30
-@RequestMapping("/oa/supply")
31
-public class CmcSupplyController extends BaseController
32
-{
33
-    @Autowired
34
-    private ICmcSupplyService cmcSupplyService;
35
-
36
-    /**
37
-     * 查询cmc用品信息列表
38
-     */
39
-    @GetMapping("/list")
40
-    public TableDataInfo list(CmcSupply cmcSupply)
41
-    {
42
-        startPage();
43
-        List<CmcSupply> list = cmcSupplyService.selectCmcSupplyList(cmcSupply);
44
-        return getDataTable(list);
45
-    }
46
-
47
-    /**
48
-     * 导出cmc用品信息列表
49
-     */
50
-    @Log(title = "cmc用品信息", businessType = BusinessType.EXPORT)
51
-    @PostMapping("/export")
52
-    public void export(HttpServletResponse response, CmcSupply cmcSupply)
53
-    {
54
-        List<CmcSupply> list = cmcSupplyService.selectCmcSupplyList(cmcSupply);
55
-        ExcelUtil<CmcSupply> util = new ExcelUtil<CmcSupply>(CmcSupply.class);
56
-        util.exportExcel(response, list, "cmc用品信息数据");
57
-    }
58
-
59
-    /**
60
-     * 获取cmc用品信息详细信息
61
-     */
62
-    @GetMapping(value = "/{supplyId}")
63
-    public AjaxResult getInfo(@PathVariable("supplyId") Long supplyId)
64
-    {
65
-        return success(cmcSupplyService.selectCmcSupplyBySupplyId(supplyId));
66
-    }
67
-
68
-    /**
69
-     * 新增cmc用品信息
70
-     */
71
-    @Log(title = "cmc用品信息", businessType = BusinessType.INSERT)
72
-    @PostMapping
73
-    public AjaxResult add(@RequestBody CmcSupply cmcSupply)
74
-    {
75
-        return toAjax(cmcSupplyService.insertCmcSupply(cmcSupply));
76
-    }
77
-
78
-    /**
79
-     * 修改cmc用品信息
80
-     */
81
-    @Log(title = "cmc用品信息", businessType = BusinessType.UPDATE)
82
-    @PutMapping
83
-    public AjaxResult edit(@RequestBody CmcSupply cmcSupply)
84
-    {
85
-        return toAjax(cmcSupplyService.updateCmcSupply(cmcSupply));
86
-    }
87
-
88
-    /**
89
-     * 删除cmc用品信息
90
-     */
91
-    @Log(title = "cmc用品信息", businessType = BusinessType.DELETE)
92
-	@DeleteMapping("/{supplyIds}")
93
-    public AjaxResult remove(@PathVariable Long[] supplyIds)
94
-    {
95
-        return toAjax(cmcSupplyService.deleteCmcSupplyBySupplyIds(supplyIds));
96
-    }
97
-}

+ 0
- 210
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSupply.java View File

1
-package com.ruoyi.oa.domain;
2
-
3
-import java.math.BigDecimal;
4
-import java.util.Date;
5
-import com.fasterxml.jackson.annotation.JsonFormat;
6
-import org.apache.commons.lang3.builder.ToStringBuilder;
7
-import org.apache.commons.lang3.builder.ToStringStyle;
8
-import com.ruoyi.common.annotation.Excel;
9
-import com.ruoyi.common.core.domain.BaseEntity;
10
-
11
-/**
12
- * cmc用品信息对象 cmc_supply
13
- * 
14
- * @author cmc
15
- * @date 2024-04-25
16
- */
17
-public class CmcSupply extends BaseEntity
18
-{
19
-    private static final long serialVersionUID = 1L;
20
-
21
-    /** 办公用品id */
22
-    private Long supplyId;
23
-
24
-    /** 办公用品编码 */
25
-    @Excel(name = "办公用品编码")
26
-    private String supplyNumber;
27
-
28
-    /** 出厂编号 */
29
-    @Excel(name = "出厂编号")
30
-    private String code;
31
-
32
-    /** 用品名称 */
33
-    @Excel(name = "用品名称")
34
-    private String name;
35
-
36
-    /** 用品类别 */
37
-    @Excel(name = "用品类别")
38
-    private String type;
39
-
40
-    /** 购置时间 */
41
-    @JsonFormat(pattern = "yyyy-MM-dd")
42
-    @Excel(name = "购置时间", width = 30, dateFormat = "yyyy-MM-dd")
43
-    private Date acquisitionTime;
44
-
45
-    /** 购买价格 */
46
-    @Excel(name = "购买价格")
47
-    private BigDecimal cost;
48
-
49
-    /** 预计使用年限 */
50
-    @Excel(name = "预计使用年限")
51
-    private Long expectLife;
52
-
53
-    /** 规格型号 */
54
-    @Excel(name = "规格型号")
55
-    private String series;
56
-
57
-    /** 用品品牌 */
58
-    @Excel(name = "用品品牌")
59
-    private String brand;
60
-
61
-    /** 单日成本 */
62
-    @Excel(name = "单日成本")
63
-    private BigDecimal dayCost;
64
-
65
-    /** 存放地点 */
66
-    @Excel(name = "存放地点")
67
-    private String place;
68
-
69
-    /** 管理部门 */
70
-    @Excel(name = "管理部门")
71
-    private Long manageDept;
72
-
73
-    public void setSupplyId(Long supplyId) 
74
-    {
75
-        this.supplyId = supplyId;
76
-    }
77
-
78
-    public Long getSupplyId() 
79
-    {
80
-        return supplyId;
81
-    }
82
-    public void setSupplyNumber(String supplyNumber) 
83
-    {
84
-        this.supplyNumber = supplyNumber;
85
-    }
86
-
87
-    public String getSupplyNumber() 
88
-    {
89
-        return supplyNumber;
90
-    }
91
-    public void setCode(String code) 
92
-    {
93
-        this.code = code;
94
-    }
95
-
96
-    public String getCode() 
97
-    {
98
-        return code;
99
-    }
100
-    public void setName(String name) 
101
-    {
102
-        this.name = name;
103
-    }
104
-
105
-    public String getName() 
106
-    {
107
-        return name;
108
-    }
109
-    public void setType(String type) 
110
-    {
111
-        this.type = type;
112
-    }
113
-
114
-    public String getType() 
115
-    {
116
-        return type;
117
-    }
118
-    public void setAcquisitionTime(Date acquisitionTime) 
119
-    {
120
-        this.acquisitionTime = acquisitionTime;
121
-    }
122
-
123
-    public Date getAcquisitionTime() 
124
-    {
125
-        return acquisitionTime;
126
-    }
127
-    public void setCost(BigDecimal cost) 
128
-    {
129
-        this.cost = cost;
130
-    }
131
-
132
-    public BigDecimal getCost() 
133
-    {
134
-        return cost;
135
-    }
136
-    public void setExpectLife(Long expectLife) 
137
-    {
138
-        this.expectLife = expectLife;
139
-    }
140
-
141
-    public Long getExpectLife() 
142
-    {
143
-        return expectLife;
144
-    }
145
-    public void setSeries(String series) 
146
-    {
147
-        this.series = series;
148
-    }
149
-
150
-    public String getSeries() 
151
-    {
152
-        return series;
153
-    }
154
-    public void setBrand(String brand) 
155
-    {
156
-        this.brand = brand;
157
-    }
158
-
159
-    public String getBrand() 
160
-    {
161
-        return brand;
162
-    }
163
-    public void setDayCost(BigDecimal dayCost) 
164
-    {
165
-        this.dayCost = dayCost;
166
-    }
167
-
168
-    public BigDecimal getDayCost() 
169
-    {
170
-        return dayCost;
171
-    }
172
-    public void setPlace(String place) 
173
-    {
174
-        this.place = place;
175
-    }
176
-
177
-    public String getPlace() 
178
-    {
179
-        return place;
180
-    }
181
-    public void setManageDept(Long manageDept) 
182
-    {
183
-        this.manageDept = manageDept;
184
-    }
185
-
186
-    public Long getManageDept() 
187
-    {
188
-        return manageDept;
189
-    }
190
-
191
-    @Override
192
-    public String toString() {
193
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
194
-            .append("supplyId", getSupplyId())
195
-            .append("supplyNumber", getSupplyNumber())
196
-            .append("code", getCode())
197
-            .append("name", getName())
198
-            .append("type", getType())
199
-            .append("acquisitionTime", getAcquisitionTime())
200
-            .append("cost", getCost())
201
-            .append("expectLife", getExpectLife())
202
-            .append("series", getSeries())
203
-            .append("brand", getBrand())
204
-            .append("dayCost", getDayCost())
205
-            .append("place", getPlace())
206
-            .append("remark", getRemark())
207
-            .append("manageDept", getManageDept())
208
-            .toString();
209
-    }
210
-}

+ 0
- 61
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcSupplyMapper.java View File

1
-package com.ruoyi.oa.mapper;
2
-
3
-import java.util.List;
4
-import com.ruoyi.oa.domain.CmcSupply;
5
-
6
-/**
7
- * cmc用品信息Mapper接口
8
- * 
9
- * @author cmc
10
- * @date 2024-04-25
11
- */
12
-public interface CmcSupplyMapper 
13
-{
14
-    /**
15
-     * 查询cmc用品信息
16
-     * 
17
-     * @param supplyId cmc用品信息主键
18
-     * @return cmc用品信息
19
-     */
20
-    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId);
21
-
22
-    /**
23
-     * 查询cmc用品信息列表
24
-     * 
25
-     * @param cmcSupply cmc用品信息
26
-     * @return cmc用品信息集合
27
-     */
28
-    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply);
29
-
30
-    /**
31
-     * 新增cmc用品信息
32
-     * 
33
-     * @param cmcSupply cmc用品信息
34
-     * @return 结果
35
-     */
36
-    public int insertCmcSupply(CmcSupply cmcSupply);
37
-
38
-    /**
39
-     * 修改cmc用品信息
40
-     * 
41
-     * @param cmcSupply cmc用品信息
42
-     * @return 结果
43
-     */
44
-    public int updateCmcSupply(CmcSupply cmcSupply);
45
-
46
-    /**
47
-     * 删除cmc用品信息
48
-     * 
49
-     * @param supplyId cmc用品信息主键
50
-     * @return 结果
51
-     */
52
-    public int deleteCmcSupplyBySupplyId(Long supplyId);
53
-
54
-    /**
55
-     * 批量删除cmc用品信息
56
-     * 
57
-     * @param supplyIds 需要删除的数据主键集合
58
-     * @return 结果
59
-     */
60
-    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds);
61
-}

+ 0
- 61
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcSupplyService.java View File

1
-package com.ruoyi.oa.service;
2
-
3
-import java.util.List;
4
-import com.ruoyi.oa.domain.CmcSupply;
5
-
6
-/**
7
- * cmc用品信息Service接口
8
- * 
9
- * @author cmc
10
- * @date 2024-04-25
11
- */
12
-public interface ICmcSupplyService 
13
-{
14
-    /**
15
-     * 查询cmc用品信息
16
-     * 
17
-     * @param supplyId cmc用品信息主键
18
-     * @return cmc用品信息
19
-     */
20
-    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId);
21
-
22
-    /**
23
-     * 查询cmc用品信息列表
24
-     * 
25
-     * @param cmcSupply cmc用品信息
26
-     * @return cmc用品信息集合
27
-     */
28
-    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply);
29
-
30
-    /**
31
-     * 新增cmc用品信息
32
-     * 
33
-     * @param cmcSupply cmc用品信息
34
-     * @return 结果
35
-     */
36
-    public int insertCmcSupply(CmcSupply cmcSupply);
37
-
38
-    /**
39
-     * 修改cmc用品信息
40
-     * 
41
-     * @param cmcSupply cmc用品信息
42
-     * @return 结果
43
-     */
44
-    public int updateCmcSupply(CmcSupply cmcSupply);
45
-
46
-    /**
47
-     * 批量删除cmc用品信息
48
-     * 
49
-     * @param supplyIds 需要删除的cmc用品信息主键集合
50
-     * @return 结果
51
-     */
52
-    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds);
53
-
54
-    /**
55
-     * 删除cmc用品信息信息
56
-     * 
57
-     * @param supplyId cmc用品信息主键
58
-     * @return 结果
59
-     */
60
-    public int deleteCmcSupplyBySupplyId(Long supplyId);
61
-}

+ 0
- 93
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcSupplyServiceImpl.java View File

1
-package com.ruoyi.oa.service.impl;
2
-
3
-import java.util.List;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.stereotype.Service;
6
-import com.ruoyi.oa.mapper.CmcSupplyMapper;
7
-import com.ruoyi.oa.domain.CmcSupply;
8
-import com.ruoyi.oa.service.ICmcSupplyService;
9
-
10
-/**
11
- * cmc用品信息Service业务层处理
12
- * 
13
- * @author cmc
14
- * @date 2024-04-25
15
- */
16
-@Service
17
-public class CmcSupplyServiceImpl implements ICmcSupplyService 
18
-{
19
-    @Autowired
20
-    private CmcSupplyMapper cmcSupplyMapper;
21
-
22
-    /**
23
-     * 查询cmc用品信息
24
-     * 
25
-     * @param supplyId cmc用品信息主键
26
-     * @return cmc用品信息
27
-     */
28
-    @Override
29
-    public CmcSupply selectCmcSupplyBySupplyId(Long supplyId)
30
-    {
31
-        return cmcSupplyMapper.selectCmcSupplyBySupplyId(supplyId);
32
-    }
33
-
34
-    /**
35
-     * 查询cmc用品信息列表
36
-     * 
37
-     * @param cmcSupply cmc用品信息
38
-     * @return cmc用品信息
39
-     */
40
-    @Override
41
-    public List<CmcSupply> selectCmcSupplyList(CmcSupply cmcSupply)
42
-    {
43
-        return cmcSupplyMapper.selectCmcSupplyList(cmcSupply);
44
-    }
45
-
46
-    /**
47
-     * 新增cmc用品信息
48
-     * 
49
-     * @param cmcSupply cmc用品信息
50
-     * @return 结果
51
-     */
52
-    @Override
53
-    public int insertCmcSupply(CmcSupply cmcSupply)
54
-    {
55
-        return cmcSupplyMapper.insertCmcSupply(cmcSupply);
56
-    }
57
-
58
-    /**
59
-     * 修改cmc用品信息
60
-     * 
61
-     * @param cmcSupply cmc用品信息
62
-     * @return 结果
63
-     */
64
-    @Override
65
-    public int updateCmcSupply(CmcSupply cmcSupply)
66
-    {
67
-        return cmcSupplyMapper.updateCmcSupply(cmcSupply);
68
-    }
69
-
70
-    /**
71
-     * 批量删除cmc用品信息
72
-     * 
73
-     * @param supplyIds 需要删除的cmc用品信息主键
74
-     * @return 结果
75
-     */
76
-    @Override
77
-    public int deleteCmcSupplyBySupplyIds(Long[] supplyIds)
78
-    {
79
-        return cmcSupplyMapper.deleteCmcSupplyBySupplyIds(supplyIds);
80
-    }
81
-
82
-    /**
83
-     * 删除cmc用品信息信息
84
-     * 
85
-     * @param supplyId cmc用品信息主键
86
-     * @return 结果
87
-     */
88
-    @Override
89
-    public int deleteCmcSupplyBySupplyId(Long supplyId)
90
-    {
91
-        return cmcSupplyMapper.deleteCmcSupplyBySupplyId(supplyId);
92
-    }
93
-}

+ 669
- 682
oa-back/sql/sql.sql
File diff suppressed because it is too large
View File


+ 0
- 44
oa-ui/src/api/oa/supply/supply.js View File

1
-import request from '@/utils/request'
2
-
3
-// 查询cmc用品信息列表
4
-export function listSupply(query) {
5
-  return request({
6
-    url: '/oa/supply/list',
7
-    method: 'get',
8
-    params: query
9
-  })
10
-}
11
-
12
-// 查询cmc用品信息详细
13
-export function getSupply(supplyId) {
14
-  return request({
15
-    url: '/oa/supply/' + supplyId,
16
-    method: 'get'
17
-  })
18
-}
19
-
20
-// 新增cmc用品信息
21
-export function addSupply(data) {
22
-  return request({
23
-    url: '/oa/supply',
24
-    method: 'post',
25
-    data: data
26
-  })
27
-}
28
-
29
-// 修改cmc用品信息
30
-export function updateSupply(data) {
31
-  return request({
32
-    url: '/oa/supply',
33
-    method: 'put',
34
-    data: data
35
-  })
36
-}
37
-
38
-// 删除cmc用品信息
39
-export function delSupply(supplyId) {
40
-  return request({
41
-    url: '/oa/supply/' + supplyId,
42
-    method: 'delete'
43
-  })
44
-}

+ 1
- 0
oa-ui/src/views/oa/device/index.vue View File

206
     /** 查询cmc设备信息列表 */
206
     /** 查询cmc设备信息列表 */
207
     getList() {
207
     getList() {
208
       this.loading = true;
208
       this.loading = true;
209
+      this.queryParams.type = '仪器设备';
209
       listDevice(this.queryParams).then(response => {
210
       listDevice(this.queryParams).then(response => {
210
         this.deviceList = response.rows;
211
         this.deviceList = response.rows;
211
         this.total = response.total;
212
         this.total = response.total;

+ 144
- 232
oa-ui/src/views/oa/supply/index.vue View File

1
 <template>
1
 <template>
2
   <div class="app-container">
2
   <div class="app-container">
3
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
3
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4
-      <el-form-item label="办公用品编码" prop="supplyNumber">
5
-        <el-input
6
-          v-model="queryParams.supplyNumber"
7
-          placeholder="请输入办公用品编码"
8
-          clearable
9
-          @keyup.enter.native="handleQuery"
10
-        />
11
-      </el-form-item>
12
       <el-form-item label="出厂编号" prop="code">
4
       <el-form-item label="出厂编号" prop="code">
13
-        <el-input
14
-          v-model="queryParams.code"
15
-          placeholder="请输入出厂编号"
16
-          clearable
17
-          @keyup.enter.native="handleQuery"
18
-        />
19
-      </el-form-item>
20
-      <el-form-item label="用品名称" prop="name">
21
-        <el-input
22
-          v-model="queryParams.name"
23
-          placeholder="请输入用品名称"
24
-          clearable
25
-          @keyup.enter.native="handleQuery"
26
-        />
27
-      </el-form-item>
28
-      <el-form-item label="购置时间" prop="acquisitionTime">
29
-        <el-date-picker clearable
30
-          v-model="queryParams.acquisitionTime"
31
-          type="date"
32
-          value-format="yyyy-MM-dd"
33
-          placeholder="请选择购置时间">
34
-        </el-date-picker>
35
-      </el-form-item>
36
-      <el-form-item label="购买价格" prop="cost">
37
-        <el-input
38
-          v-model="queryParams.cost"
39
-          placeholder="请输入购买价格"
40
-          clearable
41
-          @keyup.enter.native="handleQuery"
42
-        />
43
-      </el-form-item>
44
-      <el-form-item label="预计使用年限" prop="expectLife">
45
-        <el-input
46
-          v-model="queryParams.expectLife"
47
-          placeholder="请输入预计使用年限"
48
-          clearable
49
-          @keyup.enter.native="handleQuery"
50
-        />
51
-      </el-form-item>
52
-      <el-form-item label="规格型号" prop="series">
53
-        <el-input
54
-          v-model="queryParams.series"
55
-          placeholder="请输入规格型号"
56
-          clearable
57
-          @keyup.enter.native="handleQuery"
58
-        />
59
-      </el-form-item>
60
-      <el-form-item label="用品品牌" prop="brand">
61
-        <el-input
62
-          v-model="queryParams.brand"
63
-          placeholder="请输入用品品牌"
64
-          clearable
65
-          @keyup.enter.native="handleQuery"
66
-        />
5
+        <el-input v-model="queryParams.code" placeholder="请输入出厂编号" clearable @keyup.enter.native="handleQuery" />
67
       </el-form-item>
6
       </el-form-item>
68
-      <el-form-item label="单日成本" prop="dayCost">
69
-        <el-input
70
-          v-model="queryParams.dayCost"
71
-          placeholder="请输入单日成本"
72
-          clearable
73
-          @keyup.enter.native="handleQuery"
74
-        />
75
-      </el-form-item>
76
-      <el-form-item label="存放地点" prop="place">
77
-        <el-input
78
-          v-model="queryParams.place"
79
-          placeholder="请输入存放地点"
80
-          clearable
81
-          @keyup.enter.native="handleQuery"
82
-        />
83
-      </el-form-item>
84
-      <el-form-item label="管理部门" prop="manageDept">
85
-        <el-input
86
-          v-model="queryParams.manageDept"
87
-          placeholder="请输入管理部门"
88
-          clearable
89
-          @keyup.enter.native="handleQuery"
90
-        />
7
+
8
+      <el-form-item label="设备名称" prop="name">
9
+        <el-input v-model="queryParams.name" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery" />
91
       </el-form-item>
10
       </el-form-item>
92
       <el-form-item>
11
       <el-form-item>
93
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
12
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
97
 
16
 
98
     <el-row :gutter="10" class="mb8">
17
     <el-row :gutter="10" class="mb8">
99
       <el-col :span="1.5">
18
       <el-col :span="1.5">
100
-        <el-button
101
-          type="primary"
102
-          plain
103
-          icon="el-icon-plus"
104
-          size="mini"
105
-          @click="handleAdd"
106
-          v-hasPermi="['oa:supply:add']"
107
-        >新增</el-button>
19
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
20
+          v-hasPermi="['oa:device:add']">新增</el-button>
108
       </el-col>
21
       </el-col>
109
       <el-col :span="1.5">
22
       <el-col :span="1.5">
110
-        <el-button
111
-          type="success"
112
-          plain
113
-          icon="el-icon-edit"
114
-          size="mini"
115
-          :disabled="single"
116
-          @click="handleUpdate"
117
-          v-hasPermi="['oa:supply:edit']"
118
-        >修改</el-button>
23
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
24
+          v-hasPermi="['oa:device:edit']">修改</el-button>
119
       </el-col>
25
       </el-col>
120
       <el-col :span="1.5">
26
       <el-col :span="1.5">
121
-        <el-button
122
-          type="danger"
123
-          plain
124
-          icon="el-icon-delete"
125
-          size="mini"
126
-          :disabled="multiple"
127
-          @click="handleDelete"
128
-          v-hasPermi="['oa:supply:remove']"
129
-        >删除</el-button>
27
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
28
+          v-hasPermi="['oa:device:remove']">删除</el-button>
130
       </el-col>
29
       </el-col>
131
       <el-col :span="1.5">
30
       <el-col :span="1.5">
132
-        <el-button
133
-          type="warning"
134
-          plain
135
-          icon="el-icon-download"
136
-          size="mini"
137
-          @click="handleExport"
138
-          v-hasPermi="['oa:supply:export']"
139
-        >导出</el-button>
31
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
32
+          v-hasPermi="['oa:device:export']">导出</el-button>
140
       </el-col>
33
       </el-col>
141
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
34
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
142
     </el-row>
35
     </el-row>
143
 
36
 
144
-    <el-table v-loading="loading" :data="supplyList" @selection-change="handleSelectionChange">
37
+    <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
145
       <el-table-column type="selection" width="55" align="center" />
38
       <el-table-column type="selection" width="55" align="center" />
146
-      <el-table-column label="办公用品id" align="center" prop="supplyId" />
147
-      <el-table-column label="办公用品编码" align="center" prop="supplyNumber" />
39
+      <!-- <el-table-column label="设备id" align="center" prop="deviceId" /> -->
148
       <el-table-column label="出厂编号" align="center" prop="code" />
40
       <el-table-column label="出厂编号" align="center" prop="code" />
149
-      <el-table-column label="用品名称" align="center" prop="name" />
150
-      <el-table-column label="用品类别" align="center" prop="type" />
41
+      <el-table-column label="设备名称" align="center" prop="name" />
42
+      <el-table-column label="设备类别" align="center" prop="type" />
43
+      <el-table-column label="规格型号" align="center" prop="series" />
151
       <el-table-column label="购置时间" align="center" prop="acquisitionTime" width="180">
44
       <el-table-column label="购置时间" align="center" prop="acquisitionTime" width="180">
152
         <template slot-scope="scope">
45
         <template slot-scope="scope">
153
           <span>{{ parseTime(scope.row.acquisitionTime, '{y}-{m}-{d}') }}</span>
46
           <span>{{ parseTime(scope.row.acquisitionTime, '{y}-{m}-{d}') }}</span>
154
         </template>
47
         </template>
155
       </el-table-column>
48
       </el-table-column>
156
-      <el-table-column label="购买价格" align="center" prop="cost" />
49
+      <el-table-column label="购买价格(元)" align="center" prop="cost" />
157
       <el-table-column label="预计使用年限" align="center" prop="expectLife" />
50
       <el-table-column label="预计使用年限" align="center" prop="expectLife" />
158
-      <el-table-column label="规格型号" align="center" prop="series" />
159
-      <el-table-column label="用品品牌" align="center" prop="brand" />
160
-      <el-table-column label="单日成本" align="center" prop="dayCost" />
51
+      <el-table-column label="设备品牌" align="center" prop="brand" />
52
+      <el-table-column label="单日成本(元)" align="center" prop="dayCost" />
161
       <el-table-column label="存放地点" align="center" prop="place" />
53
       <el-table-column label="存放地点" align="center" prop="place" />
54
+      <el-table-column label="管理部门" align="center" prop="dept.deptName" />
162
       <el-table-column label="备注" align="center" prop="remark" />
55
       <el-table-column label="备注" align="center" prop="remark" />
163
-      <el-table-column label="管理部门" align="center" prop="manageDept" />
164
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
56
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
57
+
165
         <template slot-scope="scope">
58
         <template slot-scope="scope">
166
-          <el-button
167
-            size="mini"
168
-            type="text"
169
-            icon="el-icon-edit"
170
-            @click="handleUpdate(scope.row)"
171
-            v-hasPermi="['oa:supply:edit']"
172
-          >修改</el-button>
173
-          <el-button
174
-            size="mini"
175
-            type="text"
176
-            icon="el-icon-delete"
177
-            @click="handleDelete(scope.row)"
178
-            v-hasPermi="['oa:supply:remove']"
179
-          >删除</el-button>
59
+          <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAddDetail(scope.row)"
60
+            v-hasPermi="['oa:car:edit']">添加明细</el-button>
61
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
62
+            v-hasPermi="['oa:device:edit']">修改</el-button>
63
+          <el-button size="mini" type="text" icon="el-icon-delete" style="color: #fc0000;"
64
+            @click="handleDelete(scope.row)" v-hasPermi="['oa:device:remove']">删除</el-button>
180
         </template>
65
         </template>
181
       </el-table-column>
66
       </el-table-column>
182
     </el-table>
67
     </el-table>
183
-    
184
-    <pagination
185
-      v-show="total>0"
186
-      :total="total"
187
-      :page.sync="queryParams.pageNum"
188
-      :limit.sync="queryParams.pageSize"
189
-      @pagination="getList"
190
-    />
191
 
68
 
192
-    <!-- 添加或修改cmc用品信息对话框 -->
193
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
194
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
195
-        <el-form-item label="办公用品编码" prop="supplyNumber">
196
-          <el-input v-model="form.supplyNumber" placeholder="请输入办公用品编码" />
197
-        </el-form-item>
198
-        <el-form-item label="出厂编号" prop="code">
199
-          <el-input v-model="form.code" placeholder="请输入出厂编号" />
200
-        </el-form-item>
201
-        <el-form-item label="用品名称" prop="name">
202
-          <el-input v-model="form.name" placeholder="请输入用品名称" />
203
-        </el-form-item>
204
-        <el-form-item label="购置时间" prop="acquisitionTime">
205
-          <el-date-picker clearable
206
-            v-model="form.acquisitionTime"
207
-            type="date"
208
-            value-format="yyyy-MM-dd"
209
-            placeholder="请选择购置时间">
210
-          </el-date-picker>
211
-        </el-form-item>
212
-        <el-form-item label="购买价格" prop="cost">
213
-          <el-input v-model="form.cost" placeholder="请输入购买价格" />
214
-        </el-form-item>
215
-        <el-form-item label="预计使用年限" prop="expectLife">
216
-          <el-input v-model="form.expectLife" placeholder="请输入预计使用年限" />
217
-        </el-form-item>
218
-        <el-form-item label="规格型号" prop="series">
219
-          <el-input v-model="form.series" placeholder="请输入规格型号" />
220
-        </el-form-item>
221
-        <el-form-item label="用品品牌" prop="brand">
222
-          <el-input v-model="form.brand" placeholder="请输入用品品牌" />
223
-        </el-form-item>
224
-        <el-form-item label="单日成本" prop="dayCost">
225
-          <el-input v-model="form.dayCost" placeholder="请输入单日成本" />
226
-        </el-form-item>
227
-        <el-form-item label="存放地点" prop="place">
228
-          <el-input v-model="form.place" placeholder="请输入存放地点" />
229
-        </el-form-item>
230
-        <el-form-item label="备注" prop="remark">
231
-          <el-input v-model="form.remark" placeholder="请输入备注" />
232
-        </el-form-item>
233
-        <el-form-item label="管理部门" prop="manageDept">
234
-          <el-input v-model="form.manageDept" placeholder="请输入管理部门" />
69
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
70
+      @pagination="getList" />
71
+
72
+    <!-- 添加或修改cmc设备信息对话框 -->
73
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
74
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
75
+        <el-row :gutter="20">
76
+          <el-col :span="12">
77
+            <el-form-item label="出厂编号" prop="code">
78
+              <el-input v-model="form.code" placeholder="请输入出厂编号" />
79
+            </el-form-item>
80
+          </el-col>
81
+          <el-col :span="12">
82
+            <el-form-item label="设备名称" prop="name">
83
+              <el-input v-model="form.name" placeholder="请输入设备名称" />
84
+            </el-form-item>
85
+          </el-col>
86
+        </el-row>
87
+        <el-row :gutter="20">
88
+          <el-col :span="12">
89
+            <el-form-item label="购置时间" prop="acquisitionTime">
90
+              <el-date-picker clearable v-model="form.acquisitionTime" type="date" value-format="yyyy-MM-dd"
91
+                placeholder="请选择购置时间">
92
+              </el-date-picker>
93
+            </el-form-item>
94
+          </el-col>
95
+          <el-col :span="12">
96
+            <el-form-item label="规格型号" prop="series">
97
+              <el-input v-model="form.series" placeholder="请输入规格型号" />
98
+            </el-form-item>
99
+          </el-col>
100
+        </el-row>
101
+        <el-row :gutter="20">
102
+          <el-col :span="12">
103
+            <el-form-item label="预计使用年限" prop="expectLife">
104
+              <el-input v-model="form.expectLife" placeholder="请输入年限" style="width:130px;margin-right:10px;" />
105
+              <span>年</span>
106
+            </el-form-item>
107
+          </el-col>
108
+          <el-col :span="12">
109
+            <el-form-item label="购买价格" prop="cost">
110
+              <el-input style="width:130px;margin-right:10px;" v-model="form.cost" placeholder="请输入金额" />
111
+              <span>元</span>
112
+            </el-form-item>
113
+          </el-col>
114
+        </el-row>
115
+        <el-row :gutter="20">
116
+          <el-col :span="12">
117
+            <el-form-item label="设备品牌" prop="brand">
118
+              <el-input v-model="form.brand" placeholder="请输入设备品牌" />
119
+            </el-form-item>
120
+          </el-col>
121
+          <el-col :span="12">
122
+            <el-form-item label="单日成本" prop="dayCost">
123
+              <el-input v-model="form.dayCost" placeholder="请输入单日成本" />
124
+            </el-form-item>
125
+          </el-col>
126
+        </el-row>
127
+        <el-row :gutter="20">
128
+          <el-col :span="12">
129
+            <el-form-item label="存放地点" prop="place">
130
+              <el-input v-model="form.place" placeholder="请输入存放地点" />
131
+            </el-form-item>
132
+          </el-col>
133
+          <el-col :span="12">
134
+            <el-form-item label="设备类别" prop="place">
135
+              <el-input v-model="form.type" placeholder="请输入设备类别" />
136
+            </el-form-item>
137
+          </el-col>
138
+        </el-row>
139
+        <el-form-item label="管理部门" prop="dept.deptName">
140
+          <el-input v-model="form.deptName" placeholder="请输入管理部门" />
235
         </el-form-item>
141
         </el-form-item>
142
+        <el-row :gutter="20">
143
+          <el-col :span="24">
144
+            <el-form-item label="备注" prop="remark">
145
+              <el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
146
+            </el-form-item>
147
+          </el-col>
148
+        </el-row>
236
       </el-form>
149
       </el-form>
150
+
237
       <div slot="footer" class="dialog-footer">
151
       <div slot="footer" class="dialog-footer">
238
         <el-button type="primary" @click="submitForm">确 定</el-button>
152
         <el-button type="primary" @click="submitForm">确 定</el-button>
239
         <el-button @click="cancel">取 消</el-button>
153
         <el-button @click="cancel">取 消</el-button>
243
 </template>
157
 </template>
244
 
158
 
245
 <script>
159
 <script>
246
-import { listSupply, getSupply, delSupply, addSupply, updateSupply } from "@/api/oa/supply/supply";
160
+import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/oa/device/device";
247
 
161
 
248
 export default {
162
 export default {
249
-  name: "Supply",
163
+  name: "Device",
250
   data() {
164
   data() {
251
     return {
165
     return {
252
       // 遮罩层
166
       // 遮罩层
261
       showSearch: true,
175
       showSearch: true,
262
       // 总条数
176
       // 总条数
263
       total: 0,
177
       total: 0,
264
-      // cmc用品信息表格数据
265
-      supplyList: [],
178
+      // cmc设备信息表格数据
179
+      deviceList: [],
266
       // 弹出层标题
180
       // 弹出层标题
267
       title: "",
181
       title: "",
268
       // 是否显示弹出层
182
       // 是否显示弹出层
271
       queryParams: {
185
       queryParams: {
272
         pageNum: 1,
186
         pageNum: 1,
273
         pageSize: 10,
187
         pageSize: 10,
274
-        supplyNumber: null,
275
         code: null,
188
         code: null,
276
-        name: null,
277
         type: null,
189
         type: null,
278
         acquisitionTime: null,
190
         acquisitionTime: null,
279
         cost: null,
191
         cost: null,
280
         expectLife: null,
192
         expectLife: null,
281
-        series: null,
282
-        brand: null,
283
-        dayCost: null,
284
-        place: null,
285
-        manageDept: null
193
+        series: null
286
       },
194
       },
287
       // 表单参数
195
       // 表单参数
288
       form: {},
196
       form: {},
295
     this.getList();
203
     this.getList();
296
   },
204
   },
297
   methods: {
205
   methods: {
298
-    /** 查询cmc用品信息列表 */
206
+    /** 查询cmc设备信息列表 */
299
     getList() {
207
     getList() {
300
       this.loading = true;
208
       this.loading = true;
301
-      listSupply(this.queryParams).then(response => {
302
-        this.supplyList = response.rows;
209
+      this.queryParams.type = '办公设备';
210
+      listDevice(this.queryParams).then(response => {
211
+        this.deviceList = response.rows;
303
         this.total = response.total;
212
         this.total = response.total;
304
         this.loading = false;
213
         this.loading = false;
305
       });
214
       });
312
     // 表单重置
221
     // 表单重置
313
     reset() {
222
     reset() {
314
       this.form = {
223
       this.form = {
315
-        supplyId: null,
316
-        supplyNumber: null,
224
+        deviceId: null,
317
         code: null,
225
         code: null,
318
-        name: null,
319
         type: null,
226
         type: null,
320
         acquisitionTime: null,
227
         acquisitionTime: null,
321
         cost: null,
228
         cost: null,
322
         expectLife: null,
229
         expectLife: null,
323
-        series: null,
324
-        brand: null,
325
-        dayCost: null,
326
-        place: null,
327
-        remark: null,
328
-        manageDept: null
230
+        series: null
329
       };
231
       };
330
       this.resetForm("form");
232
       this.resetForm("form");
331
     },
233
     },
341
     },
243
     },
342
     // 多选框选中数据
244
     // 多选框选中数据
343
     handleSelectionChange(selection) {
245
     handleSelectionChange(selection) {
344
-      this.ids = selection.map(item => item.supplyId)
345
-      this.single = selection.length!==1
246
+      this.ids = selection.map(item => item.deviceId)
247
+      this.single = selection.length !== 1
346
       this.multiple = !selection.length
248
       this.multiple = !selection.length
347
     },
249
     },
348
     /** 新增按钮操作 */
250
     /** 新增按钮操作 */
349
     handleAdd() {
251
     handleAdd() {
350
       this.reset();
252
       this.reset();
351
       this.open = true;
253
       this.open = true;
352
-      this.title = "添加cmc用品信息";
254
+      this.title = "添加设备信息";
255
+    },
256
+    // 新增明细按钮
257
+    handleAddDetail(row) {
258
+      this.$router.push({
259
+        path: '/device/approval',
260
+        query: {
261
+          deviceId: row.deviceId,
262
+        }
263
+      })
353
     },
264
     },
354
     /** 修改按钮操作 */
265
     /** 修改按钮操作 */
355
     handleUpdate(row) {
266
     handleUpdate(row) {
356
       this.reset();
267
       this.reset();
357
-      const supplyId = row.supplyId || this.ids
358
-      getSupply(supplyId).then(response => {
268
+      const deviceId = row.deviceId || this.ids
269
+      getDevice(deviceId).then(response => {
359
         this.form = response.data;
270
         this.form = response.data;
360
         this.open = true;
271
         this.open = true;
361
-        this.title = "修改cmc用品信息";
272
+        this.title = "修改设备信息";
362
       });
273
       });
363
     },
274
     },
364
     /** 提交按钮 */
275
     /** 提交按钮 */
365
     submitForm() {
276
     submitForm() {
366
       this.$refs["form"].validate(valid => {
277
       this.$refs["form"].validate(valid => {
367
         if (valid) {
278
         if (valid) {
368
-          if (this.form.supplyId != null) {
369
-            updateSupply(this.form).then(response => {
279
+          if (this.form.deviceId != null) {
280
+            updateDevice(this.form).then(response => {
370
               this.$modal.msgSuccess("修改成功");
281
               this.$modal.msgSuccess("修改成功");
371
               this.open = false;
282
               this.open = false;
372
               this.getList();
283
               this.getList();
373
             });
284
             });
374
           } else {
285
           } else {
375
-            addSupply(this.form).then(response => {
286
+            addDevice(this.form).then(response => {
376
               this.$modal.msgSuccess("新增成功");
287
               this.$modal.msgSuccess("新增成功");
377
               this.open = false;
288
               this.open = false;
378
               this.getList();
289
               this.getList();
383
     },
294
     },
384
     /** 删除按钮操作 */
295
     /** 删除按钮操作 */
385
     handleDelete(row) {
296
     handleDelete(row) {
386
-      const supplyIds = row.supplyId || this.ids;
387
-      this.$modal.confirm('是否确认删除cmc用品信息编号为"' + supplyIds + '"的数据项?').then(function() {
388
-        return delSupply(supplyIds);
297
+      const deviceIds = row.deviceId || this.ids;
298
+      const code = row.code
299
+      this.$modal.confirm('是否确认删除设备编号为【"' + code + '"】的设备数据?').then(function () {
300
+        return delDevice(deviceIds);
389
       }).then(() => {
301
       }).then(() => {
390
         this.getList();
302
         this.getList();
391
         this.$modal.msgSuccess("删除成功");
303
         this.$modal.msgSuccess("删除成功");
392
-      }).catch(() => {});
304
+      }).catch(() => { });
393
     },
305
     },
394
     /** 导出按钮操作 */
306
     /** 导出按钮操作 */
395
     handleExport() {
307
     handleExport() {
396
-      this.download('oa/supply/export', {
308
+      this.download('oa/device/export', {
397
         ...this.queryParams
309
         ...this.queryParams
398
-      }, `supply_${new Date().getTime()}.xlsx`)
310
+      }, `device_${new Date().getTime()}.xlsx`)
399
     }
311
     }
400
   }
312
   }
401
 };
313
 };

Loading…
Cancel
Save