loulijun2021
2022-12-06 f7eedc924df60b69353b190dc3579ef7d0852019
1.sop上传接口接入
已修改6个文件
已删除1个文件
266 ■■■■ 文件已修改
src/api/scgl.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/xtsz.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/xtsz/sc.vue 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/xtsz/yl.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/scgl.js
@@ -296,3 +296,12 @@
    data
  })
}
// MES工单工序任务查看SOP,获取SOP文件下拉列表
export function SearchWorkStepSopList(data) {
  return request({
    url: 'ProductionManagement/SearchWorkStepSopList',
    method: 'get',
    params: data
  })
}
src/api/xtsz.js
@@ -86,7 +86,7 @@
  return request({
    url: 'SystemSetting/SystemSopSava',
    method: 'post',
    params: data
    data
  })
}
src/permission.js
@@ -8,7 +8,7 @@
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/zhkb', '/ckgl', '/cgdd', '/bzcj', '/dccj', '/zpcj', '/back', '/xtsz/yl'] // no redirect whitelist
const whiteList = ['/login', '/zhkb', '/ckgl', '/cgdd', '/bzcj', '/dccj', '/zpcj', '/back'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
  // start progress bar
src/router/index.js
@@ -64,11 +64,6 @@
    component: () => import('@/views/kb/bzcj'),
    hidden: true
  },
  {
    path: '/xtsz/yl',
    component: () => import('@/views/xtsz/yl'),
    hidden: true
  },
  {
    path: '/login',
src/views/scgl/gd.vue
@@ -319,11 +319,6 @@
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="打印工单" placement="top">
                  <!--                  <i-->
                  <!--                    class="el-icon-tickets"-->
                  <!--                    style="cursor: pointer;color: #42b983;margin-right: 15px"-->
                  <!--                    @click="check(row)"-->
                  <!--                  />-->
                  <i
                    class="el-icon-tickets"
                    style="cursor: pointer;color: #42b983;margin-right: 15px"
@@ -423,6 +418,9 @@
                    style="cursor: pointer;color: #42b983;margin-right: 15px"
                    @click="supplementSmallClick(row)"
                  />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="预览" placement="top">
                  <i class="el-icon-files" style="cursor: pointer;color:#42b983;" @click="check(row)" />
                </el-tooltip>
              </div>
            </template>
@@ -1557,6 +1555,46 @@
      </span>
    </el-dialog>
    <el-dialog
      title="文件预览"
      :visible.sync="dialogVisibleCheck"
      width="800px"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleCloseCheck"
      @close="handleCloseCheck"
    >
      <el-form label-width="80px">
        <el-form-item label="文件版本">
          <el-select
            v-model="sopSelectValue"
            style="width: 200px"
            placeholder="请选择"
            filterable
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in sopSelectArr"
              :key="item.id"
              :label="item.define_name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancelCheck">返 å›ž</el-button>
          <el-button
            type="primary"
            @click="dialogVisibleConfirmCheck"
          >预 è§ˆ</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -1566,7 +1604,7 @@
  AddUpdateMesOrder,
  ClosedMesOrder,
  DeleteMesOrder, ErpOrderSearch,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep, SearchWorkStepSopList,
  SelectRouteStep
} from '@/api/scgl'
import { InventoryFileAssociationRoute, PartSelect, SaveInventoryFile } from '@/api/zzmx'
@@ -1576,6 +1614,7 @@
import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
import QRCode from 'qrcodejs2'
import $ from 'jquery'
import { SystemSopView } from '@/api/xtsz'
export default {
  name: 'GD',
@@ -1798,7 +1837,11 @@
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7
        }
      }
      },
      /* æ–‡ä»¶é¢„览部分*/
      dialogVisibleCheck: false,
      sopSelectArr: [], // sop下拉选项数组
      sopSelectValue: ''// sop下拉选中值
    }
  },
  created() {
@@ -1947,17 +1990,32 @@
      this.wkshopArr = res2
      this.dialogForm.wkshopcode = ''
    },
    // å·¥åºä»»åŠ¡
    // é¢„览
    async check(row) {
      const { data: res } = await SearchWorkStep({ wo_code: row.wo_code })
      this.taskTableData = res
      if (this.taskTableData.length === 0) {
        return this.$message.info('无生产任务数据!')
      this.dialogVisibleCheck = true
      const data = {
        partcode: row.partcode,
        routecode: this.tableData.find(i => i.wo_code === this.radioSelected).route_code,
        stepcode: row.stepcode
      }
      this.dialogForm.mesordercode = res[0].wo_code
      this.dialogVisibleTask = true
      const { data: res } = await SearchWorkStepSopList(data)
      this.sopSelectArr = res
      this.sopSelectValue = res[0].id
    },
    // é¢„览关闭
    handleCloseCheck() {
      this.sopSelectValue = ''
    },
    // é¢„览返回
    dialogVisibleCancelCheck() {
      this.dialogVisibleCheck = false
    },
    // é¢„览新开浏览器页签
    async dialogVisibleConfirmCheck() {
      const { data: res } = await SystemSopView({ id: this.sopSelectValue, filepath: this.sopSelectArr.find(i => i.id === this.sopSelectValue).file_path })
      window.open(res)
    },
    dialogVisibleBack() {
      this.dialogVisibleTask = false
    },
src/views/xtsz/sc.vue
@@ -12,17 +12,15 @@
          >
            <div class="elForm" style="justify-content: flex-start">
              <el-form-item style="margin-right: 30px">
                <el-checkbox v-model="form.checked">备选项</el-checkbox>
                <el-checkbox v-model="checked" @change="checkedChange">最新版本</el-checkbox>
              </el-form-item>
              <el-form-item>
                <!--                prefix-icon="el-icon-search"-->
                <el-input v-model="form.search" placeholder="请输入关键字" style="width: 260px" />
              </el-form-item>
            </div>
          </el-form>
          <el-button type="primary" style="margin-left: 30px" icon="el-icon-search" @click="search">查询</el-button>
          <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
        </div>
      </div>
@@ -47,7 +45,7 @@
            label="序号"
          />
          <el-table-column
            prop="file_name"
            prop="define_name"
            label="文件名称"
            min-width="160"
            show-tooltip-when-overflow
@@ -95,7 +93,7 @@
          <el-table-column
            prop="lm_date"
            label="上传时间"
            width="160"
            min-width="160"
            sortable="custom"
          />
          <el-table-column
@@ -105,8 +103,8 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="预览" placement="top">
                  <i class="el-icon-files" style="cursor: pointer;color:#42b983;margin-right: 15px" @click="check" />
                <el-tooltip v-del-tab-index class="item" effect="dark" content="预览" placement="top">
                  <i class="el-icon-files" style="cursor: pointer;color:#42b983;margin-right: 15px" @click="check(row)" />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
                  <i class="el-icon-delete" @click="del(row)" />
@@ -172,9 +170,10 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="文件名称" prop="defilename">
          <el-input v-model="dialogForm.defilename" style="width: 200px" />
        </el-form-item>
        <!--        <el-form-item label="文件名称" prop="defilename">-->
        <!--        <el-form-item label="文件名称">-->
        <!--          <el-input v-model="dialogForm.defilename" disabled style="width: 200px" />-->
        <!--        </el-form-item>-->
        <el-form-item label="文件类型" prop="filetypecode">
          <el-select
            v-model="dialogForm.filetypecode"
@@ -192,10 +191,10 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="版本号">
          <el-input v-model="dialogForm.fileversion" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="文件上传" prop="Files">
          <!--          <el-input v-model="dialogForm.Files" style="width: 200px" />-->
          <div style="width: 200px;">
            <el-upload
              ref="uploadFileRef"
@@ -208,8 +207,6 @@
              :multiple="false"
              accept=".mp4,.pdf"
            >
              <!--              :http-request="upload"-->
              <!--              :before-upload="beforeUpload"-->
              <el-button
                type="primary"
                style="width: 200px;display: flex;justify-content: center"
@@ -219,15 +216,16 @@
            </el-upload>
          </div>
        </el-form-item>
        <el-form-item label="版本号">
          <el-input v-model="dialogForm.fileversion" disabled style="width: 200px" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
          <el-button
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="dialogVisibleConfirm"
          >ç¡® å®š</el-button>
        </div>
      </span>
    </el-dialog>
@@ -237,9 +235,14 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { SystemSopDelete, SystemSopDeviceSearch, SystemSopMaxVersion, SystemSopSava, SystemSopSearch } from '@/api/xtsz'
import {
  SystemSopDelete,
  SystemSopDeviceSearch,
  SystemSopMaxVersion,
  SystemSopSava,
  SystemSopSearch,
  SystemSopView
} from '@/api/xtsz'
import { PartSelect } from '@/api/zzmx'
export default {
@@ -254,13 +257,15 @@
      mainHeight: 0,
      tableHeight: 0,
      form: {
        checked: '', // æ˜¯å¦é€‰ä¸­æœ€é«˜ç‰ˆæœ¬
        check: 'N', // æ˜¯å¦é€‰ä¸­æœ€é«˜ç‰ˆæœ¬
        search: '', // æœç´¢å…³é”®å­—
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      checked: false,
      total: 10,
      tableData: [],
      dialogVisible: false,
@@ -285,10 +290,6 @@
        filetypecode: [
          { required: true, message: '请选择文件类型', trigger: ['blur', 'change'] }
        ]
        // Files: [
        //   { required: true, message: '请输入文件名称', trigger: ['blur', 'change'] }
        // ]
      },
      devicetvpeArr: [], // è®¾å¤‡ç±»åž‹ä¸‹æ‹‰åˆ—表
      partArr: [], // ç‰©æ–™ä¸‹æ‹‰åˆ—表
@@ -297,6 +298,7 @@
        { code: 'P002', name: '检验指导书' },
        { code: 'P003', name: '图纸' }
      ]
    }
  },
