零件采购单审批
This commit is contained in:
		
							parent
							
								
									c8086d22ef
								
							
						
					
					
						commit
						487f6294ab
					
				@ -0,0 +1,164 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-card class="hl-card" style="position: relative">
 | 
			
		||||
    <template #header>
 | 
			
		||||
      <span>详情页</span>
 | 
			
		||||
    </template>
 | 
			
		||||
    <el-form ref="formRef" :model="formData"  label-width="160px" v-loading="formLoading">
 | 
			
		||||
      <!--  基础信息   -->
 | 
			
		||||
      <el-card class="hl-card-info">
 | 
			
		||||
        <template #header>
 | 
			
		||||
          <div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
 | 
			
		||||
        </template>
 | 
			
		||||
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span="24">
 | 
			
		||||
            <el-row>
 | 
			
		||||
 | 
			
		||||
              <el-col :span="6">
 | 
			
		||||
                <el-row>
 | 
			
		||||
                  <el-col :span="24">
 | 
			
		||||
                    <el-form-item label="需求计划号" prop="projectMaterialPlanNo">
 | 
			
		||||
                      <el-input class="!w-300px" placeholder="系统自动生成" v-model="formData.projectMaterialPlanNo" disabled />
 | 
			
		||||
                    </el-form-item>
 | 
			
		||||
                  </el-col>
 | 
			
		||||
                </el-row>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="6">
 | 
			
		||||
                <el-form-item label="项目名称" prop="projectName">
 | 
			
		||||
                  <el-input class="!w-300px" placeholder="项目名称" v-model="formData.projectName" disabled />
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="6">
 | 
			
		||||
                <el-form-item label="子项目名称" prop="name">
 | 
			
		||||
                  <el-input class="!w-300px" placeholder="项目名称" v-model="formData.name" disabled />
 | 
			
		||||
                </el-form-item>
 | 
			
		||||
              </el-col>
 | 
			
		||||
            </el-row>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </el-card>
 | 
			
		||||
 | 
			
		||||
      <!--  需求单信息   -->
 | 
			
		||||
      <el-card class="hl-card-info">
 | 
			
		||||
        <template #header>
 | 
			
		||||
          <div class="hl-card-info-icona"></div><span class="hl-card-info-text">需求单信息</span>
 | 
			
		||||
        </template>
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col>
 | 
			
		||||
            <el-card class="hl-incard">
 | 
			
		||||
              <el-table :data="formData.matBoomDOList" class="hl-table" v-loading="loading">
 | 
			
		||||
                <el-table-column type="index" label="序号" fixed align="center" min-width="60" />
 | 
			
		||||
                <el-table-column prop="matName" min-width="200" label="物料名称" align="center"/>
 | 
			
		||||
                <el-table-column prop="nickname" min-width="120" label="责任人" align="center"/>
 | 
			
		||||
                <el-table-column prop="boomAmount" min-width="100" label="需求数量" align="center"/>
 | 
			
		||||
                <el-table-column prop="boomArriveDate" min-width="200" label="需求到货日期" align="center" :formatter="dateFormatter1"/>
 | 
			
		||||
                <el-table-column prop="boomSpec" min-width="200" label="规格类型" align="center"/>
 | 
			
		||||
                <el-table-column prop="mplanStatus" min-width="100" label="需求状态" align="center">
 | 
			
		||||
                  <template #default="scope">
 | 
			
		||||
                    <dict-tag :type="DICT_TYPE.HELI_PROJECT_MATERIAL_PLAN_BOOM_STATUS" :value="scope.row.mplanStatus" />
 | 
			
		||||
                  </template>
 | 
			
		||||
                </el-table-column>
 | 
			
		||||
                <el-table-column prop="description" min-width="200" label="备注" align="center"/>
 | 
			
		||||
              </el-table>
 | 
			
		||||
              <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
 | 
			
		||||
                          @pagination="getList" />
 | 
			
		||||
            </el-card>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </el-card>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <div class="hl-footer text-center">
 | 
			
		||||
      <el-button @click="closeForm" size="large">取 消</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </el-card>
 | 
			
		||||
 | 
			
		||||
  <!-- 表单弹窗:物料列表 -->
 | 
			
		||||
