123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <template>
- <div class="page-container column-container">
- <!-- <el-row :gutter="24" style="padding: 16px">
- <el-col :span="8">
- <div class="dashboard-total-item">
- <div><img :src="totalIcon2" /></div>
- <div class="dashboard-total-item-label">
- <span>待生产计划数</span>
- <span>5000</span>
- </div>
- </div>
- </el-col>
- <el-col :span="8">
- <div class="dashboard-total-item">
- <div><img :src="totalIcon3" /></div>
- <div class="dashboard-total-item-label">
- <span>投产中生产计划数</span>
- <span>5000</span>
- </div>
- </div>
- </el-col>
- <el-col :span="8">
- <div class="dashboard-total-item">
- <div><img :src="totalIcon3" /></div>
- <div class="dashboard-total-item-label">
- <span>本周完成计划数</span>
- <span>5000</span>
- </div>
- </div>
- </el-col>
- </el-row> -->
- <!-- 搜索区 -->
- <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
- <el-form-item label="计划单号:">
- <el-input placeholder="请输入计划单号" @keydown.enter.prevent @keyup.enter="handleQuery" clearable
- v-model.trim="queryParams.productionPlanNo" style="width: 160px" />
- </el-form-item>
- <!-- <el-form-item label="状态:">
- <el-select-v2 v-model="queryParams.status" clearable filterable :options="plan_status" placeholder="全部状态" @change="handleQuery" style="width: 120px" />
- </el-form-item> -->
- <el-form-item>
- <el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
- <el-button type="primary" icon="Switch" @click="handleSyncP2Plan"
- v-hasPermi="['business:productionPlan:query']">同步P2生产计划</el-button>
- </el-form-item>
- </el-form>
- <!-- 列表区 -->
- <div class="el-table-container">
- <div class="el-table-inner-container">
- <el-table v-loading="loading" :data="productionPlanList" height="100%">
- <el-table-column type="index" label="行号" width="50" align="center"></el-table-column>
- <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
- <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
- <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
- <el-table-column label="产品描述" prop="productDescription" align="center" />
- <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
- <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
- <el-table-column label="总批数" prop="totalLotNumber" width="80" align="center" />
- <el-table-column label="单批量" prop="oneLotQuantity" width="80" align="center" />
- <el-table-column label="尾批量" prop="lastLotQuantity" width="80" align="center" />
- <el-table-column label="批号状态" prop="lotCodeStatusCode" width="100" align="center">
- <template #default="scope">
- <dict-tag :options="lot_code_status_code" :value="scope.row.lotCodeStatusCode" />
- </template>
- </el-table-column>
- <!-- <el-table-column label="批号状态" prop="lotCodeStatusCode" width="60" align="center" /> -->
- <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
- <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
- <el-table-column label="库位" prop="storageLocation" width="80" align="center" />
- <el-table-column label="是否废品回用" prop="" width="90" align="center">
- <template #default="scope">
- {{ scope.row.planType == 'HY' ? '是' : '否' }}
- </template>
- </el-table-column>
- <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" fixed="right">
- <template #default="scope">
- <span>{{ scope.row.requisitionDepartmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
- <!-- <el-table-column label="完成批次" width="100" align="center">
- <template #default="scope">
- {{ '0 / ' + scope.row.totalLotNumber }}
- </template>
- </el-table-column> -->
- <!-- <el-table-column label="操作" width="80" align="center">
- <template #default="scope">
- <el-button link type="primary" icon="View" @click="handleAdd(scope.row)">查看</el-button>
- </template>
- </el-table-column> -->
- </el-table>
- </div>
- </div>
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize" @pagination="getList" />
- <!-- 表单 -->
- <!-- <productionPlan-form ref="productionPlanRef" :get-list="getList"></productionPlan-form> -->
- </div>
- </template>
- <script setup name="ProductionPlan">
- import { getP2Plan } from '@/api/business/p2.js'
- import { getConfigKey } from '@/api/system/config'
- import { listProductionPlanDetail } from '@/api/business/productionPlanDetail.js'
- import totalIcon2 from '@/assets/images/dashboard-total-icon-2.png'
- import totalIcon3 from '@/assets/images/dashboard-total-icon-3.png'
- import useSettingsStore from "@/store/modules/settings";
- const dataSource = useSettingsStore().dataSource;
- import { ref } from 'vue'
- const { proxy } = getCurrentInstance()
- /** 字典数组区 */
- /** 查询 对象 */
- const productionPlanList = ref([])
- const loading = ref(true)
- const total = ref(2)
- const { plan_status } = proxy.useDict('plan_status')
- const { lot_code_status_code } = proxy.useDict('lot_code_status_code')
- /** 查询对象 */
- const queryParams = ref({
- productionPlanNo: '',
- planStatus: '',
- pullP2PlanDetails: false,
- pageNum: 1,
- pageSize: 10
- })
- onMounted(() => {
- getList()
- })
- /**************************** 方法区 ****************************/
- /** 查询生产计划列表 */
- function getList() {
- loading.value = true
- if(!dataSource){
- getP2Plan(queryParams.value).then((res) => {
- productionPlanList.value = res.rows
- total.value = res.total
- loading.value = false
- queryParams.value.pullP2PlanDetails = false
- })
- }else{
- console.log("切换数据源")
- }
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- queryParams.value.pageNum = 1
- getList()
- }
- /**
- * 同步P2生产计划
- */
- const handleSyncP2Plan = () => {
- getConfigKey('switch_data_source').then(res =>{
- if(res.msg == 'true'){
- proxy.$modal.msgSuccess('切换数据源成功')
- }else{
- queryParams.value.pullP2PlanDetails = true
- getList()
- }
- })
- }
- </script>
- <style lang="scss" scoped>
- .dashboard-total-item {
- display: flex;
- align-items: center;
- font-size: 16px;
- height: 120px;
- background-color: #f2f2f2;
- border-radius: 10px;
- >div:first-child {
- display: flex;
- flex: 2;
- justify-content: center;
- align-items: center;
- }
- >div.dashboard-total-item-label {
- display: flex;
- flex: 3;
- flex-direction: column;
- justify-content: center;
- >span {
- display: block;
- width: 60%;
- text-align: center;
- &:first-child {
- font-size: 16px;
- margin-bottom: 4px;
- letter-spacing: 2px;
- }
- &:last-child {
- font-weight: bold;
- font-size: 24px;
- }
- }
- }
- }
- .dashboard-total-item>.dashboard-total-item-label>span:last-child {
- color: #444444;
- }
- .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:first-child {
- margin-right: 8px;
- }
- .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:last-child {
- color: #4367df;
- }
- .dashboard-total-item>.number-label {
- font-size: 40px;
- margin-left: 16px;
- font-weight: bold;
- color: #5a6ac3;
- }
- </style>
|