Commit 14ba9e6a by lichengming

修改了扫码领样

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