</template>
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 | 
			
		||||
import * as MaterialPlanApi from '@/api/heli/materialplan'
 | 
			
		||||
import * as MaterialPlanDetailApi from '@/api/heli/materialplandetail'
 | 
			
		||||
import * as MaterialPlanBoomApi from '@/api/heli/materialplanboom'
 | 
			
		||||
import type { UploadUserFile } from 'element-plus'
 | 
			
		||||
import * as PlanApi from '@/api/heli/plan'
 | 
			
		||||
import * as PlanSubApi from '@/api/heli/plansub'
 | 
			
		||||
import * as ProjectOrderApi from '@/api/heli/projectorder'
 | 
			
		||||
import * as UserApi from '@/api/system/user'
 | 
			
		||||
import * as MaterialApi from '@/api/heli/material'
 | 
			
		||||
import { deleteFile, downloadFile, getFilePage } from '@/api/infra/file'
 | 
			
		||||
import download from '@/utils/download'
 | 
			
		||||
import { getAccessToken, getTenantId } from '@/utils/auth'
 | 
			
		||||
import {dateFormatter, dateFormatter1, formatDate} from '@/utils/formatTime'
 | 
			
		||||
import { useUserStore } from '@/store/modules/user'
 | 
			
		||||
import { useTagsViewStore } from '@/store/modules/tagsView'
 | 
			
		||||
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
 | 
			
		||||
import booms from './boom.vue'
 | 
			
		||||
 | 
			
		||||
const reload: any = inject('reload')
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
const message = useMessage() // 消息弹窗
 | 
			
		||||
const { query } = useRoute()
 | 
			
		||||
const router = useRouter()
 | 
			
		||||
const tagsViewStore = useTagsViewStore()
 | 
			
		||||
 | 
			
		||||
const dialogVisible = ref(false) // 弹窗的是否展示
 | 
			
		||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 | 
			
		||||
