123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <el-button
- size="small"
- @click="AddNewOrder"
- class="filter-item"
- style="float:right;"
- type="primary"
- icon="el-icon-circle-plus-outline"
- >新增</el-button>
- </div>
- <div class="app-container">
- <div class="cell clearfix">
- <el-input
- size="small"
- style="width: 400px;"
- class="filter-item"
- v-model.trim="searchKey"
- placeholder="单据编码/制单人/厂商"
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search"
- >搜索</el-button
- >
- </div>
-
- <div class="cell clearfix">
- <label class="title"><span class="name">出库时间</span> : </label>
- <el-date-picker
- size="small"
- v-model="start_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"
- @change="startTimeChange"
- ></el-date-picker>
- <span class="cellLine"> - </span>
- <el-date-picker
- size="small"
- v-model="end_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"
- @change="endTimeChange"
- ></el-date-picker>
- </div>
-
- <div class="cell clearfix">
- <el-checkbox
- style="width: 70px"
- v-model="checked"
- @change="changeAllSelected"
- >全选</el-checkbox
- >
- <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
- </div>
-
- <el-table
- @current-change="handleSearch"
- :data="warehouseOutDate"
- :class="signAndWeighBoxPatients"
- style="width: 100%"
- border
- highlight-current-row
- ref="multipleTable"
- @selection-change="select"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- >
- <el-table-column type="selection" width="55" align="center"> </el-table-column>
-
- <el-table-column label="单据日期" align="center">
- <template slot-scope="scope">
- {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
- </template>
- </el-table-column>
-
- <el-table-column label="单据编号" align="center">
- <template slot-scope="scope">
- {{ scope.row.warehouse_out_order_number }}
- </template>
- </el-table-column>
-
- <el-table-column label="制单人" align="center">
- <template slot-scope="scope">
- {{ getXuserName(scope.row.creater) }}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>出库方式</span>
- </template>
- <template slot-scope="scope">
- <span v-if="scope.row.is_sys == 1">{{"自动出库"}}</span>
- <span v-if="scope.row.is_sys != 1">{{"手动出库"}}</span>
-
- </template>
- </el-table-column>
-
- <!-- <el-table-column label="厂家" align="center">
- <template slot-scope="scope">
- {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
- </template>
- </el-table-column>
-
- <el-table-column label="经销商" align="center">
- <template slot-scope="scope">
- {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
- </template>
- </el-table-column> -->
-
-
- <el-table-column label="操作" align="center" width="240">
- <template slot-scope="scope">
-
- <!-- <el-tooltip
- class="item"
- effect="dark"
- content="详情"
- placement="top"
- >
- <el-button
- size="small"
- type="warning"
- icon="el-icon-document"
- @click="handleSearch(scope.row.id,scope.row.warehouse_out_time,scope.row.warehouse_out_order_number)"
- >
- </el-button>
- </el-tooltip> -->
-
- <el-tooltip
- class="item"
- effect="dark"
- content="编辑"
- placement="top"
- >
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-edit-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"
- :disabled="scope.row.is_sys == 1"
- icon="el-icon-delete"
- @click="handleDelete(scope.$index, scope.row)"
- >
- </el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[5, 10, 50, 100]"
- :page-size="5"
- background
- style="margin-top:20px;text-align: right"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- <!-- 使用详情 -->
- <div v-show="tableShow" style="margin-top:10px">
- <el-table
- :data="tableList"
- :class="signAndWeighBoxPatients"
- style="width: 100%"
- border
- highlight-current-row
- ref="multipleTableOne"
- @selection-change="select"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- >
- <el-table-column label="药品名称" align="center">
- <template slot-scope="scope">
- {{scope.row.drug_name}}
- </template>
- </el-table-column>
- <el-table-column label="药品类型" align="center">
- <template slot-scope="scope">
- {{getDrugType(scope.row.drug_type)}}
- </template>
- </el-table-column>
- <el-table-column label="规格&单位" align="center">
- <template slot-scope="scope">
- {{scope.row.dose}} {{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
- </template>
- </el-table-column>
- <el-table-column label="批号" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.batch_number!=''">{{scope.row.batch_number}}</span>
- <span v-if="scope.row.batch_number == '0'"></span>
- </template>
- </el-table-column>
- <el-table-column label="出库数量" align="center">
- <template slot-scope="scope">
- {{getTotalCount(scope.row.drug_id)}}
- </template>
- </el-table-column>
- <el-table-column label="出货单价" align="center">
- <template slot-scope="scope">
- {{scope.row.price}}
- </template>
- </el-table-column>
- <el-table-column label="拆零零售价" align="center">
- <template slot-scope="scope">
- {{scope.row.min_price}}
- </template>
- </el-table-column>
- <el-table-column label="总价" align="center">
- <template slot-scope="scope">
- <span>{{getAllPrice(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
- </template>
- </el-table-column>
- <el-table-column label="生产厂家" align="center">
- <template slot-scope="scope">
- {{getManufacturerName(scope.row.manufacturer)}}
- </template>
- </el-table-column>
- <el-table-column label="生产日期" align="center">
- <template slot-scope="scope">
- {{getTime(scope.row.product_date)}}
- </template>
- </el-table-column>
- <el-table-column label="有效日期" align="center">
- <template slot-scope="scope">
- {{getTime(scope.row.expiry_date)}}
- </template>
- </el-table-column>
- <el-table-column label="经销商" align="center">
- <template slot-scope="scope">
- {{getDealerName(scope.row.dealer)}}
- </template>
- </el-table-column>
- <el-table-column label="批准文号" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.number!=''">{{scope.row.number}}</span>
- <span v-if="scope.row.number == '0'"></span>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center">
- <template slot-scope="scope">
- {{scope.row.remark}}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <span style="color: #589ff8" @click="toDetail(scope.row)">使用明细</span>
- </template>
- </el-table-column>
- </el-table>
-
- </div>
- </div>
-
-
- <el-dialog
- title="提示"
- :visible.sync="drugDialogVisible"
- width="90%">
- <span>
- <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
- border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- >
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>序号</span>
- </template>
- <template slot-scope="scope">
- <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
- <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用人</span>
- </template>
- <template slot-scope="scope">
- <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
- <span v-if="scope.row.is_total == 1"></span>
- </template>
- </el-table-column>
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用数量</span>
- </template>
- <template slot-scope="scope">
- <span >{{scope.row.count}}{{scope.row.count_unit}}</span>
- <span v-if="scope.row.is_total == 1">{{scope.row.total}}</span>
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用时间</span>
- </template>
- <template slot-scope="scope">
- <span v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
- </template>
- </el-table-column>
-
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>批次号</span>
- </template>
- <template slot-scope="scope">
- <span>{{getDrugBatchNumber(scope.row.id)}}</span>
- </template>
- </el-table-column>
-
- </el-table>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="drugDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="drugDialogVisible = false">确 定</el-button>
- </span>
- </el-dialog>
-
-
-
- <el-dialog
- title="提示"
- :visible.sync="drugDialogVisibleTwo"
- width="90%">
- <span>
- <el-table :data="userListOne" :class="signAndWeighBoxPatients" style="width: 50%"
- border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- >
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>序号</span>
- </template>
- <template slot-scope="scope">
- {{scope.$index+1}}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用人</span>
- </template>
- <template slot-scope="scope">
- <span>系统</span>
- </template>
- </el-table-column>
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用数量</span>
- </template>
- <template slot-scope="scope">
- {{scope.row.count}}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用时间</span>
- </template>
- <template slot-scope="scope">
- <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>批号</span>
- </template>
- <template slot-scope="scope">
- <span>{{scope.row.batch_number}} </span>
- </template>
- </el-table-column>
-
- </el-table>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="drugDialogVisibleTwo = false">取 消</el-button>
- <el-button type="primary" @click="drugDialogVisibleTwo = false">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import { uParseTime } from "@/utils/tools";
- import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
-
- import {
- deleteDrugWarehouseOut,
- GetAllConfig,
- getDrugWarehouseOutList,
- getDrugWarehouseOutUser,
- getDrugAutoMaticList,
- getSinleOrderDetail,
- getAutoDrugDetail,
- getDrugCountList
- } from "@/api/drug/drug_stock";
- import BreadCrumb from "../../components/bread-crumb";
- import { getInitializtion } from '@/api/stock'
- export default {
- name: "salesReturnOrder",
- components: { BreadCrumb },
- created() {
- var nowDate = new Date();
- var nowYear = nowDate.getFullYear();
- var nowMonth = nowDate.getMonth() + 1;
- var nowDay = nowDate.getDate();
- this.end_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
- nowDate.setMonth(nowDate.getMonth() - 1);
- nowYear = nowDate.getFullYear();
- nowMonth = nowDate.getMonth() + 1;
- nowDay = nowDate.getDate();
- this.start_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
- this.GetWarehouseOut();
- this.fetchAllAdminUsers();
- this.getDrugCountList()
- },
- data() {
- return {
- searchKey: "",
- crumbs: [
- { path: false, name: "库存管理" },
- { path: false, name: "出库单" }
- ],
- page: 1,
- limit: 5,
- checked: false,
- total: 0,
- pageTotal: 0,
- pageSelect: 0,
- adminUserOptions: [],
- multipleSelection: [],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- start_time: "",
- warehouseOutDate: [],
- end_time: "",
- goodType: [],
- goodInfo: [],
- manufacturer: [],
- selectedTableData: [],
- dealer: [],
- type: 1,
- dialogVisible:false,
- dialogVisibleTwo:false,
- warehousingOutInfo: {
- loading: false,
- warehousingOutData: [],
- info: {}
- },
- userList:[],
- list:[],
- drugConfig:{},
- drugList:[],
- tableList:[],
- drugTypeList:[],
- tableShow:false,
- manufacturerList:[],
- drugDialogVisible:false,
- drugDialogVisibleTwo:false,
- order_id:0,
- dealerList:[],
- countList:[],
- outCountList:[],
- autoCountList:[],
- keyword:"",
- drug_type:0,
- minCount:[],
- drugOutList:[],
- outList:[],
- userListOne:[],
- };
- },
- methods: {
- search: function() {
- const Params = {
- page: this.page,
- limit: this.limit,
- start_time: this.start_time,
- end_time: this.end_time,
- type: this.type,
- keywords: this.searchKey
- };
- this.warehouseOutDate = [];
- getDrugWarehouseOutList(Params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.total = response.data.data.total;
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.warehouseOutDate.push(response.data.data.list[i]);
- }
- }
- });
- },
- AddNewOrder: function() {
- this.$router.push({
- name: "drugStockOutOrderAdd",
- query: { type: this.type }
- });
- },
- GetWarehouseOut: function() {
- const Params = {
- page: this.page,
- limit: this.limit,
- start_time: this.start_time,
- end_time: this.end_time,
- type: this.type,
- keywords: this.searchKey
- };
- this.warehouseOutDate = [];
- getDrugWarehouseOutList(Params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.total = response.data.data.total;
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.warehouseOutDate.push(response.data.data.list[i]);
- }
-
- }
- });
- },
- getXuserName(id) {
- if (id <= 0) {
- return "";
- }
- var name = "";
- if (
- this.adminUserOptions == null ||
- typeof this.adminUserOptions.length === "undefined"
- ) {
- return name;
- }
- var leng = this.adminUserOptions.length;
- if (leng == 0) {
- return name;
- }
- for (let index = 0; index < leng; index++) {
- if (this.adminUserOptions[index].id == id) {
- name = this.adminUserOptions[index].name;
- break;
- }
- }
- return name;
- },
- fetchAllAdminUsers() {
- fetchAllAdminUsers().then(response => {
- if (response.data.state == 1) {
- this.adminUserOptions = response.data.data.users;
- var alen = this.adminUserOptions.length;
- for (let index = 0; index < alen; index++) {
- if (this.adminUserOptions[index].user_type == 2) {
- // this.doctorOptions.push(this.adminUserOptions[index]);
- }
- }
- }
- });
- },
- handleSelectionChange: function(val) {
- this.multipleSelection = val;
- },
- handleSizeChange(val) {
- this.limit = val;
- this.GetWarehouseOut();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.GetWarehouseOut();
- },
- startTimeChange(val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
- if (time > 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.start_time = "";
- } else {
- this.GetWarehouseOut();
- }
- this.GetWarehouseOut();
- },
- endTimeChange(val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
- if (time < 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.end_time = "";
- } else {
- this.GetWarehouseOut();
- }
- },
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000;
- },
- calculate: function(val) {
- return Math.round(parseFloat(val) * 100) / 100;
- },
- GetConfigInfo: function() {
- 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;
- }
- });
- },
-
- handleEdit: function(index, row) {
-
- this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys})
- },
- handleSearch(val){
-
- this.getInitializtion()
- this.getSinleOrderDetail(val.id)
- this.list = []
- // this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
-
- },
-
- handleDelete: function(index, row) {
- const ids = [];
- ids.push(row.id);
- const idStr = ids.join(",");
-
- const params = {
- ids: idStr
- };
-
- this.$confirm("确认删除出库单记录?", "删除出库单记录", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- deleteDrugWarehouseOut(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000
- });
- for (let i = 0; i < ids.length; i++) {
- for (let y = 0; y < this.warehouseOutDate.length; y++) {
- if (ids[i] == this.warehouseOutDate[y].id) {
- this.warehouseOutDate.splice(y, 1);
- }
- }
- }
- }
- });
- })
- .catch(() => {});
- },
- changeAllSelected: function(val) {
- if (val) {
- this.$refs.multipleTable.toggleAllSelection();
- } else {
- this.$refs.multipleTable.clearSelection();
- }
- },
- select(selection) {
-
- var ids= []
- for(let i=0;i<selection.length;i++){
- ids.push(selection[i].id)
- }
- this.order_id = ids.join(",")
- this.selectedTableData = selection;
- },
- batchDelete() {
- if (this.selectedTableData.length <= 0) {
- this.$message.error("请选择要删除的记录");
- return;
- }
- const ids = [];
- for (let i = 0; i < this.selectedTableData.length; i++) {
- if(this.selectedTableData[i].is_sys == 0){
- ids.push(this.selectedTableData[i].id);
- }
- }
- const idStr = ids.join(",");
- const params = {
- ids: idStr
- };
- this.$confirm("确认删除出库单记录?", "删除出库单记录", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- deleteDrugWarehouseOut(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000
- });
-
- for (let i = 0; i < ids.length; i++) {
- for (let y = 0; y < this.warehouseOutDate.length; y++) {
- if (ids[i] == this.warehouseOutDate[y].id) {
- this.warehouseOutDate.splice(y, 1);
- }
- }
- }
- }
- });
- })
- .catch(() => {});
- },
-
- jump(id){
-
- this.GetOrderDetailTwo(id)
- this.userList=[]
- this.dialogVisibleTwo = true
- },
-
- GetOrderDetailTwo(order_id) {
- const params = {
- 'id': order_id
- }
- getDrugWarehouseOutUser(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.userList=[]
- var total = 0
-
- for (let i = 0; i < response.data.data.list.length; i++) {
- var obj = response.data.data.list[i]
- obj['is_total'] = 0
- this.userList.push(obj)
- total = total + response.data.data.list[i].count
- }
-
- this.userList.push({
- is_total: 1,
- total: total,
- })
-
-
- }
- })
- },
- merge({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- const _row = this.tempArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- },
- handleSpanTempArr(){
- this.tempArr = []
-
- for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
- if (i === 0) {
- this.tempArr.push(1)
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
- this.tempArr[this.pos] += 1
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1)
- this.pos = i
- }
- }
- }
-
- let sameRowArr = [], sIdx = 0
- this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
- item.index = index
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1
- sameRowArr.push([index])
- }
- }
- })
- this.sameRowArr = sameRowArr
- },
- getDrugAutoMaticList(id,recordTime,warehouse_out_order_number){
- var params = {
- warehous_out_id:id,
- record_time:recordTime,
- warehouse_out_order_number:warehouse_out_order_number,
- }
- getDrugAutoMaticList(params).then(response=>{
- if(response.data.state ==1){
- var list = response.data.data.list
- this.list = list
- var drugConfig = response.data.data.drugConfig
-
- this.drugConfig = drugConfig
- var drugList = response.data.data.drugList
- this.drugList = drugList
- var manulist = response.data.data.manufacturerList
- this.manufacturerList = manulist
- }
- })
- },
- getDrugCount(id){
-
- var count = 0
- for(let i=0;i<this.list.length;i++){
- if(this.list[i].drug_id == id){
- count = this.list[i].Total
- }
- }
- return count
- },
- getRetailPrice(id){
- var price = 0
- for(let i=0;i<this.drugList.length;i++){
- if(id == this.drugList[i].id){
- price = this.drugList[i].retail_price
- }
- }
- return price
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- getInitializtion(){
- getInitializtion().then(response=>{
- if(response.data.state ==1){
- var drugTypeList = response.data.data.drugTypeList
-
- this.drugTypeList = drugTypeList
- }
- })
- },
- getDrugType(id){
- var name = ""
- for(let i=0;i<this.drugTypeList.length;i++){
- if(id == this.drugTypeList[i].value){
- name = this.drugTypeList[i].name
- }
- }
- return name
- },
- getManufacturerName(id){
- var name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(id == this.manufacturerList[i].id){
- name = this.manufacturerList[i].manufacturer_name
- }
- }
- return name
- },
- getDealerName(id){
- var name = ""
- for(let i=0;i<this.dealerList.length;i++){
- if(id == this.dealerList[i].id){
- name = this.dealerList[i].dealer_name
- }
- }
- return name
- },
- getSinleOrderDetail(id){
- var params = {
- id:id,
- }
- getSinleOrderDetail(params).then(response=>{
- if(response.data.state == 1){
- this.tableShow = true
- this.tableList = []
- var list = response.data.data.list
- var outList = response.data.data.outList
- for(let i=0;i<outList.length;i++){
- //如果都是最大单位,把最数量转为最小数量
- if(outList[i].count_unit == outList[i].max_unit){
- outList[i].count = outList[i].min_number * outList[i].count
- }
- }
- this.outList = outList
-
- // console.log("list",list)
- // console.log("outList222",outList)
- this.manufacturerList = response.data.data.manufacturerList
- this.dealerList = response.data.data.dealerList
- for(let i=0;i<list.length;i++){
- if(list[i].batch_number == "0" || list[i].batch_number == 0){
- list[i].batch_number = ""
- }
-
- if(list[i].number == "0" || list[i].number == 0){
- list[i].number = ""
- }
- }
- this.tableList = list
- }
- })
- },
- toDetail(val){
- console.log("val",val)
- var params = {
- warehouse_out_id:val.warehouse_out_id,
- drug_id:val.drug_id,
- record_time:val.sys_record_time,
- }
- this.userList = []
- getAutoDrugDetail(params).then(response=>{
- if(response.data.state == 1){
-
- var total = 0
- for (let i = 0; i < response.data.data.list.length; i++) {
- var obj = response.data.data.list[i]
- obj['is_total'] = 0
- this.userList.push(obj)
- total = this.getTotalCount(response.data.data.list[i].drug_id)
- }
- this.userList.push({
- is_total: 1,
- total: total,
- })
- if(val.is_sys == 1){
- this.drugDialogVisible = true
- }
- if(val.is_sys == 0){
- this.drugDialogVisibleTwo = true
- }
- var userListOne = response.data.data.outList
- console.log("手动出库2232332",userListOne)
- this.userListOne = userListOne
- }
- })
- },
- toPrint(){
- if(this.order_id == 0){
- this.$message.error("请选择出库单")
- }else{
- this.$router.push({path:"/stock/drugStockOutOrderDetailPrint?id="+this.order_id})
- }
- },
-
- getDrugCountList(){
- var params = {
- keyword: this.keywords,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- console.log("paramsw2ww",params)
- getDrugCountList(params).then(response=>{
- if(response.data.state == 1){
- var countlist = response.data.data.countList
- // console.log("入库数据",countlist)
- this.countList = countlist
- var outcountlist = response.data.data.outCountList
- // console.log("出库数据",outcountlist)
- this.outCountList = outcountlist
- var aucountlist = response.data.data.auCountList
- // console.log("自动数据",aucountlist)
- this.autoCountList = aucountlist
- var minCount = response.data.data.minCount
- // console.log("minCount",minCount)
- this.minCount = minCount
- var info = response.data.data.info
- for(let i=0;i<info.length;i++){
- if(info[i].count_unit == info[i].max_unit){
- info[i].count = info[i].count * info[i].min_number
- }
- }
- // console.log("info2222222",info)
- this.drugOutList = info
- }
- })
- },
-
- getCount(drug_id,min_number,max_unit,min_unit){
- var count= 0
- var str = ""
- var min_str = ""
- for(let i=0;i<this.drugOutList.length;i++){
- if(drug_id == this.drugOutList[i].drug_id){
- count += parseInt(this.drugOutList[i].count)
- }
- }
- if(parseInt(count/min_number)!=0){
- str = parseInt(count/min_number)+ max_unit
- }
- if((count%min_number)!=0){
- min_str = count%min_number + min_unit
- }
- return str + min_str
- },
- getTotalCount(drug_id){
- var str = ""
- var min_str = ""
- for(let i=0;i<this.outList.length;i++){
- if(this.outList[i].drug_id == drug_id){
- if(parseInt(this.outList[i].count/this.outList[i].min_number)!=0){
- str = parseInt(this.outList[i].count/this.outList[i].min_number)+ this.outList[i].max_unit
- }
- if((this.outList[i].count%this.outList[i].min_number)!=0){
- min_str = this.outList[i].count%this.outList[i].min_number + this.outList[i].min_unit
- }
- }
- }
- return str + min_str
- },
- getAllPrice(drug_id,price,min_price){
- var strprice = 0
- var minstrprice = 0
- var str = ""
- var min_str = ""
- var total_price = 0
- for(let i=0;i<this.outList.length;i++){
- if(this.outList[i].drug_id == drug_id){
- if(parseInt(this.outList[i].count/this.outList[i].min_number)!=0){
- str = parseInt(this.outList[i].count/this.outList[i].min_number)
- }
- if((this.outList[i].count%this.outList[i].min_number)!=0){
- min_str = this.outList[i].count%this.outList[i].min_number
- }
- }
- }
- strprice = str * price
- minstrprice = min_str * min_price
- // console.log("strprice3",strprice)
- // console.log("minstrprice",minstrprice)
- total_price = strprice + minstrprice
- return total_price
- },
-
- getDrugBatchNumber(id){
-
- var arr= []
- var batchNumber =[]
-
- for(let i=0;i<this.userList.length;i++){
- if(id == this.userList[i].id){
- arr.push(this.userList[i].drugwarehouseoutinfo)
- }
- }
- if(batchNumber.length > 0 ){
- for(let j=0;j<arr.length;j++){
- batchNumber.push(arr[j].batch_number)
- }
- }
- return batchNumber.join(",")
- }
-
- }
- };
- </script>
-
- <style rel="stylesheet/scss" lang="scss">
- .app-container {
- // margin: 20px;
- font-size: 15px;
- .filter-container {
- padding-bottom: 5px;
- }
- .search-component {
- width: 500px;
- .searchBox {
- width: 300px;
- height: 36px;
- line-height: 36px;
- padding-left: 15px;
- border: 1px #dcdfe6 solid;
- border-right: none;
- outline: none;
- float: left;
- border-radius: 6px 0 0 6px;
- font-size: 14px;
- color: #333;
- background: #fff;
- box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
- }
- .searchBtn {
- background-color: #409eff;
- color: #fff;
- font-size: 15px;
- text-align: center;
- height: 36px;
- line-height: 36px;
- float: left;
- outline: none;
- width: 70px;
- border: none;
- border-radius: 0 6px 6px 0;
- font-family: "Microsoft Yahei";
- cursor: pointer;
- }
- }
-
- .amount {
- font-weight: normal;
- padding: 10px 0 0 0;
- color: #606266;
- font-size: 14px;
- span {
- color: #ef2525;
- font-family: "Arial";
- padding: 0 2px;
- }
- }
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
|