loulijun2021
2023-05-06 24a3cbbc31b8fbff1c6a3c9b9e4360dc82a05f4e
src/views/reportManager/logisticsCheck.vue
@@ -17,7 +17,7 @@
            <el-form-item label="检验类型" style=" display: flex;">
              <!--              <el-input v-model="form.checktypecode" placeholder="请输入" style="width: 200px" />-->
              <el-select v-model="form.style" style="width: 200px" placeholder="请选择">
              <el-select v-model="form.checktypecode" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in checktypeArr"
                  :key="item.code"
@@ -120,16 +120,37 @@
            fixed
            label="序号"
          />
          <!--          <el-table-column-->
          <!--            prop="check_type"-->
          <!--            label="检验类型"-->
          <!--            width="160"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div>{{ checktypeArr.find(i=>i.code===row.check_type).name }}</div>-->
          <!--            </template>-->
          <!--          </el-table-column> -->
          <el-table-column
            prop="wo_code"
            prop="check_typename"
            label="检验类型"
            width="160"
            width="110"
            sortable="custom"
          />
          <el-table-column
            prop="sampmethod"
            label="抽样方式"
            width="110"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.sampmethod==='FIXED'">固时抽检</div>
              <div v-if="row.sampmethod==='SCARE'">比例抽检</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="partcode"
            label="物料编码"
            width="160"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
@@ -142,7 +163,7 @@
          />
          <el-table-column
            prop="partspec"
            label="产品规格"
            label="规格型号"
            width="120"
            show-tooltip-when-overflow
            sortable="custom"
@@ -158,67 +179,80 @@
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.hbatchno">{{ row.hbatchno }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="hbarcode"
            label="条码编号"
            width="110"
            width="160"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="customer_name"
            label="往来单位"
            width="160"
            min-width="160"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="plan_qty"
            label="任务数量"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="repair_qty"
            label="维修数量"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="bad_qty"
            label="报废数量"
            width="110"
            sortable="custom"
          />
          <el-table-column
            prop="defect_code"
            label="缺陷代码"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="defect_name"
            label="批次条码"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="lm_user"
            label="检验人员"
            prop="username"
            label="质检人员"
            width="110"
            sortable="custom"
          />
          <el-table-column
            prop="lm_date"
            label="检验时间"
            label="质检时间"
            width="160"
            sortable="custom"
          />
          <el-table-column
            prop="check_result"
            label="检验结果"
            width="110"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_result==='OK'" style="display: flex;align-items: center">
                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                合格
              </div>
              <div v-if="row.check_result==='NG'" style="display: flex;align-items: center">
                <i class="el-icon-error" style="color: red;margin-right: 2px" />
                不合格
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="检验明细"
            width="120"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="查看" placement="top">
                  <i
                    class="el-icon-view"
                    :style="{color:$store.state.settings.theme}"
                    style="margin-right:15px;cursor: pointer;"
                    @click="edit('edit',row)"
                  />
                </el-tooltip>
                <!--                <el-tooltip class="item" effect="dark" content="编辑" placement="top">-->
                <!--                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />-->
                <!--                </el-tooltip>-->
                <!--                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">-->
                <!--                  <i class="el-icon-delete" @click="del(row)" />-->
                <!--                </el-tooltip>-->
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
@@ -236,7 +270,7 @@
    <el-dialog
      v-el-drag-dialog
      :title="operation==='add'?'新增':'人员明细'"
      :title="operation==='add'?'新增':'检验明细'"
      :visible.sync="dialogVisible"
      width="800px"
      :close-on-click-modal="false"
