loulijun2021
2022-07-21 bd54d5d5f292fe398599199b8ca2658b2549777d
1.工序检验开发完成
已添加1个文件
已修改6个文件
已删除1个文件
403 ■■■■■ 文件已修改
src/api/all.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ImportPicker/index.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kb/index.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjy.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/wljy.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/all.js
ÎļþÒÑɾ³ý
src/components/ImportPicker/index.vue
@@ -47,7 +47,7 @@
          <el-button class="but_style" icon="el-icon-upload2" size="small">{{ button_name }}</el-button>
        </el-upload>
        è¯·ç‚¹å‡»
        <el-button type="text" icon="el-icon-download" @click="clickDown(code)">下载数据模版</el-button>
        <el-button type="text" style="font-size: 14px;cursor: pointer" icon="el-icon-download" @click="clickDown(code)">下载数据模版</el-button>
        , å¹¶æŒ‰ç…§æ¨¡ç‰ˆç¼–辑导入数据
      </div>
      <p v-if="div1">{{ file_name }}</p>
@@ -124,7 +124,8 @@
  </el-dialog>
</template>
<script>
import all from '@/api/all'
import { DownLoadExcel, ExcelModelCheck } from '@/api/Excel'
export default {
  props: {
@@ -231,31 +232,34 @@
      }
    },
    ExcelImportSubmit(data) {
      all.ExcelImportSubmit(data).then((res) => {
        if (res.statusCode === '200') {
          this.div3 = true
          this.num += 2
          this.button_text = '完成'
          this.disState = false
        } else {
          this.num += 1
          this.div3_sb = true
          this.disState = true
          this.error_message = res.message
        }
      })
      // all.ExcelImportSubmit(data).then((res) => {
      //   if (res.statusCode === '200') {
      //     this.div3 = true
      //     this.num += 2
      //     this.button_text = '完成'
      //     this.disState = false
      //   } else {
      //     this.num += 1
      //     this.div3_sb = true
      //     this.disState = true
      //     this.error_message = res.message
      //   }
      // })
    },
    ExcelCheckData(data) {
      all.ExcelCheckData(data).then((res) => {
        this.div2_state = res.StuCode
        setTimeout(() => {
          this.cg4 = true
        }, 2000)
        this.error_list = res.list
        this.total_num = res.Count
        if (res.StuCode === '200') {
          this.disState = false
        }
      // all.ExcelCheckData(data).then((res) => {
      //   this.div2_state = res.StuCode
      //   setTimeout(() => {
      //     this.cg4 = true
      //   }, 2000)
      //   this.error_list = res.list
      //   this.total_num = res.Count
      //   if (res.StuCode === '200') {
      //     this.disState = false
      //   }
      // })
      ExcelModelCheck(data).then(res => {
      })
    },
    beforeUpload(file) {
@@ -334,7 +338,10 @@
      const data = {
        FileCode: code
      }
      all.DownLoadExcel(data).then((res) => {
      // all.DownLoadExcel(data).then((res) => {
      //   window.location.href = res
      // })
      DownLoadExcel(data).then(res => {
        window.location.href = res
      })
    }
src/layout/components/Sidebar/index.vue
@@ -26,7 +26,7 @@
    </el-scrollbar>
    <div style="position: absolute;bottom: 20px;left: 30px;">
      <div>
        <el-button type="text">新凯迪制造V1.0.01</el-button>
        <el-button type="text" style="font-size: 14px;cursor: pointer">新凯迪制造V1.0.01</el-button>
        <!--        <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">新凯迪制造V1.0.01</a></el-button>-->
      </div>
    </div>
src/permission.js
@@ -8,7 +8,7 @@
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login'] // no redirect whitelist
const whiteList = ['/login', '/kb'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
  // start progress bar
src/router/index.js
@@ -32,6 +32,11 @@
 */
export const commonRoutes = [
  {
    path: '/kb',
    component: () => import('@/views/kb/index'),
    hidden: true
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
src/views/kb/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
<template>
  <div>
    <div style="margin: 100px;">
      <el-button type="primary" @click="click">请点击我</el-button>
      <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
    </div>
  </div>
</template>
<script>
import ImportPicker from '@/components/ImportPicker'
export default {
  name: 'Wljy',
  components: {
    ImportPicker
  },
  data() {
    return {
      title_value: '数据导入 / ç”¨æˆ·è§’色',
      code: '2',
      shows: false
    }
  },
  mounted() {
  },
  methods: {
    click() {
      this.shows = true
      this.$refs.importPickerFunc.newDataFunc()
    },
    colos() {
      this.shows = false
    }
  }
}
</script>
<style scoped>
</style>
src/views/zlgl/gxjy.vue
@@ -89,7 +89,7 @@
        </div>
        <div style="margin-top: 10px">
          <el-table
            ref="tableDataRef"
            ref="multipleTable"
            :data="JYTableData"
            :height="(tableHeight-195)+'px'"
            border
@@ -98,6 +98,7 @@
            highlight-current-row
            :header-cell-style="this.$headerCellStyle"
            :cell-style="this.$cellStyle"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              type="index"
@@ -111,7 +112,7 @@
            <!--            />-->
            <el-table-column
              prop="code"
              label="检验项目名称(名称)"
              label="检验项目编码(名称)"
            >
              <template slot-scope="{row}">
                <div v-if="row.isVisible===0" style="display: flex;">
@@ -147,20 +148,42 @@
            </el-table-column>
            <el-table-column
              prop="reslut"
              prop="result"
              label="检验结果"
              width="100"
            >
              <template slot-scope="{row}">
                <el-radio-group v-model="row.reslut" size="small" @change="a=>changeRadioValue(a,row)">
                  <el-radio-button style="box-shadow: none" :label="0" @click.native.prevent="clickRadio(0,row)">
                    åˆæ ¼
                  </el-radio-button>
                  <el-radio-button style="box-shadow: none" :label="1" @click.native.prevent="clickRadio(1,row)">
                    ä¸è‰¯
                  </el-radio-button>
                </el-radio-group>
                <div v-if="row.result==='OK'">合格</div>
                <div v-if="row.result==='NG'">不良</div>
              </template>
              <!--              <template slot-scope="{row}">-->
              <!--                <el-radio-group-->
              <!--                  v-model="row.result"-->
              <!--                  size="small"-->
              <!--                  @change="a=>changeRadioValue(a,row)"-->
              <!--                >-->
              <!--                  <el-radio-->
              <!--                    :label="0"-->
              <!--                    @change="clickRadio(0,row)"-->
              <!--                  >-->
              <!--                    åˆæ ¼-->
              <!--                  </el-radio>-->
              <!--                  <el-radio-->
              <!--                    :label="1"-->
              <!--                    @change="clickRadio(1,row)"-->
              <!--                  >-->
              <!--                    ä¸è‰¯-->
              <!--                  </el-radio>-->
              <!--                </el-radio-group>-->
              <!--              </template>-->
            </el-table-column>
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column
              label="操作"
@@ -202,10 +225,10 @@
        </div>
        <div style="display: flex;margin: 30px 0;align-items: center">
          <el-button type="primary">首检保存</el-button>
          <el-button type="primary" style="margin-left: 50px">巡检保存</el-button>
          <el-button type="primary" style="margin-left: 50px">完工检保存</el-button>
          <el-button type="info" style="margin-left: 50px">取消</el-button>
          <el-button type="primary" @click="submitButton('FirstCheck')">首检保存</el-button>
          <el-button type="primary" style="margin-left: 50px" @click="submitButton('PatroCheck')">巡检保存</el-button>
          <el-button type="primary" style="margin-left: 50px" @click="submitButton('EndCheck')">完工检保存</el-button>
          <el-button type="info" style="margin-left: 50px" @click="submitButton('Cancel')">取消</el-button>
        </div>
      </div>
    </div>
@@ -219,9 +242,10 @@
// const SER_HZ = /^[\u4e00-\u9fa5]+$/
import $ from 'jquery'
import {
  DeleteStepCheckStaned,
  MesOrderStepCheckItemList,
  MesOrderStepCheckSearch,
  MesOrderStepCheckSelect,
  MesOrderStepCheckSelect, SaveMesOrderStepCheckItem,
  StepCheckItemSelect
} from '@/api/zlgl'
import { MesOrderSelectUser } from '@/api/scgl'
@@ -236,7 +260,8 @@
      mainHeight: 0,
      tableHeight: 0,
      form: { // å·¥åº
        orderstepqrcode: 'MO-2022-07-0001_1;001', // æ‰«æçš„二维码信息
        // MO-2022-07-0001_1;001
        orderstepqrcode: '', // æ‰«æçš„二维码信息
        wo_code: '', // å·¥å•编码
        partcode: '', // äº§å“ç¼–码
        partname: '', // äº§å“åç§°
@@ -257,10 +282,8 @@
      JYTableData: [], // æ£€éªŒé¡¹ä¿¡æ¯è¡¨æ ¼
      JYSelectArr: [], // æ£€éªŒä¸‹æ‹‰æ•°ç»„
      JYSelectedArr: [] // å·²é€‰æ£€éªŒé¡¹ç›®æ•°ç»„
      // checkresultArr:[
      //   {''}
      // ]
      JYSelectedArr: [], // å·²é€‰æ£€éªŒé¡¹ç›®æ•°ç»„
      multipleSelection: []// è¡¨æ ¼å¤šé€‰æ¡†
    }
  },
  created() {
@@ -306,63 +329,42 @@
        let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
        number = number === 0 ? (10 + Math.random()) : number
        item.reslut = 0 // 0合格  1不良
        // item.result = 0 // 0合格  1不良
        item.result = 'NG'
        item.isVisible = 0
        item.number = number
        this.JYSelectedArr.push(item.code)
      })
    },
    changeRadioValue(val, row) {
      console.log(val, row)
    },
    clickRadio(e, row) {
      console.log(e, row, 1)
      row.reslut = row.reslut === 0 ? 1 : 0
      // this.JYTableData.forEach(item => {
      //   if (row.code === item.code) {
      //     item.reslut = row.reslut === 0 ? 1 : 0
      //   }
      // })
      // e === row.reslut ? row.reslut = null : row.reslut = e
      // this.$nextTick(() => {
      //   row.reslut = row.reslut === 0 ? 1 : 0
      // })
      //
      // this.$forceUpdate()
      // this.$refs.tableDataRef.toggleRowSelection(row, false)
    },
    reslutChange(val, row) {
    },
    xxxx(val) {
      console.log(val)
    },
    changeSelect(val, row) {
      console.log(val, row)
    },
    changSwitch(val, row) {
      console.log(val)
      // row.result = val
      // this.JYTableData.forEach(item => {
      //   if (row.code === item.code) {
      //     item.reslut = val === 'NG' ? 'OK' : 'NG'
      //   }
      // })
      // row.reslut = !row.reslut
      // this.handleValue(row)
    },
    handleValue(row) {
      this.JYTableData.forEach(item => {
        if (item.code === row.code) {
          item.reslut = item.reslut === 'OK' ? 'NG' : 'OK'
    // changeRadioValue(val, row) {
    //   console.log(val, row.result, 20000)
    // },
    // clickRadio(e, row) {
    //   console.log(e, row.result, 10000)
    //   row.result = e
    // },
    handleSelectionChange(val) {
      this.multipleSelection = val
      const arr = this.multipleSelection.map(i => i.number)
      this.JYTableData.forEach(it => {
        if (arr.includes(it.number)) {
          it.result = 'OK'
        } else {
          it.result = 'NG'
        }
      })
      if (this.multipleSelection.length > 0) {
        if (this.multipleSelection.length === this.JYTableData.length) {
          this.checkResult = 'OK'
        } else {
          this.checkResult = 'NG'
        }
      } else {
        this.checkResult = ''
      }
    },
    //
    // æ£€éªŒé¡¹ç›®ç¼–码(名称)
    changeCode(val, row) {
      row.stepcheckitem_desc = this.JYSelectArr.find(it => it.code === val).descr
      row.name = this.JYSelectArr.find(it => it.code === val).name
@@ -388,37 +390,40 @@
      let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
      number = number === 0 ? (10 + Math.random()) : number
      const data = { code: '', name: '', stepcheckitem_desc: '', isVisible: 1, number }
      const data = { result: 'NG', code: '', name: '', stepcheckitem_desc: '', isVisible: 1, number }
      this.JYTableData.push(data)
    },
    //  ç¡®è®¤
    confirm(row) {
      if (row.code === '') {
        return this.$message.info('检验标准编码(名称)不能为空!')
        return this.$message.info('检验项目编码(名称)不能为空!')
      }
      if (this.JYSelectedArr.find(item => item === row.code) !== undefined) {
        return this.$message.info('检验标准编码(名称)不能重复!')
        return this.$message.info('检验项目编码(名称)不能重复!')
      } else {
        this.JYSelectedArr.push(row.code)
      }
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          item.isVisible = 0
          this.JYTableData.splice(index, 1, {
            number: row.number,
            code: row.code,
            name: row.name,
            isVisible: 0,
            reslut: row.reslut,
            stepcheckitem_desc: row.stepcheckitem_desc
          })
          item.code = row.code
          item.name = row.name
          item.result = row.result
          item.stepcheckitem_desc = row.stepcheckitem_desc
        }
      })
      console.log(this.JYTableData)
      if (this.multipleSelection.length > 0) {
        if (this.multipleSelection.length === this.JYTableData.length) {
          this.checkResult = 'OK'
        } else {
          this.checkResult = 'NG'
        }
      } else {
        this.checkResult = ''
      }
    },
    //  å–消
    cancel(row) {
@@ -448,6 +453,67 @@
        }
      })
    },
    // æäº¤
    submitButton(val) {
      console.log(val)
      if (val !== 'Cancel') {
        const text = val === 'FirstCheck' ? '首检保存' : (val === 'PatroCheck' ? '巡检保存' : '完工检保存')
        this.$confirm('是否确认' + text + '?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const arr = []
          this.JYTableData.forEach((item, index) => {
            arr.push({
              code: item.code,
              name: item.name,
              seq: (index + 1),
              descr: item.stepcheckitem_desc,
              checkresult: item.result
            })
          })
          const data = {
            'mesordercode': this.form.wo_code, // å·¥å•编号
            'partcode': this.form.partcode, // äº§å“ç¼–码
            'stepcode': this.form.stepcode, // å·¥åºç¼–码
            'checkstanedcode': this.checkStandard, // æ£€éªŒæ ‡å‡†ç¼–码
            'checkusercode': this.checkUser, // æ£€éªŒäººå‘˜ç¼–码
            'checktypecode': val, // æ£€éªŒç±»åž‹ç¼–码
            'checkresult': this.checkResult, // æ£€éªŒç»“æžœ(OK(合格) NG(不良))
            'checkdescr': this.checkdescr, // æ£€éªŒæè¿°
            'data': arr
          }
          const res = SaveMesOrderStepCheckItem(data)
          if (res.code === '200') {
            this.$message.success(text + '成功!')
            this.clearContent()
            this.getFocus()
          }
        }).catch(() => {
          this.$message.info('已取消保存')
        })
      } else {
        this.clearContent()
        this.getFocus()
      }
    },
    // æ¸…空页面内容
    clearContent() {
      this.JYTableData = []
      this.multipleSelection = []
      this.checkdescr = ''
      this.checkUser = ''
      this.checkResult = ''
      this.checkStandard = ''
      this.form.orderstepqrcode = ''
      this.form.wo_code = ''
      this.form.partcode = ''
      this.form.partname = ''
      this.form.partspec = ''
      this.form.stepcode = ''
      this.form.stepname = ''
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
src/views/zlgl/wljy.vue
@@ -1,38 +0,0 @@
<!--<template>-->
<!--  <div>-->
<!--    <div style="margin: 100px;">-->
<!--      <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />-->
<!--    </div>-->
<!--  </div>-->
<!--</template>-->
<!--<script>-->
<!--import ImportPicker from '@/components/ImportPicker'-->
<!--export default {-->
<!--  name: 'Wljy',-->
<!--  components: {-->
<!--    ImportPicker-->
<!--  },-->
<!--  data() {-->
<!--    return {-->
<!--      title_value: '数据导入 / ç”¨æˆ·è§’色',-->
<!--      code: '2',-->
<!--      shows: false-->
<!--    }-->
<!--  },-->
<!--  mounted() {-->
<!--    this.shows = true-->
<!--    this.$refs.importPickerFunc.newDataFunc()-->
<!--  },-->
<!--  methods: {-->
<!--    colos() {-->
<!--      this.shows = false-->
<!--    }-->
<!--  }-->
<!--}-->
<!--</script>-->
<!--<style scoped>-->
<!--</style>-->