浏览代码

Merge branch 'feature/20250314' into develop

cc12458 1 年之前
父节点
当前提交
f210d5e525

+ 23 - 0
src/api/inventory/inventory.js

@@ -180,3 +180,26 @@ export function fySummaryExport(query) {
     params: query
   })
 }
+// 运输明细报表
+export function getTransportReport(query) {
+  return request({
+    url: '/yfc-admin/prescriptionManage/transportPage',
+    method: 'post',
+    data: query,
+    params: {
+      pageNum: query.pageNum,
+      pageSize: query.pageSize,
+    },
+  })
+}
+// 运输明细报表导出
+export function exportTransportReport(query) {
+  const {pageNum, pageSize, ...data} = query;
+  return request({
+    url: '/yfc-admin/prescriptionManage/exportTransport',
+    method: 'post',
+    data,
+    responseType: 'blob',
+    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+  })
+}

+ 13 - 2
src/api/pda/index.js

@@ -12,8 +12,7 @@ export function packTwiceList(query) {
 }
 
 export function dispatchList(query) {
-  const {pageNum, pageSize, date, ...data} = query;
-  if (Array.isArray(date)) [data.startTime, data.endTime = data.startTime] = date;
+  const {pageNum, pageSize, ...data} = query;
   return request({
     url: '/yfc-admin/prescriptionManage/resFlowPage',
     method: 'post',
@@ -21,3 +20,15 @@ export function dispatchList(query) {
     params: {pageNum, pageSize},
   })
 }
+
+// 物流管理报表导出
+export function exportDispatchReport(query) {
+  const {pageNum, pageSize, ...data} = query;
+  return request({
+    url: '/yfc-admin/prescriptionManage/exportResFlow',
+    method: 'post',
+    data,
+    responseType: 'blob',
+    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+  })
+}

+ 8 - 0
src/api/prescription/prescriptionCore.js

@@ -192,6 +192,14 @@ export function getPrescriptionCore2(id) {
   });
 }
 
