123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686 |
- <template>
- <!-- 待出库 -->
- <div>
- <div class="right-button">
- <el-button style="margin-right:6px" type="primary" @click="handlemultiplex" :loading="sureLoading"
- >订单复用</el-button
- >
- </div>
- <div class="common-card">
- <h3>基本信息</h3>
- <el-form
- :model="listForm"
- ref="listform"
- label-width="237px"
- class="grid-form-class"
- >
- <div class="form-body">
- <div class="flex-css">
- <el-form-item label="采购单号" prop="id">
- <div class="content">
- {{ listForm.id }}
- </div>
- </el-form-item>
- <el-form-item label="采购品种" prop="detlCnt">
- <div class="content">
- {{ listForm.detlCnt }}
- </div>
- </el-form-item>
- <el-form-item label="采购总数量" prop="qtySum">
- <div class="content">
- {{ listForm.qtySum }}
- </div>
- </el-form-item>
- </div>
- <div class="flex-css">
- <el-form-item label="总金额" prop="purcAmt">
- <div class="content">
- {{ listForm.purcAmt }}
- </div>
- </el-form-item>
-
- <el-form-item label="来源部门" prop="deptName">
- <div class="content">
- {{ listForm.deptName }}
- </div>
- </el-form-item>
- <el-form-item label="客户名称" prop="branchName">
- <div class="content">
- {{ listForm.branchName }}
- </div>
- </el-form-item>
- </div>
- <div class="flex-css">
-
-
- <el-form-item label="当前状态" prop="stas">
- <div class="content">
- {{ listForm.stas }}
- </div>
- </el-form-item>
- <el-form-item label="采购时间" prop="docmkDate">
- <div class="content">
- {{ listForm.docmkDate }}
- </div>
- </el-form-item>
- <el-form-item label=" " prop="">
- <div class="content">
- <!-- {{ listForm.docmker }} -->
- </div>
- </el-form-item>
- </div>
- </div>
- </el-form>
- </div>
- <div class="common-card" v-show="cShow">
- <h3>手术信息</h3>
- <el-form
- :model="listForm"
- ref="listform"
- label-width="150px"
- class="grid-form-class"
- >
- <div class="form-body">
- <div class="flex-css">
- <el-form-item label="手术名称" prop="oprn">
- <div class="content">
- {{ listForm.oprn }}
- </div>
- </el-form-item>
- <el-form-item label="手术间" prop="oprtRoom">
- <div class="content">
- {{ listForm.oprtRoom }}
- </div>
- </el-form-item>
- </div>
- <div class="flex-css">
- <el-form-item label="主治医生" prop="atddr">
- <div class="content">
- {{ listForm.atddr }}
- </div>
- </el-form-item>
- <el-form-item label="手术日期" prop="oprtTime">
- <div class="content">
- {{ listForm.oprtTime }}
- </div>
- </el-form-item>
- </div>
- </div>
- </el-form>
- </div>
- <div class="common-card">
- <h3>商品明细</h3>
- <el-form :model="listQuery" ref="listQuery" :inline="true" label-width="90px">
- <el-form-item size="mini" label="生产企业" prop="prodEntp" class="long">
- <el-input v-model="listQuery.prodEntp" placeholder="请输入生产企业"></el-input>
- </el-form-item>
- <el-form-item size="mini" label="是否集采" prop="isFas" class="long">
- <el-select v-model="listQuery.isFas" placeholder="请选择是否集采" clearable>
- <el-option
- v-for="item in isFasData"
- :key="item.value"
- :label="item.name"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item size="mini" label="注册证号" prop="regcertno" class="long">
- <el-input v-model="listQuery.regcertno" placeholder="请输入注册证号"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getData()">查询</el-button>
- <el-button @click="reset">重置</el-button>
- </el-form-item>
- </el-form>
- <el-form :model="tableData" ref="tabledata">
- <el-table
- :data="tableData"
- v-loading="loding"
- element-loading-text="加载中..."
- border
- :span-method="handleSpan"
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column fixed type="index" label="序号" width="60" />
- <el-table-column label="耗材编码" prop="prodCode" />
- <el-table-column label="医保编码" prop="hiCode" />
- <el-table-column label="耗材信息" width="300">
- <template slot-scope="scope">
- <mcs-info :info="scope.row"></mcs-info>
- </template>
- </el-table-column>
- <el-table-column label="规格" prop="spec" />
- <el-table-column label="型号" prop="mol" />
- <el-table-column label="材质" prop="matl" />
- <el-table-column label="是否集采" prop="isFas" >
- <template #default="{ row }">
- <span v-if="row.isFas == '0'">否</span>
- <span v-if="row.isFas == '1'">是</span>
- </template>
- </el-table-column>
- <el-table-column label="包装" prop="convrat" width="120px">
- <template #default="{ row }">
- <span>{{row.purcUnt}} ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="采购数量" prop="purcCnt" />
- <el-table-column label="采购价" prop="purcPric" >
- <template #default="{ row }">
- <span>{{row.purcPric}}元/{{row.prcUnt}}</span>
- </template>
- </el-table-column> -->
- <!-- <el-table-column label="单价" prop="purcPric" /> -->
- <el-table-column label="批号" prop="lotNum" width="120">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- :prop="scope.$index + '.lotNum'"
- :rules="[
- {
- required: true,
- message: '请输入',
- trigger: 'blur',
- },
- ]"
- >
- <el-input placeholder="请输入" v-model="scope.row.lotNum" @change="handleEDIT(scope.row,scope.$index)"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="生产日期" prop="manuDate" width="220">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- :prop="scope.$index + '.manuDate'"
- :rules="[
- {
- required: true,
- message: '请选择生产日期',
- trigger: 'change',
- },
- ]"
- >
- <el-date-picker
- style="width: 100%"
- v-model="scope.row.manuDate"
- :picker-options="TimeOption1"
- type="date"
- placeholder="请选择生产日期"
- value-format="yyyy-MM-dd"
- @change="handleEDIT(scope.row,scope.$index)"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="有效期至" width="220" prop="prodExpy">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- :prop="scope.$index + '.prodExpy'"
- :rules="[
- {
- required: true,
- message: '请选择有效期',
- trigger: 'change',
- },
- ]"
- >
- <el-date-picker
- style="width: 100%"
- v-model="scope.row.prodExpy"
- :picker-options="TimeOption"
- type="date"
- placeholder="请选择有效期"
- value-format="yyyy-MM-dd"
- @change="handleEDIT(scope.row,scope.$index)"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="需求数量" prop="purcCnt" />
- <el-table-column label="已出库数量" prop="delvCntYck" width="90px" />
- <el-table-column label="剩余出库量" prop="toDelvCnt" width="90px" />
- <el-table-column label="本次出库数量" prop="delvCnt" width="150">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- :prop="scope.$index + '.delvCnt'"
- :rules="[
- {
- required: true,
- pattern: /^[0-9]\d*$/,
- message: '请输入正整数',
- trigger: 'blur',
- },
- ]"
- >
- <el-input-number v-model="scope.row.delvCnt" controls-position="right" @change="updateNum(scope.row,scope.$index)" :min="0"></el-input-number>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="UDI码" prop="udi" v-if="cShow">
- <!-- <el-table-column label="UDI码" prop="udi"> -->
- <template slot-scope="scope">
- <el-button type="text" @click="handleudi(scope.row,scope.$index)">{{scope.row.delvCnt}}</el-button>
- </template>
- </el-table-column>
- <el-table-column label="报关单" prop="invoFileId" width="200">
- <template slot-scope="scope">
- <yl-upload
- v-if="scope.row.prodSouc=='2'"
- :fileId="scope.row.invoFileId"
- @getUpload="getUpload1"
- urlName="acco"
- :index="scope.$index"
- >
- <template v-slot:dec>只能上传pdf文件</template>
- </yl-upload>
- </template>
- </el-table-column>
- <!-- <el-table-column label="随货单" prop="dyntFileId" width="200">
- <template slot-scope="scope">
- <yl-upload
- :fileId="scope.row.dyntFileId"
- @getUpload="getUpload"
- urlName="acco"
- :index="scope.$index"
- >
- <template v-slot:dec>只能上传pdf文件</template>
- </yl-upload>
- </template>
- </el-table-column> -->
- <el-table-column label="备注" prop="memo" width="120">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- >
- <el-input placeholder="请输入" v-model="scope.row.memo"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column align="center" fixed="right" label="操作" width="120">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.showDeleteButton"
- class="red"
- type="text"
- @click="handleDelete(scope.row, scope.$index)"
- >删除</el-button
- >
- <el-button v-else type="text" @click="handleBatch(scope.row, scope.$index)"
- >添加批次
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <div class="foot-button" style="margin-top: 30px">
- <el-button
- type="primary"
- @click="handleDelivery"
- v-if="listForm.stas === '待出库'"
- >出库</el-button
- >
- <el-button
- type="primary"
- @click="handleDelivery"
- v-if="listForm.stas === '部分出库'"
- >出库</el-button
- >
- <el-button type="info" @click="handleBack" >返 回</el-button>
- </div>
- </div>
- <!-- 选择发票 -->
- <el-dialog title="选择发票" :visible.sync="dialogFa" width="55%">
- <el-form :model="faForm" ref="faForm" :inline="true">
- <el-form-item label="发票信息" prop="billInfo">
- <el-input v-model="faForm.billInfo" placeholder="请输入发票名称"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getFaData('search')">查询</el-button>
- <el-button @click="faReset">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table
- v-loading="faLoading"
- element-loading-text="加载中"
- :data="faData"
- fit
- stripe
- border
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="发票名称" prop="billName" />
- <el-table-column label="开票金额" prop="billAmt" />
- <el-table-column label="发票号码" prop="invoNum" />
- <el-table-column label="开票时间" prop="billDate" />
- <el-table-column label="上传时间" prop="upldDate" />
- <el-table-column fixed="right" label="操作" width="100">
- <template slot-scope="scope">
- <el-button type="primary" plain @click="handleRow(scope.row)">选择</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="faTotal > 0"
- :total="faTotal"
- :page.sync="faForm.current"
- :limit.sync="faForm.size"
- @pagination="getFaData"
- />
- </el-dialog>
- <!-- 选择同行单 -->
- <el-dialog title="选择同行单" :visible.sync="dialogTong" width="55%">
- <el-form :model="tongForm" ref="tongForm" :inline="true">
- <el-form-item label="发票信息" prop="billInfo">
- <el-input v-model="tongForm.billInfo" placeholder="请输入同行单名称"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getTongData('search')">查询</el-button>
- <el-button @click="tongReset()">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table
- v-loading="tongLoading"
- element-loading-text="加载中"
- :data="tongData"
- fit
- stripe
- border
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="票据名称" prop="billName" />
- <el-table-column label="票据金额" prop="billAmt" />
- <el-table-column label="票据单号" prop="invoNum" />
- <el-table-column label="开票时间" prop="billDate" />
- <el-table-column label="上传时间" prop="upldDate" />
- <el-table-column fixed="right" label="操作" width="100">
- <template slot-scope="scope">
- <el-button type="primary" plain @click="handleRowTong(scope.row)"
- >选择</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="tongTotal > 0"
- :total="tongTotal"
- :page.sync="tongForm.current"
- :limit.sync="tongForm.size"
- @pagination="getTongData"
- />
- </el-dialog>
- <!-- UDI码 -->
- <el-dialog
- title="UDI码填写"
- :visible.sync="udidialog"
- width="70%"
- :close-on-click-modal="false"
- :before-close="handleClose"
- >
- <el-form :model="udiData" ref="udiForm">
- <el-table
- element-loading-text="加载中"
- :data="udiData"
- fit
- stripe
- border
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="耗材信息" width="230">
- <template slot-scope="scope">
- <mcs-info :info="scope.row"></mcs-info>
- </template>
- </el-table-column>
- <el-table-column label="规格" prop="spec" />
- <el-table-column label="型号" prop="mol" />
- <el-table-column label="材质" prop="matl" />
- <el-table-column label="是否集采" prop="isFas" >
- <template #default="{ row }">
- <span v-if="row.isFas == '0'">否</span>
- <span v-if="row.isFas == '1'">是</span>
- </template>
- </el-table-column>
- <el-table-column label="批号" prop="lotNum">
- </el-table-column>
- <el-table-column label="生产日期" prop="manuDate">
- </el-table-column>
- <el-table-column label="有效期至" prop="prodExpy">
- </el-table-column>
- <el-table-column label="包装" prop="convrat" width="120px">
- <template #default="{ row }">
- <span>{{row.purcUnt}} ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
- </template>
- </el-table-column>
- <el-table-column label="UDI码" prop="udi" width="150" fixed="right">
- <template slot-scope="scope">
- <el-form-item
- label-width="0"
- class="item"
- :prop="scope.$index + '.udi'"
- :rules="[
- {
- required: true,
- message: '请输入',
- trigger: 'blur',
- },
- ]"
- >
- <el-input placeholder="请输入" v-model="scope.row.udi"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <div class="foot-button" style="margin-top: 30px">
- <el-button
- type="primary"
- @click="clickUdi"
- >确 认</el-button
- >
- </div>
- </el-dialog>
- <!-- 出库单预览 -->
- <el-dialog title="出库单预览" :visible.sync="printVisible" width="70%">
- <div id="printMe">
- <table cellspacing="0" cellpadding="0" border="1" width="100%" class="chuTable">
- <tr height="50px">
- <th :colspan="12" :rowspan="1" style="font-size: 26px; font-weight: 800">
- 送货单
- </th>
- <th :colspan="8" :rowspan="1" style="font-size: 20px">
- NO:<span style="color: red">{{ listForm.id }}</span>
- </th>
- </tr>
- <tr class="hang">
- <th :colspan="2">医院名称:</th>
- <th :colspan="8">
- {{ listForm.branchName }}
- </th>
- <!-- <th>
- 制单人:
- </th>
- <th :colspan="4">
- {{ listForm.docmker }}
- </th> -->
- <th :colspan="2">制单时间:</th>
- <th :colspan="8">
- {{ listForm.docmkDate }}
- </th>
- </tr>
- <tr class="hang">
- <th :colspan="2">出库人:</th>
- <th :colspan="8">
- {{ $store.state.user.username }}
- </th>
- <th :colspan="2">出库日期:</th>
- <th :colspan="8">
- {{ listForm.OutboundDate }}
- </th>
- </tr>
- <tr class="hang">
- <th>序号</th>
- <th>耗材编码</th>
- <th>医保编码</th>
- <th>耗材名称</th>
- <th>商品类别</th>
- <th>规格</th>
- <th>型号</th>
- <th>材质</th>
- <th>生产来源</th>
- <th>注册证号</th>
- <th>生产企业</th>
- <!-- <th>单价</th> -->
- <th>批号</th>
- <th>生产日期</th>
- <th>有效期至</th>
- <!-- <th>UDI码</th> -->
- <th>需求数量</th>
- <th>已出库数量</th>
- <th>剩余出库量</th>
- <th>本次出库数量</th>
-
- </tr>
- <tr v-for="(item, index) in chuList" :key="index" class="hang">
- <td align="center">
- {{ index + 1 }}
- </td>
- <td align="center">
- {{ item.prodCode }}
- </td>
- <td align="center">
- {{ item.hiCode }}
- </td>
- <td align="center">
- {{ item.prodName }}
- </td>
- <td align="center">
- <span v-if="item.mcsType=='0'">普通耗材</span>
- <span v-if="item.mcsType=='1'">高值耗材</span>
- <span v-if="item.mcsType=='2'">试剂</span>
- </td>
- <td align="center">
- {{ item.spec }}
- </td>
- <td align="center">
- {{ item.mol }}
- </td>
- <!-- 材质 -->
- <td align="center">
- {{ item.matl }}
- </td>
- <td align="center">
- <span v-if="item.prodSouc=='1'">国产</span>
- <span v-if="item.prodSouc=='2'">进口</span>
- </td>
- <td align="center">
- {{ item.regcertno }}
- </td>
- <td align="center">
- {{ item.prodEntp }}
- </td>
- <!-- <td align="center">
- {{ item.purcPric }}
- </td> -->
- <td align="center">
- {{ item.lotNum }}
- </td>
- <td align="center">
- {{ item.manuDate }}
- </td>
- <td align="center">
- {{ item.prodExpy }}
- </td>
- <!-- <td align="center">
- {{ item.udi }}
- </td> -->
- <td align="center">
- {{ item.purcCnt }}
- </td>
- <td align="center">
- {{ item.delvCntYck }}
- </td>
- <td align="center">
- {{ item.toDelvCnt }}
- </td>
- <td align="center">
- {{ item.delvCnt }}
- </td>
- </tr>
- <tr class="hang">
- <th align="left" :colspan="6" >合计</th>
- <td :colspan="12" align="left">
- {{ mcsSum }}
- </td>
- <!-- <td align="center"> -->
- <!-- {{ numSum }} -->
- <!-- </td> -->
- </tr>
- <tr class="hang">
- <th :colspan="6" align="left">发货金额(人民币)大写:</th>
- <td :colspan="12">
- {{ mcsSum | toChineseAmount }}
- </td>
- </tr>
- <tr height="50px">
- <th :colspan="6" align="left">备注:</th>
- <td :colspan="12"></td>
- </tr>
- <!-- <tr class="hang">
- <th align="left" :colspan="6">收货人:</th>
- <td :colspan="13"></td>
- </tr> -->
- </table>
- </div>
- <div class="foot-button" style="margin-top: 40px">
- <el-button type="primary" :loading="comfirmLoad" @click="handleConfirm"
- >确认</el-button
- >
- <el-button type="primary" v-print="printObj">打印</el-button>
- </div>
- </el-dialog>
- <!-- 订单复用 mulDialog-->
- <el-dialog
- title="订单复用"
- :visible.sync="mulDialog"
- width="70%"
- >
- <el-table
- element-loading-text="加载中"
- :data="mulData"
- fit
- stripe
- border
- >
- <template slot="empty">
- <img src="@/assets/nopage.png" alt />
- <p>暂无数据</p>
- </template>
- <el-table-column fixed="left" width="45px">
- <template slot-scope="scope">
- <el-radio
- v-model="roleRadio"
- style="margin-left: 10px"
- :label="scope.row.id"
- @change.native="getTemplateRow(scope.$index, scope.row)"
- />
- </template>
- </el-table-column>
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="出库单号" prop="id" />
- <el-table-column label="手术名称" prop="oprn" />
- <el-table-column label="手术日期" prop="oprtTime" />
- <el-table-column label="品总数" prop="detlCnt" >
- </el-table-column>
- <el-table-column label="申领总数" prop="qtySum">
- </el-table-column>
- <el-table-column label="申领金额" prop="purcAmt">
- </el-table-column>
- <el-table-column label="使用数量" prop="prodExpy">
- </el-table-column>
- <el-table-column label="使用金额" prop="" />
- <el-table-column label="客户名称" prop="branchName" />
- <el-table-column label="采购员" prop="docmker" />
- <el-table-column label="采购时间" prop="docmker" />
- </el-table>
- <!--分页-->
- <yl-pagination
- v-show="totalm > 0"
- :total="totalm"
- :page.sync="listQuerym.current"
- :limit.sync="listQuerym.size"
- @pagination="getOutboundData"
- />
- <div class="foot-button" style="margin-top: 30px">
- <el-button
- type="primary"
- @click="clickMul"
- >确 认</el-button
- :loading="fyLoad"
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import ylStep from "@/components/yl-step";
- import ylPagination from "@/components/yl-pagination";
- import ylUpload from "@/components/yl-upload";
- import mcsInfo from "@/views/components/mcs-info.vue";
- import { countNumPrice, getTotalAmount } from "@/utils/utils";
- import moment from "moment";
- import {
- getMcsOrdDck,
- } from "@/api/orderManage-sup/index";
- import {
- getMcsOrdDckDetl,
- saveDelvOrd,
- finishMcsDelvOrd,
- finishDelvOrd,
- getBillPage,
- submitMcsDelvOrd,
- selectDelvOrdCopy,
- } from "@/api/orderManage-sup/index";
- export default {
- components: {
- ylStep,
- ylPagination,
- ylUpload,
- mcsInfo
- },
- data() {
- return {
- roleRadio:"",
- cShow:false,
- pdfSrc: "",
- dialogVisible: false,
- saveLoad: false,
- confirmLoad: false,
- endLoad: false,
- number: [],
- listForm: {
- id: "",
- detlCnt: "",
- orgName: "",
- docmker: "",
- docmkDate: "",
- stas: "",
- deptName:"",
- branchName:"",
- },
- stasOptions: [
- { value: "A", lable: "未受理" },
- { value: "B", lable: "未出库" },
- { value: "R", lable: "被驳回" },
- { value: "C", lable: "已出库" },
- { value: "D", lable: "部分出库" },
- { value: "Y", lable: "已入库" },
- { value: "P", lable: "部分入库" },
- ],
- essdrugOptions: ["非基药", "基药"],
- tableData: [],
- loading: false,
- cellList: [],
- count: null,
- // 选择发票
- dialogFa: false,
- faForm: {
- billType: "invo",
- billInfo: "",
- billName: "",
- current: 1,
- size: 10,
- },
- faLoading: false,
- faData: [],
- faTotal: 0,
- faIndex: "",
- // 选择同行单
- dialogTong: false,
- tongForm: {
- billType: "acco",
- billInfo: "",
- billName: "",
- current: 1,
- size: 10,
- },
- tongLoading: false,
- tongData: [],
- tongTotal: 0,
- tongIndex: "",
- code: "",
- // 出库单预览
- printVisible: false,
- chuList: [],
- // 打印
- printObj: {
- id: "printMe",
- popTitle: "", // 打印配置页上方标题
- extraHead: "", //最上方的头部文字,附加在head标签上的额外标签,使用逗号分隔
- preview: "", // 是否启动预览模式,默认是false(开启预览模式,可以先预览后打印)
- previewTitle: "", // 打印预览的标题(开启预览模式后出现),
- previewPrintBtnLabel: "", // 打印预览的标题的下方按钮文本,点击可进入打印(开启预览模式后出现)
- zIndex: "", // 预览的窗口的z-index,默认是 20002(此值要高一些,这涉及到预览模式是否显示在最上面)
- previewBeforeOpenCallback() {}, //预览窗口打开之前的callback(开启预览模式调用)
- previewOpenCallback() {}, // 预览窗口打开之后的callback(开启预览模式调用)
- beforeOpenCallback: () => {}, // 开启打印前的回调事件
- openCallback() {}, // 调用打印之后的回调事件
- closeCallback() {}, //关闭打印的回调事件(无法确定点击的是确认还是取消)
- url: "",
- standard: "",
- extraCss: "",
- },
- fileIndex:null,
- fileIndex1:null,
- endBtn:false,
- listQuery:{
- prodEntp: "",
- isFas: "",
- regcertno: "",
- },
- isFasData: [
- { value: "1", name: "是" },
- { value: "0", name: "否" },
- ],
- TimeOption: {
- disabledDate(time) {
- return time.getTime() < Date.now();
- },
- },
- TimeOption1: {
- disabledDate(time) {
- return time.getTime() > Date.now();
- },
- },
- udidialog:false,
- mulDialog:false,
- udiData:[],
- mulData:[],
- mcsSum:0,
- purcOrdId:"",
- rowIndex:0,
- listQuerym:
- {
- current: 1,
- size: 10,
- id: "",
- branchName:"",
- docmkDateStart: "",
- docmkDateEnd: "",
- docmkDate: [],
- stas: "",
- spdId:this.$route.query.spdId,
- fyLoad:false,
- }
- };
- },
- created() {
- this.listForm.id = this.$route.query.id;
- // this.listForm.materialId = this.$route.query.materialId;
- this.listForm.detlCnt = this.$route.query.detlCnt;
- this.listForm.qtySum = this.$route.query.qtySum;
- this.listForm.purcAmt = this.$route.query.purcAmt;
- this.listForm.docmker = this.$route.query.docmker;
- this.listForm.stas = this.$route.query.stas;
- this.listForm.docmkDate = this.$route.query.docmkDate;
- this.listForm.OutboundDate = moment(new Date()).format("YYYY-MM-DD HH:mm:ss");
- this.listForm.branchName = this.$route.query.branchName;
- this.listForm.deptName = this.$route.query.deptName;
- this.listForm.oprn = this.$route.query.oprn;
- this.listForm.oprtRoom = this.$route.query.oprtRoom;
- this.listForm.oprtTime = this.$route.query.oprtTime;
- this.listForm.atddr = this.$route.query.atddr;
- if(this.listForm.stas=='部分出库'){
- this.endBtn = true
- }
- if(this.$route.query.purcType=="2"){
- this.cShow = true
- }else{
- this.cShow = false
- }
- // this.stasOptions.forEach((i)=>{
- // if(i.value == this.$route.query.stas){
- // this.listForm.stas = i.lable
- // }
- // })
- // console.log(this.listForm.stas,"listForm.stas")
- },
- computed: {
- numSum: function () {
- return this.chuList
- .map((row) => row.delvCnt)
- .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
- },
- moneySum: function () {
- return this.chuList
- .map((row) => row.price)
- .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
- },
- },
- filters: {
- toChineseAmount(money) {
- var cnNums = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
- var cnIntRadice = ["", "拾", "佰", "仟"];
- var cnIntUnits = ["", "万", "亿", "兆"];
- var cnDecUnits = ["角", "分", "毫", "厘"];
- var cnInteger = "整";
- var cnIntLast = "元";
- var maxNum = 999999999999999.9999;
- var integerNum;
- var decimalNum;
- var chineseStr = "";
- var parts;
- if (money === "") {
- return "";
- }
- money = parseFloat(money);
- if (money >= maxNum) {
- return "";
- }
- if (money === 0) {
- chineseStr = cnNums[0] + cnIntLast + cnInteger;
- return chineseStr;
- }
- money = money.toString();
- if (money.indexOf(".") === -1) {
- integerNum = money;
- decimalNum = "";
- } else {
- parts = money.split(".");
- integerNum = parts[0];
- decimalNum = parts[1].substr(0, 4);
- }
- if (parseInt(integerNum, 10) > 0) {
- var zeroCount = 0;
- var IntLen = integerNum.length;
- for (var i = 0; i < IntLen; i++) {
- var n = integerNum.substr(i, 1);
- var p = IntLen - i - 1;
- var q = p / 4;
- var m = p % 4;
- if (n === "0") {
- zeroCount++;
- } else {
- if (zeroCount > 0) {
- chineseStr += cnNums[0];
- }
- zeroCount = 0;
- chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
- }
- if (m === 0 && zeroCount < 4) {
- chineseStr += cnIntUnits[q];
- }
- }
- chineseStr += cnIntLast;
- }
- if (decimalNum !== "") {
- var decLen = decimalNum.length;
- for (i = 0; i < decLen; i++) {
- n = decimalNum.substr(i, 1);
- if (n !== "0") {
- chineseStr += cnNums[Number(n)] + cnDecUnits[i];
- }
- }
- }
- if (chineseStr === "") {
- chineseStr += cnNums[0] + cnIntLast + cnInteger;
- } else if (decimalNum === "") {
- chineseStr += cnInteger;
- }
- return chineseStr;
- },
- },
- mounted() {
- this.getData();
- },
- methods: {
- getData() {
- this.listLoading = true;
- getMcsOrdDckDetl({ id: this.$route.query.id,
- spdId:this.$route.query.spdId,
- prodEntp:this.listQuery.prodEntp,
- isFas:this.listQuery.isFas,
- regcertno:this.listQuery.regcertno, })
- .then((res) => {
- this.tableData = res.data;
- this.tableData.udiList=[];
- this.chuList = res.data;
- this.listLoading = false;
- this.computeCell(this.tableData);
- this.tableData.forEach((item) => {
- if (!item.delvCnt) {
- // item.delvCnt = 0;
- this.$set(item, "delvCnt", 0);
- }
- item.essdrugType = this.essdrugOptions[item.essdrugType * 1];
- });
- // 将待出库数量放入number数组
- // this.number = this.tableData.map((i)=>{
- // return i.toDelvCnt
- // })
- })
- .catch((err) => {
- this.listLoading = false;
- });
- },
- // 出库数量变更
- updateNum(row, index) {
- // const aa = this.tableData.findIndex((item) => item.id === row.id);
- // if(this.number[aa]){
- // this.shanchu2(row,aa);
- // }else{
- // this.shanchu(row);
- // }
- this.shanchu3(row);
- this.numOrPriceChange(index, row);
- this.tableData[index].udiList=[];
- },
- numOrPriceChange(index, row) {
- this.$set(
- this.tableData[index],
- "price",
- getTotalAmount(row.delvCnt, row.purcPric)
- );
- this.amount = countNumPrice(this.tableData);
- },
- //获取出库数量和
- numAll(row) {
- let num = 0;
- this.tableData.forEach((item) => {
- if (item.prodCode == row.prodCode) {
- num += item.delvCnt;
- }
- });
- return num;
- },
- //公共函数
- shanchu(row) {
- this.tableData.forEach(async (item) => {
- await this.numAll(row);
- if (item.id == row.id) {
- if (this.numAll(row) > item.purcCnt) {
- this.$message.info("出库数量不能大于订货数");
- row.delvCnt = 0;
- item.toDelvCnt = item.purcCnt - this.numAll(row);
- return;
- }
- item.toDelvCnt = item.purcCnt - this.numAll(row);
- }
- let choose = this.tableData;
- this.tableData = choose;
- });
- },
- shanchu2(row, index) {
- this.tableData.forEach(async (item) => {
- await this.numAll(row);
- if (item.id == row.id) {
- if (this.numAll(row) > this.number[index]) {
- this.$message.info("出库数量不能大于待出库数量");
- row.delvCnt = 0;
- row.toDelvCnt = this.number[index];
- item.toDelvCnt = this.number[index] - this.numAll(row);
- return;
- }
- item.toDelvCnt = this.number[index] - this.numAll(row);
- }
- let choose = this.tableData;
- this.tableData = choose;
- });
- },
- shanchu3(row) {
- this.tableData.forEach(async (item) => {
- await this.numAll(row);
- if (item.prodCode == row.prodCode) {
- if (this.numAll(row) > item.toDelvCnt) {
- this.$message.warning("出库数量不能大于待出库数量");
- row.delvCnt = 0;
- row.price = 0;
- return;
- }
- }
- let choose = this.tableData;
- this.tableData = choose;
- });
- },
- // 预览文件
- dataURLtoBlob(e) {
- let bstr = atob(e);
- let n = bstr.length;
- let u8arr = new Uint8Array(n);
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n);
- } //确定解析格式
- let blob = new Blob([u8arr], { type: "application/pdf;chartset=UTF-8" });
- let url = window.URL.createObjectURL(blob);
- return url;
- },
- // 添加批次
- handleBatch(row, index) {
- let list = {
- prodCode:row.prodCode,
- regcertno:row.regcertno,
- delvCnt: "",
- delvCntYck:row.delvCntYck,
- docmkDate:row.docmkDate,
- docmker:row.docmker,
- essdrugType:row.essdrugType,
- prodEntp: row.prodEntp,
- materialId: row.materialId,
- prodName: row.prodName,
- hiCode:row.hiCode,
- mol: row.mol,
- matl: row.matl,
- memo:row.memo,
- mcsType:row.mcsType,
- purcPric: row.purcPric,
- purcAmt: row.purcAmt,
- purcCnt: row.purcCnt,
- prodSouc:row.prodSouc,
- spec: row.spec,
- toDelvCnt: row.toDelvCnt,
- convrat:row.convrat,
- prcUnt:row.prcUnt,
- purcUnt:row.purcUnt,
- invoFileId: "",
- lotNum: "",
- manuDate: "",
- prodExpy: "",
- dyntFileId: "",
- isFas:row.isFas,
- // udiList:[],
- };
- this.tableData.splice(index + 1, 0, list);
- list.showDeleteButton = true;
- this.computeCell(this.tableData);
- // const aa = this.tableData.findIndex((item) => item.id === row.id);
- // this.number.splice(aa+1,0,this.number[aa])
- },
- handleEDIT(row,index){
- this.tableData[index].udiList=[];
- },
- // 筛选合并项
- computeCell(tableData) {
- this.cellList = [];
- this.count = null;
- for (let i = 0; i < tableData.length; i++) {
- if (i == 0) {
- // 先设置第一项
- this.cellList.push(1); // 初为1,若下一项和此项相同,就往cellList数组中追加0
- this.count = 0;
- // console.log("索引", 0, this.count);
- } else {
- // 判断当前项与上项的设备类别是否相同,因为是合并这一列的单元格
- if (tableData[i].prodCode == tableData[i - 1].prodCode) {
- this.cellList[this.count] += 1; // 增加计数
- this.cellList.push(0); // 相等就往cellList数组中追加0
- // console.log("索引", i, this.count);
- } else {
- this.cellList.push(1); // 不等就往cellList数组中追加1
- this.count = i; // 将索引赋值为计数
- // console.log("索引", i, this.count);
- }
- }
- }
- },
- // 合并列
- handleSpan({ row, column, rowIndex, columnIndex }) {
- if (
- columnIndex === 1 ||
- columnIndex === 2 ||
- columnIndex === 3 ||
- columnIndex === 4 ||
- columnIndex === 5 ||
- columnIndex === 6 ||
- columnIndex === 7 ||
- columnIndex === 8 ||
- columnIndex === 12 ||
- columnIndex === 13 ||
- columnIndex === 14
- ) {
- // console.log("单元格数组,若下一项为0,则代表合并上一项", this.cellList);
- const rowCell = this.cellList[rowIndex];
- if (rowCell > 0) {
- const colCell = 1;
- // console.log(`动态竖向合并单元格, 第${colCell}列,竖向合并${rowCell}个单元格 `);
- return {
- rowspan: rowCell,
- colspan: colCell,
- };
- } else {
- // 清除原有的单元格,必须要加,否则就会出现单元格会被横着挤到后面了!!!
- // 本例中数据是写死的不会出现,数据若是动态后端获取的,就会出现了!!!
- return {
- rowspan: 0,
- colspan: 0,
- };
- }
- }
- // if (columnIndex === 2 && rowIndex == 0) {
- // return {
- // rowspan: this.pos,
- // colspan: 1
- // };
- // }else{
- // for(let i=1;i<this.pos;i++){
- // if(rowIndex === this.pos-i && columnIndex == 2){
- // return {
- // rowspan: 0,
- // colspan: 0
- // };
- // }
- // }
- // }
- },
- //删除
- handleDelete(row, i) {
- const index = this.tableData.findIndex((item) => item.prodCode === row.prodCode);
- if (index !== -1) {
- let qwe = this.tableData.findIndex(function (item) {
- return item.prodCode == row.prodCode;
- });
- this.tableData.splice(i, 1);
- this.cellList.splice(i, 1);
- this.cellList[qwe]--;
- }
- row.showDeleteButton = false;
- this.shanchu3(row);
- // if(this.number[index]){
- // this.shanchu2(row,index);
- // }else{
- // this.shanchu(row);
- // }
- // this.number.splice(i,1);
- },
- getUpload1(id,index) {
- this.tableData[index].invoFileId = id
- if (id) {
- this.$refs.tabledata.clearValidate("invoFileId");
- } else {
- this.$refs.tabledata.validateField("invoFileId");
- }
- },
- getUpload(id,index) {
- this.tableData[index].dyntFileId = id
- if (id) {
- this.$refs.tabledata.clearValidate("dyntFileId");
- } else {
- this.$refs.tabledata.validateField("dyntFileId");
- }
- },
-
-
- // 获取发票信息
- getFaData(type) {
- if (type == "search") {
- this.faForm.current = 1;
- }
- this.faLoading = true;
- getBillPage(this.faForm)
- .then((res) => {
- this.faData = res.data.records;
- this.faTotal = res.data.total;
- this.faLoading = false;
- })
- .catch((err) => {
- this.faLoading = false;
- });
- // this.faData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
- // this.faTotal = 1
- },
- faReset() {
- this.$refs.faForm.resetFields();
- this.getFaData();
- },
- // 选择发票
- handleFa(e, row) {
- this.faIndex = e;
- this.dialogFa = true;
- this.getFaData();
- this.code = "";
- this.code = row.id;
- },
- // 选择发票 确认选择
- handleRow(row) {
- this.tableData[this.faIndex].invoFileId = row.fileId;
- // this.tableData.forEach((i)=>{
- // if(i.id == this.code){
- // i.invoFileId = row.fileId
- // }
- // })
- this.computeCell(this.tableData);
- this.dialogFa = false;
- },
- // 获取同行单信息
- getTongData(type) {
- if (type == "search") {
- this.tongForm.current = 1;
- }
- this.tongLoading = true;
- getBillPage(this.tongForm)
- .then((res) => {
- this.tongData = res.data.records;
- this.tongTotal = res.data.total;
- this.tongLoading = false;
- })
- .catch((err) => {
- this.tongLoading = false;
- });
- // this.tongData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
- // this.tongTotal = 1
- },
- tongReset() {
- this.$refs.tongForm.resetFields();
- this.getTongData();
- },
- // 填写UDI码
- handleudi(row,index){
- if(row.lotNum && row.manuDate && row.prodExpy && row.delvCnt){
- this.rowIndex = index;
- if(!this.tableData[index].udiList || this.tableData[index].udiList.length==0 || this.tableData[index].udiList.length!==row.delvCnt || this.tableData[index].lotNum!==this.tableData[index].udiList[0].lotNum){
- let udiObj={
- ...row,
- udi:"",
- }
- const n = row.delvCnt;
- const copiedObjects = Array.from({ length: n }, () => ({ ...udiObj }));
- this.tableData[index].udiList = copiedObjects;
-
- }
- this.$nextTick(()=>{
- this.udidialog = true;
- this.udiData = this.tableData[index].udiList
- })
- }else{
- this.$message.warning("先填写必填信息,再填写UDI码")
- }
-
- },
- // 去冲
- handleClose(){
- this.udiData.forEach((v)=>{
- if(v.udi){
- let udicf = this.udif(this.udiData);
- if (udicf == true) {
- this.$message({
- message: "同一产品的udi码不能重复",
- type: "error",
- });
- throw new Error("同一产品的udi码不能重复");
- }else{
- this.udidialog = false
- }
- }else{
- this.udidialog = false
- }
- })
-
- },
-
- // 确定UDI
- clickUdi(){
- this.$refs.udiForm.validate((valid) => {
- if (valid) {
- let udicf = this.udif(this.udiData);
- if (udicf == true) {
- this.$message({
- message: "同一产品的udi码不能重复",
- type: "info",
- });
- throw new Error("同一产品的udi码不能重复");
- }
- this.$confirm("确认提交udi码", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
-
- this.tableData[this.rowIndex].udiList = this.udiData
- this.udidialog = false;
- });
- } else {
- this.$message({
- type: "warning",
- message: "请填写必填项信息",
- });
- }
- });
- },
- // 判断一个数组对象的属性是否有重复
- pf(arr) {
- for (let i = 0; i < arr.length - 1; i++) {
- for (let j = i + 1; j < arr.length; j++) {
- console.log(arr[i].prodCode, arr[j].prodCode);
- if (arr[i].prodCode == arr[j].prodCode) {
- var set = new Set(); //创建个集合Set对象(用object对象也可以)
- return arr.some(function (v, i) {
- //遍历 arr数组,当返回值为true时提前退出遍历。
- var f = set.has(v.lotNum); //判断每个对象里number属性的值是否在集合Set
- set.add(v.lotNum); //将number属性的值添加到集合Set中
- return f;
- });
- } else {
- console.log("else");
- }
- }
- }
- },
- udif(arr) {
- for (let i = 0; i < arr.length - 1; i++) {
- for (let j = i + 1; j < arr.length; j++) {
- console.log(arr[i].prodCode, arr[j].prodCode);
- if (arr[i].prodCode == arr[j].prodCode) {
- var set = new Set(); //创建个集合Set对象(用object对象也可以)
- return arr.some(function (v, i) {
- //遍历 arr数组,当返回值为true时提前退出遍历。
- var f = set.has(v.udi); //判断每个对象里number属性的值是否在集合Set
- set.add(v.udi); //将number属性的值添加到集合Set中
- return f;
- });
- } else {
- console.log("else");
- }
- }
- }
- },
- // 选择同行单
- handleTong(e, row) {
- this.tongIndex = e;
- this.dialogTong = true;
- this.getTongData();
- this.code = "";
- this.code = row.id;
- },
- // 选择同行单 确认选择
- handleRowTong(row) {
- // this.tableData[this.tongIndex].dyntFileId = row.fileId;
- this.tableData.forEach((i) => {
- if (i.id == this.code) {
- i.dyntFileId = row.fileId;
- }
- });
- this.computeCell(this.tableData);
- this.dialogTong = false;
- },
- // 出库
- handleDelivery() {
- let lotnum = this.pf(this.tableData);
- if (lotnum == true) {
- this.$message({
- message: "同一产品的批号不能重复",
- type: "info",
- });
- throw new Error("同一产品的批号不能重复");
- }
- this.tableData.forEach((item) => {
- if (item.delvCnt=='0') {
- this.$message({
- message: "本次出库数量必须大于0",
- type: "warning",
- });
- throw new Error("本次出库数量必须大于0");
- }
- if (item.prodSouc=="2" && !item.invoFileId) {
- this.$message({
- // message: "请填写相应信息,并选择报关单和随货单",
- message: "请填写相应信息,并选择报关单",
- type: "warning",
- });
- throw new Error("请填写相应信息,并选择报关单");
- }
- if(this.cShow==true &&( !item.udiList|| item.udiList.length==0)){
- this.$message.warning("请填写udi再提交")
- throw new Error("请填写udi再提交");
- }
- item.udiList.forEach((v,index)=>{
- if(v.udi==""||v.udi==null){
- this.$message.warning("请填写udi再提交")
- throw new Error("请填写udi再提交");
- }
- })
- });
-
- this.$refs.tabledata.validate((valid) => {
- if (valid) {
- this.$confirm("确认出库", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.mcsSum = 0;
- this.tableData.forEach((item) => {
- let rowSum = 0;
- rowSum = item.purcPric*item.convrat*item.delvCnt;
- this.mcsSum+=rowSum
- })
- this.mcsSum = (this.mcsSum).toFixed(4)
- this.printVisible = true;
- });
- } else {
- this.$message({
- type: "warning",
- message: "请填写必填项信息",
- });
- }
- });
- },
- // 出库确认
- handleConfirm() {
- this.$confirm("确认出库", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let data2 = {
- delvOrdId: "",
- purcOrdId: this.$route.query.id,
- detlList: this.tableData,
- deptId: this.$route.query.deptId,
- spdId: this.$route.query.spdId,
- deptName: this.$route.query.deptName,
- };
- submitMcsDelvOrd(data2)
- .then((res) => {
- this.printVisible = false;
- this.$message.success("出库成功")
- this.$router.push({
- name: "purOrderDelivery",
- query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
- });
- })
- .catch((err) => {
- // this.$message.error("出库失败")
- // this.confirmLoadLoad = false;
- });
- });
- },
- // 保存
- handleSave() {
- let data = this.tableData.map((i) => {
- return {
- drugListId: i.drugListId,
- delvCnt: i.delvCnt,
- lotNum: i.lotNum,
- manuDate: i.manuDate,
- prodExpy: i.prodExpy,
- invoFileId: i.invoFileId,
- dyntFileId: i.dyntFileId,
- };
- });
- let data2 = {
- delvOrdId: "",
- purcOrdId: this.$route.query.id,
- detlList: data,
- };
- this.saveLoad = true;
- saveDelvOrd(data2)
- .then((res) => {
- this.saveLoad = false;
- })
- .catch((err) => {
- this.saveLoad = false;
- });
- },
- // 订单复用
- handlemultiplex(){
- this.mulDialog = true;
- this.getOutboundData()
- this.roleRadio = "";
- this.purcOrdId = "";
-
- },
- // 复用查询
- getOutboundData() {
- getMcsOrdDck(this.listQuerym)
- .then((res) => {
- this.mulData = res.data.records;
- this.totalm = res.data.total;
- })
- .catch((err) => {
- });
- },
- // 返回
- handleBack(){
- this.$router.push({
- name: "purOrderDelivery",
- query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
- });
- },
- // 重置
- reset(){
- this.$refs.listQuery.resetFields();
- this.getData()
- },
- // 复用单选
- getTemplateRow(index, row) {
- this.purcOrdId = row.id;
- },
- // 复用确认
- clickMul(){
- if(!this.purcOrdId){
- this.$message.warning("请选择要复用的订单")
- }else{
- this.$confirm("确认复用该订单", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- selectDelvOrdCopy({delvOrdId:this.listForm.id,purcOrdId:this.purcOrdId}).then((res)=>{
- this.fyLoad = true;
- if(res.success==true){
- this.$message.success("操作成功")
- this.mulDialog = false;
- this.fyLoad = false;
- this.purcOrdId = "";
- }else{
- // this.$message.error("操作失败")
- this.$message(res.message)
- this.fyLoad = false;
- this.purcOrdId="";
- }
- }).catch((err)=>{
- // this.$message(res.message)
- this.fyLoad = false;
- this.purcOrdId="";
- })
- })
- }
- },
-
- },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-table__body tr.hover-row > td {
- background-color: transparent !important;
- }
- ::v-deep .el-table {
- th.el-table__cell.is-leaf,
- td.el-table__cell {
- border-bottom: 1px solid #eee;
- }
- }
- ::v-deep .dd .el-dialog {
- height: 90%;
- margin-top: 30px !important;
- }
- ::v-deep .dd .el-dialog__body {
- height: 90%;
- padding: 0 25px 0px;
- }
- .chuTable {
- color: #000;
- }
- .hang {
- height: 30px;
- }
- </style>
|