|
|
@@ -0,0 +1,1462 @@
|
|
|
+<style>
|
|
|
+ .input-with-select .el-select .el-input {
|
|
|
+ width: 110px;
|
|
|
+ }
|
|
|
+ .input-with-select .el-input-group__append {
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-card style="min-height: calc(100vh - 189px)">
|
|
|
+ <div slot="header" style="height: 20px;">
|
|
|
+ <span style="float: left;">
|
|
|
+ <i class="icon icon-table2"></i>
|
|
|
+ </span>
|
|
|
+ <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item :to="{ path: '/lims/taskplan' }">检测计划</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>{{pagetitle}}</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+
|
|
|
+ <span style="float: right;">
|
|
|
+
|
|
|
+ <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="mainForm.EntrustStatus == 0"
|
|
|
+ @click="trueEntrustNo">保存</el-button>
|
|
|
+ <router-link :to="'/lims/taskplan'">
|
|
|
+ <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px">返回</el-button>
|
|
|
+ </router-link>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-form :model="mainForm" :rules="rulesmainForm" label-width="130px" ref="mainForm">
|
|
|
+ <el-row :gutter="10" class="entrustformcss">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="检测报告" prop="ProjectTypeId">
|
|
|
+ <el-select ref="refProjectTypeId" v-model="mainForm.ProjectTypeId" @change="SampleTypeChangeHandler"
|
|
|
+ style="width:100%" filterable placeholder="请选择">
|
|
|
+ <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item :label="(!tjz)?'委托单号':'报告单号'" prop="EntrustNo">
|
|
|
+ <el-input v-model="mainForm.EntrustNo" placeholder="单号" :disabled="mainForm.EntrustNo == ''"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="委托类型" prop="EntrustTypeId">
|
|
|
+ <el-select ref="refEntrustType" v-model="mainForm.EntrustTypeId" style="width:100%" placeholder="请选择委托类型">
|
|
|
+ <el-option v-for="item in entypeList" :key="item.Id" :label="item.Value" :value="item.Id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="委托方名称">
|
|
|
+ <el-input v-model="mainForm.CustomerName" placeholder="委托方名称" readonly></el-input>
|
|
|
+ <!--<el-select ref="selectCustomer" disabled v-model="mainForm.CustomerId" filterable placeholder="请选择" style="width: 100%"
|
|
|
+ @change="chooseCustomer">
|
|
|
+ <el-option-group v-for="group in groupOptions" :key="group.label" :label="group.label">
|
|
|
+ <el-option v-for="item in group.options" :key="item.Id" :label="item.CustomerName" :value="item.Id">
|
|
|
+ </el-option>
|
|
|
+ </el-option-group>
|
|
|
+ </el-select>-->
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="委托方地址">
|
|
|
+ <el-input v-model="mainForm.Address" placeholder="委托方地址" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" v-if="!tjz">
|
|
|
+ <el-form-item label="检测地点" required>
|
|
|
+ <el-select ref="refAddress" v-model="mainForm.AddressId" style="width:100%" placeholder="请选择检测地点">
|
|
|
+ <el-option v-for="item in addressList" :key="item.Id" :label="item.PositionName" :value="item.Id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8">
|
|
|
+ <el-form-item label="机构代码">
|
|
|
+ <el-input v-model="mainForm.CustomerCode" placeholder="请输入委托方机构代码" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="经办人">
|
|
|
+ <el-input v-model="mainForm.CustomerPerson" placeholder="委托方经办人"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="联系电话">
|
|
|
+ <el-input v-model="mainForm.CustomerTelephone" placeholder="委托方联系电话"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8" v-if="tjz">
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!-- 暂时隐藏
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="样品名称">
|
|
|
+ <el-cascader :options="sampleTypeTreeList" :props="orgtreeprops" :show-all-levels="false" v-model="selectedorg"
|
|
|
+ placeholder="请选择样品名称" style="width: 100%"></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="数量/单位" prop="SampleNum">
|
|
|
+ <el-input type="SampleNum" placeholder="数量" v-model.number="mainForm.SampleNum" class="input-with-select">
|
|
|
+ <el-select ref="reftube" v-model="mainForm.Unit" slot="append" placeholder="单位">
|
|
|
+ <el-option v-for="item in sampeunitlist" :label="item.Value" :value="item.Value" :key="item.Value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="委托时间" prop="EntrustTime">
|
|
|
+ <el-date-picker style="width: 100%" v-model="mainForm.EntrustTime" type="datetime" placeholder="请选择委托日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="截止日期" prop="EndTime">
|
|
|
+ <el-date-picker style="width: 100%" v-model="mainForm.EndTime" type="datetime" placeholder="请选择截止日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="8" v-if="ServiceId != 'addentrust'">
|
|
|
+ <el-form-item label="委托状态">
|
|
|
+ <el-select v-model="mainForm.EntrustStatus" style="width:100%" placeholder="请选择委托状态">
|
|
|
+ <el-option label="待审核" value="0"></el-option>
|
|
|
+ <el-option label="已审核" value="1"></el-option>
|
|
|
+ <el-option label="审核未通过" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="委托描述">
|
|
|
+ <el-input v-model="mainForm.Remarks" type="textarea" :rows=3 placeholder="请输入委托描述"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" v-if="mainForm.EntrustStatus == 1">
|
|
|
+ <el-form-item label="检测样本数量">
|
|
|
+ <span>{{ TestSampleNum }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="24" v-if="mainForm.EntrustStatus != 0">
|
|
|
+ <el-form-item label="审核说明">
|
|
|
+ <el-input v-model="mainForm.AuditorRemark" type="textarea" :rows=3 placeholder="请输入审核说明"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="tableData2"
|
|
|
+ stripe
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="seqNo"
|
|
|
+ label="序号"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="设备分类"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address"
|
|
|
+ label="地点名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address2"
|
|
|
+ label="设备厂家">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address3"
|
|
|
+ label="设备型号">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+ import axios from "../../../../../.nuxt/axios";
|
|
|
+ import docTemplateApi from '@/api/lims/docTemplate';
|
|
|
+ import entrustApi from "@/api/lims/limsentrust";
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'limsentrustdetail',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ //ln
|
|
|
+ typevalue: [],
|
|
|
+ EntrustSampleId: '',
|
|
|
+ //ln
|
|
|
+ currentPage: 1,
|
|
|
+ size: 10,
|
|
|
+ currentItemCount: 0,
|
|
|
+ pagetitle: '', //界面标题
|
|
|
+ ServiceId: '',
|
|
|
+ Id: '',
|
|
|
+ //样本单位
|
|
|
+ sampeunitlist: [],
|
|
|
+ //委托方名称
|
|
|
+ customerList: [],
|
|
|
+ groupOptions: [{
|
|
|
+ label: '大港油田',
|
|
|
+ options: []
|
|
|
+ }, {
|
|
|
+ label: '外部委托方',
|
|
|
+ options: []
|
|
|
+ }],
|
|
|
+ addressList: [],
|
|
|
+ CusAddList: [],
|
|
|
+ projectTypeList: [], //检测报告大项
|
|
|
+ sampleTypeList: [], //检测项目小项,样品名称列表
|
|
|
+ sampleTypeTreeList: [],
|
|
|
+ selectedorg: [],
|
|
|
+ //详情
|
|
|
+ testdetails: [],
|
|
|
+ //检测类型
|
|
|
+ testtypes: [],
|
|
|
+
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'FullName',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ sampleTypeOrigList: [],
|
|
|
+ testTypeList: [], //检测类型
|
|
|
+ entypeList: [], //委托类型
|
|
|
+ departmentList: [], //特检站下属部门
|
|
|
+ departmentId: '',
|
|
|
+ templatecode: '',
|
|
|
+ tjz: false,
|
|
|
+ entrustTotal: 0,
|
|
|
+ SampleTypeIdnow: '',
|
|
|
+ mainForm: {
|
|
|
+ Id: '',
|
|
|
+ SampleNum: 0.0,
|
|
|
+ EntrustNo: '',
|
|
|
+ CustomerId: '',
|
|
|
+ CustomerName: '',
|
|
|
+ CustomerPerson: '',
|
|
|
+ CustomerTelephone: '',
|
|
|
+ AddressId: '',
|
|
|
+ AddressName: '',
|
|
|
+ ProjectType: '',
|
|
|
+ ProjectTypeId: '',
|
|
|
+ EntrustStatus: 0,
|
|
|
+ AuditorRemark: '',
|
|
|
+ DeliverStatus: 0,
|
|
|
+ ReportStatus: 0,
|
|
|
+ EntrustTime: new Date(),
|
|
|
+ EndTime: new Date(),
|
|
|
+ DetectSample: '',
|
|
|
+ DetectSampleId: '',
|
|
|
+ Samplelist: '',
|
|
|
+ Remarks: '',
|
|
|
+ Person: '',
|
|
|
+ Telephone: '',
|
|
|
+ Address: '',
|
|
|
+ CustomerCode: '',
|
|
|
+ ParentId: '',
|
|
|
+ ISdeliver: 0,
|
|
|
+ ISprepare: 0,
|
|
|
+ PrepareNum: 0,
|
|
|
+ ISreveive: 0,
|
|
|
+ ReveiveNum: 0.0,
|
|
|
+ DataTemplateId: 0,
|
|
|
+ DataTemplateName: '',
|
|
|
+ },
|
|
|
+ TestSampleNum: 0,
|
|
|
+ rulesmainForm: {
|
|
|
+ EntrustNo: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入委托单号',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ EntrustTypeId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择委托类型',
|
|
|
+ trigger: 'change'
|
|
|
+ }],
|
|
|
+ ProjectTypeId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择检测报告',
|
|
|
+ trigger: 'change'
|
|
|
+ }],
|
|
|
+ CustomerId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择委托方',
|
|
|
+ trigger: 'change'
|
|
|
+ }],
|
|
|
+ SampleNum: [{
|
|
|
+ type: 'number',
|
|
|
+ message: "样品数量必须为数值",
|
|
|
+ trigger: "blur",
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ tableData2: [{
|
|
|
+ seqNo: '1',
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'A001'
|
|
|
+ }, {
|
|
|
+ seqNo: '2',
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'B002'
|
|
|
+ }, {
|
|
|
+ seqNo: '3',
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'C003'
|
|
|
+
|
|
|
+ }, {
|
|
|
+ seqNo: '4',
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'D004'
|
|
|
+ },{
|
|
|
+ seqNo: '5',
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'A001'
|
|
|
+ }, {
|
|
|
+ seqNo: '6',
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'B002'
|
|
|
+ }, {
|
|
|
+ seqNo: '7',
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'C003'
|
|
|
+
|
|
|
+ }, {
|
|
|
+ seqNo: '8',
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'D004'
|
|
|
+ }],
|
|
|
+ status_flag: false,
|
|
|
+ deliverShow: false,
|
|
|
+ deliverList: [],
|
|
|
+ deliverTitle: '',
|
|
|
+ deliver_flag: '',
|
|
|
+ sampleForm: {
|
|
|
+ Id: '',
|
|
|
+ EId: '',
|
|
|
+ EntrustNo: '',
|
|
|
+ SampleCode: '',
|
|
|
+ DetectSampleId: '',
|
|
|
+ DetectSample: '',
|
|
|
+ EntrustTypeId: '',
|
|
|
+ EntrustType: '',
|
|
|
+ SourceType: '',
|
|
|
+ DetectCharacter: '',
|
|
|
+ Unit: '',
|
|
|
+ SampleNum: 0.0,
|
|
|
+ Specification: '',
|
|
|
+ SampleLogo: '',
|
|
|
+ Environment: '',
|
|
|
+ OriginalCode: '',
|
|
|
+ CollectionBy: '',
|
|
|
+ CollectionDate: new Date(),
|
|
|
+ ISsend: 0,
|
|
|
+ ISexchange: 0,
|
|
|
+ ISprepare: 0,
|
|
|
+ PrepareNum: 0,
|
|
|
+ ISreveive: 0,
|
|
|
+ ReveiveNum: 10.,
|
|
|
+ Remark: ''
|
|
|
+ },
|
|
|
+ rulesdeliverForm: {
|
|
|
+ SampleNum: [{
|
|
|
+ type: 'number',
|
|
|
+ message: "样品数量必须为数值",
|
|
|
+ trigger: "blur",
|
|
|
+ }],
|
|
|
+ SampleCode: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入样品编号',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ detail_flag: true,
|
|
|
+ transportDialog: false,
|
|
|
+ detailsDialog: false,
|
|
|
+ deliverForm: {
|
|
|
+ Id: '',
|
|
|
+ EId: '',
|
|
|
+ EntrustNo: '',
|
|
|
+ DetectSampleId: '',
|
|
|
+ DetectSample: '',
|
|
|
+ EntrustTypeId: '',
|
|
|
+ EntrustType: '',
|
|
|
+ Unit: '',
|
|
|
+ SampleNum: 0.0,
|
|
|
+ DeliverNo: '',
|
|
|
+ Transport: '',
|
|
|
+ TransportNum: '',
|
|
|
+ Courier: '',
|
|
|
+ Sender: '',
|
|
|
+ Notes: '',
|
|
|
+ ISsend: 0,
|
|
|
+ },
|
|
|
+ rulesTransport: {
|
|
|
+ Sender: [{
|
|
|
+ required: true,
|
|
|
+ message: "请填写发件人",
|
|
|
+ trigger: "blur",
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ //分配信息弹窗
|
|
|
+ balanceShow: false,
|
|
|
+ partuserlist: [],
|
|
|
+ balanceForm: {
|
|
|
+ ConUserId: '',
|
|
|
+ ConUserBy: '',
|
|
|
+ Remark: '',
|
|
|
+ },
|
|
|
+ OfficerList: [],
|
|
|
+ docTemplateDictList: [],
|
|
|
+ //审核信息弹窗
|
|
|
+ auditorShow: false,
|
|
|
+ shenheForm: {
|
|
|
+ SuccessStatus: 0,
|
|
|
+ AuditorRemark: ''
|
|
|
+ },
|
|
|
+ lightpermission: false,
|
|
|
+ permissionscode: {
|
|
|
+ add: 'lims.deliver.add',
|
|
|
+ edit: 'lims.entrust.edit',
|
|
|
+ balance: 'lims.balance.edit',
|
|
|
+ },
|
|
|
+ permissions: {
|
|
|
+ 'lims.deliver.add': false,
|
|
|
+ 'lims.entrust.edit': false,
|
|
|
+ 'lims.balance.edit': false,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.ServiceId = this.$route.params.opera
|
|
|
+ this.departmentId = this.authUser.Profile.DepartmentId
|
|
|
+
|
|
|
+ this.getCustomerInfo()
|
|
|
+ // request
|
|
|
+ if (this.ServiceId === 'add') {
|
|
|
+ this.pagetitle = '新增检测计划'
|
|
|
+ this.mainForm.EntrustTypeId = 329 //委托检测
|
|
|
+ // this.getEntrustNo()
|
|
|
+ // this.testcodec()
|
|
|
+ } else if (this.ServiceId != '0') {
|
|
|
+ this.pagetitle = '编辑检测计划'
|
|
|
+ this.getEntrustInfo()
|
|
|
+ }
|
|
|
+ //获取委托类型
|
|
|
+ this.getEntypeList()
|
|
|
+ this.getsamplesnumlist()
|
|
|
+ this.getCustomer()
|
|
|
+ this.getProjectType()
|
|
|
+ this.getSampleTypeOrigList()
|
|
|
+ this.getDictList()
|
|
|
+ //判断组织结构
|
|
|
+ this.getOrganizeListById()
|
|
|
+ this.getPermissions() //权限
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //验证单号是否唯一
|
|
|
+ trueEntrustNo() {
|
|
|
+ let _this = this
|
|
|
+ if (_this.ServiceId == 'addentrust') {
|
|
|
+ _this.$axios.get("/limsentrust/entrustmakesure?EntrustNo=" + _this.mainForm.EntrustNo, {})
|
|
|
+ .then(function (response) {
|
|
|
+ _this.entrustTotal = response.data.items
|
|
|
+ if (_this.entrustTotal === 0) {
|
|
|
+ _this.checkField()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '单号重复!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.checkField()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //检查字段是否为空
|
|
|
+ checkField() {
|
|
|
+ let _this = this
|
|
|
+ if (_this.selectedorg && _this.selectedorg.length > 0) { //验证样本
|
|
|
+ if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { //验证委托方
|
|
|
+ if (!_this.tjz) {
|
|
|
+ if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { //验证检测地点
|
|
|
+ _this.saveEntity()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择检测地点!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.saveEntity()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择委托方!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择样品名称!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保存数据
|
|
|
+ saveEntity() {
|
|
|
+ if (this.ServiceId == 'addentrust' || this.ServiceId <= '0') {
|
|
|
+ this.addEntrust()
|
|
|
+ } else {
|
|
|
+ this.editEntrust()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ addEntrust() {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['mainForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.mainForm.EntrustStatus = -1
|
|
|
+ _this.mainForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
|
|
|
+ _this.mainForm.CustomerId = parseInt(_this.mainForm.CustomerId)
|
|
|
+ _this.mainForm.CustomerName = _this.$refs.selectCustomer.selectedLabel + ''
|
|
|
+ _this.mainForm.AddressId = parseInt(_this.mainForm.AddressId)
|
|
|
+ if (!_this.tjz && _this.mainForm.AddressId && _this.mainForm.AddressId != 0) {
|
|
|
+ _this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
|
|
|
+ }
|
|
|
+ _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
|
|
|
+ _this.mainForm.ProjectType = _this.$refs.refProjectTypeId.selectedLabel + ''
|
|
|
+ _this.mainForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
|
|
|
+ _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
|
|
|
+ _this.mainForm.DetectSampleId = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
|
|
|
+ _this.mainForm.DetectSample = _this.getDetectSampleName(_this.mainForm.DetectSampleId)
|
|
|
+ _this.mainForm.Samplelist = _this.selectedorg.join(',')
|
|
|
+ _this.$axios.post('/limsentrust/addentrust', _this.mainForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.ServiceId = res.data.item
|
|
|
+ //刷新一下界面
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ _this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editEntrust() {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['mainForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let _this = this
|
|
|
+ _this.mainForm.EntrustStatus = parseInt(_this.mainForm.EntrustStatus)
|
|
|
+ _this.mainForm.SampleNum = parseInt(_this.mainForm.SampleNum)
|
|
|
+ _this.mainForm.CustomerId = parseInt(_this.mainForm.CustomerId)
|
|
|
+ _this.mainForm.CustomerName = _this.$refs.selectCustomer.selectedLabel + ''
|
|
|
+ _this.mainForm.AddressId = parseInt(_this.mainForm.AddressId)
|
|
|
+ if (_this.mainForm.AddressId && _this.mainForm.AddressId != 0) {
|
|
|
+ _this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
|
|
|
+ }
|
|
|
+ _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
|
|
|
+ _this.mainForm.ProjectType = _this.$refs.refProjectTypeId.selectedLabel + ''
|
|
|
+ _this.mainForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
|
|
|
+ _this.mainForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
|
|
|
+ _this.mainForm.DetectSampleId = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
|
|
|
+ _this.mainForm.DetectSample = _this.getDetectSampleName(_this.mainForm.DetectSampleId)
|
|
|
+ _this.mainForm.Samplelist = _this.selectedorg.join(',')
|
|
|
+ _this.$axios.put('limsentrust/editentrust/' + _this.ServiceId, _this.mainForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ _this.getSampleList()
|
|
|
+ _this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getEntrustInfo() {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('limsentrust/getentrustinfo/' + _this.ServiceId, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.mainForm = res.data
|
|
|
+ _this.mainForm.EntrustStatus = _this.mainForm.EntrustStatus + ''
|
|
|
+ if (res.data.EntrustStatus == '1') {
|
|
|
+ _this.status_flag = true
|
|
|
+ }
|
|
|
+ _this.mainForm.SampleNum = parseInt(_this.mainForm.SampleNum + '')
|
|
|
+ _this.mainForm.EntrustTime = new Date(res.data.EntrustTime)
|
|
|
+ _this.mainForm.EndTime = new Date(res.data.EndTime)
|
|
|
+ // if (res.data.Samplelist) {
|
|
|
+ // let dataIntArr = res.data.Samplelist.split(',')
|
|
|
+ // dataIntArr = dataIntArr.map(function (data) {
|
|
|
+ // return +data;
|
|
|
+ // })
|
|
|
+ // _this.selectedorg = dataIntArr
|
|
|
+ // } else {
|
|
|
+ // _this.selectedorg = []
|
|
|
+ // }
|
|
|
+ _this.getAddress(_this.mainForm.CustomerId)
|
|
|
+ _this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSampleNum() {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('limsentrust/getsamplenum/' + _this.ServiceId, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.TestSampleNum = res.data
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ saveDetail() {
|
|
|
+ let _this = this
|
|
|
+ //负责人姓名
|
|
|
+ let tempOfficers = [];
|
|
|
+ for (let idx in _this.OfficerList) {
|
|
|
+ let selectId = _this.OfficerList[idx];
|
|
|
+ for (let idx2 in _this.partuserlist) {
|
|
|
+ let item = _this.partuserlist[idx2];
|
|
|
+ if (item.Id == selectId) {
|
|
|
+ tempOfficers.push(item.Realname);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _this.balanceForm.ConUserBy = tempOfficers.join(',');
|
|
|
+ _this.$axios.post('/limsentrust/taskbalance/' + _this.mainForm.Id + '?samplecode=' + _this.sampleForm.SampleCode,
|
|
|
+ _this.balanceForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.balanceShow = false
|
|
|
+ _this.getEntrustInfo() //更新界面
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //保存委托样本明细信息
|
|
|
+ addSample() {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['sampleForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let _this = this
|
|
|
+ _this.sampleForm.EId = parseInt(_this.ServiceId)
|
|
|
+ _this.sampleForm.EntrustNo = _this.mainForm.EntrustNo
|
|
|
+ _this.sampleForm.DetectSampleId = parseInt(_this.sampleForm.DetectSampleId)
|
|
|
+ _this.sampleForm.DetectSample = _this.getDetectSampleName(_this.sampleForm.DetectSampleId)
|
|
|
+ _this.sampleForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
|
|
|
+ _this.sampleForm.EntrustType = _this.$refs.refEntrustType.selectedLabel + ''
|
|
|
+ _this.sampleForm.Unit = _this.sampleForm.Unit
|
|
|
+ _this.sampleForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
|
|
|
+ _this.sampleForm.ISsend = parseInt(_this.mainForm.ISsend)
|
|
|
+ _this.sampleForm.ISprepare = parseInt(_this.mainForm.ISprepare)
|
|
|
+ _this.sampleForm.PrepareNum = parseInt(_this.mainForm.PrepareNum)
|
|
|
+ _this.sampleForm.ISreveive = parseInt(_this.mainForm.ISreveive)
|
|
|
+ _this.sampleForm.ReveiveNum = parseFloat(_this.mainForm.ReveiveNum)
|
|
|
+ _this.$axios.post('limsentrustsample/entrustsampleadd/', _this.sampleForm)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.deliverShow = false
|
|
|
+ _this.getSampleList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showSample(val) {
|
|
|
+ let _this = this
|
|
|
+ _this.deliver_flag = 'showSample'
|
|
|
+ _this.deliverTitle = "样品交接详情"
|
|
|
+ _this.sampleForm.Id = val.Id
|
|
|
+ _this.sampleForm.SampleCode = val.SampleCode
|
|
|
+ _this.sampleForm.DetectSampleId = val.DetectSampleId
|
|
|
+ _this.sampleForm.DetectSample = val.DetectSample
|
|
|
+ _this.sampleForm.SourceType = val.SourceType
|
|
|
+ _this.sampleForm.DetectCharacter = val.DetectCharacter
|
|
|
+ _this.sampleForm.SampleNum = val.SampleNum
|
|
|
+ _this.sampleForm.Unit = val.Unit
|
|
|
+ _this.sampleForm.Specification = val.Specification
|
|
|
+ _this.sampleForm.SampleLogo = val.SampleLogo
|
|
|
+ _this.sampleForm.Environment = val.Environment
|
|
|
+ _this.sampleForm.OriginalCode = val.OriginalCode
|
|
|
+ _this.sampleForm.CollectionBy = val.CollectionBy
|
|
|
+ _this.sampleForm.CollectionDate = new Date(val.CollectionDate)
|
|
|
+ _this.sampleForm.ISprepare = _this.mainForm.ISprepare
|
|
|
+ _this.sampleForm.Remark = val.Remark
|
|
|
+ _this.deliverShow = true
|
|
|
+ },
|
|
|
+ editSample() {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['sampleForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let _this = this
|
|
|
+ _this.sampleForm.SampleNum = parseFloat(_this.sampleForm.SampleNum)
|
|
|
+ _this.sampleForm.ISsend = parseInt(_this.mainForm.ISsend)
|
|
|
+ _this.sampleForm.ISprepare = parseInt(_this.sampleForm.ISprepare)
|
|
|
+ _this.sampleForm.PrepareNum = parseInt(_this.sampleForm.PrepareNum)
|
|
|
+ _this.sampleForm.ISreveive = parseInt(_this.sampleForm.ISreveive)
|
|
|
+ _this.sampleForm.ReveiveNum = parseFloat(_this.sampleForm.ReveiveNum)
|
|
|
+ _this.$axios.put('limsentrustsample/editentrustsample/' + _this.sampleForm.Id, _this.sampleForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.deliverShow = false
|
|
|
+ _this.getSampleList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteSample(val) {
|
|
|
+ let _this = this;
|
|
|
+ _this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ _this.$axios
|
|
|
+ .delete("limsentrustsample/entrustsampledelete/" + val.Id, {})
|
|
|
+ .then(function (response) {
|
|
|
+ // response
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: response.data.message
|
|
|
+ });
|
|
|
+ // 更新界面
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ //刷新样品明显列表
|
|
|
+ _this.getSampleList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: response.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ sampleDialog() {
|
|
|
+ this.deliverShow = true
|
|
|
+ this.deliverTitle = '新增样品信息'
|
|
|
+ this.deliver_flag = 'adddeliver'
|
|
|
+ this.sampleForm.Id = ''
|
|
|
+ this.sampleForm.DetectSampleId = ''
|
|
|
+ this.sampleForm.DetectSample = ''
|
|
|
+ this.sampleForm.SourceType = ''
|
|
|
+ this.sampleForm.DetectCharacter = ''
|
|
|
+ this.sampleForm.SampleNum = this.mainForm.SampleNum
|
|
|
+ this.sampleForm.Unit = this.mainForm.Unit
|
|
|
+ this.sampleForm.Specification = ''
|
|
|
+ this.sampleForm.SampleLogo = ''
|
|
|
+ this.sampleForm.Environment = ''
|
|
|
+ this.sampleForm.OriginalCode = ''
|
|
|
+ this.sampleForm.CollectionBy = ''
|
|
|
+ this.sampleForm.CollectionDate = new Date()
|
|
|
+ this.sampleForm.Notes = ''
|
|
|
+ this.testcodec()
|
|
|
+ },
|
|
|
+ getSampleList() {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ this.$axios.get("/limsentrustsample/getentrustsamplelist/" + _this.ServiceId, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.deliverList = res.data.items
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //ln
|
|
|
+ deletetesttype(val) {
|
|
|
+ let _this = this;
|
|
|
+ this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ _this.$axios
|
|
|
+ .delete('/limsentrustsample/deletetesttype/' + val.Id)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ _this.details1(_this.EntrustSampleId)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ addTestType() {
|
|
|
+ this.$axios.post('/limsentrustsample/addtesttype/' + this.EntrustSampleId, this.typevalue)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ this.details1(this.EntrustSampleId)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ this.typevalue = []
|
|
|
+ },
|
|
|
+ //详情
|
|
|
+ details(val) {
|
|
|
+ this.EntrustSampleId = val.Id
|
|
|
+ this.$axios.get("/limsentrustsample/getdetails/" + val.Id)
|
|
|
+ .then(response => {
|
|
|
+ this.testdetails = response.data.item
|
|
|
+ this.testtypes = response.data.types
|
|
|
+ })
|
|
|
+ this.detailsDialog = true
|
|
|
+ },
|
|
|
+ details1(id) {
|
|
|
+ this.$axios.get("/limsentrustsample/getdetails/" + id)
|
|
|
+ .then(response => {
|
|
|
+ this.testdetails = response.data.item
|
|
|
+ this.testtypes = response.data.types
|
|
|
+ })
|
|
|
+ this.detailsDialog = true
|
|
|
+ },
|
|
|
+ //ln
|
|
|
+
|
|
|
+ //发送
|
|
|
+ transportShow() {
|
|
|
+ if (this.mainForm.DeliverStatus == 0) {
|
|
|
+ this.getDeliverNo()
|
|
|
+ } else {
|
|
|
+ this.getDeliverInfo()
|
|
|
+ }
|
|
|
+ this.transportDialog = true
|
|
|
+ },
|
|
|
+ getDeliverInfo() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ ServiceId: _this.mainForm.Id
|
|
|
+ }
|
|
|
+ _this.$axios.get('/limsdeliver/deliverinfo', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.deliverForm = res.data.items
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveDeliver() {
|
|
|
+ if (this.mainForm.DeliverStatus == 0) {
|
|
|
+ this.addDeliver('deliverForm')
|
|
|
+ } else if (this.mainForm.DeliverStatus == 1) {
|
|
|
+ this.editDeliver('deliverForm')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addDeliver(formName) {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['deliverForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.deliverForm.EId = _this.mainForm.Id
|
|
|
+ _this.deliverForm.EntrustNo = _this.mainForm.EntrustNo
|
|
|
+ _this.deliverForm.DetectSampleId = parseInt(_this.mainForm.DetectSampleId)
|
|
|
+ _this.deliverForm.DetectSample = _this.mainForm.DetectSample
|
|
|
+ _this.deliverForm.EntrustType = _this.mainForm.EntrustType
|
|
|
+ _this.deliverForm.EntrustTypeId = parseInt(_this.mainForm.EntrustTypeId)
|
|
|
+ _this.deliverForm.Unit = _this.mainForm.Unit
|
|
|
+ _this.deliverForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
|
|
|
+ _this.$axios.post('/limsdeliver/savedeliver', _this.deliverForm)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '添加成功'
|
|
|
+ })
|
|
|
+ _this.transportDialog = false
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ _this.getSampleList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '添加失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editDeliver(formName) {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['deliverForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.put('/limsdeliver/editdeliver/' + _this.deliverForm.Id, _this.deliverForm)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '添加成功'
|
|
|
+ })
|
|
|
+ _this.transportDialog = false
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ _this.getSampleList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '添加失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sendTransport() {
|
|
|
+ if (this.deliverForm.Sender || this.deliverForm.Sender != '') {
|
|
|
+ this.deliverForm.ISsend = 1
|
|
|
+ this.editDeliver()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '发件人不能为空,请填写发件人!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ auditor() {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm("确定审核该检测计划?审核后所有信息将不可修改!", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (_this.shenheForm.SuccessStatus === 0) {
|
|
|
+ _this.mainForm.EntrustStatus = 1
|
|
|
+ } else {
|
|
|
+ _this.mainForm.EntrustStatus = 2
|
|
|
+ }
|
|
|
+ _this.mainForm.AuditorRemark = _this.shenheForm.AuditorRemark
|
|
|
+ _this.mainForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
|
|
|
+ _this.auditorShow = false
|
|
|
+ _this.makesure()
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ makesure() {
|
|
|
+ if (this.ServiceId <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '记录主键不存在,不能完成审核!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ entrustApi.applyEntrust(this.ServiceId, this.mainForm, this.$axios).then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.getEntrustInfo()
|
|
|
+ this.getSampleList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ testcodec() {
|
|
|
+ this.$axios.get('/codesequence/GetProjectCenterDailySequence')
|
|
|
+ .then(res => {
|
|
|
+ this.sampleForm.SampleCode = res.data.items
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCode() {
|
|
|
+ if (this.ServiceId === 'add') {
|
|
|
+ if (this.tjz) {
|
|
|
+ for (var i = 0; i < this.projectTypeList.length; i++) {
|
|
|
+ if (this.mainForm.ProjectTypeId == this.projectTypeList[i].Id) {
|
|
|
+ this.templatecode = this.projectTypeList[i].TemplateCode
|
|
|
+ this.getReportNo()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.getEntrustNo()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getEntrustNo() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('orderadd/getOrderNumgene')
|
|
|
+ .then(function (response) {
|
|
|
+ _this.mainForm.EntrustNo = response.data.items + ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getReportNo() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ TemplateCode: _this.templatecode
|
|
|
+ }
|
|
|
+ _this.$axios.get('limsentrust/getentrustno', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(function (response) {
|
|
|
+ _this.mainForm.EntrustNo = response.data.items + ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDeliverNo() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('orderadd/getOrderNumgene')
|
|
|
+ .then(function (response) {
|
|
|
+ _this.deliverForm.DeliverNo = response.data.items + ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //判断组织结构确定流程
|
|
|
+ getOrganizeListById() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/limsentrust/getstyle')
|
|
|
+ .then(
|
|
|
+ function (response) {
|
|
|
+ _this.departmentList = response.data.items
|
|
|
+ let arr = _this.departmentList.split(',')
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ if (_this.departmentId == arr[i]) {
|
|
|
+ _this.tjz = true
|
|
|
+ // _this.mainForm.EntrustTypeId = 329 //委托检测
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ balanceaction(){
|
|
|
+ this.balanceShow=true
|
|
|
+ this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
+ },
|
|
|
+ getDictList() {
|
|
|
+ docTemplateApi.getDictList(this.$axios).then(res => {
|
|
|
+ this.docTemplateDictList = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getpartuserlist(val) {
|
|
|
+ this.partuserlist = ""
|
|
|
+ let docTempType = '';
|
|
|
+ for (let idx in this.docTemplateDictList) {
|
|
|
+ if (val == this.docTemplateDictList[idx].Id) {
|
|
|
+ docTempType = this.docTemplateDictList[idx].TemplateCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (val != "") {
|
|
|
+ if (docTempType === "DAYT.LightProtect.Report" || docTempType === "DAYT.Equipotent.Report") {
|
|
|
+ this.lightpermission = true
|
|
|
+ } else {
|
|
|
+ this.lightpermission = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('limsbalance/partuserlist?LightPermission=' + this.lightpermission, {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ _this.partuserlist = res.data.items
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取委托类型
|
|
|
+ getEntypeList() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/items/worditem?code=DelegateType', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.entypeList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //委托方名称下拉
|
|
|
+ getCustomer() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/customer/customerlist', {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ _this.customerList = res.data.items
|
|
|
+ for (var i = 0; i < res.data.items.length; i++) {
|
|
|
+ if (res.data.items[i].ViceBusiness == '大港油田') {
|
|
|
+ _this.groupOptions[0].options.push(res.data.items[i])
|
|
|
+ } else {
|
|
|
+ _this.groupOptions[1].options.push(res.data.items[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //下拉选择委托方
|
|
|
+ chooseCustomer() {
|
|
|
+ let _this = this
|
|
|
+ for (var i = 0; i < _this.customerList.length; i++) {
|
|
|
+ if (_this.customerList[i].Id == _this.mainForm.CustomerId) {
|
|
|
+ _this.mainForm.CustomerCode = _this.customerList[i].CustomerCode
|
|
|
+ _this.mainForm.CustomerPerson = _this.customerList[i].Person
|
|
|
+ _this.mainForm.CustomerTelephone = _this.customerList[i].Telephone
|
|
|
+ _this.mainForm.Address = _this.customerList[i].Address
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getAddress(_this.mainForm.CustomerId)
|
|
|
+ },
|
|
|
+ //检测地点下拉
|
|
|
+ getAddress(CId) {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('/limsreporthuxf/getEntrustCorp/' + CId)
|
|
|
+ .then(res => {
|
|
|
+ _this.addressList = res.data.items['PositionCheck']
|
|
|
+ if (!_this.tjz) {
|
|
|
+ if (this.addressList && this.addressList.length > 0 && !this.mainForm.AddressId) {
|
|
|
+ this.mainForm.AddressId = this.addressList[0].Id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //检测报告
|
|
|
+ getProjectType() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/testtype/testypetreeall', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.testTypeList = res.data.items
|
|
|
+ if (!_this.testTypeList) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (var i = 0; i < _this.testTypeList.length; i++) {
|
|
|
+ if (_this.testTypeList[i].ParentId === 0) {
|
|
|
+ _this.projectTypeList.push(_this.testTypeList[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getCustomerInfo () {
|
|
|
+ let _this = this // request
|
|
|
+ this.$axios.get('customer/getcustomerbydepartid', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.mainForm.CustomerId = res.data.items['Id']
|
|
|
+ _this.mainForm.CustomerName = res.data.items['CustomerName']
|
|
|
+ _this.mainForm.CustomerPerson = res.data.items['Person']
|
|
|
+ _this.mainForm.CustomerTelephone = res.data.items['Telephone']
|
|
|
+ _this.mainForm.Address = res.data.items['Address']
|
|
|
+ _this.getAddress(_this.mainForm.CustomerId)
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ SampleTypeChangeHandler() {
|
|
|
+ this.mainForm.DetectSampleId = ''
|
|
|
+ this.selectedorg = []
|
|
|
+ this.getCode()
|
|
|
+ this.getSampleType()
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取样品数量单位
|
|
|
+ getsamplesnumlist() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/items/worditem?code=SamplesNum', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.sampeunitlist = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //样品名称
|
|
|
+ getSampleTypeOrigList() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/limsampletype/sampletypetree', {})
|
|
|
+ .then(function (res) {
|
|
|
+ _this.sampleTypeOrigList = res.data.items
|
|
|
+ if (_this.mainForm.ProjectTypeId && _this.mainForm.ProjectTypeId != 0) {
|
|
|
+ _this.getSampleType(_this.mainForm.ProjectTypeId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSampleType() {
|
|
|
+ let _this = this
|
|
|
+ _this.sampleTypeList = []
|
|
|
+ for (var i = 0; _this.sampleTypeOrigList && i < _this.sampleTypeOrigList.length; i++) {
|
|
|
+ if (_this.sampleTypeOrigList[i].ProjectTypeId == _this.mainForm.ProjectTypeId) {
|
|
|
+ _this.sampleTypeList.push(_this.sampleTypeOrigList[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (_this.sampleTypeList.length == 1) {
|
|
|
+ _this.selectedorg.push(_this.sampleTypeList[0].Id)
|
|
|
+ } else if (_this.sampleTypeList.length > 1) {
|
|
|
+ _this.selectedorg.push(_this.sampleTypeList[1].Id)
|
|
|
+ for (var j = 0; j < _this.sampleTypeList.length; j++) {
|
|
|
+ if (_this.sampleTypeList[j].ParentId == _this.sampleTypeList[1].Id) {
|
|
|
+ _this.selectedorg.push(_this.sampleTypeList[j].Id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _this.sampleTypeTreeList = window.toolfun_gettreejson(_this.sampleTypeList, 'Id', 'ParentId',
|
|
|
+ 'Id,FullName')
|
|
|
+ },
|
|
|
+ getDetectSampleName(sampleId) {
|
|
|
+ let ret = ''
|
|
|
+ for (let idx in this.sampleTypeList) {
|
|
|
+ if (sampleId === this.sampleTypeList[idx].Id) {
|
|
|
+ ret = this.sampleTypeList[idx].FullName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ },
|
|
|
+ SamplePropertyHandler() {
|
|
|
+ let _this = this
|
|
|
+ var sampleid = _this.selectedorg[_this.selectedorg.length - 1]
|
|
|
+ this.$axios.get('limsampletype/getsampleproperty/' + sampleid, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.sampleForm.ISexchange = res.data.items.ISdeliver
|
|
|
+ _this.sampleForm.ISprepare = res.data.items.ISprepare
|
|
|
+ _this.sampleForm.PrepareNum = res.data.items.PrepareNum
|
|
|
+ _this.sampleForm.ISreveive = res.data.items.ISreveive
|
|
|
+ _this.sampleForm.ReveiveNum = res.data.items.ReveiveNum
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取权限
|
|
|
+ getPermissions() {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ let params = {
|
|
|
+ percodes: `'${this.permissionscode.add}','${this.permissionscode.edit}','${this.permissionscode.balance}'`
|
|
|
+ }
|
|
|
+ this.$axios.get('/permissions/isauths', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data instanceof Array && res.data.length > 0) {
|
|
|
+ res.data.forEach(element => {
|
|
|
+ _this.permissions[element.Code] = element.Isperm
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ jstimehandle(val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .entrustcard .el-card__header {
|
|
|
+ padding: 5px 10px;
|
|
|
+ font-size: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .delivercard .el-button--mini {
|
|
|
+ padding: 2px
|
|
|
+ }
|
|
|
+
|
|
|
+ .deliverFormcss .el-card__header {
|
|
|
+ padding: 5px 10px;
|
|
|
+ font-size: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .delivercard .el-button--mini {
|
|
|
+ padding: 2px
|
|
|
+ }
|
|
|
+
|
|
|
+ .cellcaijiattr div {
|
|
|
+ margin-top: -4px;
|
|
|
+ color: #4F94CD;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .cellcaijiattr div span {
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .collectionattrbtncss .el-button {
|
|
|
+ padding: 12px 2px;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .entrustformcss .el-col-8 {
|
|
|
+ height: 58px;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|