loulijun2021
2022-08-27 3cbb9eb9e6f594721239bde5754db6df924472a6
1.工序检验记录开发完成
已修改4个文件
209 ■■■■■ 文件已修改
src/views/sbgl/djbz.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjy.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjybz.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjyjl.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sbgl/djbz.vue
@@ -155,8 +155,8 @@
      :close-on-click-modal="false"
      top="8vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <!--      @close="handleClose"-->
      <div>
        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />设备点检标准信息
      </div>
@@ -415,7 +415,7 @@
import { getCookie } from '@/utils/auth'
import ImportPicker from '@/components/ImportPicker'
import {
  AddUpdateDeviceCheckStandArd,
  AddUpdateDeviceCheckStandArd, DeleteDeviceCheckStaned,
  DeviceCheckItemSelect,
  DeviceCheckStandArdSearch,
  ViewDeviceCheckStanedSearch
@@ -488,9 +488,9 @@
        ]
      },
      tableDataDialog: [], // 表格数据
      tableDataDialogSelected: [], // 已选code
      // tableDataDialogSelected: [], // 已选code
      checkItemSelectArr: [],
      checkItemIsCancel: true,
      dialogVisibleEqp: false,
      dialogFormEqp: {
@@ -523,6 +523,8 @@
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.getDeviceCheckItemSelect()
  },
  methods: {
    async getDeviceCheckStandArdSearch() {
@@ -558,10 +560,9 @@
    },
    // 重置
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.form.checkstandcode = ''
      this.form.checkstandname = ''
      this.form.checkcontr = ''
      this.getDeviceCheckStandArdSearch()
    },
@@ -574,25 +575,46 @@
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
      this.getDeviceCheckItemSelect()
      // this.getDeviceCheckItemSelect()
      this.$nextTick(() => {
        this.$refs.tableDataDialogRef.doLayout()
      })
    },
    // 修改按钮
    edit(operation, row) {
      // this.getDeviceCheckItemSelect()
      this.operation = operation
      this.getViewDeviceCheckStanedSearch(row.code)
      this.dialogVisible = true
      this.getDeviceCheckItemSelect()
      this.$nextTick(() => {
        this.$refs.tableDataDialogRef.doLayout()
      })
      this.$nextTick(() => {
        this.dialogForm.code = row.code
        this.dialogForm.name = row.name
        this.dialogForm.enable = row.enable
        this.dialogForm.description = row.description
      // this.$nextTick(() => {
      //   this.dialogForm.code = row.code
      //   this.dialogForm.name = row.name
      //   this.dialogForm.enable = row.enable
      //   this.dialogForm.description = row.description
      // })
    },
    // 修改前请求接口
    async getViewDeviceCheckStanedSearch(checkstand_code) {
      const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code })
      this.tableDataDialog = res.Data
      this.dialogForm.code = res.code
      this.dialogForm.name = res.name
      this.dialogForm.enable = res.enable
      this.dialogForm.description = res.description
      this.tableDataDialog.forEach(item => {
        item.isVisible = 0
        item.checkitem_code = item.code
        item.checkitem_name = item.name
        item.checkitem_descr = item.chkdesc
      })
      this.checkItemSelectArr = [...this.checkItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.checkitem_code !== x.code))
    },
    // 删除按钮
    async del(row) {
@@ -601,7 +623,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
        DeleteDeviceCheckStaned({ checkstand_code: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getDeviceCheckStandArdSearch()
@@ -611,10 +633,7 @@
        this.$message.info('已取消删除')
      })
    },
    // 修改前请求接口
    // async    getViewDeviceCheckStanedSearch(checkstand_code) {
    //   const { data: res } = await ViewDeviceCheckStanedSearch()
    // },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.code = ''
