廖井涛
2024-06-14 fd596adc9e93e777d2dec6dacf8003c4b8dbf960
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorageCreate.vue
@@ -70,35 +70,35 @@
const value = ref('')
const options = [
  {
    value: '原片',
    label: '原片'
    value: t('mainIngredient.originalFilm'),
    label: t('mainIngredient.originalFilm')
  },
  {
    value: '辅料',
    label: '辅料',
    value: t('mainIngredient.accessories'),
    label: t('mainIngredient.accessories'),
  }
]
let arr = [
  {field: 'select',type: 'checkbox',fixed:"left", title: '选择', width: '80' },
  { type: 'seq',fixed:"left", title: '自序', width: '80' },
  {field: 'returnQuantity', width:'150', title: '返库数量', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'dateOfManufacture', width:'150', title: '生产日期', sortable: true,editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},},
  {field: 'select',type: 'checkbox',fixed:"left", title: t('basicData.check'), width: '80' },
  { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' },
  {field: 'returnQuantity', width:'150', title: t('mainIngredientStock.returnQuantity'), sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'dateOfManufacture', width:'150', title: t('mainIngredientStock.dateOfManufacture'), sortable: true,editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},},
  {field: 'inventoryOrganization', width:'150', title: '库存组织', sortable: true,folding: true,slots: { edit: 'inventoryOrganization'},editRender: { name: '$select', attrs: { placeholder: '' } }},
  {field: 'producer', width:'150', title: '产地', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'qualityGuaranteePeriod', width:'150', title: '保质期', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'inventoryArea', width:'150', title: '库存区域',sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'inventoryOrganization', width:'150', title: t('mainIngredientStock.inventoryOrganization'), sortable: true,folding: true,slots: { edit: 'inventoryOrganization'},editRender: { name: '$select', attrs: { placeholder: '' } }},
  {field: 'producer', width:'150', title: t('mainIngredientStock.producer'), sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'qualityGuaranteePeriod', width:'150', title: t('mainIngredientStock.qualityGuaranteePeriod'), sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'inventoryArea', width:'150', title: t('productStock.inventoryArea'),sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'remarks',width: '80', title: '备注', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'id', width: '150',title: '物料编码', sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
  {field: 'remarks',width: '80', title: t('basicData.remarks'), sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
  {field: 'id', width: '150',title: t('mainIngredient.materialCode'), sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
]
//页面第一次加载
request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织|材料返库类型`).then((res) => {
request.get(`/BasicWarehouse/BasicWarehouseTypes/`+t('mainIngredientStock.inventoryOrganization')+'|'+t('mainIngredientStock.materialReturnType')).then((res) => {
  if(res.code==200){
    titleSelectJson.value=deepClone(res.data)
@@ -132,7 +132,7 @@
      if(res.code==200){
        titleUploadData.value=deepClone(res.data.returningWarehouse)
        //根据审核状态显示审核按钮或者是反审按钮
        value.value='原片|辅料'
        value.value=t('mainIngredient.originalFilm')+'|'+t('mainIngredient.accessories')
        getStoreWork()
        if(titleUploadData.value.reviewedState!==0){
          gridOptions.toolbarConfig.buttons[1].disabled = true
@@ -179,7 +179,7 @@
        //显示复选框
        xGrid.value.showColumn("select")
        value.value='原片'
        value.value=t('mainIngredient.originalFilm')
        getStoreWork()
        getStoreWorks()
@@ -198,7 +198,7 @@
//库存组织
const getInventoryOrganization=()=>{
  //页面第一次加载
  request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织|材料返库类型`).then((res) => {
  request.get(`/BasicWarehouse/BasicWarehouseTypes//`+t('mainIngredientStock.inventoryOrganization')+'|'+t('mainIngredientStock.materialReturnType')).then((res) => {
    if(res.code==200){
      titleSelectJson.value=deepClone(res.data)
@@ -260,11 +260,11 @@
        materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
      }
      if(value.value==='原片'){
      if(value.value===t('mainIngredient.originalFilm')){
        materialStore.value.forEach(item => {
          item['inventoryOrganization'] = titleSelectJson.value["inventoryOrganization"][0].operateTypeName
        })
      }else if(value.value==='辅料'){
      }else if(value.value===t('mainIngredient.accessories')){
        materialStore.value.forEach(item => {
          item['inventoryOrganization'] = titleSelectJson.value["inventoryOrganization"][1].operateTypeName
        })
@@ -308,27 +308,27 @@
          }
          const materialRequisitionPersonnel = titleUploadData.value.materialRequisitionPersonnel
          if(materialRequisitionPersonnel === null || materialRequisitionPersonnel === undefined || materialRequisitionPersonnel === ''){
            ElMessage.error("请输入领料员")
            ElMessage.error(t('mainIngredientStock.materialRequisitionPersonnel'))
            return
          }
          const materialRequisitionTeam = titleUploadData.value.materialRequisitionTeam
          if(materialRequisitionTeam === null || materialRequisitionTeam === undefined || materialRequisitionTeam === ''){
            ElMessage.error("请输入领料班组")
            ElMessage.error(t('mainIngredientStock.materialRequisitionTeam'))
            return
          }
          const orderId = titleUploadData.value.orderId
          if(orderId === null || orderId === undefined || orderId === ''){
            ElMessage.error("请输入销售单号")
            ElMessage.error(t('order.orderId'))
            return
          }
          const project = titleUploadData.value.project
          if(project === null || project === undefined || project === ''){
            ElMessage.error("请输入项目名称")
            ElMessage.error(t('order.project'))
            return
          }
          const batch = titleUploadData.value.batch
          if(batch === null || batch === undefined || batch === ''){
            ElMessage.error("请输入批次")
            ElMessage.error(t('order.batch'))
            return
          }
@@ -343,14 +343,14 @@
          })
          request.post("/MaterialInventory/saveReturningWarehouse", flowData.value).then((res) => {
            if(res.code==200 && res.data===true){
              ElMessage.success('保存成功')
              ElMessage.success(t('basicData.msg.saveSuccess'))
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            }else{
              ElMessage.warning("保存失败")
              ElMessage.warning(t('basicData.msg.saveFail'))
              router.push("/login")
            }
          }).catch((err)=>{
            ElMessage.error('系统错误')
            ElMessage.error(t('basicData.msg.ServerConnectionError'))
            router.push("/login")
          })
          break
@@ -367,11 +367,11 @@
              ElMessage.success(t('basicData.msg.ReviewSuccess'))
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            } else {
              ElMessage.warning("审核失败")
              ElMessage.warning(t('basicData.msg.reviewFail'))
              router.push("/login")
            }
          }).catch((err)=>{
            ElMessage.error('系统错误')
            ElMessage.error(t('basicData.msg.ServerConnectionError'))
            router.push("/login")
          })
          break
@@ -387,11 +387,11 @@
              ElMessage.success(t('basicData.msg.cancelReviewSuccess'))
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            } else {
              ElMessage.warning("反审失败")
              ElMessage.warning(t('basicData.msg.cancelReviewFail'))
              router.push("/login")
            }
          }).catch((err)=>{
            ElMessage.error('系统错误')
            ElMessage.error(t('basicData.msg.ServerConnectionError'))
            router.push("/login")
          })
          break
