12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508 |
- <style lang="less" scoped>
- // @import "../../less/admin.less";
- #AddRuleContent {
- width: 100%;
- min-width: 1000px;
- padding: 20px;
- padding-top: 50px;
- padding-bottom: 0;
- box-sizing: border-box;
- .table_form {
- width: 100%;
- box-sizing: border-box;
- background: #fff;
- padding: 20px;
- padding-bottom: 0;
- display: flex;
- flex-wrap: wrap;
- .table_cell {
- flex: 1;
- min-width: 25%;
- }
- }
- /deep/ .el-input--mini .el-input__inner,
- .el-select {
- width: 100%;
- font-size: 14px;
- }
- .tip_text {
- // margin-top: -8px;
- font-size: 12px;
- color: red;
- line-height: 16px;
- // transform: scale(.8, .8);
- }
- .form_btn {
- width: 100%;
- background: #fff;
- padding-bottom: 20px;
- text-align: center;
- }
- /deep/ .el-form-item.is-success .el-input__inner,
- .el-form-item.is-success .el-textarea__inner {
- border-color: #c9c9c9 !important;
- }
- /deep/ .el-form-item.is-success .el-textarea__inner {
- border-color: #c9c9c9 !important;
- }
- /deep/ .el-form-item.is-success .el-textarea__inner {
- border-color: #c9c9c9 !important;
- }
- .my_error {
- position: absolute;
- top: 0;
- left: -16px;
- img {
- width: 12px;
- height: 12px;
- cursor: pointer;
- }
- }
- }
- </style>
- <style lang="less">
- .popper_class {
- // background: #fff !important;
- border: 1px solid #ffa0a0 !important;
- color: #999999 !important;
- padding: 3px 50px 3px 10px !important;
- margin-left: -10px;
- }
- .popper__arrow {
- border-top-color: #ffa0a0 !important;
- }
- </style>
- <template>
- <div>
- <crumbs
- :title="title"
- :param="$route.params"
- linkTo="ZskRuleManager"
- ></crumbs>
- <div id="AddRuleContent">
- <el-form size="mini" :model="form" ref="ruleForm">
- <div class="table_form">
- <div class="table_cell">
- <!-- 规则名称 -->
- <el-form-item
- label-width="130px"
- label="规则名称:"
- :rules="rules.parDescription"
- prop="parDescription"
- >
- <el-input
- style="width: 100%"
- v-model.trim="form.parDescription"
- />
- </el-form-item>
- </div>
- <div class="table_cell">
- <!-- 规则类型 -->
- <el-form-item
- label-width="130px"
- label="规则类型:"
- :rules="rules.parRuleType"
- prop="parRuleType"
- >
- <el-select
- v-model="form.parRuleType"
- placeholder="请选择"
- @change="ruleTypeChange"
- >
- <el-option
- v-for="item in ruleTypeList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- <template slot="error" slot-scope="scope">
- <div class="my_error">
- <el-tooltip
- class="item"
- effect="light"
- :content="scope.error"
- placement="top-start"
- popper-class="popper_class"
- >
- <img src="../../images/exclamationpoint.png" alt />
- </el-tooltip>
- </div>
- </template>
- <div class="tip_text">
- 注:更改规则类型,将会清空已填写的规则内容~
- </div>
- </el-form-item>
- </div>
- <div class="table_cell">
- <!-- 规则术语类型: -->
- <el-form-item
- label-width="130px"
- label="规则术语类型:"
- :rules="rules.parLenCode"
- prop="parLenCode"
- >
- <template slot="error" slot-scope="scope">
- <div class="my_error">
- <el-tooltip
- class="item"
- effect="light"
- :content="scope.error"
- placement="top-start"
- popper-class="popper_class"
- >
- <img src="../../images/exclamationpoint.png" alt />
- </el-tooltip>
- </div>
- </template>
- <el-select
- v-model="form.parLenCode"
- placeholder="请选择"
- @change="ruleTermChange"
- >
- <el-option
- v-for="item in ruleTermTypeList"
- :key="item.id"
- :label="item.name"
- :value="item.code"
- ></el-option>
- </el-select>
- <div class="tip_text">
- 注:更改规则术语类型,将会清空已填写的规则内容~
- </div>
- </el-form-item>
- </div>
- <div class="table_cell">
- <el-form-item
- label-width="130px"
- label="医学标准术语:"
- :style="{ height: '100%' }"
- :rules="rules.parConceptId"
- prop="parConceptId"
- >
- <el-select
- clearable
- filterable
- remote
- :remote-method="searchConcept"
- v-model.trim="form.parConceptId"
- @change="parConceptIdChange"
- >
- <el-option
- v-for="item in conceptList"
- :key="item.conceptId"
- :label="item.conceptName"
- :value="item.conceptId"
- :title="item.conceptName"
- ></el-option>
- </el-select>
- </el-form-item>
- </div>
- <div
- class="table_cell"
- v-if="showHasSub && isShow"
- style="max-width: 25%"
- >
- <el-form-item
- label-width="130px"
- label="有无子条件:"
- :rules="rules.parHasSub"
- prop="parHasSub"
- >
- <el-select
- v-model="form.parHasSub"
- placeholder="请选择"
- @change="hasSubChange"
- >
- <el-option label="有" :value="1"></el-option>
- <el-option label="无" :value="0"></el-option>
- </el-select>
- </el-form-item>
- </div>
- <!-- <div
- class="table_cell"
- style="flex: 3; max-width: 50%"
- v-if="showMsg"
- >
-
- <el-form-item
- label-width="130px"
- label="附加信息:"
- :rules="rules.parMsg"
- prop="parMsg"
- >
- <el-input
- type="textarea"
- :rows="1"
- placeholder="请输入附加信息"
- v-model.trim="form.parMsg"
- ></el-input>
- </el-form-item>
- </div>-->
- </div>
- <!-- 表格 -->
- <AddNewRuleTable
- ref="tableView"
- v-if="form.parHasSub && tableShow"
- :klRuleByIdSub="form.klRuleByIdSub"
- :maxNum="subRuleMaxNum"
- :showMsg="showMsg"
- :showMsg2="showMsg2"
- :ruleTermCodeStr="ruleTermCodeStr"
- @subTypeChange="subTypeChange"
- @searchConcept="searchConcept"
- @addGroup="addGroup"
- @delGroup="delGroup"
- @delGroupChild="delGroupChild"
- @setFormData="setFormData"
- @editKlRuleByIdSub="editKlRuleByIdSub"
- @clearValidate="clearValidate"
- @childClearConcept="childClearConcept"
- @childClearNumText="childClearNumText"
- @ChildDataTypeChange="ChildDataTypeChange"
- @childSubCodeChange="childSubCodeChange"
- />
- <AddNewRuleContent
- ref='ruleContent'
- v-if="(!form.parHasSub && !tableShow) || contentRuls"
- @ruleContent='ruleContent'
- :isContent="isEdit"
- :formEidtCopy='formEidt'
- :isError='isErr'
- >
- </AddNewRuleContent>
- <el-form-item>
- <div class="form_btn">
- <el-button
- type="primary"
- size="medium "
- @click="submitForm('ruleForm')"
- >确定</el-button
- >
- </div>
- </el-form-item>
- </el-form>
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import api from "@api/knowledgeLib.js";
- import { formRules } from "./rules";
- import AddNewRuleTable from "./AddNewRuleTable";
- import AddNewRuleContent from "./AddNewRuleContent";
- export default {
- name: "AddRule",
- data() {
- return {
- isRedMsg:[],
- isErr:false, //控制护理开单项里面的错误提示
- staicData:{ //护理开单项里面的数据
- gljtxx:[],
- fjxx:''
- },
- formEidt:{},
- isEdit:false, //判断是否是编辑页面
- isStatic:false, //判断关联静态知识的tabel列是否显示
- contentRuls:false, //判断规则内容为列表还是表单
- title: "规则维护-添加规则",
- ruleTypeList: [], //规则类型列表 1
- ruleTermTypeList: [], //规则术语类型列表 2
- conceptList: [], //医学标准术语列表 3
- baseTypeList: [], //基础规则类型列表 4
- baseTermTypeList: [], //基础规则术语类型 5
- subRuleMaxNum: null, //规则内容中规则的限制个数
- isCopy: false,
- parId: null,
- msgDict: "", //显示附加信息的类型
- firstPlace: null,
- tableShow: true,
- form: {
- parDescription: "",
- parRuleType: "",
- parConceptId: "",
- parlibName: "",
- parLenName: "",
- parHasSub: undefined,
- parLenCode: "",
- klRuleByIdSub: [],
- },
- isShow: false,
- rules: formRules,
- dragVal: null,
- dragArr: null,
- };
- },
- created() {
- this.getTypeList();
- this.setDict();
- const param = this.$route.params;
- let info = param.data;
- if (info) {
- this.parId = info.parId;
- this.isCopy = param.copy;
- this.title = "规则维护-" + (this.isCopy ? "复制" : "修改") + "规则";
- this.getDragData(info);
- // 编辑初始化选择框
- this.initEdidData();
- }
- },
- methods: {
- //护理开单项子组件里面的传过来的值
- ruleContent(data){
- this.staicData=data
- },
- clearValidate(data) {
- this.$refs.ruleForm.clearValidate(data);
- },
- // 编辑初始化
- async initEdidData() {
- // 规则术语类型初始化
- this.contentRuls=false;
- this.isEdit=false;
- this.isRedMsg=[];
- const newruleTermTypeList = await this.ruleTypeList.find(
- (it) => it.id == this.form.parRuleType
- );
- this.ruleTermTypeList = await newruleTermTypeList.subMenuList;
- // 基础规则类型初始化
- const obj = await this.ruleTermTypeList.find(
- (it1) => it1.code == this.form.parLenCode
- );
- this.baseTypeList = obj.subMenuList;
- this.subRuleMaxNum = obj.number;
- this.conceptList = [
- {
- conceptName: this.form.parlibName,
- conceptId: this.form.parConceptId,
- },
- ];
- // 加载护理开单项的推送内容
- if(!this.form.klRuleByIdSub){
- this.isEdit=true;
- this.contentRuls=true;
- this.formEidt=JSON.parse(JSON.stringify(this.form))
- return
- }
- //加载护理非开单项的关联静态知识
- if(this.form.parRuleType==8){
- this.isStatic=true;
- if(Array.isArray(this.form.klRuleByIdGroup)){
- let itemCopy={} //用来存放对象
- let itemsCopy={}
- let klRuleByIdSub=[] //中间数组
- this.form.klRuleByIdGroup.forEach((item,index)=>{
- let obj={
- groupType:item.groupType,
- klRuleStaticSub:item.klRuleStaticSub
- }
- itemCopy=JSON.parse(JSON.stringify(obj))
- klRuleByIdSub.push(itemCopy)
- })
- if(Array.isArray(this.form.klRuleByIdSub)){
- this.form.klRuleByIdSub.forEach(item=>{
- this.$set(item,'ruleStatic',[])
- this.$set(item,'ruleStaticList',[])
- this.$set(item,'ruleStaticLists',[])
- })
- }
- this.form.klRuleByIdSub.forEach((item,index)=>{
- klRuleByIdSub.forEach(items=>{
- if(items.groupType==item.groupType){
- this.form.klRuleByIdSub[index].ruleStaticLists=items.klRuleStaticSub
- }
- })
- })
- this.form.klRuleByIdSub.forEach((item,index)=>{
- if(Array.isArray(item.ruleStaticLists)){
- item.ruleStaticLists.forEach(items=>{
- let obj={
- id:items.conceptId,
- name:items.name
- }
- itemsCopy=JSON.parse(JSON.stringify(obj))
- this.form.klRuleByIdSub[index].ruleStaticList.push(itemsCopy)
- this.form.klRuleByIdSub[index].ruleStatic.push(itemsCopy.id)
- })
- }
- })
- }
- }
-
- //加载列表规则内容
- if (this.form.parConceptId && this.checkFirstPlace && this.conceptList) {
- this.firstPlace = this.conceptList.find(
- (it) => it.conceptId === this.form.parConceptId
- );
- if (this.firstPlace) {
- this.firstPlace["checkedType"] = this.ruleTermCodeStrs;
- }
- } else if (!this.form.parConceptId) {
- this.setInitGroupData();
- this.firstPlace = null;
- } else {
- this.firstPlace = null;
- }
- await this.form.klRuleByIdSub.forEach((item, i, arr) => {
- item.groupId = "groupId" + item.groupType;
- item.groupChildId = "child" + item.subId;
- //TODO => 赋值时一定要注意set更新页面
- this.$set(item, "baseTypes", [...this.baseTypeList]);
- // this.$set(key, "baseTypes", [...this.baseTypeList]);
- this.$set(
- item,
- "baseTermTypeList",
- item.baseTypes.find((it2) => it2.type === item.subType).subMenuList
- );
- this.$set(item, "conceptList", [
- {
- conceptName: item.subLibName || item.subConceptName,
- conceptId: item.subConceptId,
- },
- ]);
- if (item.subMaxOperator || item.subMinOperator) {
- item.dataType = "1";
- } else if (item.subEqValue) {
- item.dataType = "2";
- }
- // disable
- if (this.form.parHasSub && this.firstPlace) {
- const del =
- localStorage
- .getItem("zskDelDict")
- .match(
- new RegExp(this.firstPlace.checkedType + "-\\d+" + "-\\d+", "g")
- ) || [];
- if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
- this.$set(item, "disabled", false);
- if (del.length > 0 && item.subType == del[0].split("-")[2]) {
- const delType = del[0].split("-");
- const types = del[0].split("-");
- const subobj = this.baseTypeList.find(
- (it) => it.type == types[2]
- );
- const screenArr = subobj.subMenuList.filter((item) => {
- return !types[3].includes(item.code);
- });
- this.$set(item, "baseTermTypeList", screenArr);
- }
- } else {
- this.$set(item, "disabled", true);
- }
- }
- const dragDel =
- localStorage
- .getItem("zskDragDict")
- .match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
- //药品开单合理判断
- if (dragDel.length > 0) {
- const obj = this.baseTypeList.find((it) => it.type === 1);
- if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
- let klRuleByIdSub = this.form.klRuleByIdSub;
- klRuleByIdSub.forEach((item, i, arr) => {
- if (arr[i].key != 0) {
- const arr = this.baseTypeList.filter((it) => {
- return it.type == 1;
- });
- if (i > 0) {
- this.$set(item, "baseTypes", arr);
- }
- }
- });
- if (item.key == 2) {
- //获取互斥项code
- const list = obj.subMenuList.filter((it) => {
- return (
- it.code == arr[i - 1].subLenCode &&
- it.remark.split("|")[0] == 3
- );
- });
- const dragArr = list[0].remark.split("|")[1].split(",");
- this.dragArr = dragArr;
- this.dragVal = item.subLenCode;
- item.dragArr = dragArr;
- //取出互斥项
- const screenArr = obj.subMenuList.filter((item) =>
- dragArr.some(
- (ele) => ele === item.code && item.remark.split("|")[0] == 3
- )
- );
- this.$set(item, "baseTermTypeList", screenArr);
- } else {
- const screenArr = obj.subMenuList.filter((it) => {
- if (it.remark == "") {
- return it;
- } else {
- return it.remark.split("|")[0] == (item.key % 3) + 1;
- }
- });
- this.$set(item, "baseTermTypeList", screenArr);
- }
- }
- console.log(this.form);
- }
- });
- },
- //药品数据处理
- getDragData(info) {
- let dataArr = [];
- //处理修改接口请求的数据
- //先将数据深拷贝,避免数据污染
- let infoCopy=JSON.parse(JSON.stringify(info))
- infoCopy.klRuleByIdSubCopy=[];
- if(info.klRuleByIdGroup.length>0){
- let klRuleByIdSub={}
- info.klRuleByIdGroup.forEach(item=>{
- if(item.klRuleByIdSub&&Array.isArray(item.klRuleByIdSub)){
- item.klRuleByIdSub.forEach(items=>{
- klRuleByIdSub=JSON.parse(JSON.stringify(items));
- infoCopy.klRuleByIdSubCopy.push(klRuleByIdSub)
- })
- infoCopy.klRuleByIdSub=[...item.klRuleByIdSub]
- }
- })
- }
- if(Array.isArray(info.klRuleByIdGroup)&&info.klRuleByIdGroup.length==0){
- this.form = JSON.parse(JSON.stringify(info));
- return
- }
- //判断是否存在klRuleByIdSub,没有就是护理开单项直接赋值
- if(!info.klRuleByIdGroup[0].klRuleByIdSub){
- this.form = JSON.parse(JSON.stringify(info));
- }else{
- let arr = JSON.parse(JSON.stringify(infoCopy.klRuleByIdSubCopy));
- arr.map((mapItem) => {
- if (dataArr.length == 0) {
- dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
- } else {
- let res = dataArr.some((item) => {
- //判断相同日期,有就添加到当前项
- if (item.groupType == mapItem.groupType) {
- item.List.push(mapItem);
- return true;
- }
- });
- if (!res) {
- //如果没找相同日期添加一个新对象
- dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
- }
- }
- });
- this.getDragData2(info, dataArr);
- }
-
- },
- getDragData2(info, dataArr) {
- let arr = [];
- dataArr.map((item) => {
- item.List.map((it, i) => {
- it.key = i;
- it.del = i == 0 ? true : false;
- arr.push(it);
- });
- });
- info.klRuleByIdSub = arr;
- this.form = JSON.parse(JSON.stringify(info));
- },
- // 提交
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.isErr=false;
- this.isRedMsg=[];
- let params = JSON.parse(JSON.stringify(this.form));
- if(params.klRuleByIdSub){
- params.klRuleInfoSaveSub = params.klRuleByIdSub;
- delete params.klRuleByIdSub;
- params.klRuleInfoSaveSub.forEach((item, i, arr) => {
- if (i === 0) {
- item.groupType = 1;
- } else {
- if (item.groupId == arr[i - 1].groupId) {
- item.groupType = arr[i - 1].groupType;
- item.subMsg = arr[i - 1].subMsg;
- } else {
- item.groupType = arr[i - 1].groupType + 1;
- }
- }
- });
- params.klRuleInfoSaveSub.forEach((ite) => {
- delete ite.groupId;
- delete ite.groupChildId;
- delete ite.rowIndex;
- delete ite.baseTypes;
- delete ite.baseTermTypeList;
- delete ite.conceptList;
- });
- }
- if (this.parId) {
- params.parId = this.isCopy ? undefined : this.parId;
- params.parStatus = this.isCopy ? 1 : this.form.parStatus;
- }
- //改造params,保存护理开单项类型的
- let paramsCopy=JSON.parse(JSON.stringify(params))
- //先遍历子集klRuleInfoSaveSub
- paramsCopy.klRuleInfoSaveGroup=[];
- let obj={
- groupType:0,
- klRuleInfoSaveSub:[],
- }
- this.$set(obj,'ruleStatic',[])
- if(params.klRuleInfoSaveSub&&Array.isArray(params.klRuleInfoSaveSub)){
- if(params.klRuleInfoSaveSub.length>0){
- params.klRuleInfoSaveSub.forEach((item)=>{
- obj.groupType=item.groupType;
- obj.klRuleInfoSaveSub=[item]
- let objCopy=JSON.parse(JSON.stringify(obj))
- //可以处理objCopy,将groupType相同的放入klRuleInfoSaveSub里面
- paramsCopy.klRuleInfoSaveGroup.push(objCopy)
- })
- }else{
- paramsCopy.klRuleInfoSaveGroup.push(obj)
- }
- }else{
- paramsCopy.klRuleInfoSaveGroup.push(obj)
- }
- if(paramsCopy.klRuleInfoSaveSub&&Array.isArray(paramsCopy.klRuleInfoSaveSub)){
- //护理非开单项的关联静态知识的处理
- paramsCopy.klRuleInfoSaveSub.forEach((item,ind)=>{
- let ruleObj={}
- if(Array.isArray(item.ruleStatic)){
- item.ruleStatic.forEach((items,index)=>{
- ruleObj.conceptId=items;
- ruleObj.orderNo=index;
- let ruleObjCopy=JSON.parse(JSON.stringify(ruleObj))
- //将关联静态知识的对象放入数组内
- paramsCopy.klRuleInfoSaveGroup[ind].ruleStatic.push(ruleObjCopy)
- })
- }
- })
- //删除第二层的klRuleInfoSaveSub
- delete paramsCopy.klRuleInfoSaveSub
- //清除子集的关联静态知识
- paramsCopy.klRuleInfoSaveGroup.forEach((item,index)=>{
- if(index+1>=paramsCopy.klRuleInfoSaveGroup.length) return
- if(item.groupType==paramsCopy.klRuleInfoSaveGroup[index+1].groupType){
- paramsCopy.klRuleInfoSaveGroup[index+1].ruleStatic=[]
- }
- })
- }
- //判断护理开单是否附加信息和关联静态信息是否都没存在值
- let flagRule=false;
- //附加信息
- if(this.staicData.fjxx ){
- paramsCopy.klRuleInfoSaveGroup[0].groupType='1';
- paramsCopy.parMsg=this.staicData.fjxx ;
- flagRule=true;
- }else{
- paramsCopy.parMsg='';
- }
- //关联静态知识
- if(this.staicData.gljtxx.length>0){
- paramsCopy.klRuleInfoSaveGroup[0].groupType='1';
- let rule={};
- this.staicData.gljtxx.forEach((item,index)=>{
- rule.conceptId=item;
- rule.orderNo=index;
- let ruleCopy=JSON.parse(JSON.stringify(rule))
- paramsCopy.klRuleInfoSaveGroup[0].ruleStatic.push(ruleCopy);
- })
- flagRule=true;
- }
- //如果是护理项并且静态知识和附加信息都没有值
- if(this.contentRuls &&!flagRule){
- this.isErr=true
- return;
- }
- //如果护理非开单项关联静态知识和附加信息都没有值
- if(this.isStatic){
- if(Array.isArray(paramsCopy.klRuleInfoSaveGroup)){
- paramsCopy.klRuleInfoSaveGroup.forEach((item)=>{
- if(Array.isArray(item.klRuleInfoSaveSub)){
- item.klRuleInfoSaveSub.forEach(items=>{
- if(items.ruleStatic&&Array.isArray(items.ruleStatic)){
- if(items.ruleStatic.length>0||items.subMsg){
- this.isRedMsg.push(false)
- }else{
- this.isRedMsg.push(true)
- }
- }else{
- this.isRedMsg.push(false)
- }
- })
- }
- })
- }
- }
- //判断护理非开单项里面的附加信息和关联静态知识是否填写
- if(this.isStatic&&this.isRedMsg.length>0){
- let flag=this.isRedMsg.some(item=>{
- return item
- })
- //都填写了
- if(!flag) this.saveRule(paramsCopy);
-
- }else{
- this.saveRule(paramsCopy);
- }
- } else {
- return false;
- }
- });
- },
- // 子集修改父级的数组
- setFormData(index, data) {
- this.$set(this.form.klRuleByIdSub[index], "conceptList", data);
- },
- // table_form 规则类型选中
- ruleTypeChange(val) {
- //先初始化
- this.contentRuls=false;
- this.isStatic=false;
- this.isRedMsg=[]
- //是否护理非开单项
- if(val===8){
- this.isStatic=true
- }
- this.form.parLenCode = "";
- const obj = this.ruleTypeList.find((it) => it.id === val);
- this.ruleTermTypeList = obj.subMenuList;
- this.subRuleMaxNum = undefined;
- this.setInitGroupData();
- },
- // table_form 规则术语类型选中
- ruleTermChange(val) {
- this.contentRuls=false;
- this.isRedMsg=[]
- const obj = this.ruleTermTypeList.find((it) => it.code === val);
- this.form.parLenName = obj.name;
- this.baseTypeList = obj.subMenuList;
- this.subRuleMaxNum = obj.number;
- this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
- if(!this.form.parHasSub){
- this.contentRuls=true;
- }
- //初始化护理开单项的输入框
- if(this.contentRuls){
- this.$nextTick(()=>{
- this.isEdit=false
- this.$refs.ruleContent.clearFormData()
- })
- }
- this.isShow = obj.subMenuList.length ? 1 : 0;
- this.setInitGroupData();
- },
- // 医学标准术语
- parConceptIdChange(val) {
- this.$nextTick(() => {
- if (val && this.checkFirstPlace && this.conceptList) {
- this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
- if (this.firstPlace) {
- this.firstPlace["checkedType"] = this.ruleTermCodeStrs;
- }
- } else if (!val) {
- this.setInitGroupData();
- this.firstPlace = null;
- } else {
- this.firstPlace = null;
- }
- if (this.form.parHasSub && this.firstPlace) {
- const dict =
- localStorage
- .getItem("zskDicts")
- .match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
- [];
- const del =
- localStorage
- .getItem("zskDelDict")
- .match(
- new RegExp(this.firstPlace.checkedType + "-\\d+" + "-\\d+", "g")
- ) || [];
- const types = dict[0].split("-");
- let obj = this.form.klRuleByIdSub;
- obj.forEach((item, i, arr) => {
- if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
- this.$set(item, "disabled", false);
- if (del.length > 0) {
- const delType = del[0].split("-");
- if (
- item.subType == delType[2] ||
- item.subLenCode == delType[3]
- ) {
- this.$set(this.form.klRuleByIdSub, i, {
- groupId: item.groupId,
- groupChildId: "child" + new Date().valueOf(),
- baseTypes: this.baseTypeList,
- baseTermTypeList: [],
- conceptList: [],
- subDescription: "",
- parRuleType: "",
- subConceptId: "",
- subType: "",
- subMaxOperator: "",
- subMaxUnit: "",
- subMaxValue: "",
- subMinOperator: "",
- subMinUnit: "",
- subMinValue: "",
- subEqValue: "",
- subLenCode: "",
- dataType: "",
- key: 0,
- });
- }
- }
- } else {
- this.$set(item, "disabled", true);
- this.$set(item, "subType", parseInt(types[2]));
- const subobj = this.baseTypeList.find(
- (it) => it.type == types[2]
- );
- this.$set(item, "baseTermTypeList", subobj.subMenuList);
- this.$set(item, "subLenCode", types[1]);
- this.$set(item, "subDescription", this.firstPlace.conceptName);
- this.$set(item, "subConceptId", this.firstPlace.conceptId);
- this.$set(item, "subConceptName", this.firstPlace.conceptName);
- this.$set(item, "conceptList", [this.firstPlace]);
- }
- });
- this.$set(this.form, "klRuleByIdSub", obj);
- }
- });
- },
- // 初始化表格
- setInitGroupData(init) {
- this.tableShow = false;
- const date = new Date().valueOf();
- this.$nextTick(() => {
- if (this.form.parHasSub && this.form.parHasSub != 0) {
- this.$set(this.form, "klRuleByIdSub", [
- {
- groupId: date,
- groupChildId: "child" + new Date().valueOf(),
- baseTypes: this.baseTypeList,
- baseTermTypeList: [],
- conceptList: [],
- subDescription: "",
- parRuleType: "",
- subConceptId: "",
- subType: "",
- subMaxOperator: "",
- subMaxUnit: "",
- subMaxValue: "",
- subMinOperator: "",
- subMinUnit: "",
- subMinValue: "",
- subEqValue: "",
- subLenCode: "",
- dataType: "",
- key: 0,
- del: true,
- },
- ]);
- } else {
- this.$set(this.form, "klRuleByIdSub", []);
- }
- if (!init) {
- this.form.parConceptId = ""; //医学标准术语清空
- this.conceptList = []; //下拉列表清空
- this.firstPlace = null;
- }
- this.tableShow = true;
- });
- },
- // 有无子条件切换
- hasSubChange(val) {
- if (val) {
- this.setInitGroupData(true);
- } else {
- this.form.klRuleByIdSub = [];
- }
- },
- // 基础规则类型切换
- subTypeChange(val, index, groupId, key) {
- // index
- const dragDel =
- localStorage
- .getItem("zskDragDict")
- .match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
- const obj = this.baseTypeList.find((it) => it.type === val);
- let dragType = false;
- let isDel = false;
- let screenArr;
- let type;
- //药品开单合理判断
- if (dragDel.length > 0) {
- dragType = true;
- const types = dragDel[0].split("-");
- const arr = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId == groupId;
- });
- if (key == 1 && arr[2]) {
- type = arr[2].subLenCode == "" ? false : true;
- } else if (key == 2) {
- type = arr[1].subLenCode == "" ? false : true;
- }
- if (arr.length == 3 && key != 0 && type) {
- //获取互斥项code
- const val = key == 1 ? arr[2].subLenCode : arr[1].subLenCode;
- const list = obj.subMenuList.filter((it) => {
- return it.code == val && it.remark.split("|")[0] == 3;
- });
- console.log(obj.subMenuList);
- const dragArr = list[0].remark.split("|")[1].split(",");
- this.dragArr = dragArr;
- arr[1].dragArr = arr[2].dragArr = dragArr;
- //取出互斥项
- screenArr = obj.subMenuList.filter((item) =>
- dragArr.some(
- (ele) => ele === item.code && item.remark.split("|")[0] == 3
- )
- );
- } else {
- screenArr = obj.subMenuList.filter((item) => {
- if (item.remark == "") {
- return item;
- } else {
- return item.remark.split("|")[0] == (key % 3) + 1;
- }
- });
- }
- // const klRuleByIdSub = this.form.klRuleByIdSub;
- // klRuleByIdSub.forEach((item, i) => {
- // arr.forEach((it) => {
- // if (item.groupId == it.groupId) {
- // if (key == 0) {
- // this.$set(item, "baseTypes", this.baseTypeList);
- // } else {
- // const arrList = this.baseTypeList.filter((it) => {
- // return it.type == 1;
- // });
- // if (i > 0) {
- // this.$set(item, "baseTypes", arrList);
- // }
- // }
- // }
- // });
- // });
- }
- //危急值实验室子项目已选医学标准术语判断
- if (this.form.parHasSub && this.firstPlace) {
- const del =
- localStorage
- .getItem("zskDelDict")
- .match(
- new RegExp(this.firstPlace.checkedType + "-\\d+" + "-\\d+", "g")
- ) || [];
- if (del.length > 0) {
- isDel = true;
- const types = del[0].split("-");
- const subobj = this.baseTypeList.find((it) => it.type == types[2]);
- screenArr = subobj.subMenuList.filter((item) => {
- return !types[3].includes(item.code);
- });
- }
- }
- this.$set(
- this.form.klRuleByIdSub[index],
- "baseTermTypeList",
- (isDel && val == 2) || dragType ? screenArr : obj.subMenuList
- );
- this.$set(this.form.klRuleByIdSub[index], "subLenCode", "");
- this.$set(this.form.klRuleByIdSub[index], "dataType", "");
- this.clearConcept(index);
- this.clearNumText(index);
- },
- clearConcept(index) {
- this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
- this.conceptList = [];
- },
- clearNumText(index) {
- this.$set(this.form.klRuleByIdSub[index], "subMaxOperator", "");
- this.$set(this.form.klRuleByIdSub[index], "subMaxValue", "");
- this.$set(this.form.klRuleByIdSub[index], "subMaxUnit", "");
- this.$set(this.form.klRuleByIdSub[index], "subMinOperator", "");
- this.$set(this.form.klRuleByIdSub[index], "subMinValue", "");
- this.$set(this.form.klRuleByIdSub[index], "subMinUnit", "");
- this.$set(this.form.klRuleByIdSub[index], "subEqValue", "");
- this.$set(this.form.klRuleByIdSub[index], "subEqOperator", "");
- },
- editKlRuleByIdSub(data) {
- this.$set(this.form, "klRuleByIdSub", data);
- // this.form.klRuleByIdSub = data;
- },
- // 添加分组 || 规则
- addGroup(date, key, arg = { index: null, groupId: null }) {
- /**
- * @params
- * date:存在则添加规则 不存在则添加分组
- * arg:{index:添加规则用索引,groupId:添加分组用确切id}
- */
- !date && (date = new Date().valueOf());
- const obj = {
- groupId: date,
- groupChildId: "child" + new Date().valueOf(),
- baseTypes: this.baseTypeList,
- baseTermTypeList: [],
- conceptList: [],
- subDescription: "",
- parRuleType: "",
- subConceptId: "",
- subType: "",
- subMaxOperator: "",
- subMaxUnit: "",
- subMaxValue: "",
- subMinOperator: "",
- subMinUnit: "",
- subMinValue: "",
- subEqValue: "",
- subLenCode: "",
- dataType: "",
- };
- if (typeof arg.index == "number") {
- // 添加规则 直接在当前位置之后添加
- this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
- this.$set(obj, "del", false);
- const dragDel =
- localStorage
- .getItem("zskDragDict")
- .match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
- if (dragDel.length > 0) {
- const len = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId == date;
- });
- let obj = this.form.klRuleByIdSub;
- obj.forEach((item, i, arr) => {
- len.forEach((its, index) => {
- if (item.groupId == its.groupId) {
- this.$set(its, "key", index);
- if (its.key > 0 && index > 0) {
- const arrList = this.baseTypeList.filter((it) => {
- return it.type == 1;
- });
- this.$set(its, "baseTypes", arrList);
- }
- }
- });
- });
- if (
- len.length == 3 && (key == 1 || key == 0) && key == 0
- ? len[2].subLenCode
- : len[1].subLenCode
- ) {
- const dragVal = key == 0 ? len[2].subLenCode : len[1].subLenCode;
- this.dragVal = dragVal;
- const subobj = this.baseTypeList.find((it) => it.type == 1);
- const list = subobj.subMenuList.filter((it) => {
- return it.code == dragVal && it.remark.split("|")[0] == 3;
- });
- // //获取互斥项code
- const dragArr = list[0].remark.split("|")[1].split(",");
- len[1].dragArr = len[2].dragArr = dragArr;
- }
- }
- } else {
- // 添加分组 在列表中相同groupId之后添加
- // 添加分组时判断是否需要加disabled和添加默认值
- if (this.form.parHasSub && this.firstPlace) {
- obj.disabled = true;
- const dict =
- localStorage
- .getItem("zskDicts")
- .match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
- [];
- const types = dict[0].split("-");
- this.$set(obj, "disabled", true);
- this.$set(obj, "subType", parseInt(types[2]));
- const subobj = this.baseTypeList.find((it) => it.type == types[2]);
- this.$set(obj, "baseTermTypeList", subobj.subMenuList);
- this.$set(obj, "subLenCode", types[1]);
- this.$set(obj, "subDescription", this.firstPlace.conceptName);
- this.$set(obj, "subConceptId", this.firstPlace.conceptId);
- this.$set(obj, "subConceptName", this.firstPlace.conceptName);
- this.$set(obj, "conceptList", [this.firstPlace]);
- }
- var i = -1;
- this.form.klRuleByIdSub.forEach((item, inx) => {
- if (item.groupId === arg.groupId) {
- i = inx;
- }
- });
- this.form.klRuleByIdSub.splice(i + 1, 0, obj);
- this.$set(obj, "del", true);
- this.$set(obj, "key", 0);
- this.dragArr = null;
- }
- this.$nextTick(() => {
- this.$refs.tableView.scrollFun();
- });
- },
- // 删除分组
- delGroup(groupId) {
- const list = this.form.klRuleByIdSub.filter(
- (item) => item.groupId != groupId
- );
- this.form.klRuleByIdSub = list;
- },
- // 删除规则
- delGroupChild(groupChildId, index, groupId, del, key, lens) {
- let newGroupList;
- const dragDel =
- localStorage
- .getItem("zskDragDict")
- .match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
- let list;
- if (dragDel.length > 0) {
- const arr = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId != groupId;
- });
- const len = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId == groupId;
- });
- if (del) {
- const date = new Date().valueOf();
- if (key == 0 && arr.length > 0) {
- newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId != groupId;
- });
- } else {
- newGroupList = [
- {
- groupId: date,
- groupChildId: "child" + new Date().valueOf(),
- baseTypes: this.baseTypeList,
- baseTermTypeList: [],
- conceptList: [],
- subDescription: "",
- parRuleType: "",
- subConceptId: "",
- subType: "",
- subMaxOperator: "",
- subMaxUnit: "",
- subMaxValue: "",
- subMinOperator: "",
- subMinUnit: "",
- subMinValue: "",
- subEqValue: "",
- subLenCode: "",
- dataType: "",
- key: 0,
- del: true,
- },
- ];
- this.dragVal = null;
- this.dragArr = null;
- }
- } else if (key == 1) {
- let klRuleByIdSub = JSON.parse(
- JSON.stringify(this.form.klRuleByIdSub)
- );
- for (let i = klRuleByIdSub.length - 1; i >= 0; i--) {
- if (
- klRuleByIdSub[i].groupId == groupId &&
- klRuleByIdSub[i].key > 0
- ) {
- klRuleByIdSub.splice(i, 1);
- }
- }
- newGroupList = klRuleByIdSub;
- this.dragVal = null;
- this.dragArr = null;
- } else {
- newGroupList = this.form.klRuleByIdSub.filter(
- (item) => item.groupChildId != groupChildId
- );
- if (lens == 4) {
- const obj = this.baseTypeList.find((it) => it.type === 1);
- const screenArr = obj.subMenuList.filter((item) => {
- return item.remark.split("|")[0] == 2;
- });
- len[1].baseTermTypeList = screenArr;
- }
- this.dragVal = len[1].subLenCode;
- }
- } else {
- newGroupList = this.form.klRuleByIdSub.filter(
- (item) => item.groupChildId != groupChildId
- );
- }
- this.form.klRuleByIdSub = newGroupList;
- },
- setDict() {
- this.dict = localStorage.getItem("zskDicts");
- this.msgDict = localStorage.getItem("zskMsgDict");
- this.subDict = localStorage.getItem("zskSubDict");
- },
- showConfirmDialog(msg, resolve) {
- this.$alert(msg, "提示", {
- confirmButtonText: "确定",
- type: "warning",
- })
- .then(() => {
- resolve();
- })
- .catch(() => {});
- },
- searchConcept(val) {
- const param = {
- excludedConceptIds: [this.form.parRuleType],
- libType: this.form.parLenCode,
- name: val,
- };
- api
- .searchConcept(param)
- .then((res) => {
- if (res.data.code == "0") {
- const data = res.data.data;
- this.conceptList = data;
- }
- })
- .catch((error) => {
- console.log(error);
- });
- },
- getTypeList() {
- this.ruleTypeList = JSON.parse(localStorage.getItem("zskTypesList"));
- },
- saveRule(params) {
- api.saveRule(params).then((res) => {
- if (res.data.code == 0) {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- this.$router.push({
- name: "ZskRuleManager",
- params: Object.assign({}, this.$route.params, { currentPage: 1 }),
- });
- } else {
- this.$message({
- message: res.data.msg,
- type: "warning",
- });
- }
- });
- },
- /**
- * 子组件调用方法
- */
- childClearConcept(index) {
- this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
- this.$set(this.form.klRuleByIdSub[index], "conceptList", []);
- },
- childClearNumText(index) {
- let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
- obj[index].subMaxOperator = "";
- obj[index].subMaxValue = "";
- obj[index].subMaxUnit = "";
- obj[index].subMinOperator = "";
- obj[index].subMinValue = "";
- obj[index].subMinUnit = "";
- obj[index].subEqValue = "";
- // this.$set(obj[index], "subEqValue", "");
- obj[index].subEqOperator = "";
- // this.klRuleByIdSub = obj;
- // this.$emit("editKlRuleByIdSub", obj);
- this.editKlRuleByIdSub(obj);
- },
- ChildDataTypeChange(val, index) {
- this.form.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
- this.$set(
- this.form.klRuleByIdSub[index],
- "subEqOperator",
- val === "2" ? "=" : ""
- );
- this.childClearNumText(index);
- // TODO 新增的内容追踪不到
- this.form.klRuleByIdSub.forEach((item, i) => {
- if (index === i) {
- this.$set(item, "dataType", val);
- }
- });
- },
- childSubCodeChange(val, index, numTypes, groupId, key, code, lens) {
- const dragDel =
- localStorage
- .getItem("zskDragDict")
- .match(new RegExp(this.ruleTermCodeStrs, "g")) || [];
- const subobj = this.baseTypeList.find((it) => it.type == 1);
- let obj = this.form.klRuleByIdSub;
- let type;
- const len = this.form.klRuleByIdSub.filter((item, i) => {
- return item.groupId == groupId;
- });
- const inx = key % 3 == 2 ? index - 1 : key % 3 == 1 ? index + 1 : index;
- if (key == 1 && len[2]) {
- type = len[2].subLenCode == "" ? false : true;
- } else if (key == 2) {
- type = len[1].subLenCode == "" ? false : true;
- }
- //判断药品合理性总条数是否大于1条,是否存在第二条或第三条类型为1,存在触发互斥
- if (
- //判断3条规则是否都已选中
- dragDel.length > 0 &&
- len.length == 3 &&
- index > 0 &&
- key > 0
- ) {
- if (type) {
- //判断是否存在符合互斥条件的两条出具,若存在,置空另一条出具
- if (
- code != "" &&
- (key == 1
- ? len[2].dragArr.indexOf(val)
- : len[1].dragArr.indexOf(val)) > -1 &&
- lens == 4
- ) {
- //剂型给药途径互斥判断
- const arr = this.baseTypeList.filter((it) => {
- return it.type == 1;
- });
- this.$set(this.form.klRuleByIdSub, inx, {
- groupId: this.form.klRuleByIdSub[inx].groupId,
- groupChildId: "child" + new Date().valueOf(),
- baseTypes: arr,
- baseTermTypeList: [],
- conceptList: [],
- subDescription: "",
- parRuleType: "",
- subConceptId: "",
- subType: "",
- subMaxOperator: "",
- subMaxUnit: "",
- subMaxValue: "",
- subMinOperator: "",
- subMinUnit: "",
- subMinValue: "",
- subEqValue: "",
- subLenCode: "",
- dataType: "",
- del: false,
- key: key == 2 ? 1 : 2,
- });
- }
- } else {
- const list = subobj.subMenuList.filter((it) => {
- return it.code == val && it.remark.split("|")[0] == 3;
- });
- //获取互斥项code
- const dragArr = list[0].remark.split("|")[1].split(",");
- this.dragArr = dragArr;
- len[1].dragArr = dragArr;
- len[2].dragArr = dragArr;
- // if (len[1]) {
- // len[1].dragArr = dragArr;
- // } else if (len[2]) {
- // len[2].dragArr = dragArr;
- // }
- //获取互斥项
- const screenArr = subobj.subMenuList.filter((item) =>
- dragArr.some(
- (ele) => ele === item.code && item.remark.split("|")[0] == 3
- )
- );
- if (
- this.form.klRuleByIdSub[inx] &&
- this.form.klRuleByIdSub[inx].subType != ""
- ) {
- this.$set(
- this.form.klRuleByIdSub[inx],
- "baseTermTypeList",
- screenArr
- );
- }
- }
- this.dragVal = val;
- }
- if ((numTypes + ",").indexOf(val + ",") > -1) {
- this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
- } else {
- this.$set(this.form.klRuleByIdSub[index], "dataType", "");
- }
- this.childClearConcept(index);
- this.childClearNumText(index);
- },
- // 去重
- unique(arr, obj) {
- return arr.reduce((cur, next) => {
- obj[next] ? "" : (obj[next] = true && cur.push(next));
- return cur;
- }, []);
- },
- },
- watch: {
- form: {
- handler(val) {
- if(val.klRuleByIdSub){
- this.form.klRuleByIdSub.forEach((item, i, arr) => {
- if (i == 0) {
- item.rowIndex = 1;
- } else if (item.groupId == arr[i - 1].groupId) {
- item.rowIndex = arr[i - 1].rowIndex;
- } else {
- item.rowIndex = arr[i - 1].rowIndex + 1;
- }
- });
- }
- },
- immediate: true,
- deep: true,
- },
- },
- computed: {
- disable: function () {
- return Object.keys(this.firstPlace || {}).length > 0;
- },
- ruleTermCodeStr: function () {
- const str = this.form.parRuleType + "-" + this.form.parLenCode + "-" + 1;
- if (str.length <= 1) {
- return "";
- }
- return str;
- },
- ruleTermCodeStr2: function () {
- const str = this.form.parRuleType + "-" + this.form.parLenCode + "-" + 0;
- if (str.length <= 1) {
- return "";
- }
- return str;
- },
- ruleTermCodeStrs: function () {
- const str = this.form.parRuleType + "-" + this.form.parLenCode;
- if (str.length <= 1) {
- return "";
- }
- return str;
- },
- showMsg: function () {
- return (
- this.ruleTermCodeStr.length > 2 &&
- this.msgDict.indexOf(this.ruleTermCodeStr) > -1
- );
- },
- showMsg2: function () {
- return (
- this.ruleTermCodeStr2.length > 2 &&
- this.msgDict.indexOf(this.ruleTermCodeStr2) > -1
- );
- },
- showHasSub() {
- if (this.ruleTermCodeStrs.length > 2) {
- return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;
- }
- return false;
- },
- checkFirstPlace: function () {
- return this.dict.indexOf(this.ruleTermCodeStrs) > -1;
- },
- },
- components: { AddNewRuleTable,AddNewRuleContent },
- };
- </script>
|