@@ -244,16 +278,89 @@
      @closed="handleClose"
      @close="handleClose"
    >
      <div style="height: 300px;width: 100%;background-color: aliceblue;padding:20px">
        <el-tag
          v-for="tag in tagArr"
          :key="tag.name"
          type="success"
          style="margin-right: 15px;min-width: 80px;text-align: center"
      <el-table
        ref="tableDataRef2"
        class="tableFixed"
        :data="dialogTableData"
        height="500"
        style="height:500px"
        border
        :row-class-name="tableRowClassName"
        highlight-current-row
        :header-cell-style="this.$headerCellStyle"
        :cell-style="this.$cellStyle"
      >
        <el-table-column
          type="index"
          width="50"
          fixed
          label="序号"
        />
        <el-table-column
          prop="stepcheckitem_code"
          width="150"
          label="检验项目"
        >
          {{ tag }}
        </el-tag>
      </div>
          <template slot-scope="{row}">
            <el-select
              v-if="row.isVisible===1"
              v-model="row.stepcheckitem_code"
              filterable
              placeholder="请选择"
              style="width: 100%;"
            >
              <!--              @change="val=>tableChange(val,row)"-->
              <el-option
                v-for="item in CheckItemSelectArr"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
            <div v-else>{{
              CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code).name
            }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          prop="stepcheckitem_desc"
          label="标准要求"
          show-tooltip-when-overflow
        >
          <template slot-scope="{row}">
            <el-input
              v-if="row.isVisible===1"
              v-model="row.stepcheckitem_desc"
              placeholder="请输入"
            />
            <div v-else>{{ row.stepcheckitem_desc ? row.stepcheckitem_desc : '/' }}</div>
          </template>
        </el-table-column>
        <!--        这里写for循环遍历语句-->
        <el-table-column
          v-if="operation!=='check'"
          label="操作"
          width="120"
          fixed="right"
        >
          <template slot-scope="{row}">
            <div class="operationClass">
              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">确认</el-button>
              <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">取消
              </el-button>
              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="editZjlbRow(row)">编辑</el-button>
              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="delZjlbRow(row)">删除</el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-waves @click="dialogVisible=false">返 回</el-button>
@@ -263,30 +370,20 @@
      </span>
    </el-dialog>
    <!--导入组件-->
    <import-picker
      ref="importPickerFunc"
      class="importPickerClass"
      :shows.sync="shows"
      :title="title_value"
      :colos="colos"
      :code="code"
    />
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { getCookie } from '@/utils/auth'
import ImportPicker from '@/components/ImportPicker'
import { handleDatetime, validateCode } from '@/utils/global'
import { handleDatetime } from '@/utils/global'
import {
  GroupSalaryReportSearchUser, MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch
  MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch
} from '@/api/reportManager'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { MesOrderStepReportSelectUserGroup } from '@/api/produceManager'
import { PurchSupplierSelect } from '@/api/basicInfo'
export default {
  name: 'Zzjg',
@@ -327,40 +424,13 @@
      total: 10,
      tableData: [],
      dialogVisible: false,
      tagArr: [], //
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// 上级单位
      },
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
        ],
        OrgName: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ]
      },
      title_value: '数据导入 / 点检部位',
      code: '4',
      shows: false
      dialogTableData: []
    }
  },
  watch: {
    shows() {
      if (!this.shows) {
        this.getLogisticsCheckSearch()
      }
    }
  },
  created() {
    this.handleRequest()
  },
@@ -446,14 +516,7 @@
    search() {
      this.getLogisticsCheckSearch()
    },
    // 导入按钮
    upload() {
      this.shows = true
      this.$refs.importPickerFunc.newDataFunc()
    },
    colos() {
      this.shows = false
    },
    // 重置
    reset() {
      this.form.checktypecode = ''
@@ -469,77 +532,22 @@
    },
    // 新增按钮
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // add(operation) {
    //   this.operation = operation
    //   this.dialogVisible = true
    // },
    // 修改按钮
    async edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      const res = await GroupSalaryReportSearchUser({ id: row.id })
      this.tagArr = res.data.map(r => r.checkuser)
      // this.tagArr = ['楼李俊', '张三', '李四']
      // this.$nextTick(() => {
      //   this.dialogForm.OrgCode = row.org_code
      //   this.dialogForm.OrgName = row.org_name
      //   this.dialogForm.SupUnit = row.parent_id
      // })
    },
    // 删除按钮
    async del(row) {
      // this.$confirm('是否确认删除?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //   DeleteOrganization({ orgid: row.code }).then(res => {
      //     if (res.code === '200') {
      //       this.$message.success('删除成功!')
      //       if (this.form.page > 1 && this.tableData.length === 1) {
      //         this.form.page--
      //       }
      //       this.getLogisticsCheckSearch()
      //     }
      //   })
      // }).catch(() => {
      //   this.$message.info('已取消删除')
      // })
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // 对话框确认
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
          }
          // AddUpdateOrganization(data).then(res => {
          //   if (res.code === '200') {
          //     this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
          //     this.dialogVisible = false
          //     this.getLogisticsCheckSearch()
          //   } else {
          //     this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
          //   }
          // })
        }
      })
    },
    // 获取页面高度
    getHeight() {
@@ -677,11 +685,12 @@
  justify-content: center;
}
.tableFixed{
  ::v-deep .el-table__fixed-right{
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
  ::v-deep .el-table__fixed{
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}