12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb
- v-if="this.$route.query.type == 1"
- :crumbs="crumbs"
- ></bread-crumb>
- <bread-crumb
- v-if="this.$route.query.type == 2"
- :crumbs="crumbs2"
- ></bread-crumb>
-
- <div style="float:right;">
- <el-button size="small" @click="back()" class="filter-item"
- >取 消</el-button
- >
- <el-button
- size="small"
- type="primary"
- @click="submit()"
- v-loading="loading"
- v-if="is_check == 2"
- class="filter-item"
- >保 存</el-button
- >
- <el-button
- size="small"
- type="primary"
- v-if="is_check == 2"
- @click="toCheck()"
- class="filter-item"
- >审核</el-button
- >
- <el-button
- size="small"
- type="primary"
- v-if="is_check == 1"
- @click="toReturnCheck()"
- class="filter-item"
- >反审核</el-button
- >
- </div>
- </div>
-
- <div class="app-container" v-loading="loading">
-
- <drugs-stock-dialog
- ref="dialog"
- :propForm="propForm"
- :visibility="isVisibility"
- v-on:dialog-comfirm="comfirm"
- v-on:dialog-cancle="cancle"
- >
- </drugs-stock-dialog>
-
- <div class="cell clearfix">
- <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
- <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
- <el-option
- v-for="(option, index) in list"
- :key="index"
- :label="option.storehouse_name"
- :value="option.id">
- </el-option>
- </el-select>
- <label class="title"><span class="name">入库时间</span> : </label>
- <el-date-picker
- size="small"
- v-model="warehousing_time"
- prefix-icon="el-icon-date"
- :editable="false"
- style="width: 196px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :disabled="disabled"
- >
- </el-date-picker>
- </div>
-
-
- <!-- 编辑入库单详情 -->
- <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
- <el-table
- id="oictable"
- :data="recordInfo.recordData"
- :class="signAndWeighBoxPatients"
- style="width: 100%"
- border
- max-height="450"
- v-loading="listLoading"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- >
-
- <el-table-column align="center" width="200px">
- <template slot="header" slot-scope="scope">
- <span>药品名称<span style="color: red">*</span></span>
- </template>
-
- <template slot-scope="scope">
- <el-form-item style="padding-top: 15px">
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="scope.row.drug_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入药品名称"
- @select="handleSelect"
- @input="changeDrugName(scope.$index)"
- style="width:160px;"
- :disabled="disabled"
-
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- </template>
- </el-table-column>
-
- <el-table-column align="center" width="140">
- <template slot="header" slot-scope="scope">
- <span>药品类型</span>
- </template>
- <template slot-scope="scope">
- <el-select v-model="scope.row.drug_type" filterable placeholder="请选择厂商" :disabled="disabled">
- <el-option
- v-for="(option, index) in drugTypeList"
- :key="index"
- :label="option.name"
- :value="option.id"
-
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="center" width="140">
- <template slot="header" slot-scope="scope">
- <span>规格&单位</span>
- </template>
- <template slot-scope="scope">
- <el-form-item style="padding-top: 20px">
- <el-input
- :disabled="true"
- placeholder="请输入规格&单位"
- v-model="scope.row.name"
- ></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column align="center" width="150">
- <template slot="header" slot-scope="scope" >
- <span >批号<span style="color: red">*</span></span>
- </template>
- <template slot-scope="scope">
- <el-form-item style="padding-top: 20px" :rules="tableRules.batch_number" :prop="'recordData.' + scope.$index + '.batch_number'">
- <el-input
- :disabled="disabled"
- placeholder="请输入批号"
- v-model="scope.row.batch_number"
- ></el-input>
- </el-form-item>
- </template>
- </el-table-column>
-
-
- <el-table-column align="center" width="200">
- <template slot="header" slot-scope="scope">
- <span>入库数量<span style="color: red">*</span></span>
- </template>
- <template slot-scope="scope">
- <el-form-item
- :prop="'recordData.' + scope.$index + '.warehousing_count'"
- :rules="tableRules.warehousing_count"
- style="padding-top: 10px;"
- >
- <div style="display:flex;">
- <el-input
- :disabled="disabled"
- oninput="value=value.replace(/\D|^0/g,'')"
- placeholder="请输入入库数量"
- type="number"
- v-model="scope.row.warehousing_count"
- style="width:80px"
- ></el-input>
- <!-- <el-input
- :disabled="disabled"
- placeholder="请输入入库数量"
- v-model="scope.row.warehousing_count"
- style="width:80px"
- ></el-input> -->
- <!-- {{scope.row.max_unit}} -->
- <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" :disabled="disabled">
- <el-option
- v-for="(option, index) in unitList"
- :key="index"
- :label="option.name"
- :value="option.name"
- >
- </el-option>
- </el-select>
- </div>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column align="center" width="140">
- <template slot="header" slot-scope="scope">
- <span>拆零零售价(元)<span style="color: red">*</span></span>
- </template>
- <template slot-scope="scope">
- <el-form-item
- :prop="'recordData.' + scope.$index + '.retail_price'"
- :rules="tableRules.retail_price"
- style="padding-top: 20px"
- >
- <el-input
- style="width:100px"
- placeholder="请输入拆零零售价"
- type="number"
- v-model="scope.row.retail_price"
- :disabled="disabled"
- ></el-input>
-
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column width="120">
- <template slot="header" slot-scope="scope">
- <span>进货单价(元)<span style="color: red">*</span></span>
- </template>
- <template slot-scope="scope">
- <el-form-item
- :prop="'recordData.' + scope.$index + '.price'"
- :rules="tableRules.last_price"
- style="padding-top: 20px"
- >
- <el-input
- style="width:100px"
- placeholder="请输入单价"
- type="number"
- v-model="scope.row.last_price"
- :disabled="disabled"
- ></el-input>
-
- </el-form-item>
- </template>
- </el-table-column>
-
- <el-table-column label="总价(元)" align="center" width="80">
- <template slot-scope="scope">
- {{ calculate(scope.row.last_price * scope.row.warehousing_count) }}
- </template>
- </el-table-column>
-
-
- <el-table-column width="180" align="center">
- <template slot="header" slot-scope="scope">
- <span>有效日期<span style="color: red">*</span></span>
- </template>
- <template slot-scope="scope">
- <el-form-item :prop="'recordData.' + scope.$index + '.expiry_date'"
- :rules="tableRules.expiry_date"
- style="padding-top: 20px">
- <el-date-picker
- :disabled="disabled"
- prefix-icon="el-icon-date"
- style="width: 145px"
- v-model="scope.row.expiry_date"
- type="date"
- placeholder="选择日期时间"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- </el-form-item>
- </template>
- </el-table-column>
-
- <el-table-column label="生产日期" width="180" align="center">
- <template slot-scope="scope">
- <el-date-picker
- :disabled="disabled"
- prefix-icon="el-icon-date"
- style="width: 145px"
- v-model="scope.row.product_date"
- type="date"
- placeholder="选择日期时间"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
- </template>
- </el-table-column>
-
-
- <el-table-column label="生产厂家" width="140" align="center">
- <template slot-scope="scope">
- <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商" :disabled="disabled">
- <el-option
- v-for="(option, index) in manufacturerList"
- :key="index"
- :label="option.manufacturer_name"
- :value="option.id"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
-
-
- <el-table-column label="经销商" width="140" align="center">
- <template slot-scope="scope">
- <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
- <el-option
- v-for="(option, index) in dealerList"
- :key="index"
- :label="option.dealer_name"
- :value="option.id"
- :disabled="disabled">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
-
-
- <el-table-column align="center" width="150" label="批准文号">
- <template slot-scope="scope">
- <el-form-item style="padding-top: 20px">
- <el-input
- :disabled="disabled"
- placeholder="请输入批准文号"
- v-model="scope.row.number"
- ></el-input>
- </el-form-item>
- </template>
- </el-table-column>
-
- <el-table-column label="备注" width="150" align="center">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
- </template>
- </el-table-column>
-
- <el-table-column
- label="操作"
- fixed="right"
- align="center"
- width="150"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- content="新增"
- placement="top"
- >
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-circle-plus-outline"
- @click="handleEdit(scope.$index, scope.row)"
- >
- </el-button>
- </el-tooltip>
- <el-tooltip
- class="item"
- effect="dark"
- content="删除"
- placement="top"
- >
- <el-button
- size="mini"
- type="danger"
- icon="el-icon-delete"
- @click="handleDelete(scope.$index, scope.row)"
- >
- </el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- </div>
- </div>
- </template>
-
- <script>
- // import stockInDialog from "./Dialog/stockInDialog";
- import { uParseTime } from "@/utils/tools";
-
- import {
- GetAllConfig,
- GetAllDrugInfoByID,
- getDrugWarehouseInfoList,
- DeleteDrugWarehouseInfoItem,
- EditDrugWarehouse,
- toCheckWarehousingInfo,
- toReturnCheckWarehousing
- } from "@/api/drug/drug_stock";
- import BreadCrumb from "../../components/bread-crumb";
- import DrugsStockDialog from './drugsStockDialog/index'
- import {postSearchDrugList} from "@/api/data"
- import {getDataConfig, getDictionaryDataConfig } from "@/utils/data";
- export default {
- components: { DrugsStockDialog, BreadCrumb },
- name: "stockIn",
-
- data() {
- var checkGoodId = (rule, value, callback) => {
- setTimeout(() => {
- if (value == "" || value == 0) {
- return callback(new Error("规格名称不能为空"));
- }
- }, 2000);
- };
-
- return {
- crumbs: [
- { path: false, name: "库存管理" },
- { path: false, name: "药品入库单" },
- { path: false, name: "药品入库单" }
- ],
- crumbs2: [
- { path: false, name: "库存管理" },
- { path: false, name: "其他入库单" },
- { path: false, name: "编辑入库单" }
- ],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- warehousing_time: "",
- adminUserOptions: null,
- currentIndex: 0,
-
- recordInfo: {
- recordData: [],
- stock_in_code: "",
- current_index: ""
- },
- tableRules: {
- price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
- warehousing_count: [
- { required: true, message: "数量不能为空", trigge: "blur" }
- ],
- good_id: [{ validator: checkGoodId, trigger: "blur" }],
- expiry_date:[
- {required:true,message:'有效日期不能为空',trigger:'blur'}
- ],
- batch_number:[
- {required:true,message:'批号不能为空',trigger:'blur'}
- ],
- retail_price:[
- {required:true,message:'请输入包装零售价',trigger:'blur'}
- ]
- },
-
- total: "",
- product_date: "",
- expiry_date: "",
- numbers: "",
- // prop
- isVisibility: false,
- propForm: {
- goods: [],
- goodType: [],
- goodInfo: [],
- goodUnit: [],
- title: "入库",
- isCreated: 1
- },
-
- form: {
- manufacturer: "",
- dealer: ""
- },
- warehouse: {},
- manufacturer: [],
- dealer: [],
- goodType: [],
- goodInfo:[],
- drugList:[],
- manufacturerList:[],
- dealerList:[],
- org_id:0,
- listLoading:false,
- unitList:[],
- drug_show:false,
- loading:false,
- disabled:false,
- storehouse_id:"",
- list:[],
- is_check:0,
- drug_waresing_id:0,
- };
- },
- methods: {
- comfirm: function(val) {
- this.$refs.dialog.hide();
-
- if (val.selectedGoodInfo.length > 0) {
- for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
- if (i == 0) {
- this.recordInfo.recordData[this.currentIndex].drug_id =
- val.selectedGoodInfo[i].id;
- this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
- this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
-
-
-
- } else {
-
- const tempForm = {};
- tempForm["id"] = 0;
- tempForm["drug_id"] = val.selectedGoodInfo[i].id;
- tempForm["number"] = "";
- tempForm["product_date"] = "";
- tempForm["expiry_date"] = "";
- tempForm["warehousing_count"] = "";
- tempForm["price"] = val.selectedGoodInfo[i].last_price.toString();
- tempForm["remark"] = "";
- tempForm["dealer"] = "";
- tempForm["manufacturer"] = "";
- tempForm["retail_price"] = val.selectedGoodInfo[i].retail_price.toString();
-
- this.recordInfo.recordData.splice(
- this.currentIndex + 1,
- 0,
- tempForm
- );
- }
- }
- }
- this.currentIndex = -1;
- },
- cancle: function() {
- this.$refs.dialog.hide();
- this.propForm.goods = [];
-
- this.propForm.goodType = [];
- },
- GetConfigInfo: function() {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- GetAllConfig().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.manufacturer = response.data.data.manufacturer;
- this.dealer = response.data.data.dealer;
- for(let i = 0; i< response.data.data.drugs.length;i++){
- this.goodType.push(response.data.data.drugs[i])
- if(response.data.data.drugs[i].drug_specs != null) {
- for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
- this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
- }
- }
- }
- this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
- this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
- }
- loading.close();
- });
- },
- typeName: function(drug_id) {
- let name = "";
- for (let i = 0; i < this.goodInfo.length; i++) {
- if (this.goodInfo[i].id == drug_id) {
- name = this.goodInfo[i].drug_name;
-
- }
- }
- return name;
- },
- specificationName: function(drug_id) {
-
- let name = "";
- for (let i = 0; i < this.goodInfo.length; i++) {
- if (this.goodInfo[i].id == drug_id) {
- name = this.goodInfo[i].drug_spec;
- }
- }
- return name;
- },
- handleEdit: function(index, row) {
- if(parseInt(this.$route.query.is_check) == 1){
- this.$message.error("已审核的单据不能新增!")
- return false
- }
- if(parseInt(this.$route.query.is_sys)==13){
- this.$message.error("调拨入库数据不能新增!")
- return false
- }
- if(row.supply_warehouse_id > 0){
- this.$message.error("自动入库数据不能新增!")
- return false
- }
- const tempObj = {};
- tempObj["id"] = 0;
- tempObj["drug_id"] = 0;
- tempObj["number"] = "";
- tempObj["product_date"] = "";
- tempObj["expiry_date"] = "";
- tempObj["warehousing_count"] = "";
- tempObj["last_price"] = "";
- tempObj["price"] = "";
- tempObj["remark"] = "";
- tempObj["dealer"] = "";
- tempObj["manufacturer"] = "";
- tempObj['retail_price'] = ""
- tempObj['drug_name'] = ""
- tempObj['manufacturer'] = ""
- this.recordInfo.recordData.push(tempObj);
- },
- handleDelete: function(index, row) {
- if(parseInt(this.$route.query.is_check) == 1){
- this.$message.error("已审核的单据不能删除!")
- return false
- }
- if(parseInt(this.$route.query.is_sys)==13){
- this.$message.error("调拨入库数据不能删除!")
- return false
- }
- if(row.supply_warehouse_id > 0){
- this.$message.error("自动入库数据不能删除!")
- return false
- }
- if (row.id == 0) {
- this.recordInfo.recordData.splice(index, 1);
- } else {
- const params = {
- id: row.id
- };
- this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- DeleteDrugWarehouseInfoItem(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$message.success("删除成功");
-
- this.recordInfo.recordData.splice(index, 1);
- }
- });
- })
- .catch(() => {});
- }
- },
- calculate: function(val) {
- if (val == 0) {
- return "";
- }
- return Math.round(parseFloat(val) * 100) / 100;
- },
- getTime(val, temp) {
- if (val != 0) {
- return uParseTime(val, temp);
- } else {
- return "";
- }
- },
-
- back() {
- this.$router.go(-1);
- },
- submit() {
- this.$refs["tableForm"].validate(valid => {
- if (valid) {
- this.loading = true
- const array = this.recordInfo.recordData;
- if(this.storehouse_id == 0){
- this.$message.error("仓库不能为空!")
- return false
- }
- for (let i = 0; i < array.length; i++) {
- if (array[i].drug_id == 0) {
- this.$message.error("药品名称或者药品规格名称不能为空");
- return;
- }
- }
- for(let i=0;i<this.recordInfo.recordData.length;i++){
- if(this.recordInfo.recordData[i].dealer == ""){
- this.recordInfo.recordData[i].dealer = 0
- }
-
- if(this.recordInfo.recordData[i].manufacturer == ""){
- this.recordInfo.recordData[i].manufacturer = 0
- }
-
- this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
- this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].last_price.toString()
-
- this.recordInfo.recordData[i].retail_price = this.recordInfo.recordData[i].retail_price.toString()
-
- for(let j=0;j<this.manufacturerList.length;j++){
- if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
- this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
- }
- }
-
- for(let z=0;z<this.dealerList.length;z++){
- if(this.recordInfo.recordData[i].dealer == this.dealerList[z].dealer_name){
- this.recordInfo.recordData[i].dealer = this.dealerList[z].id
- }
- }
-
- }
- const params = {
- stockIn: this.recordInfo.recordData
- };
- EditDrugWarehouse(
- params,
- this.warehousing_time,
- this.$route.query.id,
- this.$route.query.type,
- this.form.manufacturer,
- this.form.dealer,
- this.storehouse_id,
- ).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.listLoading = false
- this.loading = false
- return false;
- } else {
- this.loading = false
- this.$message.success("保存成功");
- var list = response.data.data.list
- var manufacturerList = response.data.data.manufacturerList
- var dealerList = response.data.data.dealerList
- var drugTypeList = response.data.data.drugTypeList
- for(let i=0;i<list.length;i++){
- for(let j=0;j<manufacturerList.length;j++){
- if(list[i].manufacturer_id == manufacturerList[j].id){
- list[i].manufacturer_id = manufacturerList[j].manufacturer_name
- }
- }
- for(let s=0;s<dealerList.length;s++){
- if(list[i].dealer_id == dealerList[s].id){
- list[i].dealer_id = dealerList[s].manufacturer_name
- }
- }
-
- list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
- list[i].product_date = this.getTimeOne(list[i].product_date)
- list[i].drug_name = list[i].drug.drug_name
- list[i].name = list[i].drug.dose + list[i].drug.dose_unit +"*"+list[i].drug.min_number +list[i].drug.min_unit+"/"+list[i].drug.max_unit
- for(let z=0;z<drugTypeList.length;z++){
- if(list[i].drug.drug_type == drugTypeList[z].value){
- list[i].drug_type = drugTypeList[z].name
- }
- }
- list[i].last_price = list[i].price
- list[i].warehousing_count = list[i].warehousing_count.toString()
- }
- this.recordInfo.recordData = []
- this.recordInfo.recordData = list
- this.listLoading = false
- }
- });
- } else {
- return false;
- }
- });
- },
- GetOrderDetail: function(order_id) {
- this.listLoading = true
- const params = {
- id: order_id
- };
- getDrugWarehouseInfoList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
-
- var manufacturerList = response.data.data.manufacturerList
- this.manufacturerList = manufacturerList
- var dealerList = response.data.data.dealerList
-
- this.dealerList = dealerList
-
- for (let i = 0; i < response.data.data.info.length; i++) {
- response.data.data.info[i].product_date = this.getTime(
- response.data.data.info[i].product_date,
- "{y}-{m}-{d}"
- );
- response.data.data.info[i].expiry_date = this.getTime(
- response.data.data.info[i].expiry_date,
- "{y}-{m}-{d}"
- );
- response.data.data.info[i].price = response.data.data.info[i].price.toString();
-
- response.data.data.info[i].retail_price = response.data.data.info[i].retail_price.toString();
-
- response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
-
- response.data.data.info[i].name = response.data.data.info[i].drug.dose + response.data.data.info[i].drug.dose_unit+"*"+response.data.data.info[i].drug.min_number+ response.data.data.info[i].drug.min_unit+"/"+response.data.data.info[i].drug.max_unit
-
- response.data.data.info[i].lot_number = response.data.data.info[i].number
-
- response.data.data.info[i].drug_name = response.data.data.info[i].drug.drug_name
-
- response.data.data.info[i].last_price = response.data.data.info[i].price
-
- response.data.data.info[i].max_unit = response.data.data.info[i].max_unit
-
- response.data.data.info[i].min_unit = response.data.data.info[i].min_unit
-
- response.data.data.info[i].drug_type = response.data.data.info[i].drug.drug_type
-
- if(response.data.data.info[i].manufacturer == 0){
- response.data.data.info[i].manufacturer = ""
- }
-
- if(response.data.data.info[i].dealer == 0){
- response.data.data.info[i].dealer = ""
- }
-
- this.recordInfo.recordData.push(response.data.data.info[i]);
-
- for(let j=0;j<manufacturerList.length;j++){
- if(response.data.data.info[i].manufacturer == manufacturerList[j].id){
- response.data.data.info[i].manufacturer = manufacturerList[j].manufacturer_name
- }
- }
-
- for(let z=0;z<dealerList.length;z++){
- if(response.data.data.info[i].dealer == dealerList[z].id){
- response.data.data.info[i].dealer = dealerList[z].dealer_name
- }
- }
- }
- this.warehouse = response.data.data.warehousing;
- this.storehouse_id = response.data.data.warehousing.storehouse_id
- this.list = response.data.data.list
- this.warehousing_time = this.getTime(
- this.warehouse.warehousing_time,
- "{y}-{m}-{d}"
- );
- this.listLoading = false
- }
- });
- },
- getDictionaryDataConfig(module, filed_name) {
- return getDictionaryDataConfig(module, filed_name)
- },
-
- querySearchAsync(keyword, cb) {
- let key = '';
- if (keyword != undefined) {
- key = keyword
- }
- let searchArray = [];
- postSearchDrugList(key,this.storehouse_id).then(response => {
- if (response.data.state == 1) {
- searchArray = response.data.data.list;
- var list = response.data.data.list
-
- this.drugList = list
- var manufacturerList = response.data.data.manufacturerList
- this.manufacturerList = manufacturerList
-
- var dealerList = response.data.data.dealerList
- this.dealerList = dealerList
- for(let i=0;i<this.drugList.length;i++){
-
- for(let j=0;j<this.manufacturerList.length;j++){
- if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
- this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
-
- }
- }
-
- for(let z=0;z<dealerList.length;z++){
- if(this.drugList[i].dealer == this.dealerList[z].id){
- this.drugList[i].dealer = this.dealerList[z].dealer_name
- }
-
- }
- }
- cb(this.drugList)
- } else {
- cb([])
- }
- })
- },
- changeDrugName(val){
- this.currentIndex = val
- },
- handleSelect(val){
- for(let i=0;i<this.recordInfo.recordData.length;i++){
- if(i == this.currentIndex){
- this.recordInfo.recordData[i].drug_id = val.id
- this.recordInfo.recordData[i].lot_number = ""
- this.recordInfo.recordData[i].drug_name = val.drug_name
- this.recordInfo.recordData[i].drug_type = val.drug_type
- this.recordInfo.recordData[i].name = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
- if(val.last_price == 0){
- this.recordInfo.recordData[i].last_price =""
- }else{
- this.recordInfo.recordData[i].last_price = val.last_price
- }
- if(val.min_price == 0){
- this.recordInfo.recordData[i].retail_price = ""
- }else{
- this.recordInfo.recordData[i].retail_price = val.min_price
- }
-
- this.recordInfo.recordData[i].manufacturer = val.manufacturer
- this.recordInfo.recordData[i].number = val.number
- this.recordInfo.recordData[i].max_unit = val.max_unit
- this.recordInfo.recordData[i].min_unit = val.min_unit
- if(val.dealer == 0){
- this.recordInfo.recordData[i].dealer = ""
- }else{
- this.recordInfo.recordData[i].dealer = val.dealer
- }
-
- }
- }
- },
- toCheck(){
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)",
- });
- var params = {
- warehousing_id:parseInt(this.$route.query.id),
- }
- toCheckWarehousingInfo(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- this.$message.success("审核成功!")
- this.$router.back(-1);
- loading.close()
- }else{
- this.$message.error("审核失败!")
- loading.close()
- }
- })
- },
- toReturnCheck(){
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)",
- });
- var params = {
- warehousing_id:parseInt(this.$route.query.id),
- }
- toReturnCheckWarehousing(params).then(response=>{
- if(response.data.state == 1){
- this.$message.success(response.data.data.msg)
- this.$router.back(-1);
- loading.close()
- }else{
- this.$message.error(response.data.msg)
- loading.close()
- this.$router.back(-1);
- }
- })
- },
- getTimeOne(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- },
- created() {
-
- this.drugTypeList = getDictionaryDataConfig('system','drug_type')
- this.propForm.goodUnit = this.$store.getters.good_unit;
- const order_id = this.$route.query.id;
- this.GetOrderDetail(order_id);
- this.is_check = parseInt(this.$route.query.is_check)
- this.unitList = getDataConfig('hemodialysis','units')
- if( parseInt(this.$route.query.supply_warehouse_id)>0){
- this.disabled = true
- }
- if(parseInt(this.$route.query.is_sys) == 13 || this.is_check == 1 ){
- this.disabled = true
- }
-
- }
- };
- </script>
- <style>
- #oictable ::-webkit-scrollbar {
- height: 15px;
- }
- </style>
-
- <style rel="stylesheet/css" lang="scss" scoped>
- .information {
- border: 1px #dcdfe6 solid;
- padding: 30px 20px 30px 20px;
-
- .border {
- border-bottom: 1px #dcdfe6 solid;
- margin: 0px 0 20px 0;
- }
- }
-
- .edit_separater {
- border-top: 1px solid rgb(233, 233, 233);
- margin-top: 15px;
- margin-bottom: 15px;
- }
- </style>
-
- <style>
- .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
- font-size: 12px;
- }
-
- .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
- background: #6fb5fa;
- }
-
- </style>
|