123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <a-modal
- centered
- class="inventoryCheckAddModal-modal"
- :footer="null"
- :maskClosable="false"
- :closable="false"
- title="新增盘点单"
- v-model="isShow"
- @cancel="isShow=false"
- :width="600">
- <a-spin :spinning="spinning" tip="Loading...">
- <div>
- <div class="inventoryCheckAddModal-con">
- <h3>全盘盘点</h3>
- <p>全盘是指所有有过入库记录的产品都参与盘点</p>
- <p>确定创建新的盘点单吗?</p>
- <p v-show="isShowWarehouse">
- 仓库:<warehouse
- style="width:200px;"
- v-model="form.warehouseSn"
- isPermission
- id="inventoryCheckAddModal-warehouseSn"
- placeholder="请选择仓库"
- />
- </p>
- </div>
- <div class="btn-cont">
- <a-button id="inventoryCheckAddModal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
- <a-button type="primary" id="inventoryCheckAddModal-save" @click="handleSave">确定</a-button>
- </div>
- </div>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { checkWarehouseSave } from '@/api/checkWarehouse'
- import warehouse from '@/views/common/chooseWarehouse.js'
- export default {
- name: 'ProductInfoDetailModal',
- mixins: [commonMixin],
- components:{warehouse},
- props: {
- openModal: {
- type: Boolean,
- default: false
- }
- },
- data () {
- return {
- spinning: false,
- form:{warehouseSn:undefined},
- isShow: this.openModal
- }
- },
- methods: {
-
- handleSave () {
- if(this.isShowWarehouse && !this.form.warehouseSn){
- this.$message.error('请选择仓库')
- return
- }
- this.spinning = true
- checkWarehouseSave(this.form).then(res => {
- this.spinning = false
- if (res.status == 200) {
- this.$message.success('盘点单新增成功')
- this.$emit('ok', res.data)
- this.isShow = false
- }
- })
- }
- },
- watch: {
-
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
-
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.form.warehouseSn = undefined
- this.$emit('close')
- }else{
-
- const defWareHouse = this.$store.state.app.defWarehouse
- this.form.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
- }
- }
- }
- }
- </script>
- <style lang="less">
- .inventoryCheckAddModal-modal{
- .ant-modal-body {
- padding: 30px 40px 24px;
- }
- .inventoryCheckAddModal-con{
- text-align: center;
- h3{
- font-size: 16px;
- font-weight: bold;
- margin-bottom: 25px;
- }
- }
- .btn-cont {
- text-align: center;
- margin: 35px 0 10px;
- }
- }
- </style>
|