Commit 14ba9e6a by lichengming

修改了扫码领样

parent 50fc05b6
......@@ -137,5 +137,9 @@ export default {
// 余样编辑
editPrepare: data =>
http.put('soil/v1/prepare/' + data.id, data.obj).then(res => res),
getUserList: data => http.post('/base/v1/user/page').then(res => res)
getUserList: data => http.post('/base/v1/user/page').then(res => res),
scanTakeSample: data =>
http
.post('soil/v1/sample/scan_take_sample?sampleCode=' + data)
.then(res => res)
}
......@@ -22,6 +22,8 @@
</template>
<script>
/* 扫码接收、扫码发放 */
import { soilSample } from '../../../api'
export default {
components: {},
data() {
......@@ -62,38 +64,20 @@ export default {
_cancel() {
this.showSubmitModal = false
},
_numBlur() {
if (this.modalTitle === '扫码接收') {
// 扫码接收
this.$store
.dispatch('FoodSample/scanReceive', {
num: this.num
})
.then(() => {
this._resultChange(' 接收')
})
} else {
_numBlur: async function() {
// 扫码发放
const param = {}
Object.assign(param, this.formObj, { num: this.num })
if (this.modalTitle === '扫码发放') {
this.$store
.dispatch('FoodSample/scanSend', this.$serializeFormSearch(param))
.then(() => {
this._resultChange(' 发放')
})
} else if (this.modalTitle === '扫码接收发放') {
this.$store
.dispatch(
'FoodSample/scanReceiveSend',
this.$serializeFormSearch(param)
)
.then(() => {
this._resultChange(' 接收发放')
})
}
// 扫码接收发放
const result = await soilSample.scanTakeSample(this.num)
if (result) {
console.log(result)
// this._resultChange(' 发放')
}
// this.$store
// .dispatch('FoodSample/scanSend', this.$serializeFormSearch(param))
// .then(() => {
// this._resultChange(' 发放')
// })
this._autoFocus()
},
_resultChange(msg) {
......
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