18 changed files with 648 additions and 566 deletions
-
12src/api/stockTask/index.js
-
158src/assets/styles/manage.scss
-
5src/assets/styles/mixin.scss
-
1src/assets/styles/yxk-admin.scss
-
1src/views/components/bookSwiper.vue
-
5src/views/components/canvasPreview.vue
-
1src/views/visualCheck/checkManage/bookshelfSearch/index.vue
-
150src/views/visualCheck/checkManage/dataScreening/girdList.vue
-
188src/views/visualCheck/checkManage/dataScreening/index.vue
-
158src/views/visualCheck/checkManage/dataScreening/module/form.vue
-
148src/views/visualCheck/checkManage/dataScreening/regionsList.vue
-
123src/views/visualCheck/checkManage/dataScreening/shelfList.vue
-
62src/views/visualCheck/checkManage/statistic/reverseShelf/index.vue
-
109src/views/visualCheck/checkManage/statistic/search.vue
-
61src/views/visualCheck/checkManage/statistic/seqShelf/index.vue
-
17src/views/visualCheck/venueDevice/bookshelf/index.vue
-
5src/views/visualCheck/venueDevice/bookshelfPosition/index.vue
-
10src/views/visualCheck/venueDevice/device/index.vue
@ -0,0 +1,158 @@ |
|||
<template> |
|||
<el-dialog append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseForm" :visible="formVisible" title="新增盘点"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="盘点单号" prop="stockBill"> |
|||
<el-input v-model="form.stockBill" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="盘点类型" prop="stockTypeName"> |
|||
<el-input v-model="form.stockTypeName" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="目标位置" prop="stockRegion"> |
|||
<el-input v-model="form.stockRegion" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="目标数量" prop="stockGridNumName"> |
|||
<el-input v-model="form.stockGridNumName" disabled /> |
|||
</el-form-item> |
|||
<el-row> |
|||
<el-form-item label="备注" prop="stockRemarks"> |
|||
<el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" /> |
|||
</el-form-item> |
|||
</el-row> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="handleCloseForm">取消</el-button> |
|||
<el-button :loading="crud.status.cu === 2" type="primary" @click="handleComfiredEditing">保存</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudStockTaskLog from '@/api/stockTaskLog/index' |
|||
import CRUD, { form } from '@crud/crud' |
|||
|
|||
const defaultForm = { stockTypeName: '', stockType: null, stockBill: null, stockRegion: '', stockGridNum: null, stockGridNumName: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null } |
|||
export default { |
|||
name: 'DataForm', |
|||
mixins: [ |
|||
form(function() { |
|||
return Object.assign({ }, defaultForm) |
|||
}) |
|||
], |
|||
data() { |
|||
return { |
|||
formVisible: false, |
|||
rules: { |
|||
stockBill: [ |
|||
{ required: true, message: '请输入盘点单号', trigger: 'blur' } |
|||
], |
|||
stockTypeName: [ |
|||
{ required: true, message: '请输入盘点类型', trigger: 'blur' } |
|||
], |
|||
stockRegion: [ |
|||
{ required: true, message: '请输入目标位置', trigger: 'blur' } |
|||
], |
|||
stockGridNumName: [ |
|||
{ required: true, message: '请输入目标数量', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
setData(type) { |
|||
this.form.stockType = type |
|||
const typeMap = { |
|||
1: { |
|||
regionId: null, |
|||
shelfId: null, |
|||
gridShelf: null, |
|||
gridId: null, |
|||
stockTypeName: '全量盘点' |
|||
}, |
|||
2: { |
|||
regionId: this.form.regionId || null, |
|||
shelfId: null, |
|||
gridShelf: null, |
|||
gridId: null, |
|||
stockTypeName: '区域盘点' |
|||
}, |
|||
4: { |
|||
regionId: null, |
|||
shelfId: this.form.shelfId || null, |
|||
gridShelf: null, |
|||
gridId: null, |
|||
stockTypeName: '书架盘点' |
|||
}, |
|||
5: { |
|||
regionId: null, |
|||
shelfId: this.form.shelfId || null, |
|||
gridShelf: this.form.gridShelf || null, |
|||
gridId: null, |
|||
stockTypeName: '架位盘点' |
|||
}, |
|||
6: { |
|||
regionId: null, |
|||
shelfId: null, |
|||
gridShelf: null, |
|||
gridId: this.form.gridId || null, |
|||
stockTypeName: '层位盘点' |
|||
} |
|||
} |
|||
const { regionId, shelfId, gridShelf, gridId, stockTypeName } = typeMap[type] || {} |
|||
const params = { regionId, shelfId, gridShelf, gridId } |
|||
this.form.stockTypeName = stockTypeName |
|||
Promise.all([ |
|||
crudStockTaskLog.FetchNewBillNo(), |
|||
crudStockTaskLog.FetchStockGirdNum(params) |
|||
]).then(([newBillNoRes, stockGridNumRes]) => { |
|||
this.form.stockBill = newBillNoRes |
|||
this.form.stockGridNumName = stockGridNumRes + ' / 层位' |
|||
this.form.stockGridNum = stockGridNumRes |
|||
}).catch(error => { |
|||
console.error(error) |
|||
}) |
|||
}, |
|||
handleCloseForm() { |
|||
this.$refs['form'].clearValidate() |
|||
this.$refs['form'].resetFields() |
|||
// this.form = {} |
|||
this.formVisible = false |
|||
}, |
|||
handleComfiredEditing() { |
|||
this.$refs['form'].validate((valid) => { |
|||
if (valid) { |
|||
delete this.form.stockGridNumName |
|||
delete this.form.stockTypeName |
|||
console.log('this.form', this.form) |
|||
// crudStockTaskLog.add(this.form).then((res) => { |
|||
// if (res.code !== 500) { |
|||
// this.$message({ message: '新增盘点成功', type: 'success', offset: 8 }) |
|||
// } else { |
|||
// this.$message({ message: res.message, type: 'error', offset: 8 }) |
|||
// } |
|||
// this.handleCloseForm() |
|||
// // this.$emit('refresh') |
|||
// }).catch(err => { |
|||
// console.log(err) |
|||
// }) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
// 提交前的验证 |
|||
[CRUD.HOOK.afterValidateCU](crud) { |
|||
console.log(crud.form) |
|||
delete crud.form.stockGridNumName |
|||
delete crud.form.stockTypeName |
|||
return true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue