소스 검색

Merge branch 'test'

morphone1995 4 년 전
부모
커밋
307102354c

+ 8 - 0
src/api/config.js

@@ -87,6 +87,14 @@ 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',   //保存规则 
+    'updateBillmanStatus': '/billman/updateStatus',   //启用禁用
+
     'getAccessdMenu': '/sys/user/getUserOrgMenu',  //获取左侧菜单项
     'delConceptInfo':'/graph/conceptInfo/changeStatus',   //删除术语静态知识
     'login': '/sys/user/getJwt',

+ 30 - 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.241: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,23 @@ 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 });
+  },
+  updateBillmanStatus(param) {
+    return request({ method: 'post', url: urls.updateBillmanStatus, data: param });
+  },
+
 };

+ 2 - 1
src/api/index.js

@@ -7,6 +7,7 @@ axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
 // axios.defaults.baseURL = 'http://192.168.2.241';
 // axios.defaults.baseURL = 'http://192.168.3.113:6060';
 
+
 const urls = config.urls;
 export default {
   loginMess(data) {
@@ -23,5 +24,5 @@ export default {
   midifyPassword(param) {
     return axios.post(urls.midifyPassword, param);
   },
- 
+
 }

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

@@ -0,0 +1,392 @@
+<template>
+  <div class="AddPlanWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '开单合理性规则维护-修改规则' : '开单合理性规则维护-添加规则'"
+      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%"
+                @change="handleRuleType"
+              >
+                <el-option label="文本类型" :value="1"></el-option>
+                <el-option label="数值类型" :value="2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-row class="concept">
+              <el-col :span="8">
+                <el-form-item label="开单项目" prop="conceptType">
+                  <el-select
+                    v-model="form.conceptType"
+                    placeholder="请选择项目类型"
+                    style="width: 100%"
+                    @change="handleConceptType"
+                    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-form-item>
+              </el-col>
+              <el-col :span="16" style="paddingLeft: 4px">
+                <el-form-item label label-width="0px" prop="concept">
+                  <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-form-item>
+              </el-col>
+            </el-row>
+            <ConditionForm
+              :data="form.condition"
+              :type="form.conceptType"
+              :conceptName="form.conceptName"
+              :ruleType="form.ruleType"
+              ref="subForm"
+              @split="splitRuleName"
+              @handleInput="handleInput"
+              v-if="showCom"
+            ></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 './ConditionForm1';
+import Description from './Description';
+export default {
+  name: 'AddBill',
+  data() {
+    var checkFrequency = (rule, value, callback) => {
+      let conceptType = this.$refs.conceptType.value;
+      if (!conceptType) {
+        callback('请选择项目类型');
+      } else {
+        callback();
+      }
+    };
+    var checkFrequency2 = (rule, value, callback) => {
+      let conceptName = this.$refs.conceptName.value;
+      if (!conceptName) {
+        callback('请输入开单项目');
+      } else {
+        callback();
+      }
+    };
+    return {
+      form: {
+        ruleName: '',
+        ruleType: '',
+        conceptType: 2,
+        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: checkFrequency2, trigger: 'blur' }
+        ],
+        conceptType: [
+          { required: true, validator: checkFrequency, trigger: 'blur' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      isEdit: false, // 是否处于编辑页面 false--新增   true--编辑
+      showDrop: false, //下拉框显示文字
+      showCom: true
+    };
+  },
+  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) {
+      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) {
+      if (val === '') return;
+      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;
+      this.form.ruleName =
+        this.form.condition.name + '开单' + this.form.concept.name;
+    },
+    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;
+      }
+    },
+
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.conceptList = [];
+      }
+    },
+    handleConceptType() {
+      this.conceptList = [];
+      this.form.conceptName = '';
+    },
+    handleRuleType() {
+      this.showCom = false;
+      setTimeout(() => {
+        this.showCom = true;
+      }, 0);
+    },
+    // 搜索列表
+    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;
+      console.log(condition, '=condition');
+      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 === '' || condition.maxValue === null
+              ? ''
+              : +condition.maxValue,
+          minValue:
+            condition.minValue === '' || condition.minValue === null
+              ? ''
+              : +condition.minValue,
+          // minValue: !null && +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
+      };
+      // console.log(params,'params');
+      return params;
+    },
+
+    onSubmit() {
+      let goOn = true;
+      this.$refs.subForm.$refs.form1 &&
+        this.$refs.subForm.$refs.form1.validate(valid => {
+          if (valid) {
+            // console.log(this.$refs.subForm.$refs.form, '=========');
+          } else {
+            goOn = false;
+          }
+        });
+      this.$refs.subForm.$refs.form &&
+        this.$refs.subForm.$refs.form.validate(valid => {
+          if (valid) {
+            // console.log(this.$refs.subForm.$refs.form, '=========');
+          } else {
+            goOn = false;
+          }
+        });
+      this.$refs.subForm.$refs.ruleForm &&
+        this.$refs.subForm.$refs.ruleForm.validate(valid => {
+          if (valid) {
+            // console.log(this.$refs.subForm.$refs.form, '=========');
+          } else {
+            goOn = false;
+          }
+        });
+      this.$refs.outForm.validate(valid => {
+        if (valid) {
+          if (!goOn) return;
+          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
+              });
+            } else {
+              this.$message({
+                showClose: true,
+                message: res.data.msg,
+                type: 'error',
+                duration: 1000
+              });
+            }
+            this.saveDisable = false;
+          });
+        } else {
+          goOn = false;
+        }
+      });
+    }
+  },
+  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>

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

