Commit 38bed85a by lichengming

修改了数据录入添加设备

parent fd08629f
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
import http from '../http' import http from '../http'
import { https } from '../https'
// import { https } from '../https' // import { https } from '../https'
export default { export default {
...@@ -97,5 +98,10 @@ export default { ...@@ -97,5 +98,10 @@ export default {
'&remark=' + '&remark=' +
data.remark data.remark
) )
.then(res => res),
// 添加设备信息
addExpEquip: data =>
https
.post('soil/v1/experiment_rel_equip/add_exp_equip', JSON.stringify(data))
.then(res => res) .then(res => res)
} }
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
} }
}, },
_ok() { _ok() {
if (this.tempData.length === 0) { if (this.delIds.length === 0) {
this.$Message.warning('请至少选择一条数据!') this.$Message.warning('请至少选择一条数据!')
this._hideLoading() this._hideLoading()
} else { } else {
......
...@@ -215,8 +215,30 @@ export default { ...@@ -215,8 +215,30 @@ export default {
this.userColumns = colList this.userColumns = colList
this.$refs.pageTable._loadColumn(colList) this.$refs.pageTable._loadColumn(colList)
}, },
_equipResult(res) { _equipResult: async function(res) {
console.log(res) console.log(res)
const tempData = {}
tempData.equipList = []
res.map((item, index) => {
tempData.equipList.push({
equipId: item.id,
equipName: item.name,
acquisitionCommand: item.acquisitionCommand,
brand: item.brand,
collectionAddress: item.acquisitionAddress,
collectionType: item.acquisitionType,
equipNum: item.labNum,
ipAddress: item.ipAddress,
labNum: item.classId,
spec: item.spec
})
})
tempData.expIds = this.selectIds
const result = await soilTest.addExpEquip(tempData)
if (result) {
this.$Message.success('添加成功')
}
// let equipIds = [] // let equipIds = []
// for (let i = 0; i < res.length; i++) { // for (let i = 0; i < res.length; i++) {
// equipIds.push(res[i].id) // equipIds.push(res[i].id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment