feat(cms):  CuttingInboundList 组件中增加提交功能并优化 CuttingInboundModal 组件- 在 CuttingInboundList 组件中添加提交按钮和相关逻辑- 在 CuttingInboundModal 组件中增加入库数量校验
- 优化 CuttingInboundModal 组件的样式和布局
已修改2个文件
94 ■■■■ 文件已修改
src/views/cms/CuttingInboundList.vue 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/CuttingInboundModal.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundList.vue
@@ -21,8 +21,26 @@
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col>
            <a-col
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="确认人">
              <j-search-select-tag
                v-model="queryParam.confirmer"
                placeholder="请选择确认人"
                dict="sys_user,realname,id,del_flag!=1"
              />
            </a-form-item>
          </a-col>
<!--          <a-col :md="6" :sm="8">-->
<!--            <a-form-item label="入库时间">-->
<!--              <j-date-->
<!--                v-model="queryParam.receiveTime"-->
<!--                type="date"-->
<!--                value-format="YYYY-MM-DD"-->
<!--              />-->
<!--            </a-form-item>-->
<!--          </a-col>-->
          <a-col
            :md="6"
            :sm="8"
          >
@@ -113,6 +131,11 @@
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record.id)">
                  <a>提交</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
@@ -138,7 +161,7 @@
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import CuttingInboundModal from './modules/CuttingInboundModal'
  import CuttingInboundDetailList from './CuttingInboundDetailList'
  import { downFile } from '@api/manage'
  import { downFile, httpAction } from '@api/manage'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import store from '@/store'
@@ -238,10 +261,13 @@
      },
    },
    methods: {
      searchQuery() {
        this.loadData(1);
      },
      searchReset() {
      this.queryParam = {}
      this.$refs.cuttingInbounDetailList.dataSource = []
      this.loadData(1);
        this.queryParam = {}
        this.$refs.cuttingInbounDetailList.dataSource = []
        this.loadData(1);
      },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
@@ -289,9 +315,6 @@
        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
          param['selections'] = this.selectedRowKeys.join(",")
        }
        console.log("导出参数",param)
        downFile(this.url.exportXlsUrl,param).then((data)=>{
          if (!data) {
@@ -382,6 +405,46 @@
          }
        }
      },
      /**
       *  单据提交
       */
      // handleSubmit: function() {
      //   if (!this.url.submit) {
      //     this.$message.error('请设置url.submit属性!')
      //     return
      //   }
      //   if (this.selectedRowKeys.length != 1) {
      //     this.$message.warning('请选择一条记录!')
      //     return
      //   } else {
      //     var id = this.selectedRowKeys[0]
      //     let httpurl = this.url.submit
      //     let method = 'post'
      //     var params = { id: id }
      //
      //     const that = this
      //
      //     this.$confirm({
      //       title: '确认提交!',
      //       okText: '确认',
      //       cancelText: '取消',
      //       onOk() {
      //         httpAction(httpurl, params, method).then((res) => {
      //           if (res.success) {
      //             that.$message.success(res.message)
      //             that.loadData()
      //           } else {
      //             that.$message.warning(res.message)
      //           }
      //         }).finally(() => {
      //           that.loading = false
      //
      //         })
      //       }
      //     })
      //   }
      // },
    }
  }
</script>
src/views/cms/modules/CuttingInboundModal.vue
@@ -60,9 +60,9 @@
        </a-row>
      </a-form>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()"
      >选择刀具</a-button
    >
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">
      选择刀具
    </a-button>
    <a-table
      ref="table"
      bordered
@@ -265,6 +265,13 @@
        this.$message.error('请先选择入库刀具')
        return
      }
      // 校验入库数量是否填写
      for(let i=0; i<this.dataSource.length; i++) {
        if (!this.dataSource[i].receiveNumber || this.dataSource[i].receiveNumber <= 0) {
          this.$message.error(`必须填写入库数量`)
          return
        }
      }
      const that = this
      // 触发表单验证
      this.form.validateFields((err, values) => {