spring
2025-04-01 49944c684bf75e1a90e85caf2c5d8523981916d6
src/views/business/reliabilityPlan/index.vue
@@ -4,12 +4,12 @@
      <el-form :model="entity" ref="entity" size="small" :inline="true">
        <el-form-item label="产品型号" prop="productType" v-if="tabIndex === 0">
          <el-input v-model="entity.productType" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="goSearch($event)">
            @keyup.enter.native="goSearch($event)">
          </el-input>
        </el-form-item>
        <el-form-item label="原辅料名称" prop="entrustCode" v-if="tabIndex === 1">
        <el-form-item label="原辅材名称" prop="entrustCode" v-if="tabIndex === 1">
          <el-input v-model="entity.entrustCode" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="goSearch($event)">
            @keyup.enter.native="goSearch($event)">
          </el-input>
        </el-form-item>
        <el-form-item>
@@ -23,7 +23,7 @@
        <div>
          <ul class="tab">
            <li :class="{ active: tabIndex === 0 }" @click="handleTab(0)">成品</li>
            <li :class="{ active: tabIndex === 1 }" @click="handleTab(1)">原辅料</li>
            <li :class="{ active: tabIndex === 1 }" @click="handleTab(1)">原辅材</li>
          </ul>
        </div>
        <div>
@@ -32,36 +32,33 @@
      </div>
      <!--成品-->
      <div class="table">
        <lims-table :tableData="tableData" :column="column"
                    v-if="tabIndex === 0"
                    @pagination="pagination"
                    ref="tableData"
                    :height="'calc(100vh - 290px)'"
                    key="tableData" :page="page"
                    :tableLoading="tableLoading"></lims-table>
        <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" @pagination="pagination"
          ref="tableData" :height="'calc(100vh - 290px)'" key="tableData" :page="page"
          :tableLoading="tableLoading"></lims-table>
      </div>
      <!--原辅料-->
      <!--原辅材-->
      <div class="table">
        <lims-table :tableData="tableData1" :column="column1"
                    v-if="tabIndex === 1" :isSelection="true"
                    @pagination="pagination1"
                    :height="'calc(100vh - 290px)'"
                    key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
        <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" :isSelection="true"
          @pagination="pagination1" :height="'calc(100vh - 290px)'" key="tableData1" :page="page1"
          :tableLoading="tableLoading1"></lims-table>
      </div>
    </div>
    <el-dialog :visible.sync="proPlanDia" title="成品计划">
      <el-form :model="proPlanForm" ref="proPlanForm" :rules="proPlanRules" label-width="80px" size="small">
        <el-form-item label="产品型号" prop="productType">
          <el-input v-model="proPlanForm.productType" placeholder="请填写产品型号" :disabled="operationType === 'review'"></el-input>
          <el-input v-model="proPlanForm.productType" placeholder="请填写产品型号"
            :disabled="operationType === 'review'"></el-input>
        </el-form-item>
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="proPlanForm.productName" placeholder="请填写产品名称" :disabled="operationType === 'review'"></el-input>
          <el-input v-model="proPlanForm.productName" placeholder="请填写产品名称"
            :disabled="operationType === 'review'"></el-input>
        </el-form-item>
        <el-form-item label="零件号" prop="partNo">
          <el-input v-model="proPlanForm.partNo" placeholder="请填写零件号" :disabled="operationType === 'review'"></el-input>
        </el-form-item>
        <el-form-item label="审核人" prop="reviewerId">
          <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;" :disabled="operationType === 'review'">
          <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;"
            :disabled="operationType === 'review'">
            <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
@@ -69,21 +66,27 @@
      </el-form>
      <div slot="footer" class="foot">
        <el-button v-if="operationType !== 'review'" @click="closeProDia">取 消</el-button>
        <el-button v-if="operationType !== 'review'" type="primary" :loading="submitProLoading" @click="submitProForm">保 存</el-button>
        <el-button v-if="operationType === 'review'" :loading="submitProLoading" @click="submitProForm(0)">不通过</el-button>
        <el-button v-if="operationType === 'review'" type="primary" :loading="submitProLoading" @click="submitProForm(1)">通过</el-button>
        <el-button v-if="operationType !== 'review'" type="primary" :loading="submitProLoading" @click="submitProForm">保
          存</el-button>
        <el-button v-if="operationType === 'review'" :loading="submitProLoading"
          @click="submitProForm(0)">不通过</el-button>
        <el-button v-if="operationType === 'review'" type="primary" :loading="submitProLoading"
          @click="submitProForm(1)">通过</el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="materialDia" title="原辅料计划">
    <el-dialog :visible.sync="materialDia" title="原辅材计划">
      <el-form :model="materialForm" ref="materialForm" :rules="materialRules" label-width="90px" size="small">
        <el-form-item label="原辅料名称" prop="materialName">
          <el-input v-model="materialForm.materialName" placeholder="请填写产品名称" :disabled="operationType === 'review'"></el-input>
        <el-form-item label="原辅材名称" prop="materialName">
          <el-input v-model="materialForm.materialName" placeholder="请填写产品名称"
            :disabled="operationType === 'review'"></el-input>
        </el-form-item>
        <el-form-item label="零件号" prop="partNo">
          <el-input v-model="materialForm.partNo" placeholder="请填写零件号" :disabled="operationType === 'review'"></el-input>
          <el-input v-model="materialForm.partNo" placeholder="请填写零件号"
            :disabled="operationType === 'review'"></el-input>
        </el-form-item>
        <el-form-item label="审核人" prop="reviewerId">
          <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;" :disabled="operationType === 'review'">
          <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;"
            :disabled="operationType === 'review'">
            <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
