deliveryDetail.vue 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686
  1. <template>
  2. <!-- 待出库 -->
  3. <div>
  4. <div class="right-button">
  5. <el-button style="margin-right:6px" type="primary" @click="handlemultiplex" :loading="sureLoading"
  6. >订单复用</el-button
  7. >
  8. </div>
  9. <div class="common-card">
  10. <h3>基本信息</h3>
  11. <el-form
  12. :model="listForm"
  13. ref="listform"
  14. label-width="237px"
  15. class="grid-form-class"
  16. >
  17. <div class="form-body">
  18. <div class="flex-css">
  19. <el-form-item label="采购单号" prop="id">
  20. <div class="content">
  21. {{ listForm.id }}
  22. </div>
  23. </el-form-item>
  24. <el-form-item label="采购品种" prop="detlCnt">
  25. <div class="content">
  26. {{ listForm.detlCnt }}
  27. </div>
  28. </el-form-item>
  29. <el-form-item label="采购总数量" prop="qtySum">
  30. <div class="content">
  31. {{ listForm.qtySum }}
  32. </div>
  33. </el-form-item>
  34. </div>
  35. <div class="flex-css">
  36. <el-form-item label="总金额" prop="purcAmt">
  37. <div class="content">
  38. {{ listForm.purcAmt }}
  39. </div>
  40. </el-form-item>
  41. <el-form-item label="来源部门" prop="deptName">
  42. <div class="content">
  43. {{ listForm.deptName }}
  44. </div>
  45. </el-form-item>
  46. <el-form-item label="客户名称" prop="branchName">
  47. <div class="content">
  48. {{ listForm.branchName }}
  49. </div>
  50. </el-form-item>
  51. </div>
  52. <div class="flex-css">
  53. <el-form-item label="当前状态" prop="stas">
  54. <div class="content">
  55. {{ listForm.stas }}
  56. </div>
  57. </el-form-item>
  58. <el-form-item label="采购时间" prop="docmkDate">
  59. <div class="content">
  60. {{ listForm.docmkDate }}
  61. </div>
  62. </el-form-item>
  63. <el-form-item label=" " prop="">
  64. <div class="content">
  65. <!-- {{ listForm.docmker }} -->
  66. </div>
  67. </el-form-item>
  68. </div>
  69. </div>
  70. </el-form>
  71. </div>
  72. <div class="common-card" v-show="cShow">
  73. <h3>手术信息</h3>
  74. <el-form
  75. :model="listForm"
  76. ref="listform"
  77. label-width="150px"
  78. class="grid-form-class"
  79. >
  80. <div class="form-body">
  81. <div class="flex-css">
  82. <el-form-item label="手术名称" prop="oprn">
  83. <div class="content">
  84. {{ listForm.oprn }}
  85. </div>
  86. </el-form-item>
  87. <el-form-item label="手术间" prop="oprtRoom">
  88. <div class="content">
  89. {{ listForm.oprtRoom }}
  90. </div>
  91. </el-form-item>
  92. </div>
  93. <div class="flex-css">
  94. <el-form-item label="主治医生" prop="atddr">
  95. <div class="content">
  96. {{ listForm.atddr }}
  97. </div>
  98. </el-form-item>
  99. <el-form-item label="手术日期" prop="oprtTime">
  100. <div class="content">
  101. {{ listForm.oprtTime }}
  102. </div>
  103. </el-form-item>
  104. </div>
  105. </div>
  106. </el-form>
  107. </div>
  108. <div class="common-card">
  109. <h3>商品明细</h3>
  110. <el-form :model="listQuery" ref="listQuery" :inline="true" label-width="90px">
  111. <el-form-item size="mini" label="生产企业" prop="prodEntp" class="long">
  112. <el-input v-model="listQuery.prodEntp" placeholder="请输入生产企业"></el-input>
  113. </el-form-item>
  114. <el-form-item size="mini" label="是否集采" prop="isFas" class="long">
  115. <el-select v-model="listQuery.isFas" placeholder="请选择是否集采" clearable>
  116. <el-option
  117. v-for="item in isFasData"
  118. :key="item.value"
  119. :label="item.name"
  120. :value="item.value"
  121. ></el-option>
  122. </el-select>
  123. </el-form-item>
  124. <el-form-item size="mini" label="注册证号" prop="regcertno" class="long">
  125. <el-input v-model="listQuery.regcertno" placeholder="请输入注册证号"></el-input>
  126. </el-form-item>
  127. <el-form-item>
  128. <el-button type="primary" @click="getData()">查询</el-button>
  129. <el-button @click="reset">重置</el-button>
  130. </el-form-item>
  131. </el-form>
  132. <el-form :model="tableData" ref="tabledata">
  133. <el-table
  134. :data="tableData"
  135. v-loading="loding"
  136. element-loading-text="加载中..."
  137. border
  138. :span-method="handleSpan"
  139. >
  140. <template slot="empty">
  141. <img src="@/assets/nopage.png" alt />
  142. <p>暂无数据</p>
  143. </template>
  144. <el-table-column fixed type="index" label="序号" width="60" />
  145. <el-table-column label="耗材编码" prop="prodCode" />
  146. <el-table-column label="医保编码" prop="hiCode" />
  147. <el-table-column label="耗材信息" width="300">
  148. <template slot-scope="scope">
  149. <mcs-info :info="scope.row"></mcs-info>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="规格" prop="spec" />
  153. <el-table-column label="型号" prop="mol" />
  154. <el-table-column label="材质" prop="matl" />
  155. <el-table-column label="是否集采" prop="isFas" >
  156. <template #default="{ row }">
  157. <span v-if="row.isFas == '0'">否</span>
  158. <span v-if="row.isFas == '1'">是</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="包装" prop="convrat" width="120px">
  162. <template #default="{ row }">
  163. <span>{{row.purcUnt}} ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
  164. </template>
  165. </el-table-column>
  166. <!-- <el-table-column label="采购数量" prop="purcCnt" />
  167. <el-table-column label="采购价" prop="purcPric" >
  168. <template #default="{ row }">
  169. <span>{{row.purcPric}}元/{{row.prcUnt}}</span>
  170. </template>
  171. </el-table-column> -->
  172. <!-- <el-table-column label="单价" prop="purcPric" /> -->
  173. <el-table-column label="批号" prop="lotNum" width="120">
  174. <template slot-scope="scope">
  175. <el-form-item
  176. label-width="0"
  177. class="item"
  178. :prop="scope.$index + '.lotNum'"
  179. :rules="[
  180. {
  181. required: true,
  182. message: '请输入',
  183. trigger: 'blur',
  184. },
  185. ]"
  186. >
  187. <el-input placeholder="请输入" v-model="scope.row.lotNum" @change="handleEDIT(scope.row,scope.$index)"></el-input>
  188. </el-form-item>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="生产日期" prop="manuDate" width="220">
  192. <template slot-scope="scope">
  193. <el-form-item
  194. label-width="0"
  195. class="item"
  196. :prop="scope.$index + '.manuDate'"
  197. :rules="[
  198. {
  199. required: true,
  200. message: '请选择生产日期',
  201. trigger: 'change',
  202. },
  203. ]"
  204. >
  205. <el-date-picker
  206. style="width: 100%"
  207. v-model="scope.row.manuDate"
  208. :picker-options="TimeOption1"
  209. type="date"
  210. placeholder="请选择生产日期"
  211. value-format="yyyy-MM-dd"
  212. @change="handleEDIT(scope.row,scope.$index)"
  213. />
  214. </el-form-item>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="有效期至" width="220" prop="prodExpy">
  218. <template slot-scope="scope">
  219. <el-form-item
  220. label-width="0"
  221. class="item"
  222. :prop="scope.$index + '.prodExpy'"
  223. :rules="[
  224. {
  225. required: true,
  226. message: '请选择有效期',
  227. trigger: 'change',
  228. },
  229. ]"
  230. >
  231. <el-date-picker
  232. style="width: 100%"
  233. v-model="scope.row.prodExpy"
  234. :picker-options="TimeOption"
  235. type="date"
  236. placeholder="请选择有效期"
  237. value-format="yyyy-MM-dd"
  238. @change="handleEDIT(scope.row,scope.$index)"
  239. />
  240. </el-form-item>
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="需求数量" prop="purcCnt" />
  244. <el-table-column label="已出库数量" prop="delvCntYck" width="90px" />
  245. <el-table-column label="剩余出库量" prop="toDelvCnt" width="90px" />
  246. <el-table-column label="本次出库数量" prop="delvCnt" width="150">
  247. <template slot-scope="scope">
  248. <el-form-item
  249. label-width="0"
  250. class="item"
  251. :prop="scope.$index + '.delvCnt'"
  252. :rules="[
  253. {
  254. required: true,
  255. pattern: /^[0-9]\d*$/,
  256. message: '请输入正整数',
  257. trigger: 'blur',
  258. },
  259. ]"
  260. >
  261. <el-input-number v-model="scope.row.delvCnt" controls-position="right" @change="updateNum(scope.row,scope.$index)" :min="0"></el-input-number>
  262. </el-form-item>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="UDI码" prop="udi" v-if="cShow">
  266. <!-- <el-table-column label="UDI码" prop="udi"> -->
  267. <template slot-scope="scope">
  268. <el-button type="text" @click="handleudi(scope.row,scope.$index)">{{scope.row.delvCnt}}</el-button>
  269. </template>
  270. </el-table-column>
  271. <el-table-column label="报关单" prop="invoFileId" width="200">
  272. <template slot-scope="scope">
  273. <yl-upload
  274. v-if="scope.row.prodSouc=='2'"
  275. :fileId="scope.row.invoFileId"
  276. @getUpload="getUpload1"
  277. urlName="acco"
  278. :index="scope.$index"
  279. >
  280. <template v-slot:dec>只能上传pdf文件</template>
  281. </yl-upload>
  282. </template>
  283. </el-table-column>
  284. <!-- <el-table-column label="随货单" prop="dyntFileId" width="200">
  285. <template slot-scope="scope">
  286. <yl-upload
  287. :fileId="scope.row.dyntFileId"
  288. @getUpload="getUpload"
  289. urlName="acco"
  290. :index="scope.$index"
  291. >
  292. <template v-slot:dec>只能上传pdf文件</template>
  293. </yl-upload>
  294. </template>
  295. </el-table-column> -->
  296. <el-table-column label="备注" prop="memo" width="120">
  297. <template slot-scope="scope">
  298. <el-form-item
  299. label-width="0"
  300. class="item"
  301. >
  302. <el-input placeholder="请输入" v-model="scope.row.memo"></el-input>
  303. </el-form-item>
  304. </template>
  305. </el-table-column>
  306. <el-table-column align="center" fixed="right" label="操作" width="120">
  307. <template slot-scope="scope">
  308. <el-button
  309. v-if="scope.row.showDeleteButton"
  310. class="red"
  311. type="text"
  312. @click="handleDelete(scope.row, scope.$index)"
  313. >删除</el-button
  314. >
  315. <el-button v-else type="text" @click="handleBatch(scope.row, scope.$index)"
  316. >添加批次
  317. </el-button>
  318. </template>
  319. </el-table-column>
  320. </el-table>
  321. </el-form>
  322. <div class="foot-button" style="margin-top: 30px">
  323. <el-button
  324. type="primary"
  325. @click="handleDelivery"
  326. v-if="listForm.stas === '待出库'"
  327. >出库</el-button
  328. >
  329. <el-button
  330. type="primary"
  331. @click="handleDelivery"
  332. v-if="listForm.stas === '部分出库'"
  333. >出库</el-button
  334. >
  335. <el-button type="info" @click="handleBack" >返 回</el-button>
  336. </div>
  337. </div>
  338. <!-- 选择发票 -->
  339. <el-dialog title="选择发票" :visible.sync="dialogFa" width="55%">
  340. <el-form :model="faForm" ref="faForm" :inline="true">
  341. <el-form-item label="发票信息" prop="billInfo">
  342. <el-input v-model="faForm.billInfo" placeholder="请输入发票名称"></el-input>
  343. </el-form-item>
  344. <el-form-item>
  345. <el-button type="primary" @click="getFaData('search')">查询</el-button>
  346. <el-button @click="faReset">重置</el-button>
  347. </el-form-item>
  348. </el-form>
  349. <el-table
  350. v-loading="faLoading"
  351. element-loading-text="加载中"
  352. :data="faData"
  353. fit
  354. stripe
  355. border
  356. >
  357. <template slot="empty">
  358. <img src="@/assets/nopage.png" alt />
  359. <p>暂无数据</p>
  360. </template>
  361. <el-table-column type="index" label="序号" width="60" />
  362. <el-table-column label="发票名称" prop="billName" />
  363. <el-table-column label="开票金额" prop="billAmt" />
  364. <el-table-column label="发票号码" prop="invoNum" />
  365. <el-table-column label="开票时间" prop="billDate" />
  366. <el-table-column label="上传时间" prop="upldDate" />
  367. <el-table-column fixed="right" label="操作" width="100">
  368. <template slot-scope="scope">
  369. <el-button type="primary" plain @click="handleRow(scope.row)">选择</el-button>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. <!--分页-->
  374. <yl-pagination
  375. v-show="faTotal > 0"
  376. :total="faTotal"
  377. :page.sync="faForm.current"
  378. :limit.sync="faForm.size"
  379. @pagination="getFaData"
  380. />
  381. </el-dialog>
  382. <!-- 选择同行单 -->
  383. <el-dialog title="选择同行单" :visible.sync="dialogTong" width="55%">
  384. <el-form :model="tongForm" ref="tongForm" :inline="true">
  385. <el-form-item label="发票信息" prop="billInfo">
  386. <el-input v-model="tongForm.billInfo" placeholder="请输入同行单名称"></el-input>
  387. </el-form-item>
  388. <el-form-item>
  389. <el-button type="primary" @click="getTongData('search')">查询</el-button>
  390. <el-button @click="tongReset()">重置</el-button>
  391. </el-form-item>
  392. </el-form>
  393. <el-table
  394. v-loading="tongLoading"
  395. element-loading-text="加载中"
  396. :data="tongData"
  397. fit
  398. stripe
  399. border
  400. >
  401. <template slot="empty">
  402. <img src="@/assets/nopage.png" alt />
  403. <p>暂无数据</p>
  404. </template>
  405. <el-table-column type="index" label="序号" width="60" />
  406. <el-table-column label="票据名称" prop="billName" />
  407. <el-table-column label="票据金额" prop="billAmt" />
  408. <el-table-column label="票据单号" prop="invoNum" />
  409. <el-table-column label="开票时间" prop="billDate" />
  410. <el-table-column label="上传时间" prop="upldDate" />
  411. <el-table-column fixed="right" label="操作" width="100">
  412. <template slot-scope="scope">
  413. <el-button type="primary" plain @click="handleRowTong(scope.row)"
  414. >选择</el-button
  415. >
  416. </template>
  417. </el-table-column>
  418. </el-table>
  419. <!--分页-->
  420. <yl-pagination
  421. v-show="tongTotal > 0"
  422. :total="tongTotal"
  423. :page.sync="tongForm.current"
  424. :limit.sync="tongForm.size"
  425. @pagination="getTongData"
  426. />
  427. </el-dialog>
  428. <!-- UDI码 -->
  429. <el-dialog
  430. title="UDI码填写"
  431. :visible.sync="udidialog"
  432. width="70%"
  433. :close-on-click-modal="false"
  434. :before-close="handleClose"
  435. >
  436. <el-form :model="udiData" ref="udiForm">
  437. <el-table
  438. element-loading-text="加载中"
  439. :data="udiData"
  440. fit
  441. stripe
  442. border
  443. >
  444. <template slot="empty">
  445. <img src="@/assets/nopage.png" alt />
  446. <p>暂无数据</p>
  447. </template>
  448. <el-table-column type="index" label="序号" width="60" />
  449. <el-table-column label="耗材信息" width="230">
  450. <template slot-scope="scope">
  451. <mcs-info :info="scope.row"></mcs-info>
  452. </template>
  453. </el-table-column>
  454. <el-table-column label="规格" prop="spec" />
  455. <el-table-column label="型号" prop="mol" />
  456. <el-table-column label="材质" prop="matl" />
  457. <el-table-column label="是否集采" prop="isFas" >
  458. <template #default="{ row }">
  459. <span v-if="row.isFas == '0'">否</span>
  460. <span v-if="row.isFas == '1'">是</span>
  461. </template>
  462. </el-table-column>
  463. <el-table-column label="批号" prop="lotNum">
  464. </el-table-column>
  465. <el-table-column label="生产日期" prop="manuDate">
  466. </el-table-column>
  467. <el-table-column label="有效期至" prop="prodExpy">
  468. </el-table-column>
  469. <el-table-column label="包装" prop="convrat" width="120px">
  470. <template #default="{ row }">
  471. <span>{{row.purcUnt}} ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
  472. </template>
  473. </el-table-column>
  474. <el-table-column label="UDI码" prop="udi" width="150" fixed="right">
  475. <template slot-scope="scope">
  476. <el-form-item
  477. label-width="0"
  478. class="item"
  479. :prop="scope.$index + '.udi'"
  480. :rules="[
  481. {
  482. required: true,
  483. message: '请输入',
  484. trigger: 'blur',
  485. },
  486. ]"
  487. >
  488. <el-input placeholder="请输入" v-model="scope.row.udi"></el-input>
  489. </el-form-item>
  490. </template>
  491. </el-table-column>
  492. </el-table>
  493. </el-form>
  494. <div class="foot-button" style="margin-top: 30px">
  495. <el-button
  496. type="primary"
  497. @click="clickUdi"
  498. >确 认</el-button
  499. >
  500. </div>
  501. </el-dialog>
  502. <!-- 出库单预览 -->
  503. <el-dialog title="出库单预览" :visible.sync="printVisible" width="70%">
  504. <div id="printMe">
  505. <table cellspacing="0" cellpadding="0" border="1" width="100%" class="chuTable">
  506. <tr height="50px">
  507. <th :colspan="12" :rowspan="1" style="font-size: 26px; font-weight: 800">
  508. 送货单
  509. </th>
  510. <th :colspan="8" :rowspan="1" style="font-size: 20px">
  511. NO:<span style="color: red">{{ listForm.id }}</span>
  512. </th>
  513. </tr>
  514. <tr class="hang">
  515. <th :colspan="2">医院名称:</th>
  516. <th :colspan="8">
  517. {{ listForm.branchName }}
  518. </th>
  519. <!-- <th>
  520. 制单人:
  521. </th>
  522. <th :colspan="4">
  523. {{ listForm.docmker }}
  524. </th> -->
  525. <th :colspan="2">制单时间:</th>
  526. <th :colspan="8">
  527. {{ listForm.docmkDate }}
  528. </th>
  529. </tr>
  530. <tr class="hang">
  531. <th :colspan="2">出库人:</th>
  532. <th :colspan="8">
  533. {{ $store.state.user.username }}
  534. </th>
  535. <th :colspan="2">出库日期:</th>
  536. <th :colspan="8">
  537. {{ listForm.OutboundDate }}
  538. </th>
  539. </tr>
  540. <tr class="hang">
  541. <th>序号</th>
  542. <th>耗材编码</th>
  543. <th>医保编码</th>
  544. <th>耗材名称</th>
  545. <th>商品类别</th>
  546. <th>规格</th>
  547. <th>型号</th>
  548. <th>材质</th>
  549. <th>生产来源</th>
  550. <th>注册证号</th>
  551. <th>生产企业</th>
  552. <!-- <th>单价</th> -->
  553. <th>批号</th>
  554. <th>生产日期</th>
  555. <th>有效期至</th>
  556. <!-- <th>UDI码</th> -->
  557. <th>需求数量</th>
  558. <th>已出库数量</th>
  559. <th>剩余出库量</th>
  560. <th>本次出库数量</th>
  561. </tr>
  562. <tr v-for="(item, index) in chuList" :key="index" class="hang">
  563. <td align="center">
  564. {{ index + 1 }}
  565. </td>
  566. <td align="center">
  567. {{ item.prodCode }}
  568. </td>
  569. <td align="center">
  570. {{ item.hiCode }}
  571. </td>
  572. <td align="center">
  573. {{ item.prodName }}
  574. </td>
  575. <td align="center">
  576. <span v-if="item.mcsType=='0'">普通耗材</span>
  577. <span v-if="item.mcsType=='1'">高值耗材</span>
  578. <span v-if="item.mcsType=='2'">试剂</span>
  579. </td>
  580. <td align="center">
  581. {{ item.spec }}
  582. </td>
  583. <td align="center">
  584. {{ item.mol }}
  585. </td>
  586. <!-- 材质 -->
  587. <td align="center">
  588. {{ item.matl }}
  589. </td>
  590. <td align="center">
  591. <span v-if="item.prodSouc=='1'">国产</span>
  592. <span v-if="item.prodSouc=='2'">进口</span>
  593. </td>
  594. <td align="center">
  595. {{ item.regcertno }}
  596. </td>
  597. <td align="center">
  598. {{ item.prodEntp }}
  599. </td>
  600. <!-- <td align="center">
  601. {{ item.purcPric }}
  602. </td> -->
  603. <td align="center">
  604. {{ item.lotNum }}
  605. </td>
  606. <td align="center">
  607. {{ item.manuDate }}
  608. </td>
  609. <td align="center">
  610. {{ item.prodExpy }}
  611. </td>
  612. <!-- <td align="center">
  613. {{ item.udi }}
  614. </td> -->
  615. <td align="center">
  616. {{ item.purcCnt }}
  617. </td>
  618. <td align="center">
  619. {{ item.delvCntYck }}
  620. </td>
  621. <td align="center">
  622. {{ item.toDelvCnt }}
  623. </td>
  624. <td align="center">
  625. {{ item.delvCnt }}
  626. </td>
  627. </tr>
  628. <tr class="hang">
  629. <th align="left" :colspan="6" >合计</th>
  630. <td :colspan="12" align="left">
  631. {{ mcsSum }}
  632. </td>
  633. <!-- <td align="center"> -->
  634. <!-- {{ numSum }} -->
  635. <!-- </td> -->
  636. </tr>
  637. <tr class="hang">
  638. <th :colspan="6" align="left">发货金额(人民币)大写:</th>
  639. <td :colspan="12">
  640. {{ mcsSum | toChineseAmount }}
  641. </td>
  642. </tr>
  643. <tr height="50px">
  644. <th :colspan="6" align="left">备注:</th>
  645. <td :colspan="12"></td>
  646. </tr>
  647. <!-- <tr class="hang">
  648. <th align="left" :colspan="6">收货人:</th>
  649. <td :colspan="13"></td>
  650. </tr> -->
  651. </table>
  652. </div>
  653. <div class="foot-button" style="margin-top: 40px">
  654. <el-button type="primary" :loading="comfirmLoad" @click="handleConfirm"
  655. >确认</el-button
  656. >
  657. <el-button type="primary" v-print="printObj">打印</el-button>
  658. </div>
  659. </el-dialog>
  660. <!-- 订单复用 mulDialog-->
  661. <el-dialog
  662. title="订单复用"
  663. :visible.sync="mulDialog"
  664. width="70%"
  665. >
  666. <el-table
  667. element-loading-text="加载中"
  668. :data="mulData"
  669. fit
  670. stripe
  671. border
  672. >
  673. <template slot="empty">
  674. <img src="@/assets/nopage.png" alt />
  675. <p>暂无数据</p>
  676. </template>
  677. <el-table-column fixed="left" width="45px">
  678. <template slot-scope="scope">
  679. <el-radio
  680. v-model="roleRadio"
  681. style="margin-left: 10px"
  682. :label="scope.row.id"
  683. @change.native="getTemplateRow(scope.$index, scope.row)"
  684. />
  685. </template>
  686. </el-table-column>
  687. <el-table-column type="index" label="序号" width="60" />
  688. <el-table-column label="出库单号" prop="id" />
  689. <el-table-column label="手术名称" prop="oprn" />
  690. <el-table-column label="手术日期" prop="oprtTime" />
  691. <el-table-column label="品总数" prop="detlCnt" >
  692. </el-table-column>
  693. <el-table-column label="申领总数" prop="qtySum">
  694. </el-table-column>
  695. <el-table-column label="申领金额" prop="purcAmt">
  696. </el-table-column>
  697. <el-table-column label="使用数量" prop="prodExpy">
  698. </el-table-column>
  699. <el-table-column label="使用金额" prop="" />
  700. <el-table-column label="客户名称" prop="branchName" />
  701. <el-table-column label="采购员" prop="docmker" />
  702. <el-table-column label="采购时间" prop="docmker" />
  703. </el-table>
  704. <!--分页-->
  705. <yl-pagination
  706. v-show="totalm > 0"
  707. :total="totalm"
  708. :page.sync="listQuerym.current"
  709. :limit.sync="listQuerym.size"
  710. @pagination="getOutboundData"
  711. />
  712. <div class="foot-button" style="margin-top: 30px">
  713. <el-button
  714. type="primary"
  715. @click="clickMul"
  716. >确 认</el-button
  717. :loading="fyLoad"
  718. >
  719. </div>
  720. </el-dialog>
  721. </div>
  722. </template>
  723. <script>
  724. import ylStep from "@/components/yl-step";
  725. import ylPagination from "@/components/yl-pagination";
  726. import ylUpload from "@/components/yl-upload";
  727. import mcsInfo from "@/views/components/mcs-info.vue";
  728. import { countNumPrice, getTotalAmount } from "@/utils/utils";
  729. import moment from "moment";
  730. import {
  731. getMcsOrdDck,
  732. } from "@/api/orderManage-sup/index";
  733. import {
  734. getMcsOrdDckDetl,
  735. saveDelvOrd,
  736. finishMcsDelvOrd,
  737. finishDelvOrd,
  738. getBillPage,
  739. submitMcsDelvOrd,
  740. selectDelvOrdCopy,
  741. } from "@/api/orderManage-sup/index";
  742. export default {
  743. components: {
  744. ylStep,
  745. ylPagination,
  746. ylUpload,
  747. mcsInfo
  748. },
  749. data() {
  750. return {
  751. roleRadio:"",
  752. cShow:false,
  753. pdfSrc: "",
  754. dialogVisible: false,
  755. saveLoad: false,
  756. confirmLoad: false,
  757. endLoad: false,
  758. number: [],
  759. listForm: {
  760. id: "",
  761. detlCnt: "",
  762. orgName: "",
  763. docmker: "",
  764. docmkDate: "",
  765. stas: "",
  766. deptName:"",
  767. branchName:"",
  768. },
  769. stasOptions: [
  770. { value: "A", lable: "未受理" },
  771. { value: "B", lable: "未出库" },
  772. { value: "R", lable: "被驳回" },
  773. { value: "C", lable: "已出库" },
  774. { value: "D", lable: "部分出库" },
  775. { value: "Y", lable: "已入库" },
  776. { value: "P", lable: "部分入库" },
  777. ],
  778. essdrugOptions: ["非基药", "基药"],
  779. tableData: [],
  780. loading: false,
  781. cellList: [],
  782. count: null,
  783. // 选择发票
  784. dialogFa: false,
  785. faForm: {
  786. billType: "invo",
  787. billInfo: "",
  788. billName: "",
  789. current: 1,
  790. size: 10,
  791. },
  792. faLoading: false,
  793. faData: [],
  794. faTotal: 0,
  795. faIndex: "",
  796. // 选择同行单
  797. dialogTong: false,
  798. tongForm: {
  799. billType: "acco",
  800. billInfo: "",
  801. billName: "",
  802. current: 1,
  803. size: 10,
  804. },
  805. tongLoading: false,
  806. tongData: [],
  807. tongTotal: 0,
  808. tongIndex: "",
  809. code: "",
  810. // 出库单预览
  811. printVisible: false,
  812. chuList: [],
  813. // 打印
  814. printObj: {
  815. id: "printMe",
  816. popTitle: "", // 打印配置页上方标题
  817. extraHead: "", //最上方的头部文字,附加在head标签上的额外标签,使用逗号分隔
  818. preview: "", // 是否启动预览模式,默认是false(开启预览模式,可以先预览后打印)
  819. previewTitle: "", // 打印预览的标题(开启预览模式后出现),
  820. previewPrintBtnLabel: "", // 打印预览的标题的下方按钮文本,点击可进入打印(开启预览模式后出现)
  821. zIndex: "", // 预览的窗口的z-index,默认是 20002(此值要高一些,这涉及到预览模式是否显示在最上面)
  822. previewBeforeOpenCallback() {}, //预览窗口打开之前的callback(开启预览模式调用)
  823. previewOpenCallback() {}, // 预览窗口打开之后的callback(开启预览模式调用)
  824. beforeOpenCallback: () => {}, // 开启打印前的回调事件
  825. openCallback() {}, // 调用打印之后的回调事件
  826. closeCallback() {}, //关闭打印的回调事件(无法确定点击的是确认还是取消)
  827. url: "",
  828. standard: "",
  829. extraCss: "",
  830. },
  831. fileIndex:null,
  832. fileIndex1:null,
  833. endBtn:false,
  834. listQuery:{
  835. prodEntp: "",
  836. isFas: "",
  837. regcertno: "",
  838. },
  839. isFasData: [
  840. { value: "1", name: "是" },
  841. { value: "0", name: "否" },
  842. ],
  843. TimeOption: {
  844. disabledDate(time) {
  845. return time.getTime() < Date.now();
  846. },
  847. },
  848. TimeOption1: {
  849. disabledDate(time) {
  850. return time.getTime() > Date.now();
  851. },
  852. },
  853. udidialog:false,
  854. mulDialog:false,
  855. udiData:[],
  856. mulData:[],
  857. mcsSum:0,
  858. purcOrdId:"",
  859. rowIndex:0,
  860. listQuerym:
  861. {
  862. current: 1,
  863. size: 10,
  864. id: "",
  865. branchName:"",
  866. docmkDateStart: "",
  867. docmkDateEnd: "",
  868. docmkDate: [],
  869. stas: "",
  870. spdId:this.$route.query.spdId,
  871. fyLoad:false,
  872. }
  873. };
  874. },
  875. created() {
  876. this.listForm.id = this.$route.query.id;
  877. // this.listForm.materialId = this.$route.query.materialId;
  878. this.listForm.detlCnt = this.$route.query.detlCnt;
  879. this.listForm.qtySum = this.$route.query.qtySum;
  880. this.listForm.purcAmt = this.$route.query.purcAmt;
  881. this.listForm.docmker = this.$route.query.docmker;
  882. this.listForm.stas = this.$route.query.stas;
  883. this.listForm.docmkDate = this.$route.query.docmkDate;
  884. this.listForm.OutboundDate = moment(new Date()).format("YYYY-MM-DD HH:mm:ss");
  885. this.listForm.branchName = this.$route.query.branchName;
  886. this.listForm.deptName = this.$route.query.deptName;
  887. this.listForm.oprn = this.$route.query.oprn;
  888. this.listForm.oprtRoom = this.$route.query.oprtRoom;
  889. this.listForm.oprtTime = this.$route.query.oprtTime;
  890. this.listForm.atddr = this.$route.query.atddr;
  891. if(this.listForm.stas=='部分出库'){
  892. this.endBtn = true
  893. }
  894. if(this.$route.query.purcType=="2"){
  895. this.cShow = true
  896. }else{
  897. this.cShow = false
  898. }
  899. // this.stasOptions.forEach((i)=>{
  900. // if(i.value == this.$route.query.stas){
  901. // this.listForm.stas = i.lable
  902. // }
  903. // })
  904. // console.log(this.listForm.stas,"listForm.stas")
  905. },
  906. computed: {
  907. numSum: function () {
  908. return this.chuList
  909. .map((row) => row.delvCnt)
  910. .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
  911. },
  912. moneySum: function () {
  913. return this.chuList
  914. .map((row) => row.price)
  915. .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
  916. },
  917. },
  918. filters: {
  919. toChineseAmount(money) {
  920. var cnNums = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
  921. var cnIntRadice = ["", "拾", "佰", "仟"];
  922. var cnIntUnits = ["", "万", "亿", "兆"];
  923. var cnDecUnits = ["角", "分", "毫", "厘"];
  924. var cnInteger = "整";
  925. var cnIntLast = "元";
  926. var maxNum = 999999999999999.9999;
  927. var integerNum;
  928. var decimalNum;
  929. var chineseStr = "";
  930. var parts;
  931. if (money === "") {
  932. return "";
  933. }
  934. money = parseFloat(money);
  935. if (money >= maxNum) {
  936. return "";
  937. }
  938. if (money === 0) {
  939. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  940. return chineseStr;
  941. }
  942. money = money.toString();
  943. if (money.indexOf(".") === -1) {
  944. integerNum = money;
  945. decimalNum = "";
  946. } else {
  947. parts = money.split(".");
  948. integerNum = parts[0];
  949. decimalNum = parts[1].substr(0, 4);
  950. }
  951. if (parseInt(integerNum, 10) > 0) {
  952. var zeroCount = 0;
  953. var IntLen = integerNum.length;
  954. for (var i = 0; i < IntLen; i++) {
  955. var n = integerNum.substr(i, 1);
  956. var p = IntLen - i - 1;
  957. var q = p / 4;
  958. var m = p % 4;
  959. if (n === "0") {
  960. zeroCount++;
  961. } else {
  962. if (zeroCount > 0) {
  963. chineseStr += cnNums[0];
  964. }
  965. zeroCount = 0;
  966. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  967. }
  968. if (m === 0 && zeroCount < 4) {
  969. chineseStr += cnIntUnits[q];
  970. }
  971. }
  972. chineseStr += cnIntLast;
  973. }
  974. if (decimalNum !== "") {
  975. var decLen = decimalNum.length;
  976. for (i = 0; i < decLen; i++) {
  977. n = decimalNum.substr(i, 1);
  978. if (n !== "0") {
  979. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  980. }
  981. }
  982. }
  983. if (chineseStr === "") {
  984. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  985. } else if (decimalNum === "") {
  986. chineseStr += cnInteger;
  987. }
  988. return chineseStr;
  989. },
  990. },
  991. mounted() {
  992. this.getData();
  993. },
  994. methods: {
  995. getData() {
  996. this.listLoading = true;
  997. getMcsOrdDckDetl({ id: this.$route.query.id,
  998. spdId:this.$route.query.spdId,
  999. prodEntp:this.listQuery.prodEntp,
  1000. isFas:this.listQuery.isFas,
  1001. regcertno:this.listQuery.regcertno, })
  1002. .then((res) => {
  1003. this.tableData = res.data;
  1004. this.tableData.udiList=[];
  1005. this.chuList = res.data;
  1006. this.listLoading = false;
  1007. this.computeCell(this.tableData);
  1008. this.tableData.forEach((item) => {
  1009. if (!item.delvCnt) {
  1010. // item.delvCnt = 0;
  1011. this.$set(item, "delvCnt", 0);
  1012. }
  1013. item.essdrugType = this.essdrugOptions[item.essdrugType * 1];
  1014. });
  1015. // 将待出库数量放入number数组
  1016. // this.number = this.tableData.map((i)=>{
  1017. // return i.toDelvCnt
  1018. // })
  1019. })
  1020. .catch((err) => {
  1021. this.listLoading = false;
  1022. });
  1023. },
  1024. // 出库数量变更
  1025. updateNum(row, index) {
  1026. // const aa = this.tableData.findIndex((item) => item.id === row.id);
  1027. // if(this.number[aa]){
  1028. // this.shanchu2(row,aa);
  1029. // }else{
  1030. // this.shanchu(row);
  1031. // }
  1032. this.shanchu3(row);
  1033. this.numOrPriceChange(index, row);
  1034. this.tableData[index].udiList=[];
  1035. },
  1036. numOrPriceChange(index, row) {
  1037. this.$set(
  1038. this.tableData[index],
  1039. "price",
  1040. getTotalAmount(row.delvCnt, row.purcPric)
  1041. );
  1042. this.amount = countNumPrice(this.tableData);
  1043. },
  1044. //获取出库数量和
  1045. numAll(row) {
  1046. let num = 0;
  1047. this.tableData.forEach((item) => {
  1048. if (item.prodCode == row.prodCode) {
  1049. num += item.delvCnt;
  1050. }
  1051. });
  1052. return num;
  1053. },
  1054. //公共函数
  1055. shanchu(row) {
  1056. this.tableData.forEach(async (item) => {
  1057. await this.numAll(row);
  1058. if (item.id == row.id) {
  1059. if (this.numAll(row) > item.purcCnt) {
  1060. this.$message.info("出库数量不能大于订货数");
  1061. row.delvCnt = 0;
  1062. item.toDelvCnt = item.purcCnt - this.numAll(row);
  1063. return;
  1064. }
  1065. item.toDelvCnt = item.purcCnt - this.numAll(row);
  1066. }
  1067. let choose = this.tableData;
  1068. this.tableData = choose;
  1069. });
  1070. },
  1071. shanchu2(row, index) {
  1072. this.tableData.forEach(async (item) => {
  1073. await this.numAll(row);
  1074. if (item.id == row.id) {
  1075. if (this.numAll(row) > this.number[index]) {
  1076. this.$message.info("出库数量不能大于待出库数量");
  1077. row.delvCnt = 0;
  1078. row.toDelvCnt = this.number[index];
  1079. item.toDelvCnt = this.number[index] - this.numAll(row);
  1080. return;
  1081. }
  1082. item.toDelvCnt = this.number[index] - this.numAll(row);
  1083. }
  1084. let choose = this.tableData;
  1085. this.tableData = choose;
  1086. });
  1087. },
  1088. shanchu3(row) {
  1089. this.tableData.forEach(async (item) => {
  1090. await this.numAll(row);
  1091. if (item.prodCode == row.prodCode) {
  1092. if (this.numAll(row) > item.toDelvCnt) {
  1093. this.$message.warning("出库数量不能大于待出库数量");
  1094. row.delvCnt = 0;
  1095. row.price = 0;
  1096. return;
  1097. }
  1098. }
  1099. let choose = this.tableData;
  1100. this.tableData = choose;
  1101. });
  1102. },
  1103. // 预览文件
  1104. dataURLtoBlob(e) {
  1105. let bstr = atob(e);
  1106. let n = bstr.length;
  1107. let u8arr = new Uint8Array(n);
  1108. while (n--) {
  1109. u8arr[n] = bstr.charCodeAt(n);
  1110. } //确定解析格式
  1111. let blob = new Blob([u8arr], { type: "application/pdf;chartset=UTF-8" });
  1112. let url = window.URL.createObjectURL(blob);
  1113. return url;
  1114. },
  1115. // 添加批次
  1116. handleBatch(row, index) {
  1117. let list = {
  1118. prodCode:row.prodCode,
  1119. regcertno:row.regcertno,
  1120. delvCnt: "",
  1121. delvCntYck:row.delvCntYck,
  1122. docmkDate:row.docmkDate,
  1123. docmker:row.docmker,
  1124. essdrugType:row.essdrugType,
  1125. prodEntp: row.prodEntp,
  1126. materialId: row.materialId,
  1127. prodName: row.prodName,
  1128. hiCode:row.hiCode,
  1129. mol: row.mol,
  1130. matl: row.matl,
  1131. memo:row.memo,
  1132. mcsType:row.mcsType,
  1133. purcPric: row.purcPric,
  1134. purcAmt: row.purcAmt,
  1135. purcCnt: row.purcCnt,
  1136. prodSouc:row.prodSouc,
  1137. spec: row.spec,
  1138. toDelvCnt: row.toDelvCnt,
  1139. convrat:row.convrat,
  1140. prcUnt:row.prcUnt,
  1141. purcUnt:row.purcUnt,
  1142. invoFileId: "",
  1143. lotNum: "",
  1144. manuDate: "",
  1145. prodExpy: "",
  1146. dyntFileId: "",
  1147. isFas:row.isFas,
  1148. // udiList:[],
  1149. };
  1150. this.tableData.splice(index + 1, 0, list);
  1151. list.showDeleteButton = true;
  1152. this.computeCell(this.tableData);
  1153. // const aa = this.tableData.findIndex((item) => item.id === row.id);
  1154. // this.number.splice(aa+1,0,this.number[aa])
  1155. },
  1156. handleEDIT(row,index){
  1157. this.tableData[index].udiList=[];
  1158. },
  1159. // 筛选合并项
  1160. computeCell(tableData) {
  1161. this.cellList = [];
  1162. this.count = null;
  1163. for (let i = 0; i < tableData.length; i++) {
  1164. if (i == 0) {
  1165. // 先设置第一项
  1166. this.cellList.push(1); // 初为1,若下一项和此项相同,就往cellList数组中追加0
  1167. this.count = 0;
  1168. // console.log("索引", 0, this.count);
  1169. } else {
  1170. // 判断当前项与上项的设备类别是否相同,因为是合并这一列的单元格
  1171. if (tableData[i].prodCode == tableData[i - 1].prodCode) {
  1172. this.cellList[this.count] += 1; // 增加计数
  1173. this.cellList.push(0); // 相等就往cellList数组中追加0
  1174. // console.log("索引", i, this.count);
  1175. } else {
  1176. this.cellList.push(1); // 不等就往cellList数组中追加1
  1177. this.count = i; // 将索引赋值为计数
  1178. // console.log("索引", i, this.count);
  1179. }
  1180. }
  1181. }
  1182. },
  1183. // 合并列
  1184. handleSpan({ row, column, rowIndex, columnIndex }) {
  1185. if (
  1186. columnIndex === 1 ||
  1187. columnIndex === 2 ||
  1188. columnIndex === 3 ||
  1189. columnIndex === 4 ||
  1190. columnIndex === 5 ||
  1191. columnIndex === 6 ||
  1192. columnIndex === 7 ||
  1193. columnIndex === 8 ||
  1194. columnIndex === 12 ||
  1195. columnIndex === 13 ||
  1196. columnIndex === 14
  1197. ) {
  1198. // console.log("单元格数组,若下一项为0,则代表合并上一项", this.cellList);
  1199. const rowCell = this.cellList[rowIndex];
  1200. if (rowCell > 0) {
  1201. const colCell = 1;
  1202. // console.log(`动态竖向合并单元格, 第${colCell}列,竖向合并${rowCell}个单元格 `);
  1203. return {
  1204. rowspan: rowCell,
  1205. colspan: colCell,
  1206. };
  1207. } else {
  1208. // 清除原有的单元格,必须要加,否则就会出现单元格会被横着挤到后面了!!!
  1209. // 本例中数据是写死的不会出现,数据若是动态后端获取的,就会出现了!!!
  1210. return {
  1211. rowspan: 0,
  1212. colspan: 0,
  1213. };
  1214. }
  1215. }
  1216. // if (columnIndex === 2 && rowIndex == 0) {
  1217. // return {
  1218. // rowspan: this.pos,
  1219. // colspan: 1
  1220. // };
  1221. // }else{
  1222. // for(let i=1;i<this.pos;i++){
  1223. // if(rowIndex === this.pos-i && columnIndex == 2){
  1224. // return {
  1225. // rowspan: 0,
  1226. // colspan: 0
  1227. // };
  1228. // }
  1229. // }
  1230. // }
  1231. },
  1232. //删除
  1233. handleDelete(row, i) {
  1234. const index = this.tableData.findIndex((item) => item.prodCode === row.prodCode);
  1235. if (index !== -1) {
  1236. let qwe = this.tableData.findIndex(function (item) {
  1237. return item.prodCode == row.prodCode;
  1238. });
  1239. this.tableData.splice(i, 1);
  1240. this.cellList.splice(i, 1);
  1241. this.cellList[qwe]--;
  1242. }
  1243. row.showDeleteButton = false;
  1244. this.shanchu3(row);
  1245. // if(this.number[index]){
  1246. // this.shanchu2(row,index);
  1247. // }else{
  1248. // this.shanchu(row);
  1249. // }
  1250. // this.number.splice(i,1);
  1251. },
  1252. getUpload1(id,index) {
  1253. this.tableData[index].invoFileId = id
  1254. if (id) {
  1255. this.$refs.tabledata.clearValidate("invoFileId");
  1256. } else {
  1257. this.$refs.tabledata.validateField("invoFileId");
  1258. }
  1259. },
  1260. getUpload(id,index) {
  1261. this.tableData[index].dyntFileId = id
  1262. if (id) {
  1263. this.$refs.tabledata.clearValidate("dyntFileId");
  1264. } else {
  1265. this.$refs.tabledata.validateField("dyntFileId");
  1266. }
  1267. },
  1268. // 获取发票信息
  1269. getFaData(type) {
  1270. if (type == "search") {
  1271. this.faForm.current = 1;
  1272. }
  1273. this.faLoading = true;
  1274. getBillPage(this.faForm)
  1275. .then((res) => {
  1276. this.faData = res.data.records;
  1277. this.faTotal = res.data.total;
  1278. this.faLoading = false;
  1279. })
  1280. .catch((err) => {
  1281. this.faLoading = false;
  1282. });
  1283. // this.faData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
  1284. // this.faTotal = 1
  1285. },
  1286. faReset() {
  1287. this.$refs.faForm.resetFields();
  1288. this.getFaData();
  1289. },
  1290. // 选择发票
  1291. handleFa(e, row) {
  1292. this.faIndex = e;
  1293. this.dialogFa = true;
  1294. this.getFaData();
  1295. this.code = "";
  1296. this.code = row.id;
  1297. },
  1298. // 选择发票 确认选择
  1299. handleRow(row) {
  1300. this.tableData[this.faIndex].invoFileId = row.fileId;
  1301. // this.tableData.forEach((i)=>{
  1302. // if(i.id == this.code){
  1303. // i.invoFileId = row.fileId
  1304. // }
  1305. // })
  1306. this.computeCell(this.tableData);
  1307. this.dialogFa = false;
  1308. },
  1309. // 获取同行单信息
  1310. getTongData(type) {
  1311. if (type == "search") {
  1312. this.tongForm.current = 1;
  1313. }
  1314. this.tongLoading = true;
  1315. getBillPage(this.tongForm)
  1316. .then((res) => {
  1317. this.tongData = res.data.records;
  1318. this.tongTotal = res.data.total;
  1319. this.tongLoading = false;
  1320. })
  1321. .catch((err) => {
  1322. this.tongLoading = false;
  1323. });
  1324. // this.tongData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
  1325. // this.tongTotal = 1
  1326. },
  1327. tongReset() {
  1328. this.$refs.tongForm.resetFields();
  1329. this.getTongData();
  1330. },
  1331. // 填写UDI码
  1332. handleudi(row,index){
  1333. if(row.lotNum && row.manuDate && row.prodExpy && row.delvCnt){
  1334. this.rowIndex = index;
  1335. 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){
  1336. let udiObj={
  1337. ...row,
  1338. udi:"",
  1339. }
  1340. const n = row.delvCnt;
  1341. const copiedObjects = Array.from({ length: n }, () => ({ ...udiObj }));
  1342. this.tableData[index].udiList = copiedObjects;
  1343. }
  1344. this.$nextTick(()=>{
  1345. this.udidialog = true;
  1346. this.udiData = this.tableData[index].udiList
  1347. })
  1348. }else{
  1349. this.$message.warning("先填写必填信息,再填写UDI码")
  1350. }
  1351. },
  1352. // 去冲
  1353. handleClose(){
  1354. this.udiData.forEach((v)=>{
  1355. if(v.udi){
  1356. let udicf = this.udif(this.udiData);
  1357. if (udicf == true) {
  1358. this.$message({
  1359. message: "同一产品的udi码不能重复",
  1360. type: "error",
  1361. });
  1362. throw new Error("同一产品的udi码不能重复");
  1363. }else{
  1364. this.udidialog = false
  1365. }
  1366. }else{
  1367. this.udidialog = false
  1368. }
  1369. })
  1370. },
  1371. // 确定UDI
  1372. clickUdi(){
  1373. this.$refs.udiForm.validate((valid) => {
  1374. if (valid) {
  1375. let udicf = this.udif(this.udiData);
  1376. if (udicf == true) {
  1377. this.$message({
  1378. message: "同一产品的udi码不能重复",
  1379. type: "info",
  1380. });
  1381. throw new Error("同一产品的udi码不能重复");
  1382. }
  1383. this.$confirm("确认提交udi码", "提示", {
  1384. confirmButtonText: "确定",
  1385. cancelButtonText: "取消",
  1386. type: "warning",
  1387. }).then(() => {
  1388. this.tableData[this.rowIndex].udiList = this.udiData
  1389. this.udidialog = false;
  1390. });
  1391. } else {
  1392. this.$message({
  1393. type: "warning",
  1394. message: "请填写必填项信息",
  1395. });
  1396. }
  1397. });
  1398. },
  1399. // 判断一个数组对象的属性是否有重复
  1400. pf(arr) {
  1401. for (let i = 0; i < arr.length - 1; i++) {
  1402. for (let j = i + 1; j < arr.length; j++) {
  1403. console.log(arr[i].prodCode, arr[j].prodCode);
  1404. if (arr[i].prodCode == arr[j].prodCode) {
  1405. var set = new Set(); //创建个集合Set对象(用object对象也可以)
  1406. return arr.some(function (v, i) {
  1407. //遍历 arr数组,当返回值为true时提前退出遍历。
  1408. var f = set.has(v.lotNum); //判断每个对象里number属性的值是否在集合Set
  1409. set.add(v.lotNum); //将number属性的值添加到集合Set中
  1410. return f;
  1411. });
  1412. } else {
  1413. console.log("else");
  1414. }
  1415. }
  1416. }
  1417. },
  1418. udif(arr) {
  1419. for (let i = 0; i < arr.length - 1; i++) {
  1420. for (let j = i + 1; j < arr.length; j++) {
  1421. console.log(arr[i].prodCode, arr[j].prodCode);
  1422. if (arr[i].prodCode == arr[j].prodCode) {
  1423. var set = new Set(); //创建个集合Set对象(用object对象也可以)
  1424. return arr.some(function (v, i) {
  1425. //遍历 arr数组,当返回值为true时提前退出遍历。
  1426. var f = set.has(v.udi); //判断每个对象里number属性的值是否在集合Set
  1427. set.add(v.udi); //将number属性的值添加到集合Set中
  1428. return f;
  1429. });
  1430. } else {
  1431. console.log("else");
  1432. }
  1433. }
  1434. }
  1435. },
  1436. // 选择同行单
  1437. handleTong(e, row) {
  1438. this.tongIndex = e;
  1439. this.dialogTong = true;
  1440. this.getTongData();
  1441. this.code = "";
  1442. this.code = row.id;
  1443. },
  1444. // 选择同行单 确认选择
  1445. handleRowTong(row) {
  1446. // this.tableData[this.tongIndex].dyntFileId = row.fileId;
  1447. this.tableData.forEach((i) => {
  1448. if (i.id == this.code) {
  1449. i.dyntFileId = row.fileId;
  1450. }
  1451. });
  1452. this.computeCell(this.tableData);
  1453. this.dialogTong = false;
  1454. },
  1455. // 出库
  1456. handleDelivery() {
  1457. let lotnum = this.pf(this.tableData);
  1458. if (lotnum == true) {
  1459. this.$message({
  1460. message: "同一产品的批号不能重复",
  1461. type: "info",
  1462. });
  1463. throw new Error("同一产品的批号不能重复");
  1464. }
  1465. this.tableData.forEach((item) => {
  1466. if (item.delvCnt=='0') {
  1467. this.$message({
  1468. message: "本次出库数量必须大于0",
  1469. type: "warning",
  1470. });
  1471. throw new Error("本次出库数量必须大于0");
  1472. }
  1473. if (item.prodSouc=="2" && !item.invoFileId) {
  1474. this.$message({
  1475. // message: "请填写相应信息,并选择报关单和随货单",
  1476. message: "请填写相应信息,并选择报关单",
  1477. type: "warning",
  1478. });
  1479. throw new Error("请填写相应信息,并选择报关单");
  1480. }
  1481. if(this.cShow==true &&( !item.udiList|| item.udiList.length==0)){
  1482. this.$message.warning("请填写udi再提交")
  1483. throw new Error("请填写udi再提交");
  1484. }
  1485. item.udiList.forEach((v,index)=>{
  1486. if(v.udi==""||v.udi==null){
  1487. this.$message.warning("请填写udi再提交")
  1488. throw new Error("请填写udi再提交");
  1489. }
  1490. })
  1491. });
  1492. this.$refs.tabledata.validate((valid) => {
  1493. if (valid) {
  1494. this.$confirm("确认出库", "提示", {
  1495. confirmButtonText: "确定",
  1496. cancelButtonText: "取消",
  1497. type: "warning",
  1498. }).then(() => {
  1499. this.mcsSum = 0;
  1500. this.tableData.forEach((item) => {
  1501. let rowSum = 0;
  1502. rowSum = item.purcPric*item.convrat*item.delvCnt;
  1503. this.mcsSum+=rowSum
  1504. })
  1505. this.mcsSum = (this.mcsSum).toFixed(4)
  1506. this.printVisible = true;
  1507. });
  1508. } else {
  1509. this.$message({
  1510. type: "warning",
  1511. message: "请填写必填项信息",
  1512. });
  1513. }
  1514. });
  1515. },
  1516. // 出库确认
  1517. handleConfirm() {
  1518. this.$confirm("确认出库", "提示", {
  1519. confirmButtonText: "确定",
  1520. cancelButtonText: "取消",
  1521. type: "warning",
  1522. }).then(() => {
  1523. let data2 = {
  1524. delvOrdId: "",
  1525. purcOrdId: this.$route.query.id,
  1526. detlList: this.tableData,
  1527. deptId: this.$route.query.deptId,
  1528. spdId: this.$route.query.spdId,
  1529. deptName: this.$route.query.deptName,
  1530. };
  1531. submitMcsDelvOrd(data2)
  1532. .then((res) => {
  1533. this.printVisible = false;
  1534. this.$message.success("出库成功")
  1535. this.$router.push({
  1536. name: "purOrderDelivery",
  1537. query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
  1538. });
  1539. })
  1540. .catch((err) => {
  1541. // this.$message.error("出库失败")
  1542. // this.confirmLoadLoad = false;
  1543. });
  1544. });
  1545. },
  1546. // 保存
  1547. handleSave() {
  1548. let data = this.tableData.map((i) => {
  1549. return {
  1550. drugListId: i.drugListId,
  1551. delvCnt: i.delvCnt,
  1552. lotNum: i.lotNum,
  1553. manuDate: i.manuDate,
  1554. prodExpy: i.prodExpy,
  1555. invoFileId: i.invoFileId,
  1556. dyntFileId: i.dyntFileId,
  1557. };
  1558. });
  1559. let data2 = {
  1560. delvOrdId: "",
  1561. purcOrdId: this.$route.query.id,
  1562. detlList: data,
  1563. };
  1564. this.saveLoad = true;
  1565. saveDelvOrd(data2)
  1566. .then((res) => {
  1567. this.saveLoad = false;
  1568. })
  1569. .catch((err) => {
  1570. this.saveLoad = false;
  1571. });
  1572. },
  1573. // 订单复用
  1574. handlemultiplex(){
  1575. this.mulDialog = true;
  1576. this.getOutboundData()
  1577. this.roleRadio = "";
  1578. this.purcOrdId = "";
  1579. },
  1580. // 复用查询
  1581. getOutboundData() {
  1582. getMcsOrdDck(this.listQuerym)
  1583. .then((res) => {
  1584. this.mulData = res.data.records;
  1585. this.totalm = res.data.total;
  1586. })
  1587. .catch((err) => {
  1588. });
  1589. },
  1590. // 返回
  1591. handleBack(){
  1592. this.$router.push({
  1593. name: "purOrderDelivery",
  1594. query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
  1595. });
  1596. },
  1597. // 重置
  1598. reset(){
  1599. this.$refs.listQuery.resetFields();
  1600. this.getData()
  1601. },
  1602. // 复用单选
  1603. getTemplateRow(index, row) {
  1604. this.purcOrdId = row.id;
  1605. },
  1606. // 复用确认
  1607. clickMul(){
  1608. if(!this.purcOrdId){
  1609. this.$message.warning("请选择要复用的订单")
  1610. }else{
  1611. this.$confirm("确认复用该订单", "提示", {
  1612. confirmButtonText: "确定",
  1613. cancelButtonText: "取消",
  1614. type: "warning",
  1615. }).then(() => {
  1616. selectDelvOrdCopy({delvOrdId:this.listForm.id,purcOrdId:this.purcOrdId}).then((res)=>{
  1617. this.fyLoad = true;
  1618. if(res.success==true){
  1619. this.$message.success("操作成功")
  1620. this.mulDialog = false;
  1621. this.fyLoad = false;
  1622. this.purcOrdId = "";
  1623. }else{
  1624. // this.$message.error("操作失败")
  1625. this.$message(res.message)
  1626. this.fyLoad = false;
  1627. this.purcOrdId="";
  1628. }
  1629. }).catch((err)=>{
  1630. // this.$message(res.message)
  1631. this.fyLoad = false;
  1632. this.purcOrdId="";
  1633. })
  1634. })
  1635. }
  1636. },
  1637. },
  1638. };
  1639. </script>
  1640. <style lang="scss" scoped>
  1641. ::v-deep .el-table__body tr.hover-row > td {
  1642. background-color: transparent !important;
  1643. }
  1644. ::v-deep .el-table {
  1645. th.el-table__cell.is-leaf,
  1646. td.el-table__cell {
  1647. border-bottom: 1px solid #eee;
  1648. }
  1649. }
  1650. ::v-deep .dd .el-dialog {
  1651. height: 90%;
  1652. margin-top: 30px !important;
  1653. }
  1654. ::v-deep .dd .el-dialog__body {
  1655. height: 90%;
  1656. padding: 0 25px 0px;
  1657. }
  1658. .chuTable {
  1659. color: #000;
  1660. }
  1661. .hang {
  1662. height: 30px;
  1663. }
  1664. </style>