@@ -487,7 +487,7 @@
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
          return t('basicData.total')
        }
        // if (props.tableProp.footList.includes(column.field)) {
        //   return sumNum(data, column.field)
@@ -504,7 +504,7 @@
  returnQuantity: [{
    validator (e) {
     if (e.row.returnQuantity ==="") {
        return new Error("返库数量不能为空或者是等于0")
        return new Error(t('mainIngredientStock.theReturnQuantityCannotBeEmptyOrEqualTo0'))
      }
      const regex = /^[1-9]\d*$/g
      if ( !regex.test(e.row.returnQuantity) ) {
@@ -524,17 +524,17 @@
    <div class="order-primary" style="background-color: white">
      <el-row>
        <el-col  :span="2"><el-text>返库日期:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('mainIngredientStock.createTime')}}:</el-text></el-col>
        <el-col  :span="3"><el-input  v-model="titleUploadData.createTime" :readonly="true" ></el-input></el-col>
        <el-col  :span="2"><el-text>领料员/供应商:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('mainIngredientStock.materialRequisitionPersonnel')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.materialRequisitionPersonnel" /></el-col>
        <el-col  :span="2"><el-text>领料班组/供应商:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('mainIngredientStock.materialRequisitionTeam')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.materialRequisitionTeam" /></el-col>
        <el-col  :span="2"><el-text>仓管员:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('mainIngredientStock.warehouseManager')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.warehouseManager" :readonly="true" /></el-col>
      </el-row>
      <el-row>
        <el-col  :span="2"><el-text>返库类型:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('mainIngredientStock.returningType')}}:</el-text></el-col>
        <el-col  :span="3">
          <el-select v-model="titleUploadData.returningType"  clearable placeholder=""  >
            <el-option
@@ -545,11 +545,11 @@
            />
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>销售单号:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('order.orderId')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.orderId" /></el-col>
        <el-col  :span="2"><el-text>项目名称:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('order.project')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.project" /></el-col>
        <el-col  :span="2"><el-text>批次:</el-text></el-col>
        <el-col  :span="2"><el-text>{{$t('order.batch')}}:</el-text></el-col>
        <el-col  :span="3"><el-input v-model="titleUploadData.batch" /></el-col>
@@ -557,7 +557,7 @@
      <el-row>
        <el-select v-model="value" placeholder="请选择类别" @change="getWork" style="margin-top: 10px;border: #181818 1px solid;">
        <el-select v-model="value" :placeholder="$t('mainIngredient.pleaseSelectACategory')" @change="getWork" style="margin-top: 10px;border: #181818 1px solid;">
          <el-option
              v-for="item in options"
              :key="item.value"