const formData = ref({
 | 
			
		||||
  id: undefined,
 | 
			
		||||
  projectMaterialPlanNo: undefined,
 | 
			
		||||
  projectId: undefined,
 | 
			
		||||
  projectPlanId: undefined,
 | 
			
		||||
  projectPlanNo: undefined,
 | 
			
		||||
  projectCode: undefined,
 | 
			
		||||
  auditor: undefined,
 | 
			
		||||
  createTime: new Date(),
 | 
			
		||||
  status: undefined,
 | 
			
		||||
  description: undefined,
 | 
			
		||||
  boomItemDOList: [],
 | 
			
		||||
  boomItemRemoveList: [],
 | 
			
		||||
  matBoomDOList: [],
 | 
			
		||||
  matItemRemoveList: [],
 | 
			
		||||
  attachments: []
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
const formRef = ref() // 表单 Ref
 | 
			
		||||
const subFormRef = ref() // 表单 Ref
 | 
			
		||||
const loading = ref(true) // 列表的加载中
 | 
			
		||||
const total = ref(0) // 列表的总页数
 | 
			
		||||
const subBoomFormLoading = ref(false)
 | 
			
		||||
const subBoomFormRef = ref()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const closeForm = async () => {
 | 
			
		||||
  router.push({ path: '/purchase/management' })
 | 
			
		||||
  tagsViewStore.delVisitedView(router.currentRoute.value)
 | 
			
		||||
}
 | 
			
		||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
 | 
			
		||||
 | 
			
		||||
const queryParams = reactive({
 | 
			
		||||
  pageNo: 1,
 | 
			
		||||
  pageSize: 10,
 | 
			
		||||
  projectMaterialPlanId: query.id
 | 
			
		||||
})
 | 
			
		||||
// 页面数据加载初始化
 | 
			
		||||
onMounted(async () => {
 | 
			
		||||
  // 获取物料需求计划信息
 | 
			
		||||
  formData.value = await MaterialPlanApi.getMaterialPlan(query.id)
 | 
			
		||||
  getList();
 | 
			
		||||
})
 | 
			
		||||
const getList = async () => {
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  try {
 | 
			
		||||
    const data = await MaterialPlanBoomApi.getMaterialPlanBoomPages(queryParams)
 | 
			
		||||
    formData.value.matBoomDOList = data.list
 | 
			
		||||
    total.value = data.total
 | 
			
		||||
  } finally {
 | 
			
		||||
    loading.value = false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
@ -0,0 +1,180 @@
 | 
			
		||||
<template>
 | 
			
		||||
<el-card class="hl-card">
 | 
			
		||||
  <template #header>
 | 
			
		||||
    <span>零件采购单审批</span>
 | 
			
		||||
  </template>
 | 
			
		||||
  <ContentWrap class="borderxx">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="130px">
 | 
			
		||||
      <el-form-item label="采购单号" prop="purchaseNo">
 | 
			
		||||
        <el-input v-model="queryParams.purchaseNo" placeholder="采购单号" clearable @keyup.enter="handleQuery"
 | 
			
		||||
          class="!w-240px" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="项目名称" prop="projectName">
 | 
			
		||||
        <el-input v-model="queryParams.projectName" placeholder="项目名称" clearable @keyup.enter="handleQuery"
 | 
			
		||||
          class="!w-240px" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="子项目名称" prop="projectSubName">
 | 
			
		||||
        <el-input v-model="queryParams.projectSubName" placeholder="请输入子项目名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="供应商" prop="supplierName">
 | 
			
		||||
        <el-input v-model="queryParams.supplierName" placeholder="请输入零件名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item style="margin-left:15px">
 | 
			
		||||
        <el-button @click="handleQuery" type="primary">
 | 
			
		||||
          <Icon icon="ep:search" class="mr-5px" /> 搜索
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button @click="resetQuery">
 | 
			
		||||
          <Icon icon="ep:refresh" class="mr-5px" /> 重置
 | 
			
		||||
        </el-button>
 | 
			
		||||
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
 | 
			
		||||
  <!-- 列表 -->
 | 
			
		||||
  <ContentWrap>
 | 
			
		||||
    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table">
 | 
			
		||||
      <el-table-column label="序号" type="index" align="center" fixed min-width="70px" />
 | 
			
		||||
      <el-table-column label="物料需求计划单号" align="center" prop="projectMaterialPlanNo" min-width="180" fixed>
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <el-button text type="primary" @click="openForm('detail', scope.row.id)">
 | 
			
		||||
            {{ scope.row.projectMaterialPlanNo }}
 | 
			
		||||
          </el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="项目名称" align="center" prop="projectName" min-width="180px" />
 | 
			
		||||
      <el-table-column label="子项目名称" align="center" prop="name" min-width="180px" />
 | 
			
		||||
      <el-table-column label="客户简称" align="center" prop="brief" min-width="180px" />
 | 
			
		||||
      <el-table-column label="制单日期" align="center" prop="matPlanDate" :formatter="dateFormatter1" min-width="150" />
 | 
			
		||||
      <el-table-column label="需求计划类型" align="center" prop="matType"  min-width="150">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <dict-tag :type="DICT_TYPE.HELI_MAT_TYPE" :value="scope.row.matType" />
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" fixed="right" min-width="180">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <el-button
 | 
			
		||||
            link
 | 
			
		||||
            type="danger"
 | 
			
		||||
            @click="handleDelete(scope.row.id)"
 | 
			
		||||
          >
 | 
			
		||||
            删除
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button link type="primary" @click="openForm('detail', scope.row.id)">
 | 
			
		||||
            详情信息
 | 
			
		||||
          </el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 分页 -->
 | 
			
		||||
    <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
 | 
			
		||||
</el-card>
 | 
			
		||||
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import {  DICT_TYPE } from '@/utils/dict'
 | 
			
		||||
import { dateFormatter1} from '@/utils/formatTime'
 | 
			
		||||
import * as MaterialPlanApi from '@/api/heli/materialplan'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
defineOptions({ name: 'MaterialPlan' })
 | 
			
		||||
const router = useRouter()
 | 
			
		||||
const message = useMessage() // 消息弹窗
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
 | 
			
		||||
const loading = ref(true) // 列表的加载中
 | 
			
		||||
const list = ref([]) // 列表的数据
 | 
			
		||||
const total = ref(0) // 列表的总页数
 | 
			
		||||
const queryParams = reactive({
 | 
			
		||||
  pageNo: 1,
 | 
			
		||||
  pageSize: 10,
 | 
			
		||||
  id: undefined,
 | 
			
		||||
  purchaseNo: undefined,
 | 
			
		||||
  projectId: undefined,
 | 
			
		||||
  projectPlanId: undefined,
 | 
			
		||||
  submitUserId: undefined,
 | 
			
		||||
  projectName: undefined,
 | 
			
		||||
  projectSubName: undefined,
 | 
			
		||||
  supplierName:undefined,
 | 
			
		||||
  submitTime: [],
 | 
			
		||||
  auditor: undefined,
 | 
			
		||||
  auditTime: [],
 | 
			
		||||
  status: undefined,
 | 
			
		||||
  description: undefined,
 | 
			
		||||
  createTime: [],
 | 
			
		||||
  matType:0,
 | 
			
		||||
})
 | 
			
		||||
const queryFormRef = ref() // 搜索的表单
 | 
			
		||||
const exportLoading = ref(false) // 导出的加载中
 | 
			
		||||
 | 
			
		||||
/** 查询列表 */
 | 
			
		||||
const getList = async () => {
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  try {
 | 
			
		||||
    const data = await MaterialPlanApi.getMaterialPlanPages(queryParams)
 | 
			
		||||
    list.value = data.list
 | 
			
		||||
    total.value = data.total
 | 
			
		||||
  } finally {
 | 
			
		||||
    loading.value = false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 搜索按钮操作 */
 | 
			
		||||
const handleQuery = () => {
 | 
			
		||||
  queryParams.pageNo = 1
 | 
			
		||||
  getList()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 重置按钮操作 */
 | 
			
		||||
const resetQuery = () => {
 | 
			
		||||
  queryFormRef.value.resetFields()
 | 
			
		||||
  handleQuery()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 添加/修改操作 */
 | 
			
		||||
 | 
			
		||||
const openForm = (type: string, id?: number) => {
 | 
			
		||||
 | 
			
		||||
  switch (type) {
 | 
			
		||||
    case 'create':
 | 
			
		||||
      router.push({ path: '/purchase/materialplanadd', query: { id: id } })
 | 
			
		||||
      break;
 | 
			
		||||
    case 'update':
 | 
			
		||||
      router.push({ path: '/purchase/materialplanedit', query: { id: id } })
 | 
			
		||||
      break;
 | 
			
		||||
    case 'detail':
 | 
			
		||||
      router.push({ path: '/purchase/managementdetail', query: { id: id } })
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      break;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 删除按钮操作 */
 | 
			
		||||
const handleDelete = async (id: number) => {
 | 
			
		||||
  try {
 | 
			
		||||
    // 删除的二次确认
 | 
			
		||||
    await message.delConfirm()
 | 
			
		||||
    // 发起删除
 | 
			
		||||
    await MaterialPlanApi.delMaterialPlan(id)
 | 
			
		||||
    message.success(t('common.delSuccess'))
 | 
			
		||||
    // 刷新列表
 | 
			
		||||
    await getList()
 | 
			
		||||
  } catch { }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const userInit = ref()
 | 
			
		||||
/** 初始化 **/
 | 
			
		||||
onMounted(async () => {
 | 
			
		||||
  //用户列表数据
 | 
			
		||||
  // userInit.value = await UserApi.getSimpleUserList()
 | 
			
		||||
  getList()
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user