@@ -622,6 +641,7 @@
      this.dialogForm.enable = 'Y'
      this.dialogForm.description = ''
      this.tableDataDialog = []
      this.getDeviceCheckItemSelect()
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -632,6 +652,14 @@
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          // this.tableDataDialog.forEach((item, index) => { // 去掉正在编辑且是空checkitem_code
          //   if (item.isVisible === 1 && item.checkitem_code === '') {
          //     this.tableDataDialog.splice(index, 1)
          //   }
          // })
          this.tableDataDialog.filter(item => item.checkitem_code !== '')
          let Data = []
          // 数组中对象相同的去重
          Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => {
@@ -669,16 +697,6 @@
      row.checkitem_descr = res.description
      row.checkitem_code = res.code
      row.checkitem_name = res.name
      // row.checkitem_descr = this.checkItemSelectArr.find(item => {
      //   return item.code === val || item.name === val
      // }).description
      //
      // row.checkitem_code = this.checkItemSelectArr.find(item => {
      //   return item.code === val || item.name === val
      // }).code
      // row.checkitem_name = this.checkItemSelectArr.find(item => {
      //   return item.code === val || item.name === val
      // }).name
    },
    // 新增行
    addRow() {
@@ -700,12 +718,25 @@
        cycle: 'D',
        isVisible: 1
      })
      this.checkItemIsCancel = false
    },
    editRow(row) {
      this.tableDataDialogSelected.forEach((item, index) => {
        if (item === row.checkitem_code) {
          this.tableDataDialogSelected.splice(index, 1)
      let flag = false
      this.tableDataDialog.forEach((item, index) => {
        if (item.isVisible === 1) {
          flag = true
        }
      })
      if (flag) {
        return this.$message.info('请先确认或取消其它行!')
      }
      this.checkItemIsCancel = false
      this.checkItemSelectArr.splice(0, 0, {
        code: row.checkitem_code,
        name: row.checkitem_name,
        description: row.checkitem_descr
      })
      this.tableDataDialog.forEach((item, index) => {
@@ -722,30 +753,45 @@
      })
    },
    delRow(row) {
      console.log(row)
      this.checkItemSelectArr.splice(0, 0, {
        code: row.checkitem_code,
        name: row.checkitem_name,
        description: row.checkitem_descr
      })
      this.tableDataDialog.forEach((item, index) => {
        if (item.checkitem_code === row.checkitem_code) {
          this.tableDataDialog.splice(index, 1)
        }
      })
      this.tableDataDialogSelected.forEach((item, index) => {
        if (item === row.checkitem_code) {
          this.tableDataDialogSelected.splice(index, 1)
    },
    saveRow(row) {
      if (row.checkitem_code === '' && row.checkitem_name === '') {
        return this.$message.info('点检部位不能为空!')
      }
      row.isVisible = 0
      this.checkItemSelectArr.forEach((item, index) => {
        if (item.code === row.checkitem_code) {
          this.checkItemSelectArr.splice(index, 1)
        }
      })
    },
    saveRow(row) {
      if (this.tableDataDialogSelected.includes(row.checkitem_code)) {
        return this.$message.info('点检部位不能选择相同!')
      }
      this.tableDataDialogSelected.push(row.checkitem_code)
      row.isVisible = 0
      console.log(this.tableDataDialog)
    },
    cancelRow(row) {
      // this.checkItemSelectArr.forEach((item, index) => {
      //   if (item.code === row.checkitem_code) {
      if (this.checkItemIsCancel) {
        this.checkItemSelectArr.splice(0, 0, {
          code: row.checkitem_code,
          name: row.checkitem_name,
          description: row.checkitem_descr
        })
      }
      this.JYIsCancel = true
      // }
      // })
      this.tableDataDialog.forEach((item, index) => {
        if (item.checkitem_code === row.checkitem_code && item.isVisible === 1) {
          console.log(item)
          row.isVisible = 0
          this.tableDataDialog.splice(index, 1)
        }
src/views/zlgl/gxjy.vue
@@ -128,7 +128,7 @@
            <div style="color: red;width:10px">*</div>
            检验数量:
          </div>
          <el-input v-model="checkCount" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
          <el-input v-model="checkqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
        </div>
        <!--   检验结果   和  检验备注      -->
@@ -380,7 +380,7 @@
      checkStandard: '', // 检验标准
      checkStandardSelect: [], // 检验标准下拉数组
      checkUser: '', // 检验人员
      checkCount: 0, // 检验数量
      checkqty: 0, // 检验数量
      checkUserSelect: [], // 检验人员下拉数组
      checkResult: '', // 检验结果
      checkResultSelect: [
@@ -605,7 +605,7 @@
        if (this.checkUser.length < 1) {
          return this.$message.info('检验人员不能为空!')
        }
        if (parseFloat(this.checkCount) > 0) {
        if (parseFloat(this.checkqty) <= 0) {
          return this.$message.info('检验数量必须要大于零!')
        }
        if (this.JYTableData.length < 1) {
@@ -622,6 +622,7 @@
          type: 'warning'
        }).then(() => {
          const arr = []
          this.JYTableData = this.JYTableData.filter(item => item.code !== '')
          this.JYTableData.forEach((item, index) => {
            arr.push({
              code: item.code,
@@ -637,6 +638,7 @@
            'stepcode': this.form.stepcode, // 工序编码
            'checkstanedcode': this.checkStandard, // 检验标准编码
            'checkusercode': this.checkUser, // 检验人员编码
            'checkqty': this.checkqty, // 检验数量
            'checktypecode': val, // 检验类型编码
            'checkresult': this.checkResult, // 检验结果(OK(合格) NG(不良))
            'checkdescr': this.checkdescr, // 检验描述
@@ -665,7 +667,7 @@
      this.multipleSelection = []
      this.checkdescr = ''
      this.checkUser = ''
      this.checkCount = 0
      this.checkqty = 0
      this.checkResult = ''
      this.checkStandard = ''
      this.form.orderstepqrcode = ''
src/views/zlgl/gxjybz.vue
@@ -127,8 +127,8 @@
      :top="isIpad?'5vh':'15vh'"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
      <!--      @close="handleClose"-->
      <div style="margin-bottom: 10px">
        <i class="el-icon-s-comment" style="color:#42b983;" /> 标准信息:
      </div>
@@ -159,7 +159,7 @@
        <i class="el-icon-s-comment" style="color:#42b983;" /> 检验项信息:
      </div>
      <div style="margin-bottom: 10px">
        <el-button v-if="operation==='add'" type="primary" @click="JYadd">新增</el-button>
        <el-button v-if="operation==='add'||operation==='edit'" type="primary" @click="JYadd">新增</el-button>
      </div>
      <div>
        <el-table
@@ -179,33 +179,6 @@
            width="100"
            fixed
          />
          <!--          <el-table-column-->
          <!--            prop="code"-->
          <!--            label="检验标准编码(名称)"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.isVisible===0" style="display: flex;">-->
          <!--                <div>{{ row.code }}</div>-->
          <!--                <div style="margin-left: 10px">{{ row.name }}</div>-->
          <!--              </div>-->
          <!--              <el-select-->
          <!--                v-if="row.isVisible===1"-->
          <!--                v-model="row.code"-->
          <!--                filterable-->
          <!--                :popper-append-to-body="false"-->
          <!--                style="width: 400px;"-->
          <!--                placeholder="请选择"-->
          <!--                @change="val=>changeCode(val,row)"-->
          <!--              >-->
          <!--                <el-option-->
          <!--                  v-for="item in JYSelectArr"-->
          <!--                  :key="item.code"-->
          <!--                  :label="item.code+''+item.name"-->
          <!--                  :value="item.code"-->
          <!--                />-->
          <!--              </el-select>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="code"
            label="检验标准编码"
@@ -445,6 +418,8 @@
      this.$nextTick(() => {
        this.$refs.JYTableData.doLayout()
      })
      this.JYSelectArr = [...this.JYSelectArr].filter(x => [...this.JYTableData].every(y => y.code !== x.code))
    },
    // 删除按钮
    async del(row) {
@@ -482,6 +457,7 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const tableData = []
          this.JYTableData = this.JYTableData.filter(item => item.code !== '')
          this.JYTableData.forEach((item, index) => {
            tableData.push({
              STEPCHECKITEM_SEQ: (index + 1),
@@ -524,11 +500,6 @@
      const { data: res } = await StepCheckItemSelect()
      this.JYSelectArr = res
    },
    // 检验标准编码值改变
    // changeCode(val, row) {
    //   row.name = this.JYSelectArr.find(it => it.code === val).name
    //   row.descr = this.JYSelectArr.find(it => it.code === val).descr
    // },
    // 检验标准名称值改变
    changeName(val, row) {
      const res = this.JYSelectArr.find(item => {
@@ -551,6 +522,16 @@
      this.JYIsCancel = false
    },
    JYedit(row) {
      let flag = false
      this.JYTableData.forEach((item, index) => {
        if (item.isVisible === 1) {
          flag = true
        }
      })
      if (flag) {
        return this.$message.info('请先确认或取消其它行!')
      }
      this.JYIsCancel = false
      this.JYSelectArr.splice(0, 0, {
        code: row.code,
src/views/zlgl/gxjyjl.vue
@@ -195,12 +195,20 @@
          <el-table-column
            label="操作"
            fixed="right"
            width="120"
            width="80"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="check(row)">查看</el-button>
                <!--                <el-button type="text" @click="check(row)">查看</el-button>-->
                <!--                <el-button type="text" @click="del(row)">删除</el-button>-->
                <el-tooltip class="item" effect="dark" content="查看" placement="top">
                  <i
                    class="el-icon-view"
                    style="color: #42b983;cursor: pointer;margin-right: 15px;"
                    @click="check(row)"
                  />
                </el-tooltip>
              </div>
            </template>
          </el-table-column>