zxr 2 éve
szülő
commit
4504dd087f

+ 2 - 1
src/api/medicalhealth/antiepidemicputin.js

@@ -29,7 +29,8 @@ export function addAntiepidemicputin(data) {
 // 修改防疫用品入库登记
 export function updateAntiepidemicputin(data) {
   return request({
-    url: '/medicalhealth/antiepidemicputin',
+    // url: '/medicalhealth/antiepidemicputin',
+    url: '/medicalhealth/antiepidemicputin/update',
     method: 'put',
     data: data
   })

+ 6 - 3
src/api/medicalhealth/consumeputin.js

@@ -29,7 +29,8 @@ export function addPutin(data) {
 // 修改耗材入库登记
 export function updatePutin(data) {
   return request({
-    url: '/medicalhealth/consumeputin',
+    // url: '/medicalhealth/consumeputin',
+    url: '/medicalhealth/consumeputin/update',
     method: 'put',
     data: data
   })
@@ -65,7 +66,9 @@ export function exportYaoPingXiaoHui(query) {
   return request({
     url: '/medicalhealth/yaopinguoqi',
     method: 'get',
-    params: { id: query }
+    params: {
+      id: query
+    }
   })
 }
 
@@ -92,4 +95,4 @@ export function addPutins(data) {
     method: 'post',
     data: data
   })
-}
+}

+ 7 - 3
src/views/access/accessControl/index.vue

@@ -74,8 +74,12 @@
       <el-table-column label="时间" align="center" prop="checktime"></el-table-column>
       <el-table-column label="设备编号" align="center" prop="sn">
         <template slot-scope="scope">
-          <span v-if="scope.row.sn != 'COIV223360001'">{{scope.row.sn}}</span>
+          <span
+            v-if="scope.row.sn != 'COIV223360001'&&scope.row.sn != 'COIV223360129'&&scope.row.sn != 'COIV223360045'"
+          >{{scope.row.sn}}</span>
           <span v-if="scope.row.sn == 'COIV223360001'">#19</span>
+          <span v-if="scope.row.sn == 'COIV223360129'">支援保障营</span>
+          <span v-if="scope.row.sn == 'COIV223360045'">测控营</span>
           <!-- <span v-if="scope.row.sn=='COIV223360001'">#19</span>
           <span v-if="scope.row.sn=='COIV223360001'">#19</span>-->
         </template>
@@ -113,8 +117,8 @@ export default {
       forms: {},
       snList: [
         { id: "COIV223360001", name: "#19" },
-        { id: "COIV223360129", name: "COIV223360129" },
-        { id: "COIV223360045", name: "COIV223360045" }
+        { id: "COIV223360129", name: "支援保障营" },
+        { id: "COIV223360045", name: " 测控营" }
       ],
       starttimes: "",
       endtimes: ""

+ 68 - 68
src/views/medicalhealth/antiepidemicarchives/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:antiepidemicarchives:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:antiepidemicarchives:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:antiepidemicarchives:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:antiepidemicarchives:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,54 +85,49 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
+      <el-table-column label="防疫品编码" align="center" prop="barCode" />
       <el-table-column label="防疫品名称" align="center" prop="durgName" />
       <el-table-column label="品牌" align="center" prop="durgBrand" />
       <el-table-column label="规格" align="center" prop="specifications" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="单位" align="center" prop="unitName" />
       <el-table-column label="库存数量" align="center" prop="amount" />
       <el-table-column label="入库数量" align="center" prop="putIn" />
       <el-table-column label="出库数量" align="center" prop="putOut" />
+      <el-table-column label="过期数量" align="center" prop="overdueQuantity" />
       <!-- <el-table-column label="备注" align="center" prop="remarks" /> -->
       <el-table-column label="创建人" align="center" prop="userName" />
       <!-- <el-table-column
         label="录入时间(创建时间)"
         align="center"
         prop="createtime"
-      /> -->
+      />-->
       <!-- <el-table-column label="修改时间" align="center" prop="updatetime" /> -->
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="btu"
             type="text"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:antiepidemicarchives:edit']"
-            >修改</el-button
-          >
-          <el-button
+          >修改</el-button>
+          <!-- <el-button
             size="btd"
             type="text"
             @click="handleDelete(scope.row)"
             v-hasPermi="['medicalhealth:antiepidemicarchives:remove']"
-            >删除</el-button
-          >
+          >删除</el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -155,13 +148,10 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="80px"
-        inline
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
+        <el-form-item label="防疫品编码" prop="barCode">
+          <el-input v-model="form.barCode" @blur="barCodeblur" placeholder="请输入防疫品编码" />
+        </el-form-item>
         <el-form-item label="防疫品名称" prop="durgName">
           <el-input v-model="form.durgName" placeholder="请输入防疫品名称" />
         </el-form-item>
@@ -179,8 +169,7 @@
               :key="i"
               :value="item.dictValue"
               :label="item.dictLabel"
-            >
-            </el-option>
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="单位" prop="unitId">
@@ -194,24 +183,20 @@
         </el-form-item>
         <div class="jiben">备注</div>
         <el-form-item prop="remarks">
-          <el-input
-            v-model="form.remarks"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <!-- <el-form-item label="库存数量" prop="amount">
           <el-input v-model="form.amount" placeholder="请输入库存数量" />
-        </el-form-item> -->
+        </el-form-item>-->
         <!-- <el-form-item label="入库数量" prop="putIn">
           <el-input v-model="form.putIn" placeholder="请输入入库数量" />
-        </el-form-item> -->
+        </el-form-item>-->
         <!-- <el-form-item label="出库数量" prop="putOut">
           <el-input v-model="form.putOut" placeholder="请输入出库数量" />
-        </el-form-item> -->
+        </el-form-item>-->
         <!-- <el-form-item label="录入人(创建人)" prop="adminId">
           <el-input v-model="form.adminId" placeholder="请输入录入人(创建人)" />
-        </el-form-item> -->
+        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -228,7 +213,7 @@ import {
   delAntiepidemicarchives,
   addAntiepidemicarchives,
   updateAntiepidemicarchives,
-  exportAntiepidemicarchives,
+  exportAntiepidemicarchives
 } from "@/api/medicalhealth/antiepidemicarchives";
 import { getDept } from "@/api/medicalhealth/bdgldurgarchives";
 // 查询字典
@@ -241,7 +226,7 @@ export default {
   name: "Antiepidemicarchives",
   dicts: ["storage_room"],
   components: {
-    Treeselect,
+    Treeselect
   },
   data() {
     return {
@@ -280,7 +265,7 @@ export default {
         remarks: null,
         adminId: null,
         createtime: null,
-        updatetime: null,
+        updatetime: null
       },
       // 表单参数
       form: {},
@@ -290,19 +275,22 @@ export default {
           {
             required: true,
             message: "录入人(创建人)不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
+        barCode: [
+          { required: true, message: "防疫品编码不能为空", trigger: "blur" }
+        ]
       },
       // 库房
       warehouse: [],
       // 树形单位
-      deptOptions: [],
+      deptOptions: []
     };
   },
   created() {
     this.getList();
-    getDicts("storage_room").then((response) => {
+    getDicts("storage_room").then(response => {
       this.warehouse = response.data;
     });
   },
@@ -313,14 +301,26 @@ export default {
     },
     /** 查询部门下拉树结构 */
     getTreeselect() {
-      getDept().then((response) => {
+      getDept().then(response => {
         this.deptOptions = response.data;
       });
     },
+    barCodeblur() {
+      if (this.form.barCode) {
+        listAntiepidemicarchives({ barCode: this.form.barCode }).then(
+          response => {
+            if (response.total > 0) {
+              this.$modal.msgError("请勿重复录入");
+              this.reset();
+            }
+          }
+        );
+      }
+    },
     /** 查询防疫用品库存档案列表 */
     getList() {
       this.loading = true;
-      listAntiepidemicarchives(this.queryParams).then((response) => {
+      listAntiepidemicarchives(this.queryParams).then(response => {
         this.antiepidemicarchivesList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -346,7 +346,7 @@ export default {
         remarks: null,
         adminId: null,
         createtime: null,
-        updatetime: null,
+        updatetime: null
       };
       this.resetForm("form");
     },
@@ -362,7 +362,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -378,8 +378,8 @@ export default {
       this.getTreeselect();
       this.reset();
       const id = row.id || this.ids;
-      getAntiepidemicarchives(id).then((response) => {
-        getDicts("warehouse_type").then((response) => {
+      getAntiepidemicarchives(id).then(response => {
+        getDicts("warehouse_type").then(response => {
           this.warehouse = response.data;
         });
         this.form = response.data;
@@ -389,16 +389,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateAntiepidemicarchives(this.form).then((response) => {
+            updateAntiepidemicarchives(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addAntiepidemicarchives(this.form).then((response) => {
+            addAntiepidemicarchives(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -413,9 +413,9 @@ export default {
       this.$confirm("是否确认删除防疫用品库存档案的数据项?", "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
-        .then(function () {
+        .then(function() {
           return delAntiepidemicarchives(ids);
         })
         .then(() => {
@@ -430,19 +430,19 @@ export default {
       this.$confirm("是否确认导出所有防疫用品库存档案数据项?", "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           this.exportLoading = true;
           return exportAntiepidemicarchives(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.download(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -599,4 +599,4 @@ export default {
 ::v-deep input:-moz-placeholder {
   color: #bdbdbd4f !important;
 }
-</style>
+</style>

+ 94 - 93
src/views/medicalhealth/antiepidemicputin/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:antiepidemicputin:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:antiepidemicputin:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:antiepidemicputin:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:antiepidemicputin:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,9 +85,11 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
       <el-table-column label="防疫品名称" align="center" prop="durgName" />
@@ -97,31 +97,18 @@
       <el-table-column label="规格" align="center" prop="specifications" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="单位" align="center" prop="unitName" />
       <el-table-column label="入库数量" align="center" prop="putIn" />
       <el-table-column label="入库位置" align="center" prop="place" />
-      <el-table-column
-        label="入库时间"
-        align="center"
-        prop="putTime"
-        width="140"
-      >
+      <el-table-column label="入库时间" align="center" prop="putTime" width="140">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.putTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="过期时间"
-        align="center"
-        prop="expirationTime"
-        width="140"
-      >
+      <el-table-column label="过期时间" align="center" prop="expirationTime" width="140">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.expirationTime, "{y}-{m}-{d}") }}</span>
         </template>
@@ -131,31 +118,25 @@
       <el-table-column label="更新时间" align="center" prop="updatetime" />
 
       <el-table-column label="规格" align="center" prop="unitId" />
-      <el-table-column label="规格" align="center" prop="storeHouse" /> -->
-      <!-- <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="规格" align="center" prop="storeHouse" />-->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
-            size="mini"
+            size="btu"
             type="text"
-            icon="el-icon-edit"
+            icon
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:antiepidemicputin:edit']"
-            >修改</el-button
-          >
-          <el-button
+          >修改</el-button>
+          <!-- <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['medicalhealth:antiepidemicputin:remove']"
-            >删除</el-button
-          >
+          >删除</el-button>-->
         </template>
-      </el-table-column> -->
+      </el-table-column>
     </el-table>
 
     <pagination
@@ -174,34 +155,30 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="80px"
-        inline
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
+        <el-form-item label="防疫品编码" prop="putNumber">
+          <el-input v-model="form.putNumber" @blur="putNumberblur" placeholder="请输入入库编号" />
+        </el-form-item>
         <el-form-item label="防疫品名称" prop="durgArchivesId">
-          <el-select
-            v-model="form.durgName"
-            placeholder="请选择防疫品名称"
-            filterable
-          >
+          <el-input v-model="form.durgName" placeholder="请选择防疫品名称" />
+          <!-- <el-select v-model="form.durgName" placeholder="请选择防疫品名称" filterable>
             <el-option
               v-for="(item, i) in fangYi"
               :key="i"
               :value="item.durgName"
               :label="item.name"
               @click.native="fangYiPingXuan(item)"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="入库编号" prop="number">
-          <el-input v-model="form.putNumber" placeholder="请输入入库编号" />
+            ></el-option>
+          </el-select>-->
         </el-form-item>
         <el-form-item label="入库数量" prop="putIn">
-          <el-input v-model="form.putIn" placeholder="请输入入库数量" />
+          <el-input-number
+            v-model="form.putIn"
+            controls-position="right"
+            :min="0"
+            placeholder="请输入入库数量"
+          ></el-input-number>
+          <!-- <el-input v-model="form.putIn" placeholder="请输入入库数量" /> -->
         </el-form-item>
         <el-form-item label="入库位置" prop="place">
           <el-input v-model="form.place" placeholder="请输入入库位置" />
@@ -214,8 +191,7 @@
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="选择入库时间"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
         <el-form-item label="过期日期" prop="expirationTime">
           <el-date-picker
@@ -225,16 +201,11 @@
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="选择过期日期"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
         <div class="jiben">备注</div>
         <el-form-item prop="beizhu">
-          <el-input
-            v-model="form.beizhu"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+          <el-input v-model="form.beizhu" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <!-- <el-form-item label="录入人(创建人)" prop="adminId">
           <el-input v-model="form.adminId" placeholder="请输入录入人(创建人)" />
@@ -250,7 +221,7 @@
         </el-form-item>
         <el-form-item label="规格" prop="storeHouse">
           <el-input v-model="form.storeHouse" placeholder="请输入规格" />
-        </el-form-item> -->
+        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -268,7 +239,7 @@ import {
   addAntiepidemicputin,
   updateAntiepidemicputin,
   exportAntiepidemicputin,
-  exportAntiepidemiFangYi,
+  exportAntiepidemiFangYi
 } from "@/api/medicalhealth/antiepidemicputin";
 
 export default {
@@ -315,14 +286,18 @@ export default {
         beizhu: null,
         durgName: null,
         source: null,
-        expirationTime: null,
+        expirationTime: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {},
+      rules: {
+        putNumber: [
+          { required: true, message: "防疫品编码不能为空", trigger: "blur" }
+        ]
+      },
       // 防疫品名称
-      fangYi: [],
+      fangYi: []
     };
   },
   created() {
@@ -353,16 +328,31 @@ export default {
       this.form.storeHouse = data.storeHouse;
       this.form.unitName = data.unitName;
     },
+    putNumberblur() {
+      this.fangYiPing();
+    },
     // 查询防疫品名称列表
     fangYiPing() {
-      exportAntiepidemiFangYi().then((response) => {
-        this.fangYi = response.data;
-      });
+      if (this.form.putNumber) {
+        exportAntiepidemiFangYi({ barCode: this.form.putNumber }).then(
+          response => {
+            if (response.code == 200) {
+              if (response.data) {
+                this.$set(this.form, "durgName", response.data.durgName);
+                this.form.durgArchivesId = response.data.id;
+              } else {
+                this.$modal.msgSuccess("未有该防疫用品编码!");
+                this.reset();
+              }
+            }
+          }
+        );
+      }
     },
     /** 查询防疫用品入库登记列表 */
     getList() {
       this.loading = true;
-      listAntiepidemicputin(this.queryParams).then((response) => {
+      listAntiepidemicputin(this.queryParams).then(response => {
         this.antiepidemicputinList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -392,7 +382,7 @@ export default {
         beizhu: null,
         durgName: null,
         source: null,
-        expirationTime: null,
+        expirationTime: null
       };
       this.resetForm("form");
     },
@@ -408,13 +398,13 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.fangYiPing();
+      // this.fangYiPing();
       this.reset();
       this.open = true;
       this.title = "添加防疫用品入库登记";
@@ -423,7 +413,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids;
-      getAntiepidemicputin(id).then((response) => {
+      getAntiepidemicputin(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改防疫用品入库登记";
@@ -431,10 +421,10 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateAntiepidemicputin(this.form).then((response) => {
+            updateAntiepidemicputin(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -442,7 +432,7 @@ export default {
           } else {
             this.form.surplus = this.form.putIn;
 
-            addAntiepidemicputin(this.form).then((response) => {
+            addAntiepidemicputin(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -457,9 +447,9 @@ export default {
       this.$confirm("是否确认删除防疫用品入库登记的数据项?", "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
-        .then(function () {
+        .then(function() {
           return delAntiepidemicputin(ids);
         })
         .then(() => {
@@ -474,19 +464,19 @@ export default {
       this.$confirm("是否确认导出所有防疫用品入库登记数据项?", "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           this.exportLoading = true;
           return exportAntiepidemicputin(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.download(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -644,4 +634,15 @@ export default {
 .box {
   background-color: #ffba00 !important;
 }
-</style>
+::v-deep .el-input-number__increase {
+  background-color: transparent !important;
+  border: none;
+  color: #cccccc;
+  border-bottom: none !important;
+}
+::v-deep .el-input-number__decrease {
+  background-color: transparent !important;
+  border: none !important;
+  color: #cccccc;
+}
+</style>

+ 102 - 79
src/views/medicalhealth/antiepidemicputout/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:antiepidemicputout:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:antiepidemicputout:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:antiepidemicputout:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:antiepidemicputout:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,31 +85,25 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
       <el-table-column label="防疫品名称" align="center" prop="durgName" />
       <el-table-column label="单位" align="center" prop="unitName" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="品牌" align="center" prop="durgBrand" />
       <el-table-column label="规格" align="center" prop="specifications" />
       <el-table-column label="发放数量" align="center" prop="putOut" />
       <el-table-column label="所在位置" align="center" prop="place" />
-      <el-table-column
-        label="发放时间"
-        align="center"
-        prop="putTime"
-        width="180"
-      >
+      <el-table-column label="发放时间" align="center" prop="putTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.putTime, "{y}-{m}-{d}") }}</span>
         </template>
@@ -144,7 +136,7 @@
       <el-table-column label="使用人" align="center" prop="storeHouse" />
       <el-table-column label="领用人姓名" align="center" prop="peopleName" />
       <el-table-column label="领用人单位" align="center" prop="unitName" />
-      <el-table-column label="发放单位名称" align="center" prop="unitName1" /> -->
+      <el-table-column label="发放单位名称" align="center" prop="unitName1" />-->
       <!-- <el-table-column
         label="操作"
         align="center"
@@ -168,7 +160,7 @@
             >删除</el-button
           >
         </template>
-      </el-table-column> -->
+      </el-table-column>-->
     </el-table>
 
     <pagination
@@ -187,35 +179,31 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="80px"
-        inline
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
+        <el-form-item label="防疫品编码" prop="putNumber">
+          <el-input v-model="form.putNumber" @blur="fangYiPing" placeholder="请输入入库编号" />
+        </el-form-item>
         <el-form-item label="防疫品名称" prop="durgArchivesId">
-          <el-select
-            v-model="form.durgName"
-            placeholder="请选择防疫品名称"
-            filterable
-          >
+          <el-input v-model="form.durgName" placeholder="请输入防疫品名称" />
+          <!-- <el-select v-model="form.durgName" placeholder="请选择防疫品名称" filterable>
             <el-option
               v-for="(item, i) in fangYi"
               :key="i"
               :value="item.durgName"
               :label="item.name"
               @click.native="fangYiPingXuan(item)"
-            >
-            </el-option>
-          </el-select>
+            ></el-option>
+          </el-select>-->
         </el-form-item>
         <el-form-item label="发放数量" prop="putOut">
-          <el-input
+          <el-input-number
             v-model="form.putOut"
+            controls-position="right"
+            :min="0"
             placeholder="请输入发放数量"
             @blur="shuLiang"
-          />
+          ></el-input-number>
+          <!-- <el-input v-model="form.putOut" placeholder="请输入发放数量" @blur="shuLiang" /> -->
         </el-form-item>
         <el-form-item label="所在位置" prop="place">
           <el-input v-model="form.place" placeholder="请输入所在位置" />
@@ -228,13 +216,12 @@
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="选择使用时间"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
         <el-form-item label="领用单位" prop="unitId">
           <!-- <el-select v-model="form.unitId" placeholder="请选择领用单位">
             <el-option label="请选择字典生成" value="" />
-          </el-select> -->
+          </el-select>-->
           <treeselect
             v-model="form.unitId"
             :options="deptOptions"
@@ -245,7 +232,7 @@
         <el-form-item label="使用人" prop="peopleId">
           <!-- <el-select v-model="form.unitId1" placeholder="">
             <el-option label="请选择字典生成" value="" />
-          </el-select> -->
+          </el-select>-->
           <el-select v-model="form.peopleId" placeholder="请选择使用人">
             <el-option
               v-for="(item, i) in renYuan"
@@ -253,17 +240,12 @@
               :label="item.name"
               :value="item.id"
               @click.native="compere(item.name)"
-            >
-            </el-option>
+            ></el-option>
           </el-select>
         </el-form-item>
         <div class="jiben">备注</div>
         <el-form-item prop="remarks">
-          <el-input
-            v-model="form.remarks"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <!-- <el-form-item label="领用人" prop="peopleId">
           <el-input v-model="form.peopleId" placeholder="请输入领用人" />
@@ -276,11 +258,11 @@
         </el-form-item>
         <el-form-item label="规格" prop="specifications">
           <el-input v-model="form.specifications" placeholder="请输入规格" />
-        </el-form-item> -->
+        </el-form-item>-->
         <!-- <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
         </el-form-item>
-       
+
         <el-form-item label="使用人" prop="storeHouse">
           <el-input v-model="form.storeHouse" placeholder="请输入使用人" />
         </el-form-item>
@@ -292,7 +274,7 @@
         </el-form-item>
         <el-form-item label="发放单位名称" prop="unitName1">
           <el-input v-model="form.unitName1" placeholder="请输入发放单位名称" />
-        </el-form-item> -->
+        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -309,11 +291,13 @@ import {
   delAntiepidemicputout,
   addAntiepidemicputout,
   updateAntiepidemicputout,
-  exportAntiepidemicputout,
+  exportAntiepidemicputout
 } from "@/api/medicalhealth/antiepidemicputout";
 import { exportAntiepidemiFangYiChuKu } from "@/api/medicalhealth/antiepidemicputin";
 import { getZhuChiRen } from "@/api/grassrootsregistration/bdglmeeting";
 import { getDept } from "@/api/medicalhealth/bdgldurgarchives";
+
+import { exportAntiepidemiFangYi } from "@/api/medicalhealth/antiepidemicputin";
 // 导入树形结构
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -322,7 +306,7 @@ export default {
   name: "Antiepidemicputout",
   dicts: ["storage_room"],
   components: {
-    Treeselect,
+    Treeselect
   },
   data() {
     return {
@@ -365,12 +349,16 @@ export default {
         storeHouse: null,
         peopleName: null,
         unitName: null,
-        unitName1: null,
+        unitName1: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {},
+      rules: {
+        putNumber: [
+          { required: true, message: "防疫品编码不能为空", trigger: "blur" }
+        ]
+      },
       // 防疫品名称
       fangYi: [],
       // 树形单位
@@ -378,7 +366,7 @@ export default {
       // 人员
       renYuan: [],
       // 药品数
-      yaoPingShu: "",
+      yaoPingShu: ""
     };
   },
   created() {
@@ -388,7 +376,8 @@ export default {
     // 数量的判断
     shuLiang() {
       if (this.form.putOut > this.yaoPingShu) {
-        return this.$modal.msgWarning(`库存数量为${this.yaoPingShu}`);
+        this.form.putOut = 0;
+        return this.$modal.msgWarning(`未过期库存数量为${this.yaoPingShu}`);
       }
     },
     //  人员点击触发
@@ -397,7 +386,7 @@ export default {
     },
     // 获取人员
     getZhuChi(id) {
-      getZhuChiRen(id).then((res) => {
+      getZhuChiRen(id).then(res => {
         this.renYuan = res.data;
       });
     },
@@ -410,7 +399,7 @@ export default {
     },
     /** 查询部门下拉树结构 */
     getTreeselect() {
-      getDept().then((response) => {
+      getDept().then(response => {
         this.deptOptions = response.data;
       });
     },
@@ -424,16 +413,39 @@ export default {
       this.form.inId = data.id;
       this.yaoPingShu = data.surplus;
     },
+    // putNumberblur() {
+    //   this.fangYiPing();
+    // },
     // 查询防疫品名称列表
     fangYiPing() {
-      exportAntiepidemiFangYiChuKu().then((response) => {
-        this.fangYi = response.data;
-      });
+      // exportAntiepidemiFangYiChuKu({ barCode: this.form.putNumber }).then(
+      //   response => {
+      //     this.fangYi = response.data;
+      //   }
+      // );
+      if (this.form.putNumber) {
+        exportAntiepidemiFangYi({ barCode: this.form.putNumber }).then(
+          response => {
+            if (response.code == 200) {
+              if (response.data) {
+                this.$set(this.form, "durgName", response.data.durgName);
+                this.form.durgArchivesId = response.data.id;
+                this.yaoPingShu =
+                  response.data.amount - response.data.overdueQuantity;
+                // this.form.putNumber = response.data.barCode;
+              } else {
+                this.$modal.msgSuccess("未有该防疫用品编码!");
+                this.reset();
+              }
+            }
+          }
+        );
+      }
     },
     /** 查询防疫用品发放登记列表 */
     getList() {
       this.loading = true;
-      listAntiepidemicputout(this.queryParams).then((response) => {
+      listAntiepidemicputout(this.queryParams).then(response => {
         this.antiepidemicputoutList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -464,7 +476,7 @@ export default {
         storeHouse: null,
         peopleName: null,
         unitName: null,
-        unitName1: null,
+        unitName1: null
       };
       this.resetForm("form");
     },
@@ -480,13 +492,13 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.fangYiPing();
+      // this.fangYiPing();
       this.getTreeselect();
       this.reset();
       this.open = true;
@@ -496,7 +508,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids;
-      getAntiepidemicputout(id).then((response) => {
+      getAntiepidemicputout(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改防疫用品发放登记";
@@ -504,10 +516,10 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateAntiepidemicputout(this.form).then((response) => {
+            updateAntiepidemicputout(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -516,7 +528,7 @@ export default {
             if (this.form.putOut > this.yaoPingShu) {
               return;
             }
-            addAntiepidemicputout(this.form).then((response) => {
+            addAntiepidemicputout(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -530,7 +542,7 @@ export default {
       const ids = row.id || this.ids;
       this.$modal
         .confirm("是否确认删除防疫用品发放登记的数据项?")
-        .then(function () {
+        .then(function() {
           return delAntiepidemicputout(ids);
         })
         .then(() => {
@@ -548,13 +560,13 @@ export default {
           this.exportLoading = true;
           return exportAntiepidemicputout(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.$download.name(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -710,4 +722,15 @@ export default {
 ::v-deep input:-moz-placeholder {
   color: #bdbdbd4f !important;
 }
-</style>
+::v-deep .el-input-number__increase {
+  background-color: transparent !important;
+  border: none;
+  color: #cccccc;
+  border-bottom: none !important;
+}
+::v-deep .el-input-number__decrease {
+  background-color: transparent !important;
+  border: none !important;
+  color: #cccccc;
+}
+</style>

+ 73 - 80
src/views/medicalhealth/archives/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:bdgldurgarchives:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:bdgldurgarchives:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:bdgldurgarchives:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:bdgldurgarchives:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,26 +85,22 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
+      <el-table-column label="耗材编码" align="center" prop="barCode" />
       <el-table-column label="耗材名称" align="center" prop="durgName" />
       <el-table-column label="品牌" align="center" prop="durgBrand" />
       <el-table-column label="厂家" align="center" prop="manufacturer" />
       <el-table-column label="规格" align="center" prop="specifications" />
-      <el-table-column
-        label="功能主治"
-        align="center"
-        prop="productIntroduction"
-      />
+      <el-table-column label="功能主治" align="center" prop="productIntroduction" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="单位" align="center" prop="unitName" />
@@ -116,27 +110,20 @@
       <el-table-column label="过期数量" align="center" prop="overdue" />
       <!-- <el-table-column label="备注" align="center" prop="remarks" /> -->
       <el-table-column label="录入/创建人" align="center" prop="userName" />
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-        width="200"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
         <template slot-scope="scope">
           <el-button
             size="btu"
             type="text"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:bdgldurgarchives:export']"
-            >修改</el-button
-          >
-          <el-button
+          >修改</el-button>
+          <!-- <el-button
             size="btd"
             type="text"
             @click="handleDelete(scope.row)"
             v-hasPermi="['medicalhealth:bdgldurgarchives:export']"
-            >删除</el-button
-          >
+          >删除</el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -158,13 +145,10 @@
       :close-on-click-modal="false"
     >
       <div class="jiben">基本信息</div>
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="120px"
-        :inline="true"
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
+        <el-form-item label="耗材编码" prop="barCode">
+          <el-input v-model="form.barCode" @blur="barCodeblur" placeholder="请输入耗材编码" />
+        </el-form-item>
         <el-form-item label="耗材名称" prop="durgName">
           <el-input v-model="form.durgName" placeholder="请输入耗材名称" />
         </el-form-item>
@@ -187,7 +171,7 @@
           />
           <!-- <el-select v-model="form.unitId" placeholder="请选择单位">
             <el-option label="请选择字典生成" value="" />
-          </el-select> -->
+          </el-select>-->
         </el-form-item>
         <el-form-item label="品牌" prop="durgBrand">
           <el-input v-model="form.durgBrand" placeholder="请输入品牌" />
@@ -201,7 +185,7 @@
         <!-- <el-form-item label="录入/创建人" prop="adminId">
           <el-input v-model="form.adminId" placeholder="请输入录入人(创建人)" />
         </el-form-item>
-        
+
         <el-form-item label="库存数量" prop="amount">
           <el-input v-model="form.amount" placeholder="请输入库存数量" />
         </el-form-item>
@@ -213,22 +197,14 @@
         </el-form-item>
         <el-form-item label="过期数量" prop="overdue">
           <el-input v-model="form.overdue" placeholder="请输入过期数量" />
-        </el-form-item> -->
+        </el-form-item>-->
         <div class="jiben">功能主治</div>
-        <el-form-item label="" prop="productIntroduction">
-          <el-input
-            v-model="form.productIntroduction"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+        <el-form-item label prop="productIntroduction">
+          <el-input v-model="form.productIntroduction" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <div class="jiben">备注</div>
-        <el-form-item label="" prop="remarks">
-          <el-input
-            v-model="form.remarks"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+        <el-form-item label prop="remarks">
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -246,7 +222,7 @@ import {
   delArchives,
   addArchives,
   updateArchives,
-  exportArchives,
+  exportArchives
 } from "@/api/medicalhealth/archives";
 // 导入树形结构
 import Treeselect from "@riophae/vue-treeselect";
@@ -257,7 +233,7 @@ export default {
   name: "Archives",
   dicts: ["storage_room"],
   components: {
-    Treeselect,
+    Treeselect
   },
   data() {
     return {
@@ -297,7 +273,7 @@ export default {
         putOut: null,
         overdue: null,
         remarks: null,
-        adminId: null,
+        adminId: null
       },
       // 表单参数
       form: {},
@@ -307,33 +283,40 @@ export default {
           {
             required: true,
             message: "录入人(创建人)不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         unitId: [
           {
             required: true,
             message: "单位不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         storeHouse: [
           {
             required: true,
             message: "库房不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         durgName: [
           {
             required: true,
             message: "耗品名称不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
+        barCode: [
+          {
+            required: true,
+            message: "耗品编码不能为空",
+            trigger: "blur"
+          }
+        ]
       },
       // 树形单位
-      deptOptions: [],
+      deptOptions: []
     };
   },
   created() {
@@ -346,14 +329,24 @@ export default {
     },
     /** 查询部门下拉树结构 */
     getTreeselect() {
-      getDept().then((response) => {
+      getDept().then(response => {
         this.deptOptions = response.data;
       });
     },
+    barCodeblur() {
+      if (this.form.barCode) {
+        listArchives({ barCode: this.form.barCode }).then(response => {
+          if (response.total > 0) {
+            this.$modal.msgError("请勿重复录入");
+            this.reset();
+          }
+        });
+      }
+    },
     /** 查询耗材库存档案列表 */
     getList() {
       this.loading = true;
-      listArchives(this.queryParams).then((response) => {
+      listArchives(this.queryParams).then(response => {
         this.archivesList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -382,7 +375,7 @@ export default {
         remarks: null,
         adminId: null,
         createTime: null,
-        updateTime: null,
+        updateTime: null
       };
       this.resetForm("form");
     },
@@ -398,7 +391,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -414,7 +407,7 @@ export default {
       this.getTreeselect();
       this.reset();
       const id = row.id || this.ids;
-      getArchives(id).then((response) => {
+      getArchives(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改耗材库存档案";
@@ -422,16 +415,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateArchives(this.form).then((response) => {
+            updateArchives(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addArchives(this.form).then((response) => {
+            addArchives(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -445,7 +438,7 @@ export default {
       const ids = row.id || this.ids;
       this.$modal
         .confirm("是否确认删除耗材库存档案的数据项?")
-        .then(function () {
+        .then(function() {
           return delArchives(ids);
         })
         .then(() => {
@@ -463,13 +456,13 @@ export default {
           this.exportLoading = true;
           return exportArchives(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.$download.name(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -599,7 +592,7 @@ export default {
 ::v-deep .el-dialog__footer {
   margin-right: 50px;
 }
-.el-form--inline .el-form-item{
+.el-form--inline .el-form-item {
   margin-right: 62px;
 }
-</style>
+</style>

+ 19 - 8
src/views/medicalhealth/bdgldurgarchives/index.vue

@@ -47,7 +47,7 @@
           >修改</el-button
         >
       </el-col>-->
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,7 +57,7 @@
           @click="handleDelete"
           v-hasPermi="['medicalhealth:bdgldurgarchives:remove']"
         >删除</el-button>
-      </el-col>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -120,12 +120,12 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:bdgldurgarchives:edit']"
           >修改</el-button>
-          <el-button
+          <!-- <el-button
             size="btd"
             type="text"
             @click="handleDelete(scope.row)"
             v-hasPermi="['medicalhealth:bdgldurgarchives:remove']"
-          >删除</el-button>
+          >删除</el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -148,7 +148,12 @@
     >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
         <el-form-item label="药品编码" prop="drugNo">
-          <el-input v-model="form.drugNo" placeholder="请输入药品编码" @blur="No(form.drugNo)" />
+          <el-input
+            v-model="form.drugNo"
+            :disabled="disabled"
+            placeholder="请输入药品编码"
+            @blur="No(form.drugNo)"
+          />
         </el-form-item>
 
         <el-form-item label="药品名称" prop="durgName">
@@ -292,7 +297,8 @@ export default {
       // 树形单位
       deptOptions: [],
       // 库房
-      warehouse: []
+      warehouse: [],
+      disabled: false
     };
   },
   created() {
@@ -350,8 +356,7 @@ export default {
     No(a) {
       if (a) {
         this.loading = true;
-        this.queryParams.drugNo = this.form.drugNo;
-        listBdgldurgarchives(this.queryParams).then(response => {
+        listBdgldurgarchives({ drugNo: this.form.drugNo }).then(response => {
           this.total = response.total;
           this.loading = false;
           if (response.total > 0) {
@@ -405,6 +410,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加药品库存档案";
+      this.disabled = false;
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -415,6 +421,7 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = "修改药品库存档案";
+        this.disabled = true;
       });
     },
     /** 提交按钮 */
@@ -628,4 +635,8 @@ export default {
 ::v-deep input:-moz-placeholder {
   color: #bdbdbd4f !important;
 }
+::v-deep .el-input.is-disabled .el-input__inner {
+  background: #004d86;
+  color: #fff;
+}
 </style>

+ 23 - 18
src/views/medicalhealth/bdgldurgputin/index.vue

@@ -47,7 +47,7 @@
           >修改</el-button
         >
       </el-col>-->
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,7 +57,7 @@
           @click="handleDelete"
           v-hasPermi="['medicalhealth:bdgldurgputin:remove']"
         >删除</el-button>
-      </el-col>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -158,7 +158,7 @@
     >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
         <el-form-item label="药品编码" prop="number">
-          <el-input v-model="form.number" @blur="getYaoPing" placeholder="请输入入库编号" />
+          <el-input v-model="form.number" @blur="getYaoPing" placeholder="请输入药品编码" />
         </el-form-item>
 
         <!-- <el-form-item label="药品编码" prop="drugNo">
@@ -297,6 +297,9 @@ export default {
       rules: {
         updateReason: [
           { required: true, message: "修改原因不能为空", trigger: "blur" }
+        ],
+        number: [
+          { required: true, message: "药品编码不能为空", trigger: "blur" }
         ]
       },
       // 药品列表
@@ -335,24 +338,26 @@ export default {
     },
     // 查询药品名称列表
     getYaoPing() {
-      this.form.durgName = null;
-      exportYao({ drugNo: this.form.number }).then(response => {
-        // this.yaoList = response.data;
-        if (response.code == 200) {
-          if (response.data) {
-            this.form = response.data;
-            this.form.putIn = null;
+      if (this.form.number) {
+        exportYao({ drugNo: this.form.number }).then(response => {
+          if (response.code == 200) {
+            if (response.data) {
+              // this.form = response.data;
+              this.form.putIn = null;
 
-            this.form.durgName = response.data.yaoPinName;
+              // this.$set(this.form, "durgName", response.data.yaoPinName);
+              this.form.durgName = response.data.yaoPinName;
 
-            this.form.durgArchivesId = this.form.id;
-            this.form.id = null;
-            this.form.number = response.data.drugNo;
-          } else {
-            this.$modal.msgSuccess("未有该药品编码!");
+              this.form.durgArchivesId = response.data.id;
+              this.form.id = null;
+              this.form.number = response.data.drugNo;
+            } else {
+              this.$modal.msgSuccess("未有该药品编码!");
+              this.reset();
+            }
           }
-        }
-      });
+        });
+      }
     },
     /** 查询药品入库登记列表 */
     getList() {

+ 65 - 33
src/views/medicalhealth/bdgldurgputout/index.vue

@@ -47,7 +47,7 @@
           >修改</el-button
         >
       </el-col>-->
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,7 +57,7 @@
           @click="handleDelete"
           v-hasPermi="['medicalhealth:bdgldurgputout:remove']"
         >删除</el-button>
-      </el-col>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -87,7 +87,9 @@
         <template scope="scope">
           <span>
             {{
-            (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
+            (queryParams.pageNum - 1) * queryParams.pageSize +
+            scope.$index +
+            1
             }}
           </span>
         </template>
@@ -120,20 +122,15 @@
       </el-table-column>
       <!-- <el-table-column label="库房" align="center" prop="unitId" /> -->
       <el-table-column label="单位" align="center" prop="unitName1" />
-      <!-- <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
-            size="mini"
+            size="btu"
             type="text"
-            icon="el-icon-edit"
+            icon
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:bdgldurgputout:edit']"
-            >修改</el-button
-          >
+          >修改</el-button>
           <el-button
             size="mini"
             type="text"
@@ -232,7 +229,10 @@
         <el-form-item prop="remarks">
           <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-
+        <!-- <div class="jiben" v-if="updateReasonshow">修改原因</div>
+        <el-form-item prop="updateReason" v-if="updateReasonshow">
+          <el-input v-model="form.updateReason" type="textarea" placeholder="请输入修改原因" />
+        </el-form-item>-->
         <!-- <el-form-item label="录入人(创建人)" prop="adminId">
           <el-input v-model="form.adminId" placeholder="请输入录入人(创建人)" />
         </el-form-item>
@@ -338,7 +338,14 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {},
+      rules: {
+        updateReason: [
+          { required: true, message: "修改原因不能为空", trigger: "blur" }
+        ],
+        number: [
+          { required: true, message: "药品编码不能为空", trigger: "blur" }
+        ]
+      },
       // 药品列表
       yaoList: [],
       // 树形单位
@@ -346,7 +353,8 @@ export default {
       // 人员
       renYuan: [],
       // 数量
-      yaoPingShu: ""
+      yaoPingShu: "",
+      updateReasonshow: false
     };
   },
   created() {
@@ -374,7 +382,8 @@ export default {
     // 数量的判断
     shuLiang() {
       if (this.form.putOut > this.yaoPingShu) {
-        return this.$modal.msgWarning(`库存数量为${this.yaoPingShu}`);
+        this.form.putOut = 0;
+        return this.$modal.msgWarning(`未过期库存数量为${this.yaoPingShu}`);
       }
     },
     // 新增选择单位触发
@@ -412,23 +421,44 @@ export default {
     },
     // 查询药品名称列表
     getYaoPing() {
-      exportYao({ drugNo: this.form.number }).then(response => {
-        if (response.code == 200) {
-          if (response.data) {
-            this.form = response.data;
-            this.form.putOut = null;
-            this.form.durgName = response.data.yaoPinName;
-            this.form.durgArchivesId = this.form.id;
-            this.form.id = null;
-            this.form.number = response.data.drugNo;
-            this.yaoPingShu = response.data.amount;
-          } else {
-            this.$modal.msgSuccess("未有该药品编码!");
+      if (this.form.number) {
+        exportYao({ drugNo: this.form.number }).then(response => {
+          if (response.code == 200) {
+            if (response.data) {
+              // this.form = response.data;
+              this.form.putOut = null;
+              this.form.durgName = response.data.yaoPinName;
+              this.form.durgArchivesId = response.data.id;
+              this.form.id = null;
+              // this.form.number = num;
+              this.yaoPingShu = response.data.amount - response.data.overdue;
+              this.form.createTime = null;
+              this.form.updateTime = null;
+            } else {
+              this.$modal.msgSuccess("未有该药品编码!");
+              this.reset();
+            }
           }
-        }
-
-        // this.yaoPingShu = response.data.surplus;
-      });
+        });
+      }
+      // exportChuYao({ drugNo: this.form.number }).then(res => {
+      //   if (res.code == 200) {
+      //     if (response.data) {
+      //       this.form = response.data;
+      //       this.form.putOut = null;
+      //       this.form.durgName = response.data.yaoPinName;
+      //       this.form.durgArchivesId = this.form.id;
+      //       this.form.id = null;
+      //       this.form.number = response.data.drugNo;
+      //       this.yaoPingShu = response.data.amount;
+      //       this.form.createTime = null;
+      //       this.form.updateTime = null;
+      //     } else {
+      //       this.$modal.msgSuccess("未有该药品编码!");
+      //     }
+      //   }
+      // });
+      // this.yaoPingShu = response.data.surplus;
     },
     /** 查询药品出库登记列表 */
     getList() {
@@ -491,17 +521,19 @@ export default {
       this.getTreeselect();
       // this.getYaoPing();
       this.open = true;
+      this.updateReasonshow = false;
       this.title = "添加药品出库登记";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      // this.getYaoPing();
       const id = row.id || this.ids;
       getBdgldurgputout(id).then(response => {
         this.form = response.data;
         this.open = true;
+        this.updateReasonshow = true;
         this.title = "修改药品出库登记";
+        this.getYaoPing();
       });
     },
     /** 提交按钮 */

+ 97 - 103
src/views/medicalhealth/consumeputin/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:bdgldurgarchives:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:bdgldurgarchives:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:bdgldurgarchives:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:bdgldurgarchives:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,19 +85,18 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
       <el-table-column label="耗材名称" align="center" prop="durgName" />
       <el-table-column label="单位" align="center" prop="unitName" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="品牌" align="center" prop="durgBrand" />
@@ -111,61 +108,36 @@
       <el-table-column label="耗材来源" align="center" prop="source" />
       <!-- <el-table-column label="入库说明" align="center" prop="remarks" /> -->
       <el-table-column label="录入人" align="center" prop="userName" />
-      <el-table-column
-        label="入库时间"
-        align="center"
-        prop="putTime"
-        width="180"
-      >
+      <el-table-column label="入库时间" align="center" prop="putTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.putTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="过期日期"
-        align="center"
-        prop="overduedate"
-        width="180"
-      >
+      <el-table-column label="过期日期" align="center" prop="overduedate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.overduedate, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
 
-      <!-- 
+      <!--
       <el-table-column label="编号" align="center" prop="number" />
       <el-table-column label="剩余库存" align="center" prop="surplus" />
-      <el-table-column label="是否销毁" align="center" prop="status" /> -->
+      <el-table-column label="是否销毁" align="center" prop="status" />-->
 
-      <!-- <el-table-column
-        label="功能主治"
-        align="center"
-        prop="productIntroduction"
-      /> -->
+      <!-- <el-table-column label="功能主治" align="center" prop="productIntroduction" /> -->
 
-      <!-- <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-        width="200"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="btu"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:putin:edit']"
-            >修改</el-button
-          >
-          <el-button
+          <el-button size="btu" type="text" @click="handleUpdate(scope.row)">修改</el-button>
+          <!-- <el-button
             size="mini"
             type="btd"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:putin:remove']"
             >删除</el-button
-          >
+          >-->
         </template>
-      </el-table-column> -->
+      </el-table-column>
     </el-table>
 
     <pagination
@@ -184,32 +156,31 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="120px"
-        :inline="true"
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
         <div class="jiben">基本信息</div>
-        <el-form-item label="耗材名称" prop="durgArchivesId">
-          <el-select
-            v-model="form.durgName"
-            placeholder="请选择耗材名称"
-            filterable
-          >
+        <el-form-item label="耗材编码" prop="number">
+          <el-input v-model="form.number" @blur="getHaoCai" placeholder="请输入耗材编码" />
+        </el-form-item>
+        <el-form-item label="耗材名称" prop="durgName">
+          <el-input v-model="form.durgName" placeholder="请输入耗材名称" />
+          <!-- <el-select v-model="form.durgName" placeholder="请选择耗材名称" filterable>
             <el-option
               v-for="(item, i) in Consumables"
               :key="i"
               :label="item.name"
               :value="item.durgName"
               @click.native="haocailie(item)"
-            >
-            </el-option>
-          </el-select>
+            ></el-option>
+          </el-select>-->
         </el-form-item>
         <el-form-item label="入库数量" prop="putIn">
-          <el-input v-model="form.putIn" placeholder="请输入入库数量" />
+          <el-input-number
+            v-model="form.putIn"
+            controls-position="right"
+            :min="0"
+            placeholder="请输入入库数量"
+          ></el-input-number>
+          <!-- <el-input v-model="form.putIn" placeholder="请输入入库数量" /> -->
         </el-form-item>
         <el-form-item label="入库位置" prop="place">
           <el-input v-model="form.place" placeholder="请输入入库位置" />
@@ -226,8 +197,7 @@
             value-format="yyyy-MM-dd"
             placeholder="选择入库时间"
             :editable="false"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
         <el-form-item label="过期日期" prop="overduedate">
           <el-date-picker
@@ -238,16 +208,11 @@
             value-format="yyyy-MM-dd"
             placeholder="选择过期日期"
             :editable="false"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
         <div class="jiben">入库说明</div>
-        <el-form-item label="" prop="remarks">
-          <el-input
-            v-model="form.remarks"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+        <el-form-item label prop="remarks">
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -266,7 +231,7 @@ import {
   addPutin,
   updatePutin,
   exportPutin,
-  exportHaoCai,
+  exportHaoCai
 } from "@/api/medicalhealth/consumeputin";
 
 export default {
@@ -314,7 +279,7 @@ export default {
         specifications: null,
         productIntroduction: null,
         storeHouse: null,
-        unitId: null,
+        unitId: null
       },
       // 表单参数
       form: {},
@@ -324,26 +289,33 @@ export default {
           {
             required: true,
             message: "耗材名称不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         unitId: [
           {
             required: true,
             message: "入库数量不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         storeHouse: [
           {
             required: true,
             message: "入库位置不能为空",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
+        number: [
+          {
+            required: true,
+            message: "耗材编码不能为空",
+            trigger: "blur"
+          }
+        ]
       },
       // 耗材列表
-      Consumables: [],
+      Consumables: []
     };
   },
   created() {
@@ -362,14 +334,25 @@ export default {
     },
     // 获取耗材列表
     getHaoCai() {
-      exportHaoCai().then((res) => {
-        this.Consumables = res.data;
-      });
+      if (this.form.number) {
+        exportHaoCai({ barCode: this.form.number }).then(res => {
+          if (res.code == 200) {
+            console.log(res);
+            if (res.data) {
+              this.$set(this.form, "durgName", res.data.durgName);
+              this.form.durgArchivesId = res.data.id;
+            } else {
+              this.$modal.msgSuccess("未有该耗材编码!");
+              this.reset();
+            }
+          }
+        });
+      }
     },
     /** 查询耗材入库登记列表 */
     getList() {
       this.loading = true;
-      listPutin(this.queryParams).then((response) => {
+      listPutin(this.queryParams).then(response => {
         this.putinList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -402,7 +385,7 @@ export default {
         specifications: null,
         productIntroduction: null,
         storeHouse: null,
-        unitId: null,
+        unitId: null
       };
       this.resetForm("form");
     },
@@ -418,13 +401,13 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.getHaoCai();
+      // this.getHaoCai();
       this.reset();
       this.open = true;
       this.title = "添加耗材入库登记";
@@ -433,7 +416,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids;
-      getPutin(id).then((response) => {
+      getPutin(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改耗材入库登记";
@@ -441,17 +424,17 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updatePutin(this.form).then((response) => {
+            updatePutin(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
             this.form.surplus = this.form.putIn;
-            addPutin(this.form).then((response) => {
+            addPutin(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -465,7 +448,7 @@ export default {
       const ids = row.id || this.ids;
       this.$modal
         .confirm("是否确认删除耗材入库登记的数据项?")
-        .then(function () {
+        .then(function() {
           return delPutin(ids);
         })
         .then(() => {
@@ -483,13 +466,13 @@ export default {
           this.exportLoading = true;
           return exportPutin(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.$download.name(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -619,4 +602,15 @@ export default {
 ::v-deep .el-dialog__footer {
   margin-right: 30px;
 }
-</style>
+::v-deep .el-input-number__increase {
+  background-color: transparent !important;
+  border: none;
+  color: #cccccc;
+  border-bottom: none !important;
+}
+::v-deep .el-input-number__decrease {
+  background-color: transparent !important;
+  border: none !important;
+  color: #cccccc;
+}
+</style>

+ 99 - 98
src/views/medicalhealth/consumeputout/index.vue

@@ -19,7 +19,7 @@
       <el-form-item>
         <!-- <el-button type="primary" size="btn" @click="handleQuery"
           >搜索</el-button
-        > -->
+        >-->
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -33,8 +33,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['medicalhealth:consumeputout:add']"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -47,8 +46,8 @@
           v-hasPermi="['medicalhealth:consumeputout:edit']"
           >修改</el-button
         >
-      </el-col> -->
-      <el-col :span="1.5">
+      </el-col>-->
+      <!-- <el-col :span="1.5">
         <el-button
           type="danger"
           plain
@@ -57,9 +56,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['medicalhealth:consumeputout:remove']"
-          >删除</el-button
-        >
-      </el-col>
+        >删除</el-button>
+      </el-col>-->
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -71,11 +69,11 @@
           v-hasPermi="['medicalhealth:consumeputout:export']"
           >导出</el-button
         >
-      </el-col> -->
+      </el-col>-->
       <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar> -->
+      ></right-toolbar>-->
     </el-row>
 
     <el-table
@@ -87,19 +85,18 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" align="center">
         <template scope="scope">
-          <span>{{
+          <span>
+            {{
             (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}</span>
+            }}
+          </span>
         </template>
       </el-table-column>
       <el-table-column label="耗材名称" align="center" prop="durgName" />
       <el-table-column label="单位" align="center" prop="unitName1" />
       <el-table-column label="库房" align="center" prop="storeHouse">
         <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.storage_room"
-            :value="scope.row.storeHouse"
-          />
+          <dict-tag :options="dict.type.storage_room" :value="scope.row.storeHouse" />
         </template>
       </el-table-column>
       <el-table-column label="品牌" align="center" prop="durgBrand" />
@@ -109,23 +106,13 @@
       <el-table-column label="出库位置" align="center" prop="place" />
       <el-table-column label="耗材用途" align="center" prop="purpose" />
       <!-- <el-table-column label="出库说明" align="center" prop="remarks" /> -->
-      <el-table-column
-        label="出库时间"
-        align="center"
-        prop="putTime"
-        width="180"
-      >
+      <el-table-column label="出库时间" align="center" prop="putTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.putTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
       <!-- <el-table-column label="领用人" align="center" prop="receiveId" /> -->
-      <el-table-column
-        label="录入人(创建人)"
-        align="center"
-        prop="userName"
-        width="160"
-      />
+      <el-table-column label="录入人(创建人)" align="center" prop="userName" width="160" />
 
       <!-- <el-table-column
         label="功能主治"
@@ -140,30 +127,23 @@
       <el-table-column label="发放单位名称" align="center" prop="unitName" />
       <el-table-column label="领用人姓名" align="center" prop="peopleNamee" />
       <el-table-column label="耗材名称" align="center" prop="durgName" />
-      <el-table-column label="创建人姓名" align="center" prop="userName" /> -->
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-        width="180"
-      >
+      <el-table-column label="创建人姓名" align="center" prop="userName" />-->
+      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
         <template slot-scope="scope">
           <el-button
             size="btu"
             type="text"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['medicalhealth:consumeputout:edit']"
-            >修改</el-button
-          >
+          >修改</el-button>
           <el-button
             size="btd"
             type="text"
             @click="handleDelete(scope.row)"
             v-hasPermi="['medicalhealth:consumeputout:remove']"
-            >删除</el-button
-          >
+          >删除</el-button>
         </template>
-      </el-table-column>
+      </el-table-column>-->
     </el-table>
 
     <pagination
@@ -182,28 +162,21 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form
-        ref="form"
-        :model="form"
-        :rules="rules"
-        label-width="80px"
-        inline
-      >
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" inline>
+        <el-form-item label="耗材编码" prop="number">
+          <el-input v-model="form.number" @blur="getHaoCai" placeholder="请输入耗材编码" />
+        </el-form-item>
         <el-form-item label="耗材名称" prop="durgName">
-          <el-select
-            v-model="form.durgName"
-            placeholder="请选择耗材名称"
-            filterable
-          >
+          <el-input v-model="form.durgName" placeholder="请输入耗材名称" />
+          <!-- <el-select v-model="form.durgName" placeholder="请选择耗材名称" filterable>
             <el-option
               v-for="(item, i) in Consumables"
               :key="i"
               :label="item.name"
               :value="item.durgName"
               @click.native="haocailie(item)"
-            >
-            </el-option>
-          </el-select>
+            ></el-option>
+          </el-select>-->
         </el-form-item>
         <el-form-item label="使用单位" prop="unitId1">
           <treeselect
@@ -221,16 +194,18 @@
               :label="item.name"
               :value="item.id"
               @click.native="compere(item.name)"
-            >
-            </el-option>
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="出库数量" prop="putOut">
-          <el-input
+          <el-input-number
             v-model="form.putOut"
+            controls-position="right"
+            :min="0"
             placeholder="请输入出库数量"
             @blur="shuLiang"
-          />
+          ></el-input-number>
+          <!-- <el-input v-model="form.putOut" placeholder="请输入出库数量" @blur="shuLiang" /> -->
         </el-form-item>
         <el-form-item label="出库时间" prop="putTime">
           <el-date-picker
@@ -240,35 +215,26 @@
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="选择出库时间"
-          >
-          </el-date-picker>
+          ></el-date-picker>
         </el-form-item>
 
         <el-form-item label="出库位置" prop="place">
           <el-input v-model="form.place" placeholder="请输入出库位置" />
         </el-form-item>
         <div class="jiben">耗材用途</div>
-        <el-form-item label="" prop="purpose">
-          <el-input
-            v-model="form.purpose"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+        <el-form-item label prop="purpose">
+          <el-input v-model="form.purpose" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <div class="jiben">出库说明</div>
-        <el-form-item label="" prop="remarks">
-          <el-input
-            v-model="form.remarks"
-            type="textarea"
-            placeholder="请输入内容"
-          />
+        <el-form-item label prop="remarks">
+          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
         </el-form-item>
         <!-- <el-form-item label="耗材用途" prop="purpose">
           <el-input v-model="form.purpose" placeholder="请输入药品用途" />
         </el-form-item>
         <el-form-item label="出库说明" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入出库说明" />
-        </el-form-item> -->
+        </el-form-item>-->
 
         <!-- <el-form-item label="录入人(创建人)" prop="adminId">
           <el-select v-model="form.adminId" placeholder="请选择录入人(创建人)">
@@ -314,7 +280,7 @@
         </el-form-item>
         <el-form-item label="创建人姓名" prop="userName">
           <el-input v-model="form.userName" placeholder="请输入创建人姓名" />
-        </el-form-item> -->
+        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -331,7 +297,7 @@ import {
   delConsumeputout,
   addConsumeputout,
   updateConsumeputout,
-  exportConsumeputout,
+  exportConsumeputout
 } from "@/api/medicalhealth/consumeputout";
 // 导入树形结构
 import Treeselect from "@riophae/vue-treeselect";
@@ -340,12 +306,13 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { getDept } from "@/api/medicalhealth/bdgldurgarchives";
 import { getZhuChiRen } from "@/api/grassrootsregistration/bdglmeeting";
 import { exportHaoCaiChu } from "@/api/medicalhealth/consumeputin";
+import { exportHaoCai } from "@/api/medicalhealth/consumeputin";
 
 export default {
   name: "Consumeputout",
   dicts: ["storage_room"],
   components: {
-    Treeselect,
+    Treeselect
   },
   data() {
     return {
@@ -393,12 +360,20 @@ export default {
         unitName: null,
         peopleNamee: null,
         durgName: null,
-        userName: null,
+        userName: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {},
+      rules: {
+        number: [
+          {
+            required: true,
+            message: "耗材编码不能为空",
+            trigger: "blur"
+          }
+        ]
+      },
       // 树形单位
       deptOptions: [],
       // 人员
@@ -406,7 +381,7 @@ export default {
       // 耗材列表
       Consumables: [],
       // 数量
-      haoCaiShu: "",
+      haoCaiShu: ""
     };
   },
   created() {
@@ -416,7 +391,8 @@ export default {
     // 数量的判断
     shuLiang() {
       if (this.form.putOut > this.haoCaiShu) {
-        return this.$modal.msgWarning(`库存数量为${this.haoCaiShu}`);
+        this.form.putOut = 0;
+        return this.$modal.msgWarning(`未过期库存数量为${this.haoCaiShu}`);
       }
     },
     // 选中耗材
@@ -433,9 +409,23 @@ export default {
     },
     // 获取耗材列表
     getHaoCai() {
-      exportHaoCaiChu().then((res) => {
-        this.Consumables = res.data;
-      });
+      // exportHaoCaiChu().then(res => {
+      //   this.Consumables = res.data;
+      // });
+      if (this.form.number) {
+        exportHaoCai({ barCode: this.form.number }).then(res => {
+          if (res.code == 200) {
+            if (res.data) {
+              this.$set(this.form, "durgName", res.data.durgName);
+              this.form.durgArchivesId = res.data.id;
+              this.haoCaiShu = res.data.amount - res.data.overdue;
+            } else {
+              this.$modal.msgSuccess("未有该耗材编码!");
+              this.reset();
+            }
+          }
+        });
+      }
     },
     //  人员点击触发
     compere(name) {
@@ -443,7 +433,7 @@ export default {
     },
     // 获取人员
     getZhuChi(id) {
-      getZhuChiRen(id).then((res) => {
+      getZhuChiRen(id).then(res => {
         this.renYuan = res.data;
       });
     },
@@ -456,14 +446,14 @@ export default {
     },
     /** 查询部门下拉树结构 */
     getTreeselect() {
-      getDept().then((response) => {
+      getDept().then(response => {
         this.deptOptions = response.data;
       });
     },
     /** 查询耗材出库登记列表 */
     getList() {
       this.loading = true;
-      listConsumeputout(this.queryParams).then((response) => {
+      listConsumeputout(this.queryParams).then(response => {
         this.consumeputoutList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -500,7 +490,7 @@ export default {
         unitName: null,
         peopleNamee: null,
         durgName: null,
-        userName: null,
+        userName: null
       };
       this.resetForm("form");
     },
@@ -516,7 +506,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -532,7 +522,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids;
-      getConsumeputout(id).then((response) => {
+      getConsumeputout(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改耗材出库登记";
@@ -540,13 +530,13 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
             if (this.form.putOut > this.haoCaiShu) {
               return;
             }
-            updateConsumeputout(this.form).then((response) => {
+            updateConsumeputout(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -555,7 +545,7 @@ export default {
             if (this.form.putOut > this.haoCaiShu) {
               return;
             }
-            addConsumeputout(this.form).then((response) => {
+            addConsumeputout(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -569,7 +559,7 @@ export default {
       const ids = row.id || this.ids;
       this.$modal
         .confirm("是否确认删除耗材出库登记的数据项?")
-        .then(function () {
+        .then(function() {
           return delConsumeputout(ids);
         })
         .then(() => {
@@ -587,13 +577,13 @@ export default {
           this.exportLoading = true;
           return exportConsumeputout(queryParams);
         })
-        .then((response) => {
+        .then(response => {
           this.$download.name(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style scoped>
@@ -727,4 +717,15 @@ export default {
 ::v-deep .el-input__inner {
   cursor: pointer !important;
 }
-</style>
+::v-deep .el-input-number__increase {
+  background-color: transparent !important;
+  border: none;
+  color: #cccccc;
+  border-bottom: none !important;
+}
+::v-deep .el-input-number__decrease {
+  background-color: transparent !important;
+  border: none !important;
+  color: #cccccc;
+}
+</style>