Commit 15b196a9 authored by yaobeibei's avatar yaobeibei

add ok

parent 78721aba
...@@ -678,6 +678,7 @@ app.post('/checkCall', async function (req, res) { ...@@ -678,6 +678,7 @@ app.post('/checkCall', async function (req, res) {
item.preNum = x.preNum / 3 item.preNum = x.preNum / 3
if (x.pre === false) { if (x.pre === false) {
item.sendNum = x.number / 3 item.sendNum = x.number / 3
item.entry = true
} else { } else {
item.sendNum = 0 item.sendNum = 0
} }
...@@ -2079,36 +2080,10 @@ app.post('/entry', function(req, res) { ...@@ -2079,36 +2080,10 @@ app.post('/entry', function(req, res) {
} }
console.log(response.statusCode, response.message) console.log(response.statusCode, response.message)
if (response.statusCode === 200) { if (response.statusCode === 200) {
res.send({status: 200, datas: response.message}) res.send({status: 200, datas: response.body})
} }
if (response.statusCode === 204) { if (response.statusCode === 204) {
res.send({status: 204, message: '订单数据未找到(运营商未返回任务记录)'}) res.send({status: 204, message: '订单数据未找到(运营商未返回任务记录)'})
// res.send({status: 200, datas: {
// billCheck: {
// result : "通过", // 结果(下同)
// at : 1531979761733.0 // 执行时间戳(下同)
// },
// fileCheck: {
// result : "通过",
// at : 1531979761733.0
// },
// countCheck: {
// result : "通过",
// at : 1531979761733.0,
// now: 500, // 当前数量
// expect: 500 // 期待数量
// },
// tagCheck: {
// result : "通过",
// at : 1531979761733.0,
// lose: 0, // 缺失量
// total: 500 // 期待数量
// },
// randomCall: {
// result : "通过",
// at : 1531979761733.0
// }
// }})
} }
}) })
}) })
...@@ -2124,7 +2099,7 @@ app.post('/entryIn', function(req, res) { ...@@ -2124,7 +2099,7 @@ app.post('/entryIn', function(req, res) {
} }
console.log(response.statusCode, response.message) console.log(response.statusCode, response.message)
if (response.statusCode === 200) { if (response.statusCode === 200) {
res.send({status: 200, datas: response.message}) res.send({status: 200, datas: response.body})
} }
if (response.statusCode === 204) { if (response.statusCode === 204) {
res.send({status: 204, message: '订单数据未找到'}) res.send({status: 204, message: '订单数据未找到'})
......
...@@ -512,6 +512,7 @@ ...@@ -512,6 +512,7 @@
}, },
updateStatus (row) { updateStatus (row) {
let billID = row.name let billID = row.name
let entryButton = row.entry
fetch('/api/entry', { fetch('/api/entry', {
method: 'POST', method: 'POST',
headers: {'Content-Type': 'application/json;charset=UTF-8'}, headers: {'Content-Type': 'application/json;charset=UTF-8'},
...@@ -521,8 +522,18 @@ ...@@ -521,8 +522,18 @@
}).then(data => { }).then(data => {
console.dir(data) console.dir(data)
this.entryBillID = billID this.entryBillID = billID
let datas = JSON.parse(data.datas)
console.log(datas)
if (data.status === 200) { if (data.status === 200) {
this.formatEntry(data.datas) if (entryButton) {
self.entryBtn = true
this.$message({
type: 'success',
message: '该订单已经被录入'
})
}
this.formatEntry(datas)
} else { } else {
this.$alert(data.message, '无法录入', { this.$alert(data.message, '无法录入', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -566,6 +577,7 @@ ...@@ -566,6 +577,7 @@
closeEntry () { closeEntry () {
this.entryBillID = null this.entryBillID = null
this.statusDialog = false this.statusDialog = false
this.entryBtn = false
}, },
fileReaderDsp () { fileReaderDsp () {
let self = this let self = this
...@@ -577,8 +589,11 @@ ...@@ -577,8 +589,11 @@
}).then(res => { }).then(res => {
return res.json() return res.json()
}).then(data => { }).then(data => {
console.log(data)
let datas = JSON.parse(data.datas)
console.log(datas)
if (data.status === 200) { if (data.status === 200) {
if (data.datas.ok === 1) { if (datas.ok === 1) {
this.message({ this.message({
type: 'success', type: 'success',
message: '录入成功' message: '录入成功'
...@@ -586,7 +601,7 @@ ...@@ -586,7 +601,7 @@
self.billID = null self.billID = null
self.statusDialog = false self.statusDialog = false
} else { } else {
this.$alert(data.datas.err, '录入失败', { this.$alert(datas.err, '录入失败', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$message({ this.$message({
......
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