morphone1995 4 years ago
parent
commit
53db141281

+ 7 - 0
src/api/config.js

@@ -87,6 +87,13 @@ export default {
     'revStopPlans': '/sys/plan/revStopPlans',   //停用启用方案配置
     'savePlanInfoDatas': '/sys/plan/savePlanInfoDatas',   //保存更新方案配置信息
 
+
+    'getBillmanPage': '/billman/getPage',   //获取开单合理项列表
+    'conceptBillmanIndex': '/billman/conceptIndex',   //开单项检索
+    'conditionBillmanIndex': '/billman/conditionIndex',   //条件明细检索
+    'getRecordByRelationId': '/billman/getRecordByRelationId',   //查询单条规则 
+    'saveBillmanRecord': '/billman/saveRecord',   //保存规则 
+
     'getAccessdMenu': '/sys/user/getUserOrgMenu',  //获取左侧菜单项
     'delConceptInfo':'/graph/conceptInfo/changeStatus',   //删除术语静态知识
     'login': '/sys/user/getJwt',

+ 27 - 0
src/api/icss.js

@@ -1,6 +1,17 @@
 import axios from 'axios';
 import config from '@api/config.js';
 const urls = config.urls;
+function request(config) {
+  const instance = axios.create({
+    baseURL: "http://192.168.2.236:7010",
+    timeout: 500000,
+    headers: {
+      'Content-Type': "application/json;charset=utf-8"
+    }
+  })
+  return instance(config)
+}
+
 export default {
   getTremList(param) {
     return axios.post(urls.getConceptKnowledge, param);
@@ -259,4 +270,20 @@ export default {
     return axios.post(urls.getDicList, param);
   },
 
+  getBillmanPage(param) {
+    return request({ method: 'post', url: urls.getBillmanPage, data: param });
+  },
+  conceptBillmanIndex(param) {
+    return request({ method: 'post', url: urls.conceptBillmanIndex, data: param });
+  },
+  conditionBillmanIndex(param) {
+    return request({ method: 'post', url: urls.conditionBillmanIndex, data: param });
+  },
+  getRecordByRelationId(param) {
+    return request({ method: 'post', url: urls.getRecordByRelationId, data: param });
+  },
+  saveBillmanRecord(param) {
+    return request({ method: 'post', url: urls.saveBillmanRecord, data: param });
+  },
+
 };

+ 3 - 4
src/api/index.js

@@ -3,9 +3,8 @@ import config from './config.js';
 
 axios.default.timeout = 500000;
 axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
-axios.defaults.baseURL = 'http://192.168.2.241:6060';
-// axios.defaults.baseURL = 'http://192.168.2.241';
-// axios.defaults.baseURL = 'http://192.168.3.113:6060';
+axios.defaults.baseURL = 'http://192.168.2.236:6060';
+
 
 const urls = config.urls;
 export default {
@@ -23,5 +22,5 @@ export default {
   midifyPassword(param) {
     return axios.post(urls.midifyPassword, param);
   },
- 
+
 }

+ 345 - 0
src/components/icss/bill/AddBill.vue

@@ -0,0 +1,345 @@
+<template>
+  <div class="AddPlanWrapper clearfix">
+    <crumbs
+      :title="isEdit ? 'CDSS规则维护-修改规则' : 'CDSS规则维护-添加规则'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Bill"
+    ></crumbs>
+    <div class="AddPlanBox">
+      <el-row :gutter="20">
+        <el-col :span="16">
+          <el-form ref="outForm" :model="form" label-width="80px" :rules="rules">
+            <el-form-item label="规则名称" prop="ruleName">
+              <el-input v-model="form.ruleName" disabled></el-input>
+            </el-form-item>
+            <el-form-item label="规则类型" prop="ruleType">
+              <el-select
+                v-model="form.ruleType"
+                placeholder="请选择规则类型"
+                clearable
+                style="width: 100%"
+              >
+                <el-option label="文本类型" :value="1"></el-option>
+                <el-option label="数值类型" :value="2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-row :gutter="24" class="concept">
+              <el-form-item label="开单项目" prop="concept">
+                <el-col :span="8">
+                  <el-select
+                    v-model="form.conceptType"
+                    placeholder="请选择项目类型"
+                    style="width: 100%"
+                    @change="handleConceptType"
+                    clearable
+                    ref="conceptType"
+                  >
+                    <el-option label="检验套餐" :value="1"></el-option>
+                    <el-option label="检查" :value="2"></el-option>
+                    <el-option label="检查子项" :value="3"></el-option>
+                    <el-option label="手术和操作" :value="4"></el-option>
+                    <el-option label="药品注册名" :value="5"></el-option>
+                  </el-select>
+                </el-col>
+                <el-col :span="15">
+                  <el-select
+                    style="width:100%;minWidth: 240px"
+                    v-model="form.conceptName"
+                    filterable
+                    remote
+                    clearable
+                    :loading="showDrop"
+                    loading-text="加载中..."
+                    @change="changeWord"
+                    @focus="handleFocus"
+                    @visible-change="handleVisible"
+                    placeholder="搜索开单项目"
+                    :remote-method="searchTerms"
+                    reserve-keyword
+                    ref="conceptName"
+                  >
+                    <el-option
+                      v-for="item in conceptList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.name"
+                      :title="item.name"
+                    ></el-option>
+                  </el-select>
+                </el-col>
+              </el-form-item>
+            </el-row>
+            <ConditionForm
+              :data="form.condition"
+              :type="form.conceptType"
+              :conceptName="form.conceptName"
+              :ruleType="form.ruleType"
+              ref="subForm"
+              @split="splitRuleName"
+              @handleInput="handleInput"
+            ></ConditionForm>
+            <Description :type="form.ruleType"></Description>
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit" :disabled="saveDisable">确定</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import ConditionForm from './ConditionForm';
+import Description from './Description';
+export default {
+  name: 'AddBill',
+  data() {
+    var checkFrequency = (rule, value, callback) => {
+      let conceptName = this.$refs.conceptName.value;
+      if (!conceptName) {
+        callback('请输入开单项目');
+      } else {
+        callback();
+      }
+    };
+    var checkFrequency2 = (rule, value, callback) => {
+      let conceptType = this.$refs.conceptType.value;
+      if (!conceptType) {
+        callback('请输入开单项目');
+      } else {
+        callback();
+      }
+    };
+    return {
+      form: {
+        ruleName: '',
+        ruleType: '',
+        conceptType: '',
+        conceptName: '',
+        concept: {
+          conceptLabel: '',
+          id: '',
+          name: '',
+          status: null
+        },
+        conditionName: '',
+        condition: {
+          conditionLabel: '',
+          id: '',
+          maxValue: '',
+          minValue: '',
+          name: '',
+          range: '',
+          status: '0',
+          unit: ''
+        },
+        relationId: 1146770,
+        relationName: '',
+        relationStatus: '',
+      },
+      conceptList: [],
+      rules: {
+        ruleName: [
+          { required: true, message: '规则名称为空', trigger: 'change' }
+        ],
+        ruleType: [
+          { required: true, message: '请选择提醒类型', trigger: 'change' }
+        ],
+        concept: [
+          { required: true, validator: checkFrequency, trigger: 'blur' },
+          { validator: checkFrequency2, trigger: 'change' }
+        ],
+        conditionName: [
+          { required: true, message: '请输入条件明细', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      isEdit: false, // 是否处于编辑页面 false--新增   true--编辑
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    const { isEdit, data } = this.$route.params;
+    console.log(data, '编辑页传递的data');
+    if (isEdit) {
+      this.isEdit = true;
+      this.form.ruleName = data.ruleName;
+      this.form.ruleType = data.ruleType;
+      this.form.conceptType = data.type;
+      this.form.conceptName = data.concept.name;
+      this.form.concept.conceptLabel = data.concept.conceptLabel;
+      this.form.concept = { ...data.concept };
+      this.form.condition = { ...data.condition };
+      this.form.relationId = data.relationId;
+      this.form.relationName = data.relationName;
+      this.form.relationStatus = data.relationStatus;
+    }
+  },
+
+  methods: {
+    splitRuleName(val) {
+      // console.log(val, '======val');
+      this.form.ruleName = val.name + '开单' + this.form.conceptName;
+      this.form.condition.conditionLabel = val.conditionLabel;
+      this.form.condition.id = val.id;
+      this.form.condition.status = val.status;
+      this.form.condition.name = val.name;
+    },
+    changeWord(val) {
+      let concept = this.conceptList.find(item => (item.name = val));
+      this.form.concept.conceptLabel = concept.conceptLabel;
+      this.form.concept.id = concept.id;
+      this.form.concept.name = concept.name;
+      this.form.concept.status = concept.status;
+      // console.log(this.form.concept, '===========this.form.concept');
+    },
+    handleInput(data) {
+      // console.log(data, '父组件接受的数据');
+      if (data.type === 'minValue') {
+        this.form.condition.minValue = data.value;
+      } else if (data.type === 'maxValue') {
+        this.form.condition.maxValue = data.value;
+      } else if (data.type === 'unit') {
+        this.form.condition.unit = data.value;
+      }
+
+      // console.log(this.form.condition, 'this.form.condition');
+    },
+
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.conceptList = [];
+      }
+    },
+    handleConceptType() {
+      this.conceptList = [];
+      this.form.conceptName = '';
+    },
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.conceptList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: this.form.conceptType,
+        conceptName: query
+      };
+      api.conceptBillmanIndex(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.conceptList = res.data.data;
+        }
+      });
+    },
+
+    // 处理参数
+    _getParams() {
+      const { concept, condition, ruleType, ruleName } = this.form;
+      let params = {
+        concept: {
+          conceptLabel: concept.conceptLabel,
+          id: concept.id,
+          name: concept.name,
+          status: concept.status
+        },
+        condition: {
+          conditionLabel: condition.conditionLabel,
+          id: condition.id,
+          maxValue: +condition.maxValue,
+          minValue: +condition.minValue,
+          name: condition.name,
+          range: condition.range,
+          status: condition.status,
+          unit: condition.unit
+        },
+        ruleType,
+        relationStatus: 1 // 1启用  0禁用
+        // relationId: 0,
+        // relationName: 'string',
+        // ruleName: 'string',
+        // type: 0
+      };
+      return params;
+    },
+
+    onSubmit() {
+      // this.$refs.subForm.$refs.form.validate(valid => {
+      //   if (valid) {
+      //     // console.log(this.$refs.subForm.$refs.form,'=========');
+      //   }
+      // });
+      this.$refs.outForm.validate(valid => {
+        if (valid) {
+          this.saveDisable = true;
+          let params = this._getParams();
+          if (this.isEdit) {
+            params = {
+              ...params,
+              relationId: this.form.relationId,
+              relationName: this.form.relationName,
+              relationStatus: this.form.relationStatus,
+              type: this.form.conceptType
+            };
+          }
+          api.saveBillmanRecord(params).then(res => {
+            if (res.data.code === '0') {
+              this.$message({
+                showClose: true,
+                message: '保存成功',
+                type: 'success',
+                duration: 1000
+              });
+              this.isSaveSuccess = true; // 保存成功,可正常退出
+              this.$router.push({
+                name: 'Bill',
+                params: Object.assign({}, this.$route.params, {
+                  currentPage: 1
+                })
+              });
+            } else if (res.data.code === '00020007') {
+              this.$message({
+                showClose: true,
+                message: res.data.msg,
+                type: 'error',
+                duration: 1000
+              });
+            }
+            this.saveDisable = false;
+          });
+        } else {
+        }
+      });
+    }
+  },
+  components: {
+    ConditionForm,
+    Description
+  }
+};
+</script>
+
+<style lang="less">
+.concept {
+  /deep/ .el-form-item__label {
+    margin-left: 12px !important;
+  }
+  /deep/ .el-col {
+    padding-left: 0px !important;
+    padding-right: 4px !important;
+  }
+  /deep/ .el-form-item__error {
+    float: left;
+    top: 40px;
+    left: 12px;
+  }
+}
+</style>

+ 338 - 0
src/components/icss/bill/Bill.vue

@@ -0,0 +1,338 @@
+<template>
+  <div>
+    <crumbs title="开单合理性规则维护" style="min-width: 980px">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="条件明细:">
+          <el-input size="mini" v-model="filter.conditionName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="开单项目:">
+          <el-input size="mini" v-model="filter.conceptName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item class="dododo">
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+          <el-button size="mini" type="warning" @click="addRelation">添加规则</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column :resizable="false" prop="ruleName" label="规则名称" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="conditionName" label="条件明细" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="conceptName" label="开单项目" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="ruleType" label="规则类型" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span>{{scope.row.ruleType === 1 ? '文本类型' : '数值类型'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="relationStatus" label="状态" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span>{{scope.row.relationStatus === 1 ? '启用' : '禁用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button v-if="scope.row.status===0" type="text" size="small" class="is-disabled">修改</el-button>
+            <el-button
+              v-if="scope.row.relationStatus===1"
+              type="text"
+              size="small"
+              @click="toEditProduct(scope.row)"
+            >修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              v-if="scope.row.relationStatus===0"
+              type="text"
+              size="small"
+              @click="showReuseDialog(scope.row)"
+            >启用</el-button>
+            <el-button
+              v-if="scope.row.relationStatus===1"
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row)"
+            >禁用</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+export default {
+  name: 'Bill',
+  data() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        conditionName: '', //条件明细
+        conceptName: '' //开单项目
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0
+    };
+  },
+  created() {
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.clearFilter();
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  methods: {
+    toEditProduct(row) {
+      let ruleData = {};
+      api.getRecordByRelationId({ relationId: row.relationId }).then(res => {
+        // console.log(res, '============res');
+        if (res.data.code === '0') {
+          ruleData = res.data.data;
+          const pam = this.searched
+            ? {
+                currentPage: this.currentPage,
+                pageSize: this.pageSize,
+                filter: this.filter
+              }
+            : { currentPage: this.currentPage, pageSize: this.pageSize };
+          this.$router.push({
+            name: 'AddBill',
+            params: Object.assign(pam, { data: ruleData, isEdit: true })
+          });
+        }
+      });
+    },
+
+    showReuseDialog(row) {
+      this.showConfirmDialog(
+        '确定启用该静态知识?',
+        () => {
+          api
+            .delConceptInfo({ id: row.id, status: 1 })
+            .then(res => {
+              if (res.data.code == '0') {
+                this.currentPage = 1; //恢复数据跳转到筛选条件下首页
+                this.warning(res.data.msg || '操作成功', 'success');
+                this.getDataList();
+              } else {
+                this.warning(res.data.msg);
+              }
+            })
+            .catch(error => {
+              if (error.code === '900010001') {
+                return false;
+              }
+              this.warning(error);
+            });
+        },
+        'Reuse'
+      );
+    },
+    showConfirmDialog(msg, resolve, type) {
+      let showInfo = '启用';
+      let btnNameClass = 'confirmBtn1';
+      if (type === 'Del') {
+        showInfo = '禁用';
+        btnNameClass = 'delBtn';
+      }
+
+      this.$confirm(msg, '提示', {
+        confirmButtonText: showInfo,
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: btnNameClass,
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getBillmanPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.content;
+        }
+        this.total = res.data.data && res.data.data.totalElements;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        number: this.inCurrentPage - 1 || this.currentPage - 1,
+        size: this.pageSize,
+        conditionName: this.filter.conditionName.trim(),
+        conceptName: this.filter.conceptName.trim()
+        // uniqueCode: ''
+      };
+      return param;
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        conditionName: '',
+        conceptName: ''
+      };
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddBill', params: pam });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddDept',
+        params: Object.assign(pam, { isEdit: true, data: item })
+      });
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less">
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+  /deep/.el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.exportConfirm {
+  .cancelSure {
+    display: none;
+  }
+}
+</style>

+ 519 - 0
src/components/icss/bill/ConditionForm.vue

@@ -0,0 +1,519 @@
+<template>
+  <el-form
+    :rules="rules"
+    :model="form"
+    ref="form"
+    class="sub-form"
+    :validate-on-rule-change="false"
+  >
+    <!-- 文本类型 -->
+    <el-form-item label="条件明细" label-width="80px" v-if="ruleType==1">
+      <el-select
+        style="width:100%;minWidth: 240px"
+        v-model="form.name"
+        filterable
+        remote
+        clearable
+        :loading="showDrop"
+        loading-text="加载中..."
+        @change="changeWord"
+        @focus="handleFocus"
+        @visible-change="handleVisible"
+        placeholder="搜索开单项目"
+        :remote-method="searchCondition"
+        reserve-keyword
+        ref="conditionListName"
+      >
+        <el-option
+          v-for="item in conditionList"
+          :key="item.id + item.name"
+          :label="item.name"
+          :value="item.name"
+          :title="item.name"
+        ></el-option>
+      </el-select>
+    </el-form-item>
+    <!-- <el-form-item prop="condition" label-width="0px">
+    </el-form-item>-->
+
+    <el-row v-else-if="ruleType==2">
+      <el-col :span="10">
+        <el-form-item label="条件明细" label-width="80px">
+          <el-select
+            style="width:100%"
+            v-model="form.name"
+            filterable
+            remote
+            clearable
+            :loading="showDrop"
+            loading-text="加载中..."
+            @change="changeWord"
+            @focus="handleFocus"
+            @visible-change="handleVisible"
+            placeholder="搜索条件明细"
+            :remote-method="searchCondition"
+            reserve-keyword
+            ref="conditionListName"
+          >
+            <el-option
+              v-for="item in conditionList"
+              :key="item.id + item.name"
+              :label="item.name"
+              :value="item.name"
+              :title="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="14" class="conditionName">
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label-width="0px">
+              <el-select
+                v-model="compareTop"
+                placeholder="请选择Top"
+                style="width: 100%"
+                @change="handleRangeTop"
+                clearable
+                ref="rangeTop"
+                @clear="handleClear"
+                v-if="top"
+              >
+                <el-option label="大于" :value="4" :disabled="compareBottom==3 || compareBottom==4"></el-option>
+                <el-option label="大于等于" :value="3" :disabled="compareBottom==3 || compareBottom==4"></el-option>
+                <el-option label="小于" :value="2" :disabled="compareBottom==1 || compareBottom==2"></el-option>
+                <el-option label="小于等于" :value="1" :disabled="compareBottom==1 || compareBottom==2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label-width="0px">
+              <el-select
+                v-model="compareBottom"
+                placeholder="请选择Bottom"
+                style="width: 100%"
+                @change="handleRangeBottom"
+                clearable
+                ref="rangeBottom"
+                @clear="handleClear"
+                v-if="bottom"
+              >
+                <el-option label="大于" :value="4" :disabled="compareTop==3 ||compareTop==4 "></el-option>
+                <el-option label="大于等于" :value="3" :disabled="compareTop==3 ||compareTop==4 "></el-option>
+                <el-option label="小于" :value="2" :disabled="compareTop==1 ||compareTop==2 "></el-option>
+                <el-option label="小于等于" :value="1" :disabled="compareTop==1 ||compareTop==2 "></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <div v-if="top">
+              <el-form-item label-width="0px">
+                <el-input
+                  v-model="form.minValue"
+                  ref="minValue"
+                  placeholder="minValue Top"
+                  v-if="compareTop>=3"
+                  @blur="handleChange('minValue')"
+                ></el-input>
+                <el-input
+                  v-model="form.maxValue"
+                  ref="maxValue"
+                  placeholder="maxValue Top"
+                  v-if="compareTop<=2"
+                  @blur="handleChange('maxValue')"
+                ></el-input>
+              </el-form-item>
+            </div>
+            <div v-if="bottom">
+              <el-form-item label-width="0px">
+                <el-input
+                  v-model="form.minValue"
+                  ref="minValue"
+                  placeholder="minValue Bottom"
+                  v-if="compareBottom>=3"
+                  @blur="handleChange('minValue')"
+                ></el-input>
+                <el-input
+                  v-model="form.maxValue"
+                  ref="maxValue"
+                  placeholder="maxValue Bottom"
+                  v-if="compareBottom<=2"
+                  @blur="handleChange('maxValue')"
+                ></el-input>
+              </el-form-item>
+            </div>
+          </el-col>
+          <el-col :span="7">
+            <el-form-item label-width="0px">
+              <el-input
+                v-model="form.unit"
+                ref="unit"
+                placeholder="填写单位Top"
+                v-if="top"
+                @blur="handleChange('unit')"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label-width="0px">
+              <el-input
+                v-model="form.unit"
+                ref="unit"
+                placeholder="填写单位Bottom"
+                v-if="bottom"
+                @blur="handleChange('unit')"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1" class="operation">
+            <div class="icon">
+              <img
+                src="../../../images/plus.png"
+                alt
+                @click="handleValue('plus')"
+                v-if="(top && !bottom) || (!top && bottom)"
+              />
+              <img
+                src="../../../images/cut.png"
+                alt
+                @click="handleValue('firstCut')"
+                v-if="top && bottom"
+              />
+              <img
+                src="../../../images/cut.png"
+                alt
+                @click="handleValue('secCut')"
+                v-if="top && bottom"
+              />
+            </div>
+          </el-col>
+        </el-row>
+      </el-col>
+    </el-row>
+
+    <!-- 数值类型 -->
+    <!-- <el-row :gutter="24" class="condition">
+      <el-form-item label="条件明细" prop="condition" label-width="80px">
+        <el-col :span="8" class="conditionName">
+          <el-select
+            style="width:100%"
+            v-model="form.name"
+            filterable
+            remote
+            clearable
+            :loading="showDrop"
+            loading-text="加载中..."
+            @change="changeWord"
+            @focus="handleFocus"
+            @visible-change="handleVisible"
+            placeholder="搜索条件明细"
+            :remote-method="searchCondition"
+            reserve-keyword
+            ref="conditionListName"
+          >
+            <el-option
+              v-for="item in conditionList"
+              :key="item.id + item.name"
+              :label="item.name"
+              :value="item.id"
+              :title="item.name"
+            ></el-option>
+          </el-select>
+        </el-col>
+
+        <div>
+          <el-col :span="5">
+            <el-select
+              v-model="compareTop"
+              placeholder="请选择Top"
+              style="width: 100%"
+              @change="handleRangeTop"
+              clearable
+              ref="range"
+              @clear="handleClear"
+              v-if="top"
+            >
+              <el-option label="大于" :value="4" :disabled="compareBottom==3 || compareBottom==4"></el-option>
+              <el-option label="大于等于" :value="3" :disabled="compareBottom==3 || compareBottom==4"></el-option>
+              <el-option label="小于" :value="2" :disabled="compareBottom==1 || compareBottom==2"></el-option>
+              <el-option label="小于等于" :value="1" :disabled="compareBottom==1 || compareBottom==2"></el-option>
+            </el-select>
+            <el-select
+              v-model="compareBottom"
+              placeholder="请选择Bottom"
+              style="width: 100%"
+              @change="handleRangeBottom"
+              clearable
+              ref="range"
+              @clear="handleClear"
+              v-if="bottom"
+            >
+              <el-option label="大于" :value="4" :disabled="compareTop==3 ||compareTop==4 "></el-option>
+              <el-option label="大于等于" :value="3" :disabled="compareTop==3 ||compareTop==4 "></el-option>
+              <el-option label="小于" :value="2" :disabled="compareTop==1 ||compareTop==2 "></el-option>
+              <el-option label="小于等于" :value="1" :disabled="compareTop==1 ||compareTop==2 "></el-option>
+            </el-select>
+          </el-col>
+          <el-col :span="5">
+            <div v-if="top">
+              <el-input
+                v-model="form.minValue"
+                ref="minValue"
+                placeholder="填写最小数值 Top"
+                v-if="compareTop<=2"
+              ></el-input>
+              <el-input
+                v-model="form.maxValue"
+                ref="maxValue"
+                placeholder="填写最大数值 Top"
+                v-if="compareTop>2"
+              ></el-input>
+            </div>
+            <div v-if="bottom">
+              <el-input
+                v-model="form.minValue"
+                ref="minValue"
+                placeholder="填写最小数值 Bottom"
+                v-if="compareBottom<=2"
+              ></el-input>
+              <el-input
+                v-model="form.maxValue"
+                ref="maxValue"
+                placeholder="填写最大数值 Bottom"
+                v-if="compareBottom>2"
+              ></el-input>
+            </div>
+          </el-col>
+          <el-col :span="5">
+            <el-input v-model="form.unit" ref="unit" placeholder="填写单位Top" v-if="top"></el-input>
+            <el-input v-model="form.unit" ref="unit" placeholder="填写单位Bottom" v-if="bottom"></el-input>
+          </el-col>
+          <el-col :span="1" class="operation">
+            <div class="icon">
+              <img
+                src="../../../images/plus.png"
+                alt
+                @click="handleValue('plus')"
+                v-if="(top && !bottom) || (!top && bottom)"
+              />
+              <img
+                src="../../../images/cut.png"
+                alt
+                @click="handleValue('firstCut')"
+                v-if="top && bottom"
+              />
+              <img
+                src="../../../images/cut.png"
+                alt
+                @click="handleValue('secCut')"
+                v-if="top && bottom"
+              />
+            </div>
+          </el-col>
+        </div>
+      </el-form-item>
+    </el-row>-->
+  </el-form>
+</template>
+
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'ConditionForm',
+  props: ['data', 'type', 'conceptName', 'ruleType'],
+  data() {
+    var checkFrequency = (rule, value, callback) => {
+      let conditionListName = this.$refs.conditionListName.value;
+      if (!conditionListName) {
+        callback('请输入开单项目');
+      } else {
+        callback();
+      }
+    };
+    var checkFrequency1 = (rule, value, callback) => {
+      // let conditionListName = this.$refs.conditionListName.value;
+      let rangeTop = this.$refs.rangeTop && this.$refs.rangeTop.value;
+      // let rangeBottom = this.$refs.rangeBottom && this.$refs.rangeBottom.value;
+      if (!rangeTop) {
+        callback('');
+      } else {
+        callback();
+      }
+    };
+    return {
+      showDrop: false,
+      rules: {
+        // condition: [
+        //   { required: true, validator: checkFrequency, trigger: 'change' }
+        // ],
+        // compareTop: [
+        //   { required: true, validator: checkFrequency1, trigger: 'change' }
+        // ],
+        // compareBottom: [
+        //   { required: true, validator: checkFrequency, trigger: 'change' }
+        // ],
+        // valueTop: [
+        //   { required: true, message: '请输入条件明细', trigger: 'change' }
+        // ],
+        // valueBottom: [
+        //   { required: true, message: '请输入条件明细', trigger: 'change' }
+        // ],
+        // unitTop: [
+        //   { required: true, message: '请输入条件明细', trigger: 'change' }
+        // ],
+        // unitBottom: [
+        //   { required: true, message: '请输入条件明细', trigger: 'change' }
+        // ]
+      },
+      conditionList: [],
+      form: {
+        conditionLabel: '',
+        id: '',
+        maxValue: '',
+        minValue: '',
+        name: '',
+        range: '',
+        status: '',
+        unit: ''
+      },
+      ruleMount: 1,
+      top: true,
+      bottom: false,
+      compareTop: '',
+      compareBottom: ''
+    };
+  },
+  created() {
+    this.form = { ...this.data };
+    const { maxValue, minValue } = this.data;
+    if ((maxValue || maxValue == 0) && (minValue || minValue == 0)) {
+      this.top = true;
+      this.bottom = true;
+      this.compareTop = 3;
+      this.compareBottom = 1;
+      console.log(this.bottom, 'this.bottom');
+    }
+  },
+  methods: {
+    //
+    handleChange(val) {
+      // console.log(val, 'val');
+      if (val === 'minValue') {
+        this.$emit('handleInput', {
+          type: 'minValue',
+          value: this.form.minValue
+        });
+      } else if (val === 'maxValue') {
+        this.$emit('handleInput', {
+          type: 'maxValue',
+          value: this.form.maxValue
+        });
+      } else if (val === 'unit') {
+        this.$emit('handleInput', {
+          type: 'unit',
+          value: this.form.unit
+        });
+      }
+    },
+
+    // 编辑规则
+    handleValue(form) {
+      if (form === 'plus') {
+        this.top = true;
+        this.bottom = true;
+      } else if (form === 'firstCut') {
+        this.top = false;
+        this.bottom = true;
+        this.compareTop = '';
+      } else if (form === 'secCut') {
+        this.top = true;
+        this.bottom = false;
+        this.compareBottom = '';
+      }
+    },
+    changeWord(val) {
+      // console.log(val);
+      let condition = this.conditionList.find(item => item.name == val);
+      this.$emit('split', condition);
+    },
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.conceptList = [];
+      }
+    },
+    handleRangeTop(val) {},
+    handleRangeBottom(val) {},
+    handleClear() {},
+
+    // 搜索列表
+    searchCondition(query) {
+      const { data, type, conceptName, ruleType } = this;
+      if (!query) {
+        this.conditionList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type,
+        conceptName,
+        ruleType,
+        conditionName: query
+      };
+      api.conditionBillmanIndex(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code == '0') {
+          this.conditionList = res.data.data;
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less">
+.condition {
+  /deep/ .el-form-item__label {
+    margin-left: 12px !important;
+  }
+  /deep/ .el-col {
+    padding-left: 0px !important;
+    padding-right: 4px !important;
+  }
+  /deep/ .el-form-item__error {
+    float: left;
+    top: 40px;
+    left: 12px;
+  }
+}
+
+.conditionName {
+  /deep/ .el-col {
+    padding-left: 0px !important;
+    padding-right: 0px !important;
+  }
+}
+.operation {
+  width: 0;
+  height: 30px;
+  position: relative;
+  .icon:before {
+    box-sizing: border-box;
+    position: absolute;
+    top: 20px;
+    left: 20px;
+    transform: translate(-50%, -50%);
+    -webkit-transform: translate(-50%, -50%);
+    width: 30px;
+    content: '';
+    height: 30px;
+  }
+  img {
+    position: relative;
+    width: 30px;
+    height: 30px;
+    top: 5px;
+    left: 10px;
+  }
+}
+.gap {
+  color: #fff;
+}
+</style>

+ 46 - 0
src/components/icss/bill/Description.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="container">
+    <div>
+      <p>文案生成规则说明:</p>
+      <p v-if="type ==1 ||type == ''">
+        文本规则:该患者
+        <span>条件明细(内容)</span>,不宜开
+        <span>医学术语(内容)</span>
+      </p>
+      <p v-if="type ==2 ||type == ''">
+        数值规则:该患者
+        <span>条件明细(内容)+“>/</=”+ 数值范围</span>,不宜开
+        <span>医学术语(内容)</span>
+      </p>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'Description',
+  props: ['type'],
+  data() {
+    return {};
+  },
+  created(){
+  }
+};
+</script>
+
+<style lang="less">
+.container {
+  width: 100%;
+  padding: 10px 0 10px 12px;
+  line-height: 28px;
+  font-size: 14px;
+  background-color: #f5f5f5;
+  margin-bottom: 36px;
+  p {
+    color: #777;
+  }
+  span {
+    color: #333333;
+  }
+}
+</style>

BIN
src/images/cut.png


BIN
src/images/plus.png


+ 4 - 0
src/routes.js

@@ -19,6 +19,8 @@ import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--
 import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
 import Plan from '@components/icss/plan/Plan.vue';  //关联维护设置
 import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
+import Bill from '@components/icss/bill/Bill.vue';  //开单
+import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
 
 export default [
   {
@@ -53,6 +55,8 @@ export default [
       { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
       { path: 'XTPZ-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
       { path: 'LT-DZBLFAPZ-EDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑
+      { path: 'GZWH-KDHLXGZWH', component: Bill, name: 'Bill' }, //开单
+      { path: 'GZWH-KDHLXGZWH-EDIT', component: AddBill, name: 'AddBill' }, //开单
     ],
   },
 ];