@@ -330,42 +332,24 @@
    search() {
      this.getSystemSopSearch()
    },
    // å¯¼å…¥æŒ‰é’®
    // upload(param) {
    //   console.log('111')
    //   this.dialogForm.Files = param.file
    // },
    // æ–‡ä»¶ä¸Šä¼ ä¹‹å‰æ–¹æ³•
    // beforeUpload(file) {
    // console.log(file, 1)
    // const isLt100M = file.size / 1024 / 1024 < 100
    // // if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb'].indexOf(file.type) == -1) {
    // if (['video/mp4', '.pdf'].indexOf(file.type) === -1) {
    //   this.$message.error('上传文件只能是 pdf、mp4 æ ¼å¼!')
    //   // this.$message.error('上传视频只能是 mp4、ogg、flv、avi、wmv、rmvb æ ¼å¼!')
    //   return false
    // }
    // if (!isLt100M) {
    //   this.$message.error('上传文件大小不能超过 100MB!')
    //   return false
    // }
    // return true
    // },
    // æœ€æ–°ç‰ˆæœ¬æ”¹å˜æ—¶è§¦å‘
    checkedChange(val) {
      this.form.check = val ? 'Y' : 'N'
      this.getSystemSopSearch()
    },
    // æ–‡ä»¶æ•°é‡è¶…过限定触发
    handleExceed() {
      this.$message.info('暂不支持多文件上传!')
    },
    // é‡ç½®
    reset() {
      this.form.checked = ''
      this.form.search = ''
      this.getSystemSopSearch()
    },
    // æ–°å¢žæŒ‰é’®
    add() {
      this.dialogVisible = true
      this.getSystemSopDeviceSearch()
      this.getPartSelect()
    },