@@ -0,0 +1,342 @@
+<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>
+            <span>{{scope.row.ruleType === 2 ? '数值类型' : ''}}</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.relationStatus===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,'Reuse')"
+            >启用</el-button>
+            <el-button
+              v-if="scope.row.relationStatus===1"
+              type="text"
+              size="small"
+              class="delete"
+              @click="showReuseDialog(scope.row,'Del')"
+            >禁用</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, type) {
+      let showInfo = type !== 'Del' ? '启用' : '禁用';
+      let status = type === 'Del' ? 0 : 1;
+      this.showConfirmDialog(
+        `确定要${showInfo}该规则吗?`,
+        () => {
+          api
+            .updateBillmanStatus({ relationId: row.relationId, status })
+            .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);
+            });
+        },
+        type
+      );
+    },
+    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>

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

@@ -0,0 +1,525 @@
+<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="大于等于" :disabled="compareBottom=='大于等于' || compareBottom=='大于'"></el-option>
+                <el-option label="大于等于" value="大于" :disabled="compareBottom=='大于等于' || compareBottom=='大于'"></el-option>
+                <el-option label="小于" value="小于等于" :disabled="compareBottom=='小于' || compareBottom=='小于等于'"></el-option>
+                <el-option label="小于等于" value="小于" :disabled="compareBottom=='小于' || compareBottom=='小于等于'"></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="大于等于" :disabled="compareTop=='小于' || compareTop=='小于等于'"></el-option>
+                <el-option label="大于等于" value="大于" :disabled="compareTop=='小于' || compareTop=='小于等于'"></el-option>
+                <el-option label="小于" value="小于等于" :disabled="compareTop=='大于等于' || compareTop=='大于'"></el-option>
+                <el-option label="小于等于" value="小于" :disabled="compareTop=='大于等于' || compareTop=='大于'"></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=='大于等于' || compareTop=='大于' || compareTop==''"
+                  @blur="handleChange('minValue')"
+                ></el-input>
+                <el-input
+                  v-model="form.maxValue"
+                  ref="maxValue"
+                  placeholder="maxValue Top"
+                  v-if="compareTop=='小于' || compareTop=='小于等于' "
+                  @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=='大于等于' || compareBottom=='大于'"
+                  @blur="handleChange('minValue')"
+                ></el-input>
+                <el-input
+                  v-model="form.maxValue"
+                  ref="maxValue"
+                  placeholder="maxValue Bottom"
+                  v-if="compareBottom=='小于' || compareBottom=='小于等于' || compareBottom==''"
+                  @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.form;
+    if (minValue === '' && maxValue === '') {
+      this.top = true;
+      this.bottom = false;
+    } else if (minValue === '' && maxValue !== '') {
+      this.top = true;
+      this.bottom = false;
+
+    } else if (!minValue === '' && maxValue === '') {
+      this.top = true;
+      this.bottom = false;
+    } else {
+      this.top = true;
+      this.bottom = true;
+      // this.compareTop = 3;
+      // this.compareBottom = 1;
+    }
+  },
+  methods: {
+    //
+    handleChange(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;
+      }
+    },
+    changeWord(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>

+ 512 - 0
src/components/icss/bill/ConditionForm1.vue

@@ -0,0 +1,512 @@
+<template>
+  <el-row>
+    <!-- 文本类型 -->
+    <el-col :span="24" v-if="ruleType == 1">
+      <el-form
+        :model="form"
+        ref="form1"
+        class="sub-form"
+        :validate-on-rule-change="false"
+        :rules="rules"
+      >
+        <el-form-item label="条件明细" label-width="80px" prop="condition">
+          <el-select
+            style="width:100%;minWidth: 240px"
+            v-model="form.name"
+            filterable
+            remote
+            clearable
+            :loading="showDrop"
+            loading-text="加载中..."
+            @change="changeWord"
+            @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>
+    </el-col>
+    <el-col :span="24" v-if="ruleType == 2">
+      <el-col :span="8">
+        <el-form
+          :model="form"
+          ref="form"
+          class="sub-form"
+          :validate-on-rule-change="false"
+          :rules="rules"
+        >
+          <el-row>
+            <el-form-item label="条件明细" label-width="80px" prop="condition">
+              <el-select
+                style="width:100%"
+                v-model="form.name"
+                :title="form.name"
+                filterable
+                remote
+                clearable
+                :loading="showDrop"
+                loading-text="加载中..."
+                @change="changeWord"
+                @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 label label-width="0px">
+              <span class="font">1</span>
+            </el-form-item>
+          </el-row>
+        </el-form>
+      </el-col>
+      <el-form :rules="rules1" ref="ruleForm" :model="ruleForm">
+        <el-col :span="16" v-for="(item,index) in ruleForm.ruleForm" :key="index">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label-width="0px" prop="compare">
+                <el-select
+                  v-model="item.compare"
+                  placeholder="请输入比较"
+                  style="width: 100%"
+                  ref="compare"
+                  clearable
+                  @clear="handleClear(index)"
+                >
+                  <!-- <el-option
+                    label="大于"
+                    value=">"
+                    :disabled="index=== 0 ? isCompare1==='>' : isCompare2==='>'"
+                  ></el-option> -->
+                  <el-option
+                    label="大于等于"
+                    value=">="
+                    :disabled="index=== 0 ? isCompare1==='>=' : isCompare2==='>='"
+                  ></el-option>
+                  <!-- <el-option
+                    label="小于"
+                    value="<"
+                    :disabled="index=== 0 ? isCompare1==='<' : isCompare2==='<'"
+                  ></el-option> -->
+                  <el-option
+                    label="小于等于"
+                    value="<="
+                    :disabled="index=== 0 ? isCompare1==='<=' : isCompare2==='<='"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label-width="0px" :prop="index===0?'amount0':'amount1'">
+                <el-input
+                  clearable
+                  v-model="item.value"
+                  placeholder="填写数值"
+                  @blur="handleValue('value',index)"
+                  :disabled="item.compare ==''"
+                  :ref="index===0?'amount0':'amount1'"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label-width="0px" :prop="index===0?'unit0':'unit1'">
+                <el-input
+                  clearable
+                  v-model="item.unit"
+                  placeholder="填写单位"
+                  @blur="handleValue('unit',index)"
+                  :ref="index===0?'unit0':'unit1'"
+                  :disabled="index==1"
+                  @clear="handleUnitClear(index)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1" class="operation">
+              <div class="icon">
+                <img src="../../../images/plus.png" v-if="!isOpen" @click="addForm()" />
+                <img src="../../../images/cut.png" v-if="isOpen" @click="cutForm(index)" />
+              </div>
+            </el-col>
+          </el-row>
+        </el-col>
+      </el-form>
+    </el-col>
+  </el-row>
+</template>
+
+<script>
+import api from '@api/icss.js';
+export default {
+  name: 'ConditionForm',
+  props: ['data', 'type', 'conceptName', 'ruleType'],
+  data() {
+    let checkFrequency = (rule, value, callback) => {
+      let conditionListName = this.$refs.conditionListName.value;
+      if (conditionListName === '') {
+        callback('请输入条件明细');
+      } else {
+        callback();
+      }
+    };
+    let checkFrequency1 = (rule, value, callback) => {
+      let amount0 = this.$refs['amount0'][0].value;
+      if (amount0 === '') {
+        callback('请输入数值');
+      } else {
+        callback();
+      }
+    };
+    let checkFrequency2 = (rule, value, callback) => {
+      let amount1 = this.$refs['amount1'][0].value;
+      if (amount1 === '') {
+        callback('请输入数值');
+      } else {
+        callback();
+      }
+    };
+    let checkFrequency3 = (rule, value, callback) => {
+      let unit0 = this.$refs['unit0'][0].value;
+      if (unit0 === '') {
+        callback('请输入单位');
+      } else {
+        callback();
+      }
+    };
+    let checkFrequency4 = (rule, value, callback) => {
+      let unit1 = this.$refs['unit1'][0].value;
+      if (unit1 === '') {
+        callback('请输入单位');
+      } else {
+        callback();
+      }
+    };
+    return {
+      showDrop: false,
+      conditionList: [],
+      form: {
+        conditionLabel: '',
+        id: '',
+        maxValue: '',
+        minValue: '',
+        name: '',
+        range: '',
+        status: '',
+        unit: ''
+      },
+      ruleForm: {
+        ruleForm: [
+          {
+            compare: '',
+            value: '',
+            unit: ''
+          }
+        ]
+      },
+      rules: {
+        condition: [
+          {
+            required: true,
+            validator: checkFrequency,
+            trigger: ['blur', 'change']
+          }
+        ]
+      },
+      rules1: {
+        amount0: [
+          {
+            required: true,
+            validator: checkFrequency1,
+            trigger: 'change'
+          }
+        ],
+        amount1: [
+          {
+            required: true,
+            validator: checkFrequency2,
+            trigger: 'change'
+          }
+        ],
+        unit0: [
+          {
+            required: true,
+            validator: checkFrequency3,
+            trigger: 'change'
+          }
+        ],
+        unit1: [
+          {
+            required: true,
+            validator: checkFrequency4,
+            trigger: 'change'
+          }
+        ]
+      }
+    };
+  },
+  computed: {
+    isOpen() {
+      if (this.ruleForm.ruleForm.length === 2) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    isCompare1() {
+      const { ruleForm } = this.ruleForm;
+      if (ruleForm.length != 2) return false;
+      if (ruleForm[1].compare == '') {
+        return false;
+      } else if ( ruleForm[1].compare == '>=') {
+        return '>=';
+      } else if (ruleForm[1].compare == '<=') {
+        return '<=';
+      }
+    },
+    isCompare2() {
+      const { ruleForm } = this.ruleForm;
+      if (ruleForm.length != 2) return false;
+      if (ruleForm[0].compare == '') {
+        return false;
+      } else if ( ruleForm[0].compare == '>=') {
+        return '>=';
+      } else if ( ruleForm[0].compare == '<=') {
+        return '<=';
+      }
+    }
+  },
+  created() {
+    this._initData();
+  },
+  mounted() {},
+  methods: {
+    _initData() {
+      this.form = { ...this.data };
+      const { maxValue, minValue, unit } = this.form;
+      // console.log(maxValue, 'maxValue', minValue, 'minValue');
+      if (minValue === null && maxValue === null) {
+        this.ruleForm.ruleForm = [
+          {
+            compare: '',
+            value: '',
+            unit: ''
+          }
+        ];
+      } else if (minValue === null && maxValue !== null) {
+        this.ruleForm.ruleForm = [
+          {
+            compare: '<=',
+            value: maxValue,
+            unit: unit
+          }
+        ];
+      } else if (minValue !== null && maxValue === null) {
+        this.ruleForm.ruleForm = [
+          {
+            compare: '>=',
+            value: minValue,
+            unit: unit
+          }
+        ];
+      } else if (minValue !== '' && maxValue !== '') {
+        this.ruleForm.ruleForm = [
+          {
+            compare: '>=',
+            value: minValue,
+            unit: unit
+          },
+          {
+            compare: '<=',
+            value: maxValue,
+            unit: unit
+          }
+        ];
+      } else {
+        this.ruleForm.ruleForm = [
+          {
+            compare: '',
+            value: '',
+            unit: ''
+          }
+        ];
+      }
+    },
+    changeWord(val) {
+      if (val === '') return;
+      let condition = this.conditionList.find(item => item.name == val);
+      this.$emit('split', condition);
+    },
+    handleClear(index) {
+      this.ruleForm.ruleForm[index].value = '';
+    },
+    handleUnitClear(index) {
+      // 两条规则
+      if (index === 0 && this.ruleForm.ruleForm.length == 2) {
+        this.ruleForm.ruleForm[1].unit = '';
+      }
+    },
+    // handleSelectChange(val) {
+    //   console.log(val, '===========');
+    //   this.$refs.form.clearValidate();
+    //   this.rules.compare = this.rules.compare.slice(0, 1);
+    // },
+    handleVisible(flag) {
+      if (!flag) {
+        this.conditionList = [];
+      }
+    },
+    // 搜索列表
+    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;
+        }
+      });
+    },
+    // 编辑规则
+    handleValue(from, idx) {
+      let item = this.ruleForm.ruleForm.find((item, index) => index == idx);
+      if ((item.compare == '>' || item.compare == '>=') && from == 'value') {
+        this.form.minValue = item.value;
+        this.$emit('handleInput', {
+          type: 'minValue',
+          value: this.form.minValue
+        });
+      } else if (
+        (item.compare == '<' || item.compare == '<=') &&
+        from == 'value'
+      ) {
+        this.form.maxValue = item.value;
+        this.$emit('handleInput', {
+          type: 'maxValue',
+          value: this.form.maxValue
+        });
+      } else if (from === 'unit') {
+        console.log(item, 'unit');
+        this.form.unit = item.unit;
+        this.$emit('handleInput', {
+          type: 'unit',
+          value: this.form.unit
+        });
+        // 两条规则
+        if (idx === 0 && this.ruleForm.ruleForm.length == 2) {
+          this.ruleForm.ruleForm[1].unit = item.unit;
+        }
+      }
+    },
+
+    // 新增表单
+    addForm() {
+      if (this.ruleForm.ruleForm.length === 2) return;
+      this.ruleForm.ruleForm.push({
+        compare: '',
+        value: '',
+        unit: ''
+      });
+      // 两条规则
+      if (this.ruleForm.ruleForm.length == 2) {
+        this.ruleForm.ruleForm[1].unit = this.ruleForm.ruleForm[0].unit;
+      }
+    },
+    // 减少表单
+    cutForm(i) {
+      let item = this.ruleForm.ruleForm.find((item, index) => index == i);
+      // console.log(item, '==========');
+      if (item.compare == '>' || item.compare == '>=') {
+        this.form.minValue = '';
+        this.$emit('handleInput', {
+          type: 'minValue',
+          value: this.form.minValue
+        });
+      } else if (item.compare == '<' || item.compare == '<=') {
+        this.form.maxValue = '';
+        this.$emit('handleInput', {
+          type: 'maxValue',
+          value: this.form.maxValue
+        });
+      }
+      this.ruleForm.ruleForm.splice(i, 1);
+    }
+  }
+};
+</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;
+  }
+}
+.font {
+  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" scoped>
+.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>

+ 1 - 1
src/components/icss/dept/DeptManage.vue

@@ -9,8 +9,8 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
+                      <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>
         </el-form-item>

+ 0 - 1
src/components/icss/disease/ChemicalAndCommonMapping.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

+ 0 - 1
src/components/icss/drug/DrugManage.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

+ 0 - 1
src/components/icss/fusion/Fusion.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

+ 0 - 1
src/components/icss/lis/Lis.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

+ 0 - 1
src/components/icss/operation/Operation.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

+ 0 - 1
src/components/icss/pacs/Pacs.vue

@@ -9,7 +9,6 @@
             name="uploadfile "
             id="upFile"
             @change="uploadFile($event)"
-            accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
           />
           <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
           <el-button size="mini" @click="exportData">导出</el-button>

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' }, //开单
     ],
   },
 ];