licp
2024-09-09 6bf3dda64be0aeef5c999818075facb41988f7bd
新增订单-生成报告功能
已修改2个文件
已添加1个文件
250 ■■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-report-preparation/order.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-report-preparation.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -271,6 +271,7 @@
  ratifyReport: "/insReport/ratifyReport", //报告批准
  downAll: "/insReport/downAll", //报告批量下载
  upAll: "/insReport/upAll", //报告批量上传
  isReport: "/insReport/isReport", //是否生成总报告
}
const warehouse = {
src/components/do/b1-report-preparation/order.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,230 @@
<template>
  <div style="height: calc(100vh - 280px);">
    <div class="search">
      <div class="search_thing">
        <div class="search_label">委托编号:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable
            v-model="componentData.entity.entrustCode" @keyup.enter.native="refreshTable()"></el-input></div>
      </div>
      <div class="search_thing">
        <div class="search_label">样品名称:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable
            v-model="componentData.entity.sampleName" @keyup.enter.native="refreshTable()"></el-input></div>
      </div>
      <div class="search_thing">
        <div class="search_label">样品型号:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable
            v-model="componentData.entity.sampleModel" @keyup.enter.native="refreshTable()"></el-input></div>
      </div>
      <div class="search_thing">
        <div class="search_label">样品编号:</div>
        <div class="search_input"><el-input size="small" placeholder="请输入" clearable
            v-model="componentData.entity.sampleCode" @keyup.enter.native="refreshTable()"></el-input></div>
      </div>
      <div class="search_thing" style="margin-left: 20px;">
        <el-button size="small" @click="refresh()">重 ç½®</el-button>
        <el-button size="small" type="primary" @click="refreshTable()">查 è¯¢</el-button>
      </div>
    </div>
    <div class="table">
      <ValueTable ref="ValueTable"
        :url="$api.insOrder.selectInsOrderParameter" :componentData="componentData"
        :upIndex="upIndex"  />
    </div>
  </div>
</template>
<script>
import ValueTable from '../../tool/value-table.vue'
export default {
  components: {
            ValueTable,
        },
  data() {
    return {
      componentData: {
        entity: {
          entrustCode: null,
          sample: null,
          sampleName: null,
          sampleModel: null,
          sampleCode: null,
          outEntrustCode: null,
          state: 1,
          name:null,
          engineering:null,
          production:null,
        },
        isIndex: true,
        showSelect: false,
        select: false,
        // selectMethod:'selectMethod',
        do: [{
          id: 'handleCreateReport',
          font: '生成报告',
          type: 'text',
          method: 'handleCreateReport',
          disabFun: (row, index) => {
            return row.insState == 5
          }
        }],
        tagField: {
          type: {
            select: [{
              value: 0,
              type: 'success',
              label: '普通'
            }, {
              value: 1,
              type: 'warning',
              label: '优先'
            }, {
              value: 2,
              type: 'danger',
              label: '紧急'
            }]
          },
          createUser: {
            select: []
          },
          orderType: {
            select: []
          },
          processing: {
            select: [{
              value: 1,
              label: '实验室处理'
            },{
              value: 0,
              label: '委托单位取回'
            }]
          },
          isLeave: {
            select: [{
              value: 1,
              label: '留样'
            },{
              value: 0,
              label: '不留样'
            }]
          },
          send: {
            select: [{
              value: 1,
              label: '自取'
            },{
              value: 0,
              label: '其他'
            }]
          }
        },
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        needSort: ['createTime', 'sendTime', 'type', 'appointed']
      },
      upIndex: 0,
      entityCopy: {}
    }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.getPower()
  },
  methods:{
    // æƒé™åˆ†é…
    getPower(radio) {
      let power = JSON.parse(sessionStorage.getItem('power'))
      let isReport = false
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == 'isReport') {
          isReport = true
        }
      }
      if (!isReport) {
        this.componentData.do.splice(0, 1)
      }
    },
    refreshTable(e) {
      this.$refs['ValueTable'].selectList(e)
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
      this.upIndex++
      this.refreshTable()
    },
    handleCreateReport(row){
      this.$confirm(`是否生成此委托单 ${row.entrustCode} çš„æ€»æŠ¥å‘Š?`, "提示", {
            confirmButtonText: "生成",
            cancelButtonText: "不生成",
            type: "success",
            distinguishCancelAndClose: true,
          }).then(() => {
            this.$axios.post(this.$api.insReport.isReport, {
              id:row.id,
              state:1
            }).then(res => {
              if (res.code === 201) {
                return
              }
              this.$message.success("已生成")
              this.refreshTable()
            }).catch(err => {
              console.log(err)
            })
          }).catch((e) => {
            console.log(e)
            if(e=='cancel'){
              this.$axios.post(this.$api.insReport.isReport, {
                id:row.id,
                state:0
              }).then(res => {
                if (res.code === 201) {
                  return
                }
                this.refreshTable()
                this.$message.success("已取消生成")
              }).catch(err => {
                console.log(err)
              })
            }
          })
    }
  }
}
</script>
<style scoped>
.search {
        background-color: #fff;
        height: 80px;
        display: flex;
        align-items: center;
    overflow: hidden;
    }
    .search_thing {
        display: flex;
        align-items: center;
        height: 50px;
    width: 230px;
    }
    .search_label {
        width: 90px;
        font-size: 14px;
        text-align: right;
    }
    .search_input {
        width: calc(100% - 90px);
    }
    .table {
        margin-top: 10px;
        background-color: #fff;
        height: 100%;
        padding: 20px;
    }
</style>
src/components/view/b1-report-preparation.vue
@@ -87,10 +87,15 @@
    <div style="width: 100%;height: 100%;">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px;text-align: left;">报告编制</el-col>
          <el-col :span="12" style="text-align: left;">
            <el-radio-group v-model="radio"size="medium" fill="#3A7BFA">
              <el-radio-button label="0">报告编制</el-radio-button>
              <el-radio-button label="1">订单</el-radio-button>
            </el-radio-group>
          </el-col>
        </el-row>
      </div>
      <div class="search" style="position: relative;">
      <div class="search" style="position: relative;" v-if="radio==0">
        <div class="search_thing">
          <div class="search_label">报告编号:</div>
          <div class="search_input"><el-input size="small" placeholder="请输入" clearable
@@ -124,13 +129,13 @@
          </el-upload>
        </div>
      </div>
      <!-- <input id="input" type="file" accept=".doc,.docx"></input> -->
      <div class="table">
      <div class="table" v-if="radio==0">
        <ValueTable ref="ValueTable" :url="$api.insReport.pageInsReport"
                    :isColumnWidth="true"
                    :componentData="componentData"
          :key="upIndex" />
      </div>
      <Order v-if="radio==1"/>
    </div>
    <el-dialog title="在线编制" :visible.sync="claimVisible" width="22cm" :modal-append-to-body="false"
      :fullscreen="fullscreen">
@@ -213,13 +218,16 @@
<script>
  import ValueTable from '../tool/value-table.vue'
  import onlyoffice from '../tool/onlyoffice.vue'
  import Order from '../do/b1-report-preparation/order.vue'
  export default {
    components: {
      ValueTable,
      onlyoffice
      onlyoffice,
      Order
    },
    data() {
      return {
        radio:0,
        componentData: {
          entity: {
            entrustCode: null,
@@ -486,6 +494,7 @@
      refresh() {
        this.componentData.entity = this.HaveJson(this.entityCopy)
        this.upIndex++
        this.$refs['ValueTable'].selectList(e)
      },
      async handleWeave(row) {
        let fileName = (row.urlS===null||row.urlS==='')?row.url:row.urlS