From 31cb0c2647468edf9205a74a18bb5680ed760fa6 Mon Sep 17 00:00:00 2001
From: unknown <280848880@qq.com>
Date: 星期二, 07 十一月 2023 09:08:40 +0800
Subject: [PATCH] web苏州:1管片发运计划提交.2样式问题修改

---
 web/src/views/DuctpiecePLM/PlanManage/DuctForward.vue |  551 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 551 insertions(+), 0 deletions(-)

diff --git a/web/src/views/DuctpiecePLM/PlanManage/DuctForward.vue b/web/src/views/DuctpiecePLM/PlanManage/DuctForward.vue
index e69de29..e8eff25 100644
--- a/web/src/views/DuctpiecePLM/PlanManage/DuctForward.vue
+++ b/web/src/views/DuctpiecePLM/PlanManage/DuctForward.vue
@@ -0,0 +1,551 @@
+<template>
+  <div class="main">
+    <div class="main_header">
+      <div class="header_item">
+        <span class="header_label">项目名称:</span>
+        <el-select v-model="search.proId" placeholder="请选择项目名称" clearable filterable>
+          <el-option v-for="item in optionsProject" :key="item.proId" :label="item.proName" :value="item.proId">
+          </el-option>
+        </el-select>
+      </div>
+      <div class="header_item">
+        <span class="header_label">年份:</span>
+        <el-date-picker v-model="search.planYear" value-format="yyyy" type="year" placeholder="请选择年份">
+        </el-date-picker>
+      </div>
+      <div class="header_item">
+        <el-button icon="el-icon-search" v-if="showButton('search')" @click="searchButtonInfo(true)">查询</el-button>
+        <el-button class="search_btn" icon="el-icon-plus" v-if="showButton('insert')" @click="insertProp">新增</el-button>
+      </div>
+    </div>
+    <div class="main_content">
+      <div style="overflow-y:auto;overflow-x:hidden;height:calc(100% - 5px)">
+        <div class="plan_main_card" v-for="(item, index) in dataList" :key="index">
+          <div class="plan_main_header">
+            <div class="plan_header_left">
+              <span class="plan_header_one">{{ item.proName }}</span>
+              <span>{{ item.planYear }}年</span>
+            </div>
+            <div class="plan_header_right">
+              <el-button style="background-image:none;border:1px solid #38B2FA;border-radius:5px;padding:5px 10px;"
+                :size="size" v-if="showButton('update')" class="table_btn" @click="updateProp(item)">修改</el-button>
+              <el-button
+                style="background-image:none;border:1px solid #FD494B;background-color:#434F69;border-radius:5px;padding:5px 10px;"
+                :size="size" class="delete_btn" v-if="showButton('delete')" @click="deleteInfo(item)">删除</el-button>
+            </div>
+          </div>
+          <div class="plan_main_content">
+            <div class="plan_content_items">
+              <div class="plan_content_title">月份</div>
+              <div class="plan_content_datas" style="background-color:#052C55;color:#39B5FE"
+                v-for="(item, index) in item.monthList" :key="index">{{ item.month }}</div>
+              <div class="plan_content_datas" style="background-color:#052C55;color:#39B5FE">合计</div>
+            </div>
+            <div class="plan_content_items" style="margin-bottom:0px;border-bottom-color:transparent;">
+              <div class="plan_content_title">管片计划发运数量(片)</div>
+              <div class="plan_content_datas" v-for="(iten, index) in item.monthList" :key="index">
+                {{ iten.planProduct }}</div>
+              <div class="plan_content_datas">{{ item.needPipeNum }}</div>
+            </div>
+            <div class="plan_content_items">
+              <div class="plan_content_title">已发运管片数量(片)</div>
+              <div class="plan_content_datas" v-for="(it, index) in item.monthList" style="cursor:pointer"
+                @click="showDetails(item, index + 1)" :key="index">{{ it.completePlanProduct }}</div>
+              <div class="plan_content_datas">{{ item.completePipeNum }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="main_footer">
+      <el-pagination background @current-change="changePageNum" @size-change="changePageSize" :current-page="pageNum"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+    <!-- 钢筋笼明细弹框 -->
+    <el-dialog class="prop_dialog" title="管片明细" :visible.sync="asyncBeardetails" width="65%">
+      <div class="bears_content">
+        <el-table v-loading="loadingDetails" :data="bearDetails" height="100%">
+          <el-table-column align="center" label="序号" width="60">
+            <template #default="scope">
+              <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="ringNum" label="环号" align="center"></el-table-column>
+          <el-table-column prop="pipeNum" label="管片编号" align="center" width="160"></el-table-column>
+          <el-table-column prop="turnName" label="转向" align="center" width="120"></el-table-column>
+          <el-table-column prop="reinforcementName" label="配筋" align="center"></el-table-column>
+          <el-table-column prop="groutingHolesName" label="注浆孔" align="center"></el-table-column>
+          <el-table-column prop="blockNumName" label="块号" align="center"></el-table-column>
+          <el-table-column prop="mouldNum" label="模具" align="center"></el-table-column>
+          <el-table-column prop="intoModTime" label="入模时间" align="center" width="160"></el-table-column>
+          <el-table-column prop="pouringTime" label="浇筑时间" align="center" width="160"></el-table-column>
+          <el-table-column prop="checkTime" label="质检时间" align="center" width="160"></el-table-column>
+          <el-table-column prop="groupName" label="生产班组" align="center"></el-table-column>
+          <el-table-column prop="proName" label="项目" align="center" width="250" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="checkResult" label="质量标注" align="center"></el-table-column>
+        </el-table>
+      </div>
+      <div class="bear_footer">
+        <el-pagination background @current-change="changeDetailsPageNum" @size-change="changeDetailsPageSize"
+          :current-page="pageNumDetails" :page-sizes="[10, 20, 50, 100]" :page-size="pageSizeDetails"
+          layout="total, sizes, prev, pager, next, jumper" :total="totalDetails">
+        </el-pagination>
+      </div>
+    </el-dialog>
+    <el-dialog class="prop_dialog" :title="asyncTitle === true ? '新增' : asyncTitle === false ? '修改' : '查看'"
+      :close-on-click-modal="false" :visible.sync="asyncVisible" width="35%">
+      <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="auto" class="rule_form">
+        <el-form-item label="项目名称:" prop="proId">
+          <el-select v-model="ruleForm.proId" placeholder="请选择项目名称" :disabled="disabled" clearable>
+            <el-option v-for="item in optionsProject" :key="item.proId" :label="item.proName" :value="item.proId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="年份:" prop="planYear">
+          <el-date-picker v-model="ruleForm.planYear" value-format="yyyy" :disabled="disabled" type="year"
+            placeholder="请选择年份">
+          </el-date-picker>
+        </el-form-item>
+        <div class="months_items">
+          <div v-for="(item, index) in monthLists" :key="index" class="month_index">
+            <el-input placeholder="请输入" v-model="item.planProduct" type="number" :disabled="disabled">
+              <template slot="prepend">{{ item.month }}月</template>
+            </el-input>
+          </div>
+          <div class="months_nums">
+            <span>合计:</span>
+            <span style="color:#18F8F9;font-size:20px;font-weight:600;margin-left:5px">{{ allMonths }}</span>
+            <span>环</span>
+          </div>
+        </div>
+      </el-form>
+      <div slot="footer" v-if="asyncTitle !== 'see'">
+        <el-button @click="asyncVisible = false">取 消</el-button>
+        <el-button class="submit_btn" @click="asyncTitle ? submitInsert() : submitUpdate()">提 交</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {buttonPinia} from '../../../pinia/index';
+import {throttle, changeSize} from '../../../plugins/public'; // 导入节流、动态切换组件尺寸方法
+export default {
+  data() {
+    return {
+      size: changeSize(), // 组件尺寸
+      pageNum: 1,
+      pageSize: 10,
+      search: {},//查询条件
+      total: 0,
+      disabled: false,//是否禁止修改
+      loading: false,
+      allMonths: null,//计算出来的总数
+      rowId: '',//某一行id
+      dataList: [], //管片生产计划信息
+      asyncBeardetails: false,
+      bearDetails: [],//管片明细
+      pageNumDetails: 1,
+      pageSizeDetails: 10,
+      totalDetails: 0,
+      loadingDetails: true,
+      proId: null,
+      reinforcementId: null,
+      years: null,
+      optionsProject: [],//项目名称
+      asyncTitle: true, // 对话框title 新增:true  修改:false
+      asyncVisible: false, // 添加 修改对话框
+      ruleForm: {}, // 按钮表单
+      rules: {
+        proId: [{
+          required: true,
+          message: '请选择项目名称',
+          trigger: 'change'
+        }],
+        planYear: [{
+          required: true,
+          message: '请选择年份',
+          trigger: 'change'
+        }],
+      },
+      optionsHass: [],//配筋
+      optionsBlocks: [],//块号
+      monthLists: [],//弹框中的月
+      numLists: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, '合计'],
+    }
+  },
+  mounted() {
+    const that = this;
+    // 根据窗口大小动态修改组件尺寸
+    window.onresize = () => {
+      that.size = changeSize();
+    }
+    that.searchButtonInfo(true);
+    that.getAllProjects()
+  },
+  watch: {
+    'monthLists': {
+      handler: function (val) {
+        let allNum = 0
+        val.map(item => {
+          allNum += item.planProduct * 1
+        })
+        this.allMonths = allNum
+        return this.allMonths
+      },
+      deep: true
+    },
+    asyncVisible(bol) {
+      if (!bol) {
+        this.ruleForm = {};
+        this.$refs.ruleForm.resetFields();
+      }
+    }
+  },
+  methods: {
+    //展示管片明细弹框
+    showDetails(val, num) {
+      console.log(val)
+      this.asyncBeardetails = true
+      if (num === 13) {
+        this.asyncBeardetails = false
+        return
+      }
+      this.proId = val.proId
+      this.years = num < 10 ? val.planYear + '-0' + num : val.planYear + '-' + num
+      this.searchBearDetails(val.proId, this.years)
+    },
+    //查询管片明细
+    searchBearDetails(proId, years) {
+      this.loadingDetails = true;
+      this.bearDetails = [];
+      this.$api.Ducts.ductForward.searchDuctDetails({
+        proId: proId,
+        goIn: 2,
+        yearMonth: years,
+        pageNum: this.pageNumDetails,
+        pageSize: this.pageSizeDetails
+      }).then((res) => {
+        if (res.statusMsg === 'ok') {
+          this.totalDetails = res.data.total;
+          this.bearDetails = res.data.list;
+        } else {
+          this.$message.warning(res.statusMsg)
+        }
+        this.loadingDetails = false;
+      }).catch(() => {
+        this.loadingDetails = false
+      });
+    },
+    // 切换管片明细页数
+    changeDetailsPageNum(page) {
+      this.pageNumDetails = page;
+      this.searchBearDetails(this.proId, this.years);
+    },
+    // 切换管片明细每页条数
+    changeDetailsPageSize(size) {
+      this.pageSizeDetails = size;
+      this.searchBearDetails(this.proId, this.years);
+    },
+    //获得所有项目名称
+    getAllProjects() {
+      let obj = {
+        pageNum: 1,
+        pageSize: 100000000
+      }
+      this.$api.Engineer.searchProjects(obj).then(res => {
+        if (res.statusMsg === 'ok') {
+          this.optionsProject = res.data.list
+        } else {
+          this.$message.warning(res.statusMsg)
+        }
+      })
+    },
+    // 查询按钮列表信息
+    searchButtonInfo(bol) {
+      if (bol) {
+        this.pageNum = 1;
+      }
+      let params = Object.assign({}, this.search, {
+        pageNum: this.pageNum,
+        pageSize: this.pageSize
+      })
+      this.loading = true;
+      this.$api.Ducts.ductForward.searchDuctPlan(params).then((res) => {
+        if (res.statusMsg === 'ok') {
+          this.total = res.data.total;
+          this.dataList = res.data.list;
+          this.loading = false;
+        } else {
+          this.$message.warning(res.statusMsg)
+        }
+      })
+    },
+    // 新增按钮信息
+    insertProp() {
+      this.asyncTitle = true;
+      this.asyncVisible = true;
+      this.disabled = false
+      this.monthLists = [
+        {id: null, pipePlanId: null, month: 1, planProduct: 0},
+        {id: null, pipePlanId: null, month: 2, planProduct: 0},
+        {id: null, pipePlanId: null, month: 3, planProduct: 0},
+        {id: null, pipePlanId: null, month: 4, planProduct: 0},
+        {id: null, pipePlanId: null, month: 5, planProduct: 0},
+        {id: null, pipePlanId: null, month: 6, planProduct: 0},
+        {id: null, pipePlanId: null, month: 7, planProduct: 0},
+        {id: null, pipePlanId: null, month: 8, planProduct: 0},
+        {id: null, pipePlanId: null, month: 9, planProduct: 0},
+        {id: null, pipePlanId: null, month: 10, planProduct: 0},
+        {id: null, pipePlanId: null, month: 11, planProduct: 0},
+        {id: null, pipePlanId: null, month: 12, planProduct: 0},
+      ]
+      this.allMonths = 0
+    },
+    // 修改按钮信息
+    updateProp(row) {
+      this.asyncTitle = false;
+      this.asyncVisible = true;
+      this.disabled = false
+      this.ruleForm = row
+      this.monthLists = JSON.parse(JSON.stringify(row.monthList))
+      this.allMonths = row.needPipeNum
+      this.$set(this.ruleForm, 'planYear', row.planYear + '')
+      this.rowId = row.planId
+    },
+    // 删除按钮信息
+    deleteInfo(row) {
+      this.$confirm("该操作将删除该信息,是否继续删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          console.log(row)
+          this.$api.Ducts.ductForward.deleteDuctPlan({planOutId: row.planOutId})
+            .then(res => {
+              if (res.statusMsg === 'ok') {
+                this.searchButtonInfo(true);
+                this.$message.success("删除成功!");
+              } else {
+                this.$message.warning(res.statusMsg);
+              }
+            })
+        })
+        .catch(() => {
+          this.$message.warning("您已取消");
+        })
+    },
+    // 提交添加按钮信息
+    submitInsert: throttle(function () {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          const params = Object.assign({}, this.ruleForm);
+          params.monthList = this.monthLists
+          params.needPipeNum = this.allMonths
+          this.$api.Ducts.ductForward.insertDuctPlan(params).then((res) => {
+            if (res.statusMsg === 'ok') {
+              this.asyncVisible = false;
+              this.searchButtonInfo(true);
+              this.$message.success('添加成功!');
+            } else {
+              this.$message.warning(res.statusMsg);
+            }
+          })
+        }
+      })
+    }, 3000),
+    // 提交修改按钮信息
+    submitUpdate: throttle(function () {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          const params = Object.assign({}, this.ruleForm);
+          params.monthList = this.monthLists
+          params.needPipeNum = this.allMonths
+          this.$api.Ducts.ductForward.updateDuctPlan(params).then((res) => {
+            if (res.statusMsg === 'ok') {
+              this.asyncVisible = false;
+              this.searchButtonInfo(true);
+              this.$message.success('添加成功!');
+            } else {
+              this.$message.warning(res.statusMsg);
+            }
+          })
+        }
+      })
+    }, 3000),
+    // 判断按钮权限信息
+    showButton(str) {
+      const pinia = buttonPinia();
+      return pinia.$state.buttonInfo.includes(str);
+    },
+    // 切换页数
+    changePageNum(page) {
+      this.pageNum = page;
+      this.searchButtonInfo();
+    },
+    // 切换每页条数
+    changePageSize(size) {
+      this.pageSize = size;
+      this.searchButtonInfo();
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '../../../style/layout-main.scss';
+
+.bears_content {
+  height: 500px;
+
+  /deep/ .el-table th.el-table__cell {
+    background: #082F57 !important;
+    color: #18F6F8;
+    border-right: 1px solid #18F6F8 !important;
+    border-bottom: 1px solid #18F6F8 !important;
+    border-top: 1px solid #18F6F8 !important;
+
+    &:last-child {
+      border-right-color: transparent !important;
+    }
+  }
+
+  /deep/.el-table .el-table__cell {
+    border-left: 1px solid #18F6F8 !important;
+    border-right: 1px solid #18F6F8 !important;
+    border-bottom: 1px solid #18F6F8 !important;
+  }
+
+  /deep/.el-table tr:nth-of-type(even) {
+    background: transparent;
+  }
+}
+
+.bear_footer {
+  text-align: right;
+  line-height: 20px;
+  margin: 15px 0 15px;
+}
+
+.months_items {
+  display: flex;
+  flex-wrap: wrap;
+
+  .month_index {
+    margin-left: 10px;
+    margin-bottom: 10px;
+    max-width: calc(100%/3 - 10px);
+
+    /deep/.el-input-group__prepend {
+      color: #19F6F8;
+      background-color: #122558;
+      border-color: #1B428F;
+    }
+  }
+
+  .months_nums {
+    width: 100%;
+    height: 50px;
+    margin-bottom: 24px;
+    border-radius: 3px;
+    background-color: #0B5274;
+    display: flex;
+    align-items: center;
+
+    span {
+      margin-left: 15px;
+      color: #fff;
+    }
+  }
+}
+
+.plan_main_card {
+  width: calc(100% - 36px);
+  border-top-left-radius: 6px;
+  border-top-right-radius: 6px;
+  border-bottom-left-radius: 6px;
+  border-bottom-right-radius: 6px;
+  background-color: #031A46;
+  margin: 0px 5px 24px 0px;
+  box-shadow: 0px 0px 8px 0px #0C4F79;
+
+  .plan_main_header {
+    width: 100%;
+    height: 48px;
+    border-top-left-radius: 6px;
+    border-top-right-radius: 6px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    background-color: rgba(57, 181, 254, 0.3);
+
+    .plan_header_left {
+      display: flex;
+
+      span {
+        flex: none;
+        color: #39B5FE;
+        margin-left: 20px;
+        font-size: 16px;
+        font-weight: 600;
+      }
+
+      .plan_header_one {
+        margin-left: 40px;
+        position: relative;
+
+        &::before {
+          position: absolute;
+          left: -14px;
+          top: -1px;
+          content: '';
+          width: 5px;
+          height: 20px;
+          background-color: #39B5FE;
+        }
+      }
+    }
+
+    .plan_header_right {
+      margin-right: 15px;
+    }
+  }
+
+  .plan_main_content {
+    width: 100%;
+    height: calc(100% - 30px);
+    background-color: #031A46;
+    padding-top: 20px;
+    padding-bottom: 10px;
+    border-bottom-left-radius: 6px;
+    border-bottom-right-radius: 6px;
+
+
+    .plan_content_items {
+      display: flex;
+      border: 1px solid #39B5FE;
+      margin: 0px 15px 8px 15px;
+
+      .plan_content_title {
+        width: 145px;
+        padding: 12px 0px;
+        flex: none;
+        color: #39B5FE;
+        text-align: center;
+        background-color: #052C55;
+      }
+
+      .plan_content_datas {
+        flex: 1;
+        padding: 12px 0px;
+        color: #fff;
+        text-align: center;
+        border-left: 1px solid #1CB7E0;
+      }
+    }
+  }
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3