|
|
@@ -21,9 +21,12 @@
|
|
|
</el-breadcrumb>
|
|
|
|
|
|
<span style="float: right;">
|
|
|
+ <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="mainForm.EntrustStatus >= 0"
|
|
|
+ @click="ReceiveEntrustNo">接收计划</el-button>
|
|
|
|
|
|
- <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="mainForm.EntrustStatus == 0"
|
|
|
+ <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="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>
|
|
|
@@ -155,13 +158,31 @@
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
|
|
|
- <el-table-column v-for="column in tableColumns" :key="column.Id"
|
|
|
- v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
- </el-pagination>
|
|
|
+ <div v-if="mainForm.Id <= 0">
|
|
|
+ <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
|
|
|
+ <el-table-column v-for="column in tableColumns" :key="column.Id"
|
|
|
+ v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="mainForm.Id > 0">
|
|
|
+ <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
|
|
|
+ <el-table-column label="操作" width="100px" fixed>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="plain" plain size="mini" @click="delEntrustEquipment(scope.row.Id)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-for="column in tableColumns" :key="column.Id"
|
|
|
+ v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -170,10 +191,10 @@
|
|
|
import {
|
|
|
mapGetters
|
|
|
} from 'vuex'
|
|
|
- import axios from "../../../../../.nuxt/axios"
|
|
|
import docTemplateApi from '@/api/lims/docTemplate'
|
|
|
- import entrustApi from "@/api/lims/limsentrust"
|
|
|
+ import entrustApi from '@/api/lims/limsentrust'
|
|
|
import checkEquipmentApi from '@/api/lims/limscheckequipmentlist'
|
|
|
+ import entrustEquipmentApi from '@/api/lims/entrustEquipment'
|
|
|
export default {
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
@@ -181,21 +202,19 @@
|
|
|
})
|
|
|
},
|
|
|
name: 'limsentrustdetail',
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
- //ln
|
|
|
typevalue: [],
|
|
|
EntrustSampleId: '',
|
|
|
- //ln
|
|
|
currentPage: 1,
|
|
|
size: 10,
|
|
|
currentItemCount: 0,
|
|
|
- pagetitle: '', //界面标题
|
|
|
+ pagetitle: '', // 界面标题
|
|
|
ServiceId: '',
|
|
|
Id: '',
|
|
|
- //样本单位
|
|
|
+ // 样本单位
|
|
|
sampeunitlist: [],
|
|
|
- //委托方名称
|
|
|
+ // 委托方名称
|
|
|
customerList: [],
|
|
|
groupOptions: [{
|
|
|
label: '大港油田',
|
|
|
@@ -206,13 +225,13 @@
|
|
|
}],
|
|
|
addressList: [],
|
|
|
CusAddList: [],
|
|
|
- projectTypeList: [], //检测报告大项
|
|
|
- sampleTypeList: [], //检测项目小项,样品名称列表
|
|
|
+ projectTypeList: [], // 检测报告大项
|
|
|
+ sampleTypeList: [], // 检测项目小项,样品名称列表
|
|
|
sampleTypeTreeList: [],
|
|
|
selectedorg: [],
|
|
|
- //详情
|
|
|
+ // 详情
|
|
|
testdetails: [],
|
|
|
- //检测类型
|
|
|
+ // 检测类型
|
|
|
testtypes: [],
|
|
|
|
|
|
orgtreeprops: {
|
|
|
@@ -221,9 +240,9 @@
|
|
|
children: 'children'
|
|
|
},
|
|
|
sampleTypeOrigList: [],
|
|
|
- testTypeList: [], //检测类型
|
|
|
- entypeList: [], //委托类型
|
|
|
- departmentList: [], //特检站下属部门
|
|
|
+ testTypeList: [], // 检测类型
|
|
|
+ entypeList: [], // 委托类型
|
|
|
+ departmentList: [], // 特检站下属部门
|
|
|
departmentId: '',
|
|
|
templatecode: '',
|
|
|
tjz: false,
|
|
|
@@ -262,7 +281,7 @@
|
|
|
ISreveive: 0,
|
|
|
ReveiveNum: 0.0,
|
|
|
DataTemplateId: 0,
|
|
|
- DataTemplateName: '',
|
|
|
+ DataTemplateName: ''
|
|
|
},
|
|
|
tableColumns: [
|
|
|
{
|
|
|
@@ -345,8 +364,8 @@
|
|
|
}],
|
|
|
SampleNum: [{
|
|
|
type: 'number',
|
|
|
- message: "样品数量必须为数值",
|
|
|
- trigger: "blur",
|
|
|
+ message: '样品数量必须为数值',
|
|
|
+ trigger: 'blur',
|
|
|
}],
|
|
|
},
|
|
|
tableData2: [{
|
|
|
@@ -405,11 +424,11 @@
|
|
|
deliverList: [],
|
|
|
deliverTitle: '',
|
|
|
deliver_flag: '',
|
|
|
- //分页参数
|
|
|
+ // 分页参数
|
|
|
size: 10,
|
|
|
currentPage: 1,
|
|
|
currentItemCount: 0,
|
|
|
- //列表排序
|
|
|
+ // 列表排序
|
|
|
Column: {
|
|
|
Order: '',
|
|
|
Prop: ''
|
|
|
@@ -444,8 +463,8 @@
|
|
|
rulesdeliverForm: {
|
|
|
SampleNum: [{
|
|
|
type: 'number',
|
|
|
- message: "样品数量必须为数值",
|
|
|
- trigger: "blur",
|
|
|
+ message: '样品数量必须为数值',
|
|
|
+ trigger: 'blur',
|
|
|
}],
|
|
|
SampleCode: [{
|
|
|
required: true,
|
|
|
@@ -511,40 +530,49 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.ServiceId = this.$route.params.opera
|
|
|
this.departmentId = this.authUser.Profile.DepartmentId
|
|
|
|
|
|
- this.initDeviceList()
|
|
|
-
|
|
|
this.getCustomerInfo()
|
|
|
// request
|
|
|
if (this.ServiceId === 'add') {
|
|
|
this.pagetitle = '新增检测计划'
|
|
|
- this.mainForm.EntrustTypeId = 329 //委托检测
|
|
|
+ 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() //权限
|
|
|
+ this.getPermissions() // 权限
|
|
|
},
|
|
|
methods: {
|
|
|
- //验证单号是否唯一
|
|
|
- trueEntrustNo() {
|
|
|
+ ReceiveEntrustNo () {
|
|
|
let _this = this
|
|
|
- if (_this.ServiceId == 'addentrust') {
|
|
|
- _this.$axios.get("/limsentrust/entrustmakesure?EntrustNo=" + _this.mainForm.EntrustNo, {})
|
|
|
+ _this.$axios.get('/limsentrust/receive/' + _this.mainForm.Id + '?EntrustNo=' + _this.mainForm.EntrustNo, {})
|
|
|
+ .then(function () {
|
|
|
+ _this.getEntrustInfo()
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '接收成功'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 验证单号是否唯一
|
|
|
+ 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) {
|
|
|
@@ -560,13 +588,13 @@
|
|
|
_this.checkField()
|
|
|
}
|
|
|
},
|
|
|
- //检查字段是否为空
|
|
|
- checkField() {
|
|
|
+ // 检查字段是否为空
|
|
|
+ checkField () {
|
|
|
let _this = this
|
|
|
- if (_this.selectedorg && _this.selectedorg.length > 0) { //验证样本
|
|
|
- if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { //验证委托方
|
|
|
+ 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) { //验证检测地点
|
|
|
+ if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { // 验证检测地点
|
|
|
_this.saveEntity()
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
@@ -590,25 +618,37 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //保存数据
|
|
|
- saveEntity() {
|
|
|
- if (this.ServiceId == 'addentrust' || this.ServiceId <= '0') {
|
|
|
+ // 保存数据
|
|
|
+ saveEntity () {
|
|
|
+ if (this.ServiceId === 'add' || this.ServiceId <= '0') {
|
|
|
this.addEntrust()
|
|
|
} else {
|
|
|
this.editEntrust()
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- addEntrust() {
|
|
|
+ delEntrustEquipment (val) {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm("是否要删除关联设备?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ entrustEquipmentApi.deleteEntity(val, _this.$axios).then(function () {
|
|
|
+ _this.initDeviceList()
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+
|
|
|
+ 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) {
|
|
|
+ if (!_this.tjz && _this.mainForm.AddressId && _this.mainForm.AddressId !== 0) {
|
|
|
_this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
|
|
|
}
|
|
|
_this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
|
|
|
@@ -627,7 +667,7 @@
|
|
|
message: res.data.message
|
|
|
})
|
|
|
_this.ServiceId = res.data.item
|
|
|
- //刷新一下界面
|
|
|
+ // 刷新一下界面
|
|
|
_this.getEntrustInfo()
|
|
|
_this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
} else {
|
|
|
@@ -646,7 +686,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- editEntrust() {
|
|
|
+ editEntrust () {
|
|
|
let _this = this
|
|
|
this.$refs['mainForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
@@ -654,9 +694,8 @@
|
|
|
_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) {
|
|
|
+ if (_this.mainForm.AddressId && _this.mainForm.AddressId !== 0) {
|
|
|
_this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
|
|
|
}
|
|
|
_this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
|
|
|
@@ -691,15 +730,11 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getEntrustInfo() {
|
|
|
+ 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)
|
|
|
@@ -714,12 +749,13 @@
|
|
|
// }
|
|
|
_this.getAddress(_this.mainForm.CustomerId)
|
|
|
_this.getpartuserlist(this.mainForm.DataTemplateId)
|
|
|
+ _this.initDeviceList()
|
|
|
}).catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
},
|
|
|
- getSampleNum() {
|
|
|
+ getSampleNum () {
|
|
|
let _this = this
|
|
|
this.$axios.get('limsentrust/getsamplenum/' + _this.ServiceId, {})
|
|
|
.then(res => {
|
|
|
@@ -730,7 +766,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- saveDetail() {
|
|
|
+ saveDetail () {
|
|
|
let _this = this
|
|
|
//负责人姓名
|
|
|
let tempOfficers = [];
|
|
|
@@ -937,26 +973,48 @@
|
|
|
},
|
|
|
|
|
|
initDeviceList () {
|
|
|
- // 分页及列表条件
|
|
|
- let params = {
|
|
|
- _currentPage: this.currentPage,
|
|
|
- _size: this.size,
|
|
|
- Order: this.Column.Order,
|
|
|
- Prop: this.Column.Prop,
|
|
|
- TemplateTypeId: this.mainForm.ProjectTypeId,
|
|
|
- PositionCheckId: this.mainForm.AddressId
|
|
|
- }
|
|
|
+ if (this.mainForm.Id <= 0) {
|
|
|
+ let tmpTypeId = 0
|
|
|
+ if (this.mainForm.ProjectTypeId !== '') {
|
|
|
+ tmpTypeId = this.mainForm.ProjectTypeId
|
|
|
+ }
|
|
|
+ // 分页及列表条件
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ TemplateTypeId: tmpTypeId,
|
|
|
+ PositionCheckId: this.mainForm.AddressId
|
|
|
+ }
|
|
|
+ // 访问接口
|
|
|
+ checkEquipmentApi.getList('', params, this.$axios).then(res => {
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
|
|
|
- //访问接口
|
|
|
- checkEquipmentApi.getList('', params, this.$axios).then(res => {
|
|
|
- this.entityList = res.data.items
|
|
|
- this.currentItemCount = res.data.currentItemCount
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ // 分页及列表条件
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ EntrustMainId: this.mainForm.Id
|
|
|
+ }
|
|
|
+ // 访问接口
|
|
|
+ entrustEquipmentApi.getList('', params, this.$axios).then(res => {
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- //列表排序功能
|
|
|
+ // 列表排序功能
|
|
|
orderby(column) {
|
|
|
if (column.order == 'ascending') {
|
|
|
this.Column.Order = 'asc'
|
|
|
@@ -1050,7 +1108,7 @@
|
|
|
|
|
|
//发送
|
|
|
transportShow() {
|
|
|
- if (this.mainForm.DeliverStatus == 0) {
|
|
|
+ if (this.mainForm.DeliverStatus === 0) {
|
|
|
this.getDeliverNo()
|
|
|
} else {
|
|
|
this.getDeliverInfo()
|
|
|
@@ -1211,7 +1269,7 @@
|
|
|
if (this.ServiceId === 'add') {
|
|
|
if (this.tjz) {
|
|
|
for (var i = 0; i < this.projectTypeList.length; i++) {
|
|
|
- if (this.mainForm.ProjectTypeId == this.projectTypeList[i].Id) {
|
|
|
+ if (this.mainForm.ProjectTypeId === this.projectTypeList[i].Id) {
|
|
|
this.templatecode = this.projectTypeList[i].TemplateCode
|
|
|
this.getReportNo()
|
|
|
}
|
|
|
@@ -1396,10 +1454,14 @@
|
|
|
this.selectedorg = []
|
|
|
this.getCode()
|
|
|
this.getSampleType()
|
|
|
+
|
|
|
+ this.currentPage = 1
|
|
|
this.initDeviceList()
|
|
|
},
|
|
|
|
|
|
AddressChangeHandler () {
|
|
|
+
|
|
|
+ this.currentPage = 1
|
|
|
this.initDeviceList()
|
|
|
},
|
|
|
|