@@ -379,7 +363,6 @@
      const { data: res } = await PartSelect()
      this.partArr = res
    },
    // æ–‡ä»¶ç±»åž‹å€¼æ”¹å˜æ—¶
    async fileversionChange(val, type) {
      const data = {
@@ -391,21 +374,10 @@
      this.dialogForm.fileversion = res
    },
    // é¢„览
    check() {
      const url = this.$router.resolve({
        path: '/xtsz/yl',
        query: {
          // clue_id: row.clue_id,
          // operation: 'check',
          name: '文件预览'
        }
      })
      window.open(url.href)
      // SystemSopView
    async  check(row) {
      const { data: res } = await SystemSopView({ id: row.id, filepath: row.file_path })
      window.open(res)
    },
    // åˆ é™¤æŒ‰é’®
@@ -416,8 +388,8 @@
        type: 'warning'
      }).then(() => {
        const data = {
          id: '',
          filepath: ''
          id: row.id,
          filepath: row.file_path
        }
        SystemSopDelete(data).then(res => {
          if (res.code === '200') {
@@ -440,16 +412,17 @@
      this.dialogForm.filetypecode = ''
      this.dialogForm.fileversion = ''
      this.dialogForm.Files = ''
      this.$refs.uploadFileRef.clearFiles()
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
      this.dialogVisible = false
      this.$store.state.app.buttonIsDisabled = false
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      console.log(this.$refs.uploadFileRef.uploadFiles[0])
      if (!this.$refs.uploadFileRef.uploadFiles[0]) {
        this.$message.info('请选择文件上传!')
      }
@@ -457,25 +430,25 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const formData = new FormData()
          formData.append('devicetvpecode', this.dialogForm.devicetvpecode)
          formData.append('devicetypecode', this.dialogForm.devicetvpecode)
          formData.append('partcode', this.dialogForm.partcode)
          formData.append('defilename', this.dialogForm.defilename)
          formData.append('defilename', this.$refs.uploadFileRef.uploadFiles[0].name)
          formData.append('filetypecode', this.dialogForm.filetypecode)
          formData.append('fileversion', this.dialogForm.fileversion)
          formData.append('Files', this.$refs.uploadFileRef.uploadFiles[0].raw)
          // formData.append('Files', JSON.stringify(this.$refs.uploadFileRef.uploadFiles[0].raw))
          // formData.append('Files', JSON.stringify(this.$refs.uploadFileRef.uploadFiles[0]))
          for (var [key, value] of formData) {
            console.log(key, value)
          }
          // å‚考文件上传地方,明天看
          // for (var [key, value] of formData) {
          //   console.log(key, value)
          // }
          this.$store.state.app.buttonIsDisabled = true
          SystemSopSava(formData).then(res => {
            if (res.code === '200') {
              this.$message.success('文件上传成功!')
              this.dialogVisible = false
              this.$store.state.app.buttonIsDisabled = false
              this.getSystemSopSearch()
            } else {
              this.$message.error('文件上传失败!')
              this.$store.state.app.buttonIsDisabled = false
            }
          })
        }
src/views/xtsz/yl.vue
ÎļþÒÑɾ³ý