+export function editPrescriptionCore2(model) {
+  return request({
+    url: '/yfc-admin/prescription/prescriptionCore/updateLogistics',
+    method: 'post',
+    data: model,
+  });
+}
+
 export function getPrescriptionRS(id, medicines, {hidePregnant = false} = {}) {
   const hack = request({
     url: 'http://121.43.162.141/yf/knowlib/getYfMatInfo',

+ 104 - 10
src/components/print/express_75.vue

@@ -1,6 +1,8 @@
 <script>
 import {sf_express_print} from '@/tools/print.tool';
 import {getExpressRecordParams} from '@/api/prescription/prescriptionAudit';
+import {editPrescriptionCore2, getPrescriptionCore2} from '@/api/prescription/prescriptionCore';
+import regionOptions from '@/utils/options';
 
 export default {
   name: 'print_express_75',
@@ -8,6 +10,12 @@ export default {
     id: {type: [String, Number], required: true},
   },
   data() {
+    const locationValidator = (message) => (rule, value, callback) => {
+      if (this.dataset.expressExecutor === '顺丰') {
+        if (!value.length || (typeof value === 'string' && !value.trim())) { return callback(new Error(message)); }
+      }
+      callback();
+    };
     return {
       loaded: false,
       preview: true,
@@ -19,6 +27,20 @@ export default {
       model: null,
       device: null,
       printing: false,
+
+      submitting: false,
+      editable: false,
+      expressPayTypeOptions: [],
+      expressDechOptions: [],
+      regionOptions,
+      dataset: {},
+      rules: {
+        expressExecutor: [{required: true, message: '请选择配送方式'}],
+        consignee: [{validator: locationValidator('请输入收件人')}],
+        contactNumber: [{validator: locationValidator('请输入收件电话')}],
+        // location: [{validator: locationValidator('请选择所属地域')}],
+        address: [{validator: locationValidator('请输入详细地址')}],
+      },
     };
   },
   computed: {
@@ -32,10 +54,22 @@ export default {
   methods: {
     async print(preview = false) {
       try {
-        await this.getModel();
         if (preview) {
-
+          this.getDicts('express_dech').then((response) => {this.expressDechOptions = response.data;});
+          this.getDicts('express_pay_type').then((response) => {this.expressPayTypeOptions = response.data;});
+          const {id, ...model} = await getPrescriptionCore2(this.$props.id);
+          this.dataset = {
+            id,
+            location: model.location,
+            consignee: model.consignee,
+            contactNumber: model.contactNumber,
+            address: model.address,
+            expressDech: model.expressDech,
+            expressPayType: model.expressPayType,
+            expressExecutor: model.expressExecutor,
+          };
         } else {
+          await this.getModel();
           this.printing = true;
           await sf_express_print(this.model);
         }
@@ -51,24 +85,84 @@ export default {
     async getModel() {
       if (this.model) return this.model;
       return getExpressRecordParams({prescriptionCoreId: this.id}).then((res) => {
-        console.log(res);
         this.model = res.data;
         return this.model;
       });
     },
+
+    async save() {
+      try {
+        await this.$refs.form.validate()
+        this.submitting = true;
+        const {location = [], ...model} = this.dataset;
+        [model.province = '', model.city = '', model.region = ''] = location;
+        await editPrescriptionCore2(model);
+        this.$message.success(`修改成功`);
+      } catch (e) {
+        if (e === false) this.$message.warning('请补全表单');
+      }
+      this.submitting = false;
+    },
   },
 };
 </script>
 
 <template>
   <div class="print-preview" v-loading="loading">
-    <!--    <div class="top" :style="{backgroundColor: preview ? '#f0f0f0' : 'transparent'}"></div>-->
-    <!--    <iframe :id="tag" @load="delay"></iframe>-->
-    <div style="display: flex; align-items: center; justify-content: space-evenly;">
-      <el-button style="width: 100%;" type="primary" :loading="printing" @click="printing = true;print()">
-        打印
-      </el-button>
-    </div>
+    <el-form ref="form" :model="dataset" :rules="rules" label-position="right" label-width="auto" style="margin: 24px 0;" @submit.native.prevent="save()">
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <el-form-item label="收件人" prop="consignee">
+            <el-input v-model="dataset.consignee" placeholder="请输入收件人" :disabled="!editable || submitting"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="收件电话" prop="contactNumber">
+            <el-input type="tel" v-model="dataset.contactNumber" placeholder="请输入收件电话" minlength="11"
+                      maxlength="11" :disabled="!editable || submitting"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" style="display: flex;">
+          <el-form-item label="收件地址" prop="location">
+            <el-cascader v-model="dataset.location" :options="regionOptions" :props="{ value: 'label' }"
+                         placeholder="请选择省/市/区" clearable :disabled="!editable || submitting"></el-cascader>
+          </el-form-item>
+          <el-form-item label-width="4px" prop="address" style="flex: auto;">
+            <el-input v-model="dataset.address" placeholder="请输入详细地址" :disabled="!editable || submitting"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" style="display: flex;">
+          <el-form-item style="flex-basis: 30%;" label="结算方式" prop="expressDech">
+            <el-select v-model="dataset.expressDech" placeholder="顺丰标快" clearable
+                       :disabled="!editable || submitting">
+              <el-option v-for="item in expressDechOptions" :key="item.dictValue"
+                         :label="item.dictLabel" :value="item.dictValue"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item style="flex-basis: 30%;" label-width="4px" label="" prop="expressPayType">
+            <el-select v-model="dataset.expressPayType" placeholder="月结" clearable
+                       :disabled="!editable || submitting">
+              <el-option v-for="item in expressPayTypeOptions" :key="item.dictValue"
+                         :label="item.dictLabel" :value="item.dictValue"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <div style="display: flex; align-items: center; justify-content: space-evenly;">
+        <template v-if="editable">
+          <el-button style="flex: 1;" :disabled="submitting" @click="editable = false;">取消</el-button>
+          <el-button style="flex: 1;" type="primary" :loading="submitting" native-type="submit">保存</el-button>
+        </template>
+        <template v-else>
+          <el-button style="flex: 1;" @click="editable = true;">编辑</el-button>
+          <el-button style="flex: 3;" type="primary" :loading="printing" @click="printing = true;print()">
+            打印
+          </el-button>
+        </template>
+      </div>
+    </el-form>
   </div>
 </template>
 

文件差异内容过多而无法显示
+ 0 - 0
src/libs/print/SCPPrint-2.7.1.js


+ 8 - 2
src/tools/print.tool.js

@@ -35,7 +35,7 @@ import {withResolvers} from '@/tools/object';
  * @returns {Promise<sf_express_instance>}
  */
 let sf_express = async function (options = {}) {
-  const module = await import('@/libs/print/SCPPrint-2.7.js');
+  const module = await import('@/libs/print/SCPPrint-2.7.1.js');
 
   const {promise: load, resolve, reject} = withResolvers();
 
@@ -52,6 +52,7 @@ let sf_express = async function (options = {}) {
   try {
     const instance = await load;
     sf_express = () => Promise.resolve(instance);
+    return instance;
   } catch (e) {}
   return instance;
 };
@@ -76,7 +77,12 @@ export async function sf_express_print(data, options = {}) {
   const device = devices.find(device => device.name.startsWith(process.env.VUE_APP_SF_EXPRESS_APPNAME));
 
   if (device) instance['setPrinter'](device.index);
-  await instance.print(data);
+  return new Promise((resolve, reject) => {
+    instance.print(data, ({code, msg}) => {
+      if (code === 1) resolve()
+      else reject({code, message: msg});
+    });
+  });
 }
 
 let c_lodop = async function (options = {}) {

+ 11 - 5
src/utils/request.js

@@ -52,12 +52,18 @@ service.interceptors.request.use(config => {
 })
 
 // 响应拦截器
-service.interceptors.response.use(res => {
-    if (res.config.fileType && res.data instanceof Blob) {
+service.interceptors.response.use(async res => {
+    if (res.data instanceof Blob) {
       const value = res.headers['Content-Disposition'] || res.headers['content-disposition'] || '';
-      return {
-        name: (value.match(/fileName=["']([^"']+)["']/) || [])[1],
-        blob: new Blob([res.data], { type: res.config.fileType }),
+      const type = res.headers['Content-Type'] || res.headers['content-type'] || res.config.fileType;
+      if (type === 'application/json') {
+        const text = await res.data.text()
+        res.data = JSON.parse(text);
+      } else {
+        return {
+          name: decodeURIComponent((value.match(/fileName=["']([^"']+)["']/i) || [])[1] || ''),
+          blob: new Blob([res.data], { type }),
+        }
       }
     } else if (res.config.forced) {
       return res;

+ 18 - 0
src/utils/zipdownload.js

@@ -40,3 +40,21 @@ export function resolveBlob(res, mimeType) {
   URL.revokeObjectURL(aLink.href);//清除引用
   document.body.removeChild(aLink);
 }
+
+export function downloadBlob({blob, name}) {
+  const link = document.createElement('a');
+  document.body.appendChild(link);
+
+  const url = URL.createObjectURL(blob);
+  link.href = url;
+  link.download = name;
+  link.click();
+
+  return new Promise(resolve => {
+    setTimeout(() => {
+      document.body.removeChild(link);
+      URL.revokeObjectURL(url);
+      resolve();
+    }, 20)
+  })
+}

+ 45 - 3
src/views/pda/dispatch/index.vue

@@ -1,11 +1,13 @@
 <script>
-import {dispatchList} from '@/api/pda';
+import {dispatchList, exportDispatchReport} from '@/api/pda';
 import dayjs from 'dayjs';
 import PrintContainer from './printContainer.vue';
+import ScanPanel from '@/views/pda/dispatch/scanPanel.vue';
+import {downloadBlob} from '@/utils/zipdownload';
 
 export default {
   name: 'pda-dispatch',
-  components: {PrintContainer},
+  components: {ScanPanel, PrintContainer},
   data() {
     return {
       queryParams: {
@@ -46,6 +48,7 @@ export default {
         // { name: "煎药已作废", id: 999, key: "---" },
       ],
 
+      showScanPanel: false,
       showPrint: false,
       showPrintId: '',
       showPrintExpressCom: false,
@@ -69,9 +72,17 @@ export default {
       ];
       this.handleQuery();
     },
+    getQueryModel() {
+      const {date, ...form} = this.queryParams;
+      if (Array.isArray(date) && date.length) {
+        form.startTime = date[0];
+        form.endTime = date[1];
+      }
+      return form;
+    },
     getList() {
       this.loading = true;
-      const model = Object.assign({}, this.queryParams);
+      const model = this.getQueryModel();
       dispatchList(model).then((response) => {
         this.dataset = response.rows;
         this.total = response.total;
@@ -88,6 +99,31 @@ export default {
     handlePreview(row) {
 
     },
+    openScanPanel() {
+      this.showScanPanel = true;
+      this.$nextTick(() => {
+        const $scan = this.$refs.scan;
+        if ($scan && typeof $scan.open === 'function') return $scan.open();
+      });
+    },
+    closeScanPanel(done) {
+      this.$nextTick(() => {
+        const $scan = this.$refs.scan;
+        if ($scan && typeof $scan.close === 'function') return $scan.close();
+      });
+      done();
+    },
+
+    async exportData() {
+      const form = this.getQueryModel();
+      this.exporting = true;
+      try {
+        const data = await exportDispatchReport(form);
+        await downloadBlob(data);
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (error) {}
+      this.exporting = false;
+    },
   },
 };
 </script>
@@ -155,6 +191,8 @@ export default {
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-button type="primary"size="mini" v-hasPermi="['inventory:dispatch:export']" @click="exportData">导出</el-button>
+            <el-button icon="el-icon-printer" size="mini" v-hasPermi="['inventory:dispatch:scan']"  @click="openScanPanel">扫码枪</el-button>
           </el-form-item>
         </div>
       </div>
@@ -206,6 +244,10 @@ export default {
                        :load-express="showPrintExpressCom"
       />
     </el-dialog>
+
+    <el-dialog title="扫条码打印顺丰快递单" :visible.sync="showScanPanel" :before-close="closeScanPanel" width="60vim">
+      <scan-panel ref="scan"></scan-panel>
+    </el-dialog>
   </div>
 </template>
 

+ 1 - 1
src/views/pda/dispatch/printContainer.vue

@@ -19,7 +19,7 @@ export default {
   },
   watch: {},
   mounted() {
-    this.select(0);
+    this.select(this.loadExpress ? 0 : 1);
   },
   methods: {
     async print() {

+ 119 - 0
src/views/pda/dispatch/scanPanel.vue

@@ -0,0 +1,119 @@
+<script>
+import {dispatchList} from '@/api/pda';
+import {getExpressRecordParams} from '@/api/prescription/prescriptionAudit';
+import {sf_express_print} from '@/tools/print.tool';
+import dayjs from 'dayjs';
+
+let TAG;
+
+export default {
+  name: 'ScanPanel',
+  data() {
+    return {
+      loading: false,
+      keyword: '',
+      logs: [],
+    };
+  },
+  methods: {
+    async open() {
+      this.nonsupport();
+    },
+    async close() {
+      if (TAG) window.cancelAnimationFrame(TAG);
+      this.logs = [];
+      this.loading = false;
+    },
+    async search() {
+      if (this.loading) return;
+      this.loading = true;
+      const keyword = this.keyword.trim();
+      try {
+
+        let result = await dispatchList({pageNum: 1, pageSize: 1, orderNo: keyword});
+        if (result.code !== 200) throw {message: result.msg};
+
+        let data = result.rows[0];
+        if (!data) throw {message: `未查询到数据`};
+        if (data.expressExecutor !== '顺丰') throw {message: `无法打印,配送方式不是顺丰`};
+
+        result = await getExpressRecordParams({prescriptionCoreId: data.id});
+        if (result.code !== 200) throw {message: result.msg};
+
+        data = result.data;
+        await sf_express_print(data);
+        this.$message.success(`发送打印任务成功`);
+        this.logs.push({
+          time: dayjs().format('HH:mm:ss'),
+          state: 'success', keyword,
+          icon: 'el-icon-check', color: 'green',
+          message: `发送打印任务成功`,
+        });
+      } catch (error) {
+        this.$message.error(error.message);
+        this.logs.push({
+          time: dayjs().format('HH:mm:ss'),
+          state: 'danger', keyword,
+          icon: 'el-icon-close', color: 'red',
+          message: error.message,
+        });
+      }
+      this.$refs.input.focus();
+      this.$refs.main.scrollTop = 0;
+      this.keyword = '';
+      this.loading = false;
+    },
+
+
+    nonsupport() {
+      if (TAG) window.cancelAnimationFrame(TAG);
+      TAG = window.requestAnimationFrame(() => {
+        this.$refs.input.focus();
+        this.nonsupport();
+      });
+    },
+  },
+};
+</script>
+
+<template>
+  <div class="wrapper">
+    <div class="header">
+      <el-input ref="input" style="width: 80%;" v-model="keyword" placeholder="请输入或使用扫码枪操作" clearable
+                size="small" :disabled="loading"
+                @keyup.enter.native="search"/>
+    </div>
+    <div class="main" ref="main">
+      <el-timeline reverse>
+        <el-timeline-item
+          v-for="(log, index) in logs"
+          :key="index"
+          :icon="log.icon"
+          :color="log.color"
+          size="large" :type="log.state"
+          :timestamp="log.time" placement="top">
+          [{{ log.keyword }}] {{ log.message }}
+        </el-timeline-item>
+      </el-timeline>
+    </div>
+  </div>
+</template>
+
+<style scoped lang="scss">
+.wrapper {
+  display: flex;
+  flex-direction: column;
+  height: 60vmin;
+}
+
+.header {
+  flex: none;
+  text-align: center;
+}
+
+.main {
+  flex: auto;
+  padding-top: 24px;
+  overflow-y: auto;
+}
+</style>

+ 36 - 0
src/views/pharmacyManagement/business/deploy/index.vue

@@ -81,6 +81,27 @@
               ></el-option>
             </el-select>
           </el-form-item>
+          <el-form-item label="" prop="isBehalf">
+            <el-select
+              v-model="queryParams.isBehalf"
+              placeholder="是否代煎"
+              style="width: 120px"
+            >
+              <el-option
+                v-for="item in isBehalfArr"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="expressExecutor">
+            <el-select style="width: 120px" v-model="queryParams.expressExecutor" placeholder="配送方式" clearable>
+              <el-option v-for="item in expressExecutorArr" :key="item.id"
+                         :label="item.name" :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item>
             <el-button
               type="primary"
@@ -127,6 +148,12 @@
           {{ scope.row.type === 1 ? "中药制剂" : "中药处方" }}
         </template>
       </el-table-column>
+      <el-table-column label="是否代煎" align="center" prop="isBehalf">
+        <template slot-scope="scope">
+          {{ {0: '否', 1: '是'}[scope.row.isBehalf] }}
+        </template>
+      </el-table-column>
+      <el-table-column label="配送方式" align="center" prop="expressExecutor"/>
       <el-table-column
         label="开方时间"
         align="center"
@@ -688,6 +715,15 @@ export default {
         { name: "发药", id: 3 },
         { name: "配送", id: 4 },
       ],
+      isBehalfArr: [
+        { name: "否", id: 0 },
+        { name: "是", id: 1 },
+      ],
+      expressExecutorArr: [
+        {name: '送医院', id: '送医院'},
+        {name: '顺丰', id: '顺丰'},
+        {name: '其他', id: '其他'},
+      ],
       deployStateArr: [
         { name: "已审核", id: 110, key: "audited" },
         // { name: "已审核不通过", id: 120, key: "---" },

+ 187 - 0
src/views/reportManagement/transport/index.vue

@@ -0,0 +1,187 @@
+<script>
+import {listMedicalMechanism} from '@/api/medical/mechanism';
+import dayjs from 'dayjs';
+import {getByMechanismId, listDept} from '@/api/medical/dept';
+import {exportTransportReport, getTransportReport} from '@/api/inventory/inventory';
+import {downloadBlob} from '@/utils/zipdownload';
+
+export default {
+  name: 'report-transport',
+  data() {
+    const now = dayjs();
+    return {
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+
+        appId: null,
+        yljgId: '',
+        deptId: '',
+        isBehalf: '',
+        expressExecutor: '',
+        orderTime: [now.startOf('day').format('YYYY-MM-DD HH:mm:ss'), now.endOf('day').format('YYYY-MM-DD HH:mm:ss')],
+        yfId: window.localStorage.getItem('pharmacyId'),
+      },
+
+      listMedicalMechanismArr: [],
+      listDeptArr: [],
+      isBehalfArr: [
+        {name: '否', id: 0},
+        {name: '是', id: 1},
+      ],
+      expressExecutorArr: [
+        {name: '送医院', id: '送医院'},
+        {name: '顺丰', id: '顺丰'},
+        {name: '其他', id: '其他'},
+      ],
+      loading: false,
+      exporting: false,
+      total: 0,
+      dataset: [],
+    };
+  },
+  created() {
+    this.getListMedicalMechanism().then(first => {
+      if (!first) { throw {message: `暂无医疗机构可选,无法查询!`};}
+      return first.id;
+    }).then(id => {
+      this.getListDeptArr(id);
+      this.queryParams.yljgId = id;
+      return this.handleQuery();
+    }).catch(error => { this.$message.error(error.message); });
+  },
+  methods: {
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm('queryForm');
+      const now = dayjs();
+      this.queryParams.orderTime = [now.startOf('day').format('YYYY-MM-DD HH:mm:ss'), now.endOf('day').format('YYYY-MM-DD HH:mm:ss')];
+      this.handleMechanismId();
+      this.handleQuery();
+    },
+    handleMechanismId(e) {
+      this.queryParams.deptId = '';
+      this.getListDeptArr(e);
+    },
+    getQueryModel() {
+      const {orderTime, ...form} = this.queryParams;
+      if (Array.isArray(orderTime) && orderTime.length) {
+        form.startTime = orderTime[0];
+        form.endTime = orderTime[1];
+      }
+      if (form.yljgId) { form.hospitalName = this.listMedicalMechanismArr.find(item => item.id === form.yljgId).name; }
+      if (form.deptId) { form.department = this.listDeptArr.find(item => item.id === form.deptId).name; }
+      return form;
+    },
+    async getListMedicalMechanism() {
+      this.listMedicalMechanismArr = await listMedicalMechanism().then((res) => res.data);
+      return this.listMedicalMechanismArr[0];
+    },
+    async getListDeptArr(id) {
+      this.listDeptArr = id ? await getByMechanismId(id).then(res => res.data) : await listDept().then(res => res.rows);
+    },
+    async getList() {
+      this.loading = true;
+      const form = this.getQueryModel();
+      try {
+        const {rows, total} = await getTransportReport(form);
+        this.dataset = rows;
+        this.total = total;
+      } catch (e) { }
+      this.loading = false;
+    },
+    async exportData() {
+      const form = this.getQueryModel();
+      this.exporting = true;
+      try {
+        const data = await exportTransportReport(form);
+        await downloadBlob(data);
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (error) {}
+      this.exporting = false;
+    },
+  },
+};
+</script>
+
+<template>
+  <div class="app-container">
+    <el-form ref="queryForm" :model="queryParams" inline label-suffix="68px">
+      <div class="query-box">
+        <div class="query-box__left">
+          <el-form-item label="" prop="yljgId">
+            <el-select style="width: 160px;" v-model="queryParams.yljgId" placeholder="请选择医疗机构"
+                       @change="handleMechanismId">
+              <el-option v-for="item in listMedicalMechanismArr" :key="item.id"
+                         :label="item.name" :value="item.id" :disabled="+item.state!==1"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="deptId">
+            <el-select style="width: 160px;" v-model="queryParams.deptId" placeholder="请选择科室" clearable>
+              <el-option v-for="item in listDeptArr" :key="item.id"
+                         :label="item.name" :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="orderTime">
+            <el-date-picker style="width: 340px" v-model="queryParams.orderTime"
+                            start-placeholder="开始时间" end-placeholder="结束时间"
+                            clearable size="small"
+                            type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="" prop="isBehalf">
+            <el-select style="width: 160px" v-model="queryParams.isBehalf" placeholder="是否代煎" clearable>
+              <el-option v-for="item in isBehalfArr" :key="item.id"
+                         :label="item.name" :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="expressExecutor">
+            <el-select style="width: 160px" v-model="queryParams.expressExecutor" placeholder="配送方式" clearable>
+              <el-option v-for="item in expressExecutorArr" :key="item.id"
+                         :label="item.name" :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-button size="mini" type="primary" v-hasPermi="['inventory:transport:export']" @click="exportData">导出</el-button>
+          </el-form-item>
+        </div>
+      </div>
+    </el-form>
+    <el-table v-loading="loading" :data="dataset"
+              border size="mini">
+      <el-table-column type="index" width="55" align="center" label="序号"/>
+<!--      <el-table-column label="医疗机构" align="center" prop="hospitalName" show-overflow-tooltip/>-->
+      <el-table-column label="接方日期" align="center" prop="createTime"/>
+      <el-table-column label="处方号" align="center" prop="preNo"/>
+      <el-table-column label="患者" align="center" prop="name"/>
+      <el-table-column label="年龄" align="center" prop="age">
+        <template slot-scope="scope">{{ scope.row.age }}{{ scope.row.ageUnit || '岁' }}</template>
+      </el-table-column>
+      <el-table-column label="性别" align="center" prop="sex"/>
+      <el-table-column label="剂数" align="center" prop="number"/>
+      <el-table-column label="是否代煎" align="center" prop="isBehalf">
+        <template slot-scope="scope">{{ {0: '否', 1: '是'}[scope.row.isBehalf] }}</template>
+      </el-table-column>
+      <el-table-column label="配送方式" align="center" prop="expressExecutor"/>
+      <el-table-column label="备注" align="center" prop="entrust" show-overflow-tooltip/>
+    </el-table>
+    <pagination v-show="total > 0" :total="total"
+                :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+                @pagination="getList"
+    ></pagination>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 56 - 27
src/views/rescription/prescriptionCore/edit.vue

@@ -5,7 +5,6 @@ import {transformFlatObjectToNested, transformNestedObjectToFlat} from '@/tools/
 import {bignumber, chain, multiply} from 'mathjs';
 import {
   addPrescriptionCore2,
-  check,
   check2,
   getPrescriptionCore2,
   getPrescriptionRS,
@@ -24,7 +23,7 @@ export default {
   data() {
     const locationValidator = (message) => (rule, value, callback) => {
       if (this.model.expressExecutor === '顺丰') {
-        if (!value.length) { return callback(new Error(message)); }
+        if (!value.length || (typeof value === 'string' && !value.trim())) { return callback(new Error(message)); }
       }
       callback();
     };
@@ -40,10 +39,10 @@ export default {
         age: [{required: true, message: '请输入年龄'}],
         // recipientTel: [{required: true, message: '请输入联系电话'}],
         expressExecutor: [{required: true, message: '请选择配送方式'}],
-        consignee: [{validator: locationValidator('请输入收件电话')}],
+        consignee: [{validator: locationValidator('请输入收件')}],
         contactNumber: [{validator: locationValidator('请输入收件电话')}],
         // location: [{validator: locationValidator('请选择所属地域')}],
-        address: [{required: true, message: '请输入详细地址'}],
+        address: [{validator: locationValidator('请输入详细地址')}],
       },
 
       ageOptions: [
@@ -73,6 +72,8 @@ export default {
       mechanismOptions: [],
       dosageFormOptions: [],
       usageOptions: [],
+      // 用法方式
+      usageMethodOptions: [],
       concentrationOptions: [],
       frequencyOptions: [],
       medicationTimeOptions: [],
@@ -81,6 +82,8 @@ export default {
       schemeOptions: [],
       patternOptions: [],
       regionOptions,
+      // 药品标记
+      drugMarkOptions: [],
       showPharmacy: false,
       searchTableForSystemColumns: [
         {title: '名称', data: 'drugsName'},
@@ -142,12 +145,14 @@ export default {
     this.getMechanismList();
     this.getDicts('dosage_form').then((response) => {this.dosageFormOptions = response.data;});
     this.getDicts('pressure_pattern').then((response) => {this.patternOptions = response.data;});
-    this.getDicts('prescription.prescriptionUsage').then((response) => {this.usageOptions = response.data;});
+    this.getDicts('prescription_usage').then((response) => {this.usageOptions = response.data;});
     this.getDicts('prescription.concentration').then((response) => {this.concentrationOptions = response.data;});
-    this.getDicts('prescription.frequency').then((response) => {this.frequencyOptions = response.data;});
-    this.getDicts('prescription.medicationTime').then((response) => {this.medicationTimeOptions = response.data;});
-    this.getDicts('expressDech').then((response) => {this.expressDechOptions = response.data;});
-    this.getDicts('expressPayType').then((response) => {this.expressPayTypeOptions = response.data;});
+    this.getDicts('drug_frequency').then((response) => {this.frequencyOptions = response.data;});
+    this.getDicts('medication_time').then((response) => {this.medicationTimeOptions = response.data;});
+    this.getDicts('express_dech').then((response) => {this.expressDechOptions = response.data;});
+    this.getDicts('express_pay_type').then((response) => {this.expressPayTypeOptions = response.data;});
+    this.getDicts('usage_method').then((response) => {this.usageMethodOptions = response.data;});
+    this.getDicts('drug_mark').then((response) => {this.drugMarkOptions = response.data;});
     getSchemeList().then((response) => {this.schemeOptions = response.rows;});
   },
   mounted() {
@@ -219,6 +224,7 @@ export default {
         /* 19 处方用法 */ prescription_prescriptionUsage: '',
         /* 20 浓煎量   */ prescription_concentration: '',
         /* 21 服药频次 */ prescription_frequency: '',
+        /*    用法方式 */ prescription_usageMethod: '',
         /* 22 服药时间 */ prescription_medicationTime: '',
         /* 23 医嘱     */ prescription_entrust: '',
         /* 24 代煎     */ isBehalf: '',
@@ -283,7 +289,7 @@ export default {
         model['prescription'].drugs = medicines;
         model['prescription'].prescriptionPfSum = +this.medicineWholesalePriceTotal;
         model['prescription'].prescriptionYsSum = +this.medicineWholesalePriceTotal;
-        model['prescription'].prescriptionSum = +this.medicinePriceTotal;
+        // model['prescription'].prescriptionSum = +this.medicinePriceTotal;
 
         [model.province = '', model.city = '', model.region = ''] = this.model.location;
         delete model['location'];
@@ -350,6 +356,7 @@ export default {
         delete row.matUnitName;
         delete row.matXsj;
         delete row.matPfj;
+        delete row.drugMark;
         this.medicines.splice(index, 1, row);
       }
       if (this.getEmptyMedicineRowIndex === -1) this.appendMedicine({}, index + 1);
@@ -566,23 +573,36 @@ export default {
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
-              <el-form-item label="服药频次" prop="prescription_frequency">
-                <el-select v-model="model.prescription_frequency" placeholder="请选择服药频次" clearable>
-                  <el-option v-for="item in frequencyOptions" :key="item.dictValue"
-                             :label="item.dictLabel" :value="item.dictValue"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="服药时间" prop="prescription_medicationTime">
-                <el-select v-model="model.prescription_medicationTime" placeholder="请选择服药时间" clearable>
-                  <el-option v-for="item in medicationTimeOptions" :key="item.dictValue"
-                             :label="item.dictLabel" :value="item.dictValue"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
+            <el-col :span="16">
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="服药频次" prop="prescription_frequency">
+                    <el-select v-model="model.prescription_frequency" placeholder="请选择服药频次" clearable>
+                      <el-option v-for="item in frequencyOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="用法方式" prop="prescription_usageMethod">
+                    <el-select v-model="model.prescription_usageMethod" placeholder="请选择用法方式" clearable>
+                      <el-option v-for="item in usageMethodOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="服药时间" prop="prescription_medicationTime">
+                    <el-select v-model="model.prescription_medicationTime" placeholder="请选择服药时间" clearable>
+                      <el-option v-for="item in medicationTimeOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
             </el-col>
             <el-col v-if="showPharmacy" :span="8">
               <el-form-item label="药房" prop="yfId">
@@ -840,6 +860,15 @@ export default {
                             @input="updateMedicine(scope.row, scope.$index)"></el-input>
                 </template>
               </el-table-column>
+              <el-table-column label="标记" prop="drugMark" width="110px" align="center">
+                <template slot-scope="scope" v-if="scope.row.matCode">
+                  <el-select v-model="scope.row.drugMark" placeholder="" clearable :disabled="saving">
+                    <el-option v-for="item in drugMarkOptions" :key="item.dictValue"
+                               :label="item.dictLabel" :value="item.dictValue"
+                    ></el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
               <el-table-column label="批发价" prop="matPfj" width="110" align="center"></el-table-column>
               <el-table-column label="零售价" prop="matXsj" width="110" align="center"></el-table-column>
               <el-table-column label="小计" prop="subtotalMoney" width="110" align="center"></el-table-column>

+ 62 - 24
src/views/rescription/prescriptionReception/edit.vue

@@ -73,6 +73,8 @@ export default {
       mechanismOptions: [],
       dosageFormOptions: [],
       usageOptions: [],
+      // 用法方式
+      usageMethodOptions: [],
       concentrationOptions: [],
       frequencyOptions: [],
       medicationTimeOptions: [],
@@ -81,6 +83,8 @@ export default {
       schemeOptions: [],
       patternOptions: [],
       regionOptions,
+      // 药品标记
+      drugMarkOptions: [],
       showPharmacy: false,
       searchTableForSystemColumns: [
         {title: '名称', data: 'drugsName'},
@@ -139,12 +143,14 @@ export default {
     this.getMechanismList();
     this.getDicts('dosage_form').then((response) => {this.dosageFormOptions = response.data;});
     this.getDicts('pressure_pattern').then((response) => {this.patternOptions = response.data;});
-    this.getDicts('prescription.prescriptionUsage').then((response) => {this.usageOptions = response.data;});
+    this.getDicts('prescription_usage').then((response) => {this.usageOptions = response.data;});
     this.getDicts('prescription.concentration').then((response) => {this.concentrationOptions = response.data;});
-    this.getDicts('prescription.frequency').then((response) => {this.frequencyOptions = response.data;});
-    this.getDicts('prescription.medicationTime').then((response) => {this.medicationTimeOptions = response.data;});
-    this.getDicts('expressDech').then((response) => {this.expressDechOptions = response.data;});
-    this.getDicts('expressPayType').then((response) => {this.expressPayTypeOptions = response.data;});
+    this.getDicts('drug_frequency').then((response) => {this.frequencyOptions = response.data;});
+    this.getDicts('medication_time').then((response) => {this.medicationTimeOptions = response.data;});
+    this.getDicts('express_dech').then((response) => {this.expressDechOptions = response.data;});
+    this.getDicts('express_pay_type').then((response) => {this.expressPayTypeOptions = response.data;});
+    this.getDicts('usage_method').then((response) => {this.usageMethodOptions = response.data;});
+    this.getDicts('drug_mark').then((response) => {this.drugMarkOptions = response.data;});
     getSchemeList().then((response) => {this.schemeOptions = response.rows;});
   },
   mounted() {
@@ -202,6 +208,7 @@ export default {
         /* 19 处方用法 */ prescription_prescriptionUsage: '',
         /* 20 浓煎量   */ prescription_concentration: '',
         /* 21 服药频次 */ prescription_frequency: '',
+        /*    用法方式 */ prescription_usageMethod: '',
         /* 22 服药时间 */ prescription_medicationTime: '',
         /* 23 医嘱     */ prescription_remark: '',
         /* 24 代煎     */ isBehalf: '',
@@ -365,6 +372,11 @@ export default {
         colspan: 8,
       };
     },
+
+    getDrugMark(value) {
+      const option = this.drugMarkOptions.find(item => item.dictValue === value);
+      return option ? option.dictLabel : '';
+    }
   },
 };
 </script>
@@ -551,25 +563,39 @@ export default {
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
-              <el-form-item label="服药频次" prop="prescription_frequency">
-                <el-select v-model="model.prescription_frequency" placeholder="服药频次" clearable
-                           :disabled="!editable">
-                  <el-option v-for="item in frequencyOptions" :key="item.dictValue"
-                             :label="item.dictLabel" :value="item.dictValue"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="服药时间" prop="prescription_medicationTime">
-                <el-select v-model="model.prescription_medicationTime" placeholder="服药时间" clearable
-                           :disabled="!editable">
-                  <el-option v-for="item in medicationTimeOptions" :key="item.dictValue"
-                             :label="item.dictLabel" :value="item.dictValue"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
+            <el-col :span="16">
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="服药频次" prop="prescription_frequency">
+                    <el-select v-model="model.prescription_frequency" placeholder="服药频次" clearable
+                               :disabled="!editable">
+                      <el-option v-for="item in frequencyOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="用法方式" prop="prescription_usageMethod">
+                    <el-select v-model="model.prescription_usageMethod" placeholder="用法方式" clearable
+                               :disabled="!editable">
+                      <el-option v-for="item in usageMethodOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="服药时间" prop="prescription_medicationTime">
+                    <el-select v-model="model.prescription_medicationTime" placeholder="服药时间" clearable
+                               :disabled="!editable">
+                      <el-option v-for="item in medicationTimeOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
             </el-col>
             <el-col v-if="showPharmacy" :span="8">
               <el-form-item label="药房" prop="yfId">
@@ -815,6 +841,18 @@ export default {
                   <template v-else>{{ scope.row.matUsageName }}</template>
                 </template>
               </el-table-column>
+              <el-table-column label="标记" prop="drugMark" width="110px" align="center">
+                <template slot-scope="scope" v-if="scope.row.matCode">
+                  <template v-if="editable">
+                    <el-select v-model="scope.row.drugMark" placeholder="" clearable :disabled="saving">
+                      <el-option v-for="item in drugMarkOptions" :key="item.dictValue"
+                                 :label="item.dictLabel" :value="item.dictValue"
+                      ></el-option>
+                    </el-select>
+                  </template>
+                  <template v-else>{{ getDrugMark(scope.row.drugMark) }}</template>
+                </template>
+              </el-table-column>
               <el-table-column label="批发价" prop="matPfj" width="110" align="center"></el-table-column>
               <el-table-column label="零售价" prop="matXsj" width="110" align="center"></el-table-column>
               <el-table-column label="小计" prop="subtotalMoney" width="110" align="center"></el-table-column>

部分文件因为文件数量过多而无法显示