|
@@ -198,7 +198,9 @@
|
|
|
label="编码"
|
|
|
width="360">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.code" placeholder="请输入编码" :disabled="isFlag"></el-input>
|
|
|
+ <el-input v-model="scope.row.code" placeholder="请输入编码" :disabled="isFlag">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="tabTc(scope.row.scopeLevel,scope.$index)"></el-button>
|
|
|
+ </el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -234,6 +236,90 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-dialog
|
|
|
+ title="类别"
|
|
|
+ :visible.sync="tabA"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ size="mini"
|
|
|
+ v-model="filterTextA">
|
|
|
+ </el-input>
|
|
|
+ <el-tree
|
|
|
+ class="filter-tree"
|
|
|
+ :data="dataA"
|
|
|
+ :props="defaultPropsA"
|
|
|
+ node-key="id"
|
|
|
+ @node-click="clickTreeA"
|
|
|
+ highlight-current
|
|
|
+ :default-expanded-keys="defaultExpandedA"
|
|
|
+ :filter-node-method="filterNodeA"
|
|
|
+ ref="treeA">
|
|
|
+ </el-tree>
|
|
|
+ <span style="margin-right: 4px;">
|
|
|
+ <el-button @click="canclTabA" >取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitTabA" >确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="剂型"
|
|
|
+ :visible.sync="tabB"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ size="mini"
|
|
|
+ v-model="filterTextB">
|
|
|
+ </el-input>
|
|
|
+ <el-tree
|
|
|
+ class="filter-tree"
|
|
|
+ :data="dataB"
|
|
|
+ :props="defaultPropsB"
|
|
|
+ node-key="id"
|
|
|
+ @node-click="clickTreeB"
|
|
|
+ highlight-current
|
|
|
+ :default-expanded-keys="defaultExpandedB"
|
|
|
+ :filter-node-method="filterNodeB"
|
|
|
+ ref="treeB">
|
|
|
+ </el-tree>
|
|
|
+ <span style="margin-right: 4px;">
|
|
|
+ <el-button @click="canclTabB" >取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitTabB" >确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="物料"
|
|
|
+ :visible.sync="tabC"
|
|
|
+ :before-close="handleClose"
|
|
|
+ width="86%">
|
|
|
+ <el-row :gutter="20" >
|
|
|
+ <el-col :span="6" style="border-right: 1px solid #e9e9e9">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ size="mini"
|
|
|
+ v-model="filterTextC">
|
|
|
+ </el-input>
|
|
|
+ <el-tree
|
|
|
+ class="filter-tree"
|
|
|
+ :data="dataC"
|
|
|
+ :props="defaultPropsC"
|
|
|
+ node-key="id"
|
|
|
+ @node-click="clickTreeC"
|
|
|
+ highlight-current
|
|
|
+ :default-expanded-keys="defaultExpandedC"
|
|
|
+ :filter-node-method="filterNodeC"
|
|
|
+ ref="treeC">
|
|
|
+ </el-tree>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <Medicine :manageClass="dataFromParent" @send="handleEvent">
|
|
|
+ </Medicine>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
title="文件上传"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="30%"
|
|
@@ -257,13 +343,43 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import Medicine from "@/views/qualityControl/medicine.vue";
|
|
|
+ import Treeselect from "@riophae/vue-treeselect";
|
|
|
+ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import axios from 'axios';
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
- import { zjCompanyInfo, byCompanyCode, zjLicenseInfo, byLicenseId, upload, addOrEdit, getLicenseType } from "@/api/qualityControl/qualityControl";
|
|
|
+ import { zjCompanyInfo, byCompanyCode, zjLicenseInfo, byLicenseId, upload, addOrEdit, getLicenseType, getTreeA, getTreeB, getTreeC } from "@/api/qualityControl/qualityControl";
|
|
|
export default {
|
|
|
name: "qualityControlDetail",
|
|
|
+ components: {
|
|
|
+ Treeselect,
|
|
|
+ Medicine
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ dataFromParent: '',
|
|
|
+ filterTextA: "",
|
|
|
+ filterTextB: "",
|
|
|
+ filterTextC: "",
|
|
|
+ dataA: [],
|
|
|
+ dataB: [],
|
|
|
+ dataC: [],
|
|
|
+ defaultPropsA: {
|
|
|
+ children: "childrens",
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
+ defaultPropsB: {
|
|
|
+ children: "childrens",
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
+ defaultPropsC: {
|
|
|
+ children: "childrens",
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
+ defaultExpandedA: [],
|
|
|
+ defaultExpandedB: [],
|
|
|
+ defaultExpandedC: [],
|
|
|
+
|
|
|
key:'53cfd89363924f95b75b7221b6d0bfe3',
|
|
|
endpoint:'https://zhiguan.cognitiveservices.azure.cn/',
|
|
|
imgs: '',
|
|
@@ -312,10 +428,24 @@ export default {
|
|
|
companyCode: '',
|
|
|
licenseNumber: '',
|
|
|
fileList: [],
|
|
|
+ tabA: false,
|
|
|
+ tabB: false,
|
|
|
+ tabC: false,
|
|
|
+ thisIndex: '',
|
|
|
+ key1: '',
|
|
|
+ node1:'',
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
-
|
|
|
+ filterTextA(val) {
|
|
|
+ this.$refs.treeA.filter(val);
|
|
|
+ },
|
|
|
+ filterTextB(val) {
|
|
|
+ this.$refs.treeB.filter(val);
|
|
|
+ },
|
|
|
+ filterTextC(val) {
|
|
|
+ this.$refs.treeC.filter(val);
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.companyCode = this.$route.query.companyCode;
|
|
@@ -361,7 +491,126 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ handleEvent(arg1, arg2){
|
|
|
+ if(arg1!=''){
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'code', arg1);
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'name', arg2);
|
|
|
+ }
|
|
|
+ this.tabC = false;
|
|
|
+ },
|
|
|
+ canclTabA(){
|
|
|
+ this.node1 = '';
|
|
|
+ this.key1 = '';
|
|
|
+ this.tabA = false;
|
|
|
+ },
|
|
|
+ submitTabA(){
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'code', this.key1);
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'name', this.node1);
|
|
|
+ this.node1 = '';
|
|
|
+ this.key1 = '';
|
|
|
+ this.tabA = false;
|
|
|
+ },
|
|
|
+ canclTabB(){
|
|
|
+ this.node1 = '';
|
|
|
+ this.key1 = '';
|
|
|
+ this.tabB = false;
|
|
|
+ },
|
|
|
+ submitTabB(){
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'code', this.key1);
|
|
|
+ this.$set(this.tableData[this.thisIndex], 'name', this.node1);
|
|
|
+ this.node1 = '';
|
|
|
+ this.key1 = '';
|
|
|
+ this.tabB = false;
|
|
|
+ },
|
|
|
+ canclTabC(){
|
|
|
+ this.tabC = false;
|
|
|
+ },
|
|
|
+ submitTabC(){
|
|
|
+ this.tabC = false;
|
|
|
+ },
|
|
|
+ // 获取树形结构
|
|
|
+ getTreeDataA() {
|
|
|
+ getTreeA({}).then((res) => {
|
|
|
+
|
|
|
+ let { code, data } = res;
|
|
|
+ console.log("A:::" + JSON.stringify(data))
|
|
|
+ if (code === 200) {
|
|
|
+ this.dataA = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取树形结构
|
|
|
+ getTreeDataB() {
|
|
|
+ getTreeB({}).then((res) => {
|
|
|
+ let { code, data } = res;
|
|
|
+ if (code === 200) {
|
|
|
+ this.dataB = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getTreeDataC() {
|
|
|
+ getTreeC({}).then((res) => {
|
|
|
+ let { code, data } = res;
|
|
|
+ if (code === 200) {
|
|
|
+ this.dataC = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clickTreeA(data, node) {
|
|
|
+ this.key1 = node.key;
|
|
|
+ this.node1 = node.label;
|
|
|
+ // this.$set(this.tableData[this.thisIndex], 'code', node.key);
|
|
|
+ // this.$set(this.tableData[this.thisIndex], 'name', node.label);
|
|
|
+ },
|
|
|
+ clickTreeB(data, node) {
|
|
|
+ this.key1 = node.key;
|
|
|
+ this.node1 = node.label;
|
|
|
+ // this.$set(this.tableData[this.thisIndex], 'code', node.key);
|
|
|
+ // this.$set(this.tableData[this.thisIndex], 'name', node.label);
|
|
|
+ },
|
|
|
+ clickTreeC(data, node) {
|
|
|
+
|
|
|
+ this.dataFromParent = data.id;
|
|
|
+ },
|
|
|
+ filterNodeA(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return (
|
|
|
+ data.name.indexOf(value) !== -1 ||
|
|
|
+ data.code.indexOf(value) !== -1
|
|
|
+ );
|
|
|
+ },
|
|
|
+ filterNodeB(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return (
|
|
|
+ data.name.indexOf(value) !== -1 ||
|
|
|
+ data.code.indexOf(value) !== -1
|
|
|
+ );
|
|
|
+ },
|
|
|
+ filterNodeC(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return (
|
|
|
+ data.name.indexOf(value) !== -1 ||
|
|
|
+ data.code.indexOf(value) !== -1
|
|
|
+ );
|
|
|
+ },
|
|
|
+ tabTc(val,index){
|
|
|
+ if(val == '1'){
|
|
|
+ this.thisIndex = index;
|
|
|
+ this.tabA = true;
|
|
|
+ this.getTreeDataA();
|
|
|
+ }
|
|
|
+ if(val == '2'){
|
|
|
+ this.thisIndex = index;
|
|
|
+ this.tabB = true;
|
|
|
+ this.getTreeDataB();
|
|
|
+ }
|
|
|
+ if(val == '3'){
|
|
|
+ this.thisIndex = index;
|
|
|
+ this.tabC = true;
|
|
|
+ this.dataFromParent = '';
|
|
|
+ this.getTreeDataC();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 修改时自定义上传方法
|
|
|
handleFileUpload(params){
|
|
|
let newfile=params.file
|
|
@@ -405,6 +654,8 @@ export default {
|
|
|
handleClose(done) {
|
|
|
this.$confirm('确认关闭?')
|
|
|
.then(_ => {
|
|
|
+ this.node1 = '';
|
|
|
+ this.key1 = '';
|
|
|
done();
|
|
|
})
|
|
|
.catch(_ => {});
|