chenlu
2024-02-20 6965db086df978e46e0a1bd7227b981ad48a9b1c
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/FinishedGoodsIssue.vue
@@ -25,44 +25,59 @@
let remarks = ref(null)
const  xGrid = ref();
const gridEvents = {
  toolbarButtonClick({ code }) {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if($grid){
      switch (code){
        case 'verify':{
          const $table = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            console.log(selectRecords)
    if ($grid) {
      switch (code) {
        case 'verify': {
            let flowData = ref({
          const selectRecords = $grid.getCheckboxRecords()
          console.log(selectRecords)
              userId:userid,
              userName:username,
              operateType:operateType,
              remarks:remarks,
              orderDetail:selectRecords
            })
            request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryTakeOut",flowData.value).then((res) => {
              if(res.code==200){
                location.reload();
                ElMessage.success("领出成功")
              }else{
                ElMessage.warning(res.msg)
                router.push("/login")
              }
            })
          if (selectRecords.length > 0) {
            const errMap = await $grid.validate(selectRecords)
            console.log(errMap)
            if (errMap) {
              ElMessage.warning("数据校验失败")
              return
            }
          } else {
            ElMessage.warning("未选中数据")
            return
          }
          const operatetype = operateType._rawValue
          if(operatetype === null || operatetype === undefined || operatetype === ''){
            ElMessage.warning("请选择领出类型")
            return
          }
          let flowData = ref({
            userId:userid,
            userName:username,
            operateType:operateType,
            remarks:remarks,
            orderDetail:selectRecords
          })
          request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryTakeOut",flowData.value).then((res) => {
            if(res.code==200){
              ElMessage.success("领出成功")
              router.push({path: '/main/delivery/SelectOrderList'})
            }else{
              ElMessage.warning(res.msg)
              router.push("/login")
            }
          })
          return
        }
        case 'out':{
        case 'out': {
          router.push({path: '/main/productStock/TakeOutRecord'});
          return
        }
        case 'rework':{
        case 'rework': {
          router.push({path: '/main/productStock/FinishedProductRework'});
          return
        }
@@ -246,6 +261,13 @@
})
/*数据校验*/
const validRules = ref({
  quantity: [
    { required: true, message: '请输入领取数量' }
  ]
})
@@ -267,6 +289,7 @@
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
        :edit-rules="validRules"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->