@@ -91,9 +94,12 @@
      </el-form>
      <div slot="footer" class="foot">
        <el-button v-if="operationType !== 'review'" @click="closeMaterialRulesDia">取 消</el-button>
        <el-button v-if="operationType !== 'review'" type="primary" :loading="submitMatLoading" @click="submitMaterialRulesForm">保 存</el-button>
        <el-button v-if="operationType === 'review'" :loading="submitMatLoading" @click="submitMaterialRulesForm(0)">不通过</el-button>
        <el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading" @click="submitMaterialRulesForm(1)">通过</el-button>
        <el-button v-if="operationType !== 'review'" type="primary" :loading="submitMatLoading"
          @click="submitMaterialRulesForm">保 存</el-button>
        <el-button v-if="operationType === 'review'" :loading="submitMatLoading"
          @click="submitMaterialRulesForm(0)">不通过</el-button>
        <el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading"
          @click="submitMaterialRulesForm(1)">通过</el-button>
      </div>
    </el-dialog>
  </div>
@@ -108,13 +114,13 @@
  selectMaterial,
  selectProduct
} from "@/api/business/reliabilityPlan";
import {selectUserCondition} from "@/api/system/user";
import {deleteAuxiliaryWorkingHours} from "@/api/performance/manHour";
import { selectUserCondition } from "@/api/system/user";
import { deleteAuxiliaryWorkingHours } from "@/api/performance/manHour";
export default {
  name: '',
  // import 引入的组件需要注入到对象中才能使用
  components: {limsTable},
  components: { limsTable },
  data() {
    // 这里存放数据
    return {
@@ -162,14 +168,14 @@
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openAddDia('edit',row);
                this.openAddDia('edit', row);
              }
            },
            {
              name: '审核',
              type: 'text',
              clickFun: (row) => {
                this.openAddDia('review',row);
                this.openAddDia('review', row);
              },
            },
            {
@@ -191,11 +197,11 @@
        current: 1
      },
      //
      // 原辅料table数据
      // 原辅材table数据
      tableData1: [],
      tableLoading1: false,
      column1: [
        { label: '原辅料名称', prop: 'materialName' },
        { label: '原辅材名称', prop: 'materialName' },
        { label: '零件号', prop: 'partNo' },
        {
          dataType: 'tag',
@@ -229,14 +235,14 @@
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.openAddDia('edit',row);
                this.openAddDia('edit', row);
              }
            },
            {
              name: '审核',
              type: 'text',
              clickFun: (row) => {
                this.openAddDia('review',row);
                this.openAddDia('review', row);
              },
            },
            {
@@ -314,22 +320,22 @@
        // 成品查询
        this.getProductOrderList()
      } else if (this.tabIndex === 1) {
        // 原辅料查询
        // 原辅材查询
        this.getMaterialOrderList()
      }
    },
    getProductOrderList () {
    getProductOrderList() {
      this.tableLoading = true
      selectProduct({...this.entity, ...this.page}).then(response => {
      selectProduct({ ...this.entity, ...this.page }).then(response => {
        this.tableLoading = false
        this.tableData = response.data.records
      }).catch(error => {
        this.tableLoading = false
      })
    },
    getMaterialOrderList () {
    getMaterialOrderList() {
      this.tableLoading1 = true
      selectMaterial({...this.entity, ...this.page}).then(response => {
      selectMaterial({ ...this.entity, ...this.page }).then(response => {
        this.tableLoading1 = false
        this.tableData1 = response.data.records
      }).catch(err => {
@@ -348,17 +354,17 @@
      if (this.tabIndex === 0) {
        this.proPlanDia = true
        if (this.operationType !== 'add') {
          this.proPlanForm = {...row}
          this.proPlanForm = { ...row }
        }
      } else {
        this.materialDia = true
        if (this.operationType !== 'add') {
          this.materialForm = {...row}
          this.materialForm = { ...row }
        }
      }
    },
    // 成品信息提交
    submitProForm (state) {
    submitProForm(state) {
      this.submitProLoading = true
      if (this.operationType === 'add') {
        this.proPlanForm.state = ''
@@ -378,12 +384,12 @@
      })
    },
    // 关闭成品信息弹框
    closeProDia () {
    closeProDia() {
      this.resetForm('proPlanDia')
      this.proPlanDia = false
    },
    // 原辅料信息提交
    submitMaterialRulesForm (state) {
    // 原辅材信息提交
    submitMaterialRulesForm(state) {
      this.submitMatLoading = true
      if (this.operationType === 'add') {
        this.materialForm.state = ''
@@ -402,19 +408,19 @@
        this.submitMatLoading = false
      })
    },
    // 关闭原辅料信息弹框
    // 关闭原辅材信息弹框
    closeMaterialRulesDia() {
      this.resetForm('materialForm')
      this.materialDia = false
    },
    handleDelete (row) {
    handleDelete(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        delProduct({ id: row.id }).then((res) => {
          if (res.code == 200){
          if (res.code == 200) {
            this.$message.success("删除成功");
            this.goSearch();
          }
@@ -423,14 +429,14 @@
      });
    },
    handleDeleteM (row) {
    handleDeleteM(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        delMaterial({ id: row.id }).then((res) => {
          if (res.code == 200){
          if (res.code == 200) {
            this.$message.success("删除成功");
            this.goSearch();
          }