erpdn.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752
  1. <template>
  2. <div>
  3. <transition appear enter-active-class="animated fadeIn">
  4. <q-table
  5. class="my-sticky-header-column-table shadow-24"
  6. :data="table_list"
  7. row-key="id"
  8. :separator="separator"
  9. :loading="loading"
  10. :columns="columns"
  11. hide-bottom
  12. :pagination.sync="pagination"
  13. no-data-label="No data"
  14. no-results-label="No data you want"
  15. :table-style="{ height: height }"
  16. flat
  17. bordered
  18. >
  19. <template v-slot:header-cell="props">
  20. <q-th :props="props" @dblclick="handleHeaderDblClick(props.col)">
  21. <!-- 为特定列添加下拉选择器 -->
  22. <template
  23. v-if="
  24. [
  25. 'type',
  26. 'audit_status',
  27. 'save_status',
  28. 'bound_status',
  29. 'department',
  30. ].includes(props.col.name)
  31. "
  32. >
  33. <q-select
  34. dense
  35. outlined
  36. v-model="filterModels[props.col.name]"
  37. :options="getFilterOptions(props.col.name)"
  38. option-label="label"
  39. option-value="value"
  40. emit-value
  41. map-options
  42. clearable
  43. @input="handleFilterChange"
  44. style="min-width: 120px"
  45. >
  46. <template v-slot:prepend>
  47. <span class="text-caption">{{ props.col.label }}</span>
  48. </template>
  49. </q-select>
  50. </template>
  51. <template v-else>
  52. {{ props.col.label }}
  53. </template>
  54. </q-th>
  55. </template>
  56. <template v-slot:top>
  57. <q-btn-group push>
  58. <q-btn :label="$t('refresh')" icon="refresh" @click="reFresh()">
  59. <q-tooltip
  60. content-class="bg-amber text-black shadow-4"
  61. :offset="[10, 10]"
  62. content-style="font-size: 12px"
  63. >{{ $t("refreshtip") }}</q-tooltip
  64. >
  65. </q-btn>
  66. </q-btn-group>
  67. <q-space />
  68. <div class="flex items-center">
  69. <q-input
  70. outlined
  71. rounded
  72. dense
  73. debounce="200"
  74. color="primary"
  75. v-model="filter"
  76. :placeholder="'输入单据编号搜索'"
  77. @input="getSearchList()"
  78. @keyup.enter="getSearchList()"
  79. >
  80. <template v-slot:append>
  81. <q-icon name="search" />
  82. </template>
  83. </q-input>
  84. </div>
  85. </template>
  86. <template v-slot:body="props">
  87. <q-tr :props="props">
  88. <template v-if="props.row.id === editid">
  89. <q-td key="detail" :props="props">
  90. <q-btn
  91. round
  92. flat
  93. push
  94. color="black"
  95. icon="description"
  96. @click="detailData(props.row)"
  97. >
  98. <q-tooltip
  99. content-class="bg-amber text-black shadow-4"
  100. :offset="[10, 10]"
  101. content-style="font-size: 12px"
  102. >{{ "查看单据详情" }}</q-tooltip
  103. >
  104. </q-btn>
  105. </q-td>
  106. </template>
  107. <template v-else-if="props.row.id !== editid">
  108. <q-td key="detail" :props="props">
  109. <q-btn
  110. round
  111. flat
  112. push
  113. color="black"
  114. icon="description"
  115. @click="detailData(props.row)"
  116. >
  117. <q-tooltip
  118. content-class="bg-amber text-black shadow-4"
  119. :offset="[10, 10]"
  120. content-style="font-size: 12px"
  121. >{{ "查看批次详情" }}</q-tooltip
  122. >
  123. </q-btn>
  124. </q-td>
  125. </template>
  126. <template v-if="props.row.id === editid">
  127. <q-td key="billId" :props="props">{{ props.row.billId }}</q-td>
  128. </template>
  129. <template v-else-if="props.row.id !== editid">
  130. <q-td key="billId" :props="props">{{ props.row.billId }}</q-td>
  131. </template>
  132. <template v-if="props.row.id === editid">
  133. <q-td key="number" :props="props">{{ props.row.number }}</q-td>
  134. </template>
  135. <template v-else-if="props.row.id !== editid">
  136. <q-td key="number" :props="props">{{ props.row.number }}</q-td>
  137. </template>
  138. <template v-if="props.row.id === editid">
  139. <q-td key="type" :props="props">
  140. <q-select
  141. dense
  142. outlined
  143. square
  144. v-model="editFormData.type"
  145. :label="'单据类型'"
  146. autofocus
  147. :options="bound_code_type_list"
  148. option-label="label"
  149. option-value="value"
  150. emit-value
  151. map-options
  152. transition-show="scale"
  153. transition-hide="scale"
  154. :rules="[(val) => (val && val.length > 0) || error1]"
  155. />
  156. </q-td>
  157. </template>
  158. <template v-else-if="props.row.id !== editid">
  159. <q-td key="type" :props="props">
  160. {{ formatBSType(props.row.type) || props.row.type }}</q-td
  161. >
  162. </template>
  163. <template v-if="props.row.id === editid">
  164. <q-td key="department" :props="props">
  165. <q-select
  166. dense
  167. outlined
  168. square
  169. v-model="editFormData.department"
  170. :label="'部门'"
  171. :options="bound_department_list"
  172. option-label="label"
  173. option-value="value"
  174. emit-value
  175. map-options
  176. transition-show="scale"
  177. transition-hide="scale"
  178. :rules="[(val) => (val && val.length > 0) || error1]"
  179. />
  180. </q-td>
  181. </template>
  182. <template v-else-if="props.row.id !== editid">
  183. <q-td key="department" :props="props">
  184. {{
  185. bound_department_map[props.row.department] ||
  186. props.row.department
  187. }}</q-td
  188. >
  189. </template>
  190. <template v-if="props.row.id === editid">
  191. <q-td key="audit_status" :props="props">{{
  192. audit_status_name_map[props.row.audit_status] ||
  193. props.row.audit_status
  194. }}</q-td>
  195. </template>
  196. <template v-else-if="props.row.id !== editid">
  197. <q-td key="audit_status" :props="props">{{
  198. audit_status_name_map[props.row.audit_status] ||
  199. props.row.audit_status
  200. }}</q-td>
  201. </template>
  202. <template v-if="props.row.id === editid">
  203. <q-td key="save_status" :props="props">{{
  204. save_status_name_map[props.row.save_status] ||
  205. props.row.save_status
  206. }}</q-td>
  207. </template>
  208. <template v-else-if="props.row.id !== editid">
  209. <q-td key="save_status" :props="props">{{
  210. save_status_name_map[props.row.save_status] ||
  211. props.row.save_status
  212. }}</q-td>
  213. </template>
  214. <template v-if="props.row.id === editid">
  215. <q-td key="date" :props="props">{{ props.row.date }}</q-td>
  216. </template>
  217. <template v-else-if="props.row.id !== editid">
  218. <q-td key="date" :props="props">{{ props.row.date }}</q-td>
  219. </template>
  220. <template v-if="props.row.id === editid">
  221. <q-td key="creater" :props="props">
  222. <q-input
  223. dense
  224. outlined
  225. square
  226. v-model.number="editFormData.creater"
  227. :label="'经办人'"
  228. :rules="[(val) => (val && val > 0) || error1]"
  229. />
  230. </q-td>
  231. </template>
  232. <template v-else-if="props.row.id !== editid">
  233. <q-td key="creater" :props="props">{{ props.row.creater }}</q-td>
  234. </template>
  235. <template v-if="props.row.id === editid">
  236. <q-td key="bound_status" :props="props">
  237. {{
  238. formatStatusType(props.row.bound_status) ||
  239. props.row.bound_status
  240. }}
  241. </q-td>
  242. </template>
  243. <template v-else-if="props.row.id !== editid">
  244. <q-td key="bound_status" :props="props">
  245. <div class="row justify-center items-center">
  246. <span>{{
  247. formatStatusType(props.row.bound_status) ||
  248. props.row.bound_status
  249. }}</span>
  250. <q-btn
  251. v-if="props.row.bound_status === 0"
  252. round
  253. flat
  254. push
  255. color="primary"
  256. icon="check"
  257. size="sm"
  258. @click="auditRow(props.row)"
  259. class="q-ml-sm"
  260. >
  261. <q-tooltip
  262. content-class="bg-amber text-black shadow-4"
  263. :offset="[10, 10]"
  264. >
  265. 审核通过
  266. </q-tooltip>
  267. </q-btn>
  268. </div>
  269. </q-td>
  270. </template>
  271. <template v-if="!editMode">
  272. <q-td key="action" :props="props" style="width: 100px">
  273. <q-btn
  274. round
  275. flat
  276. push
  277. color="dark"
  278. icon="trolley"
  279. @click="change_status(props.row)"
  280. >
  281. <q-tooltip
  282. content-class="bg-amber text-black shadow-4"
  283. :offset="[10, 10]"
  284. content-style="font-size: 12px"
  285. >单据无误</q-tooltip
  286. >
  287. </q-btn>
  288. <q-btn
  289. round
  290. flat
  291. push
  292. color="deep-purple"
  293. icon="delete"
  294. @click="delete_data(props.row)"
  295. >
  296. <q-tooltip
  297. content-class="bg-amber text-black shadow-4"
  298. :offset="[10, 10]"
  299. >{{ $t("delete") }}</q-tooltip
  300. >
  301. </q-btn>
  302. </q-td>
  303. </template>
  304. <template v-else-if="editMode">
  305. <template v-if="props.row.id === editid">
  306. <q-td key="action" :props="props" style="width: 100px">
  307. <q-btn
  308. round
  309. flat
  310. push
  311. color="secondary"
  312. icon="check"
  313. @click="editDataSubmit()"
  314. >
  315. <q-tooltip
  316. content-class="bg-amber text-black shadow-4"
  317. :offset="[10, 10]"
  318. content-style="font-size: 12px"
  319. >{{ $t("confirmedit") }}</q-tooltip
  320. >
  321. </q-btn>
  322. <q-btn
  323. round
  324. flat
  325. push
  326. color="red"
  327. icon="close"
  328. @click="editDataCancel()"
  329. >
  330. <q-tooltip
  331. content-class="bg-amber text-black shadow-4"
  332. :offset="[10, 10]"
  333. content-style="font-size: 12px"
  334. >{{ $t("canceledit") }}</q-tooltip
  335. >
  336. </q-btn>
  337. </q-td>
  338. </template>
  339. <template v-else-if="props.row.id !== editid"></template>
  340. </template>
  341. </q-tr>
  342. </template>
  343. </q-table>
  344. </transition>
  345. <template>
  346. <div v-show="max !== 0" class="q-pa-lg flex flex-center">
  347. <div>{{ total }}</div>
  348. <q-pagination
  349. v-model="current"
  350. color="black"
  351. :max="max"
  352. :max-pages="6"
  353. boundary-links
  354. @click="
  355. getSearchList(current);
  356. paginationIpt = current;
  357. "
  358. />
  359. <div>
  360. <input
  361. v-model="paginationIpt"
  362. @blur="changePageEnter"
  363. @keyup.enter="changePageEnter"
  364. style="width: 60px; text-align: center"
  365. />
  366. </div>
  367. </div>
  368. <div v-show="max === 0" class="q-pa-lg flex flex-center">
  369. <q-btn flat push color="dark" :label="$t('no_data')"></q-btn>
  370. </div>
  371. </template>
  372. <q-dialog
  373. v-model="detailForm"
  374. transition-show="jump-down"
  375. transition-hide="jump-up"
  376. >
  377. <q-card style="min-width: 950px; position: relative">
  378. <q-bar
  379. class="bg-light-blue-10 text-white rounded-borders"
  380. style="height: 50px"
  381. >
  382. <div>
  383. {{ "单据信息" }}
  384. </div>
  385. <q-space></q-space>
  386. <q-btn dense flat icon="close" v-close-popup>
  387. <q-tooltip
  388. content-class="bg-amber text-black shadow-4"
  389. :offset="[20, 20]"
  390. content-style="font-size: 12px"
  391. >
  392. {{ $t("index.close") }}</q-tooltip
  393. >
  394. </q-btn>
  395. </q-bar>
  396. <q-card-section class="q-pt-md">
  397. <q-tabs v-model="activeTab">
  398. <q-tab name="tab1" label="单据信息" />
  399. <q-tab name="tab2" label="对接信息" />
  400. </q-tabs>
  401. </q-card-section>
  402. <!-- 选项卡内容 -->
  403. <q-tab-panels v-model="activeTab" animated>
  404. <q-tab-panel name="tab1" style="min-height: 609px">
  405. <div class="row q-gutter-x-md">
  406. <div class="col column q-gutter-y-md">
  407. <q-input
  408. dense
  409. outlined
  410. square
  411. v-model="table_detail.date"
  412. :label="'单据时间'"
  413. :readonly="true"
  414. />
  415. </div>
  416. <div class="col column q-gutter-y-md">
  417. <q-input
  418. dense
  419. outlined
  420. square
  421. v-model="table_detail.number"
  422. :label="'单据编码'"
  423. :readonly="true"
  424. />
  425. </div>
  426. </div>
  427. <div
  428. style="
  429. float: right;
  430. padding: 15px 15px 50px 15px;
  431. min-width: 100%;
  432. "
  433. flow="row wrap"
  434. >
  435. <q-card class="q-mb-md" bordered>
  436. <q-card-section>
  437. <template>
  438. <div class="text-h6 q-mb-md" style="max-width: 800px">
  439. {{ "批次信息" }}
  440. </div>
  441. <template v-if="batch_detail.length > 0">
  442. <q-table
  443. v-if="batch_detail.length > 0"
  444. :data="batch_detail"
  445. :columns="columns_batch"
  446. row-key="id"
  447. flat
  448. bordered
  449. hide-pagination
  450. class="my-sticky-table scrollable-table"
  451. :container-style="{ height: 'auto' }"
  452. :pagination="{ rowsPerPage: 0 }"
  453. >
  454. </q-table>
  455. </template>
  456. </template>
  457. </q-card-section>
  458. </q-card>
  459. </div>
  460. </q-tab-panel>
  461. <q-tab-panel name="tab2" style="min-height: 300px">
  462. <div class="row q-gutter-x-md">
  463. <div class="col column q-gutter-y-md">
  464. <q-input
  465. dense
  466. outlined
  467. square
  468. v-model="table_detail.date"
  469. :label="'单据时间'"
  470. :readonly="true"
  471. />
  472. </div>
  473. <div class="col column q-gutter-y-md">
  474. <q-input
  475. dense
  476. outlined
  477. square
  478. v-model="table_detail.number"
  479. :label="'单据编码'"
  480. :readonly="true"
  481. />
  482. </div>
  483. </div>
  484. <div
  485. style="
  486. float: right;
  487. padding: 15px 15px 50px 15px;
  488. min-width: 100%;
  489. "
  490. flow="row wrap"
  491. >
  492. <q-card class="q-mb-md" bordered>
  493. <q-card-section>
  494. <template>
  495. <div class="text-h6 q-mb">
  496. {{ formatBSType(detail_type) }}对接信息
  497. <q-btn dense flat icon="cached" @click="get_log_list()">
  498. <q-tooltip
  499. content-class="bg-amber text-black shadow-4"
  500. :offset="[20, 20]"
  501. content-style="font-size: 12px"
  502. >
  503. 刷新对接日志
  504. </q-tooltip>
  505. </q-btn>
  506. <q-space></q-space>
  507. </div>
  508. <div class="row q-gutter-x-md">
  509. <div class="q-pa-md col">
  510. <q-timeline color="primary">
  511. <q-timeline-entry
  512. v-for="(item, index) in logline"
  513. :key="index"
  514. :subtitle="
  515. item.create_time + ':' + item.log_content
  516. "
  517. side="left"
  518. >
  519. </q-timeline-entry>
  520. </q-timeline>
  521. </div>
  522. <div class="q-pa-md col">
  523. <q-timeline color="primary">
  524. <q-timeline-entry
  525. v-for="(stage, stageIndex) in getTimelineStages(
  526. table_detail.type
  527. )"
  528. :key="stageIndex"
  529. :subtitle="stage.timestamp"
  530. side="left"
  531. >
  532. <div class="row items-center">
  533. <q-btn
  534. round
  535. dense
  536. flat
  537. :icon="stage.icon"
  538. :color="stage.color"
  539. class="q-mr-sm"
  540. @click="checkStage(stage)"
  541. />
  542. <q-expansion-item
  543. class="col"
  544. v-model="stage.expanded"
  545. expand-icon-class="text-primary"
  546. :label="stage.title"
  547. header-class="text-primary"
  548. >
  549. <div class="q-pl-md">
  550. <div class="text-body2">
  551. {{ stage.content }}
  552. </div>
  553. </div>
  554. </q-expansion-item>
  555. </div>
  556. </q-timeline-entry>
  557. <!-- <q-timeline-entry
  558. v-for="(item, index) in timeline"
  559. :key="index"
  560. :subtitle="item.timestamp"
  561. side="left"
  562. >
  563. <div class="row items-center">
  564. <q-btn
  565. round
  566. dense
  567. flat
  568. :icon="getButtonIcon(item)"
  569. :color="getButtonColor(item)"
  570. class="q-mr-sm"
  571. @click="check_erp(item)"
  572. />
  573. <q-expansion-item
  574. class="col"
  575. v-model="item.expanded"
  576. expand-icon-class="text-primary"
  577. :label="item.title"
  578. header-class="text-primary"
  579. >
  580. <div class="q-pl-md">
  581. <div class="text-body2">
  582. {{ item.content }}
  583. </div>
  584. <div
  585. v-if="item.details"
  586. class="text-caption text-grey q-pt-sm"
  587. >
  588. {{ item.details }}
  589. </div>
  590. </div>
  591. </q-expansion-item>
  592. </div>
  593. </q-timeline-entry> -->
  594. </q-timeline>
  595. </div>
  596. </div>
  597. </template>
  598. </q-card-section>
  599. </q-card>
  600. </div>
  601. </q-tab-panel>
  602. </q-tab-panels>
  603. </q-card>
  604. </q-dialog>
  605. <q-dialog
  606. v-model="confirmForm"
  607. position="top"
  608. transition-show="scale"
  609. transition-hide="scale"
  610. >
  611. <q-card class="shadow-24">
  612. <q-card-section style="max-height: 325px; width: 500px" class="scroll">
  613. <div class="text-h6 q-mb-md">{{ "确认入库单" }}</div>
  614. 确定现场数目与入库汇报{{ choose_bill_code }}单计划数目一致吗?
  615. </q-card-section>
  616. <div style="float: right; padding: 15px 15px 15px 0">
  617. <q-btn
  618. color="white"
  619. text-color="black"
  620. style="margin-right: 25px"
  621. @click="confirmForm = false"
  622. >{{ $t("cancel") }}</q-btn
  623. >
  624. <q-btn color="primary" @click="confirm_status">{{
  625. $t("submit")
  626. }}</q-btn>
  627. </div>
  628. </q-card>
  629. </q-dialog>
  630. </div>
  631. </template>
  632. <router-view />
  633. <script>
  634. import { getauth, putauth, postauth, deleteauth } from 'boot/axios_request'
  635. import moment from 'moment'
  636. import { date, exportFile, LocalStorage } from 'quasar'
  637. export default {
  638. name: 'Pageasnlist',
  639. data () {
  640. return {
  641. // 新增:过滤模型
  642. filterModels: {
  643. type: null,
  644. audit_status: null,
  645. save_status: null,
  646. bound_status: null,
  647. department: null
  648. },
  649. activeSearchField: '', // 当前激活的搜索字段
  650. activeSearchLabel: '', // 当前激活的搜索字段的标签
  651. createDate2: '',
  652. date_range: '',
  653. proxyDate: '',
  654. date: '',
  655. goods_code: '',
  656. goods_desc: '',
  657. openid: '',
  658. login_name: '',
  659. authin: '0',
  660. warehouse_code: '',
  661. warehouse_name: '',
  662. searchUrl: '',
  663. pathname: 'wms/outboundBills/',
  664. pathfilename: 'bound/file/',
  665. pathname_previous: '',
  666. pathname_next: '',
  667. separator: 'cell',
  668. loading: false,
  669. height: '',
  670. printObj: {
  671. id: 'printMe',
  672. popTitle: this.$t('inbound.asn')
  673. },
  674. table_list: [],
  675. table_detail: {},
  676. batch_detail: [],
  677. bound_code_type_list: [],
  678. bound_code_type_map: [],
  679. bound_bs_type_list: [],
  680. bound_bs_type_map: [],
  681. bound_desc_list: [],
  682. bound_desc_map: [],
  683. bound_department_list: [],
  684. bound_department_map: [],
  685. audit_status_name_map: {
  686. 0: '待审核',
  687. 1: '已审核',
  688. 9: '无需审核'
  689. },
  690. save_status_name_map: {
  691. 0: '待保存',
  692. 1: '已保存',
  693. 9: '无需保存'
  694. },
  695. bound_status_list: [],
  696. product_list: [],
  697. product_map: [],
  698. columns: [
  699. { name: 'detail', label: '详情', field: 'detail', align: 'center' },
  700. // { name: 'billId', label: '表单序号', field: 'billId', align: 'center' },
  701. { name: 'number', label: '单据编号', field: 'number', align: 'center' },
  702. { name: 'type', label: '业务类型', field: 'type', align: 'center' },
  703. {
  704. name: 'department',
  705. label: '部门',
  706. field: 'department',
  707. align: 'center'
  708. },
  709. {
  710. name: 'audit_status',
  711. label: '审核状态',
  712. field: 'audit_status',
  713. align: 'center'
  714. },
  715. {
  716. name: 'save_status',
  717. label: '保存状态',
  718. field: 'save_status',
  719. align: 'center'
  720. },
  721. { name: 'date', label: '单据日期', field: 'date', align: 'center' },
  722. { name: 'creater', label: '经办人', field: 'creater', align: 'center' },
  723. {
  724. name: 'bound_status',
  725. label: '状态',
  726. field: 'bound_status',
  727. align: 'center'
  728. },
  729. { name: 'action', label: '操作', align: 'center' }
  730. ],
  731. // 列定义
  732. columns_batch: [
  733. // {
  734. // name: "id",
  735. // label: "主单ID",
  736. // field: (row) => row.bound_billId,
  737. // align: "center",
  738. // },
  739. // {
  740. // name: "entryid",
  741. // label: "详单ID",
  742. // field: (row) => row.entryIds,
  743. // align: "center",
  744. // },
  745. {
  746. name: 'production_batch',
  747. label: 'ERP批次号',
  748. field: (row) => row.production_batch,
  749. align: 'center'
  750. },
  751. {
  752. name: 'goods_code',
  753. label: '货物编码',
  754. field: (row) => row.goods_code,
  755. align: 'center'
  756. },
  757. {
  758. name: 'goods_name',
  759. label: '货物名称',
  760. field: (row) => row.goods_name,
  761. align: 'center'
  762. },
  763. {
  764. name: 'plan_qty',
  765. label: '计划数量',
  766. field: (row) => row.goods_out_qty,
  767. align: 'center'
  768. },
  769. {
  770. name: 'goods_unit',
  771. label: '单位',
  772. field: (row) => row.goods_unit,
  773. align: 'center'
  774. },
  775. {
  776. name: 'create_time',
  777. label: '创建时间',
  778. field: (row) => moment(row.create_time).format('YYYY-MM-DD'),
  779. align: 'center'
  780. }
  781. ],
  782. filter: '',
  783. product_filter: '',
  784. pagination: {
  785. page: 1,
  786. rowsPerPage: 11
  787. },
  788. newForm: false,
  789. newBatchForm: false,
  790. newFormData: {},
  791. newBatchFormData: {},
  792. newDetailFormData: {},
  793. editid: 0,
  794. editFormData: {},
  795. editMode: false,
  796. deleteForm: false,
  797. detailForm: false,
  798. deleteid: 0,
  799. detailid: 0,
  800. bar_code: '',
  801. error1: this.$t('goods.view_goodslist.error1'),
  802. max: 0,
  803. total: 0,
  804. paginationIpt: 1,
  805. current: 1,
  806. onlyread: false,
  807. bound_batch_list: [],
  808. activeTab: 'tab1',
  809. confirmForm: false,
  810. choose_bill_id: '',
  811. choose_bill_code: '',
  812. logline: [],
  813. timeline: [
  814. {
  815. timestamp: '出库汇报',
  816. title: '单据编码',
  817. content: '暂无',
  818. expanded: true,
  819. type: 1
  820. },
  821. {
  822. timestamp: '出库审核',
  823. title: '单据编码',
  824. content: '暂无',
  825. expanded: true,
  826. type: 2
  827. },
  828. {
  829. timestamp: '出库保存',
  830. title: '单据编码',
  831. content: '暂无',
  832. expanded: true,
  833. type: 3
  834. }
  835. ],
  836. detail_type: 0
  837. }
  838. },
  839. computed: {
  840. interval () {
  841. return (
  842. this.$t('download_center.start') +
  843. ' - ' +
  844. this.$t('download_center.end')
  845. )
  846. }
  847. },
  848. methods: {
  849. // 新增审核行方法
  850. auditRow (row) {
  851. const _this = this
  852. // 调用API更新审核状态
  853. putauth(`wms/outboundBills/${row.billId}/`, {
  854. bound_status: 1 // 设置为已审核状态
  855. })
  856. .then(res => {
  857. _this.$q.notify({
  858. message: '审核状态已更新',
  859. color: 'positive'
  860. })
  861. // 刷新数据
  862. _this.getSearchList()
  863. })
  864. .catch(err => {
  865. _this.$q.notify({
  866. message: err.detail || '更新审核状态失败',
  867. color: 'negative'
  868. })
  869. })
  870. },
  871. // 检查阶段处理
  872. // 获取过滤选项
  873. getFilterOptions (columnName) {
  874. switch (columnName) {
  875. case 'type':
  876. return [
  877. { label: '销售出库', value: 1 },
  878. { label: '生产领料', value: 2 },
  879. { label: '其他出库', value: 3 },
  880. { label: '调拨出库', value: 4 }
  881. ]
  882. case 'audit_status':
  883. return [
  884. { label: '待审核', value: 0 },
  885. { label: '已审核', value: 1 },
  886. { label: '无需审核', value: 9 }
  887. ]
  888. case 'save_status':
  889. return [
  890. { label: '待保存', value: 0 },
  891. { label: '已保存', value: 1 },
  892. { label: '无需保存', value: 9 }
  893. ]
  894. case 'bound_status':
  895. return [
  896. { label: '待审核', value: 0 },
  897. { label: '确认无误', value: 1 }
  898. ]
  899. case 'department':
  900. return this.bound_department_list
  901. default:
  902. return []
  903. }
  904. },
  905. // 处理过滤变化
  906. handleFilterChange () {
  907. this.pagination.page = 1
  908. this.getSearchList(1)
  909. },
  910. handleHeaderDblClick (column) {
  911. // 排除不需要搜索的列
  912. if (['detail', 'action'].includes(column.name)) return
  913. this.activeSearchField = column.field
  914. this.activeSearchLabel = column.label
  915. // 弹出搜索对话框
  916. this.$q
  917. .dialog({
  918. title: `搜索${column.label}`,
  919. message: `请输入${column.label}的搜索条件`,
  920. prompt: {
  921. model: '',
  922. type: 'text'
  923. },
  924. cancel: true,
  925. persistent: true
  926. })
  927. .onOk((data) => {
  928. // 执行搜索
  929. this.executeColumnSearch(column.field, data)
  930. })
  931. .onCancel(() => {
  932. this.activeSearchField = ''
  933. this.activeSearchLabel = ''
  934. })
  935. },
  936. // 执行列搜索
  937. executeColumnSearch (field, value) {
  938. // 构建搜索参数
  939. if (
  940. field === 'type' ||
  941. field === 'audit_status' ||
  942. field === 'save_status' ||
  943. field === 'bound_status'
  944. ) {
  945. const searchParams = {
  946. [field]: value
  947. }
  948. // 清除其他搜索条件
  949. this.filter = ''
  950. this.date_range = ''
  951. // 执行搜索
  952. this.getList({
  953. ...searchParams,
  954. page: 1
  955. })
  956. // 重置激活的搜索字段
  957. this.activeSearchField = ''
  958. this.activeSearchLabel = ''
  959. } else {
  960. const searchParams = {
  961. [field + '__icontains']: value
  962. }
  963. // 清除其他搜索条件
  964. this.filter = ''
  965. this.date_range = ''
  966. // 执行搜索
  967. this.getList({
  968. ...searchParams,
  969. page: 1
  970. })
  971. // 重置激活的搜索字段
  972. this.activeSearchField = ''
  973. this.activeSearchLabel = ''
  974. }
  975. },
  976. checkStage (stage) {
  977. const _this = this
  978. if (stage.type === 1) {
  979. // 业务汇报阶段处理
  980. _this.get_log_list()
  981. } else if (stage.type === 2) {
  982. // 业务审核阶段处理
  983. postauth('wms/boundBills/audit/', {
  984. billid: _this.detailid,
  985. billtype: _this.detail_type,
  986. billbase: 1
  987. }).catch((err) => {
  988. _this.$q.notify({
  989. message: err.detail || '审核失败',
  990. icon: 'close',
  991. color: 'negative'
  992. })
  993. })
  994. } else if (stage.type === 3) {
  995. // 业务保存阶段处理
  996. postauth('wms/boundBills/save/', {
  997. billid: _this.detailid,
  998. billtype: _this.detail_type,
  999. billbase: 1
  1000. })
  1001. }
  1002. },
  1003. // 根据业务类型获取时间线阶段
  1004. getTimelineStages (billType) {
  1005. const stageDefinitions = {
  1006. 1: [
  1007. // 销售出库申请 (类型1)
  1008. {
  1009. type: 1,
  1010. icon: '1',
  1011. color: 'primary',
  1012. timestamp: '出库汇报',
  1013. title: '销售出库'
  1014. },
  1015. // {
  1016. // type: 2,
  1017. // icon: 'verified',
  1018. // color: 'orange',
  1019. // timestamp: '生产审核',
  1020. // title: '生产审核'
  1021. // }
  1022. {
  1023. type: 3,
  1024. icon: 'save',
  1025. color: 'green',
  1026. timestamp: '出库保存',
  1027. title: '销售出库'
  1028. }
  1029. ],
  1030. 2: [
  1031. // 生产领料申请 (类型2)
  1032. {
  1033. type: 1,
  1034. icon: '1',
  1035. color: 'primary',
  1036. timestamp: '领料申请',
  1037. title: '领料申请'
  1038. },
  1039. {
  1040. type: 2,
  1041. icon: 'verified',
  1042. color: 'orange',
  1043. timestamp: '领料审核',
  1044. title: '领料审核'
  1045. }
  1046. // {
  1047. // type: 3,
  1048. // icon: 'save',
  1049. // color: 'green',
  1050. // timestamp: '采购保存',
  1051. // title: '采购入库'
  1052. // }
  1053. ],
  1054. 3: [
  1055. // 其他出库申请 (类型3)
  1056. {
  1057. type: 1,
  1058. icon: '1',
  1059. color: 'primary',
  1060. timestamp: '出库申请',
  1061. title: '出库申请'
  1062. },
  1063. {
  1064. type: 2,
  1065. icon: 'verified',
  1066. color: 'orange',
  1067. timestamp: '出库审核',
  1068. title: '出库审核'
  1069. }
  1070. // {
  1071. // type: 3,
  1072. // icon: "save",
  1073. // color: "green",
  1074. // timestamp: "入库完成",
  1075. // title: "入库完成",
  1076. // },
  1077. ],
  1078. 4: [
  1079. // 调拨入库 (类型4)
  1080. {
  1081. type: 1,
  1082. icon: '1',
  1083. color: 'primary',
  1084. timestamp: '调拨发起',
  1085. title: '调拨单据'
  1086. },
  1087. {
  1088. type: 2,
  1089. icon: 'verified',
  1090. color: 'orange',
  1091. timestamp: '调拨审核',
  1092. title: '调拨审核'
  1093. }
  1094. // {
  1095. // type: 3,
  1096. // icon: "save",
  1097. // color: "green",
  1098. // timestamp: "调拨入库",
  1099. // title: "调拨完成",
  1100. // },
  1101. ],
  1102. // 默认类型
  1103. default: [
  1104. {
  1105. type: 1,
  1106. icon: '1',
  1107. color: 'primary',
  1108. timestamp: '业务开始',
  1109. title: '业务开始'
  1110. },
  1111. {
  1112. type: 2,
  1113. icon: 'verified',
  1114. color: 'orange',
  1115. timestamp: '业务处理',
  1116. title: '业务处理'
  1117. },
  1118. {
  1119. type: 3,
  1120. icon: 'save',
  1121. color: 'green',
  1122. timestamp: '业务完成',
  1123. title: '业务完成'
  1124. }
  1125. ]
  1126. }
  1127. // 获取对应业务类型的阶段定义
  1128. const stages = stageDefinitions[billType] || stageDefinitions.default
  1129. // 返回带有默认值的副本
  1130. return stages.map((stage) => ({
  1131. expanded: true,
  1132. content: '暂无',
  1133. ...stage
  1134. }))
  1135. },
  1136. getButtonIcon (item) {
  1137. // 根据业务类型决定图标
  1138. if (item.type === 1) return '1' // 入库汇报
  1139. if (item.type === 2) return 'verified' // 入库审核
  1140. if (item.type === 3) return 'save' // 入库保存
  1141. return 'help' // 默认图标
  1142. },
  1143. getButtonColor (item) {
  1144. // 根据业务类型决定颜色
  1145. if (item.type === 1) return 'primary' // 蓝色
  1146. if (item.type === 2) return 'orange' // 橙色
  1147. if (item.type === 3) return 'green' // 绿色
  1148. return 'grey' // 默认颜色
  1149. },
  1150. check_erp (item) {
  1151. var _this = this
  1152. if (item.type === 1) {
  1153. _this.get_log_list()
  1154. } else if (item.type === 2) {
  1155. postauth('wms/boundBills/audit/', {
  1156. billid: _this.detailid,
  1157. billtype: _this.detail_type,
  1158. billbase: 1
  1159. }).catch((err) => {
  1160. _this.$q.notify({
  1161. message: err.detail || '审核失败',
  1162. icon: 'close',
  1163. color: 'negative'
  1164. })
  1165. })
  1166. } else if (item.type === 3) {
  1167. postauth('wms/boundBills/save/', {
  1168. billid: _this.detailid,
  1169. billtype: _this.detail_type,
  1170. billbase: 1
  1171. })
  1172. }
  1173. },
  1174. get_log_list () {
  1175. var _this = this
  1176. getauth('wms/outboundBills/log/?billid=' + _this.detailid)
  1177. .then((res) => {
  1178. if (res && res.results) {
  1179. _this.logline = res.results
  1180. } else {
  1181. console.error('响应中没有 results 属性', res)
  1182. }
  1183. })
  1184. .catch((err) => {
  1185. _this.$q.notify({
  1186. message: err.detail || '获取日志列表时出错',
  1187. icon: 'close',
  1188. color: 'negative'
  1189. })
  1190. })
  1191. postauth('wms/outboundBills/number/', { billid: _this.detailid })
  1192. .then((res) => {
  1193. _this.timeline[0].title = res.bill_number
  1194. _this.timeline[1].title = res.bill_audit
  1195. _this.timeline[2].title = res.bill_save
  1196. _this.detail_type = res.bill_type
  1197. if (res.bill_status === 0) {
  1198. _this.timeline[0].content = 'ERP已发起出库申请,请审核'
  1199. _this.timeline[1].content = '待审核'
  1200. _this.timeline[2].content = '待保存'
  1201. } else if (res.bill_status === 1) {
  1202. _this.timeline[0].content = 'ERP已发起出库申请,已审核'
  1203. _this.timeline[1].content = '已质检或无需质检'
  1204. _this.timeline[2].content = '待入库'
  1205. } else if (res.bill_status === 2) {
  1206. _this.timeline[0].content = 'ERP已发起出库申请,已审核'
  1207. _this.timeline[1].content = '已质检或无需质检'
  1208. _this.timeline[2].content = '已入库'
  1209. }
  1210. })
  1211. .catch((err) => {
  1212. _this.$q.notify({
  1213. message: err.detail || '获取单据编号时出错',
  1214. icon: 'close',
  1215. color: 'negative'
  1216. })
  1217. })
  1218. },
  1219. formatBSType (type) {
  1220. switch (type) {
  1221. case 1:
  1222. return '销售出库申请'
  1223. case 2:
  1224. return '生产领料申请'
  1225. case 3:
  1226. return '其他出库申请'
  1227. case 4:
  1228. return '调拨入库申请'
  1229. default:
  1230. return '未知'
  1231. }
  1232. },
  1233. formatStatusType (type) {
  1234. switch (type) {
  1235. case 0:
  1236. return '待审核'
  1237. case 1:
  1238. return '确认无误'
  1239. case 3:
  1240. return '其他入库'
  1241. case 4:
  1242. return '调拨入库'
  1243. default:
  1244. return '未知'
  1245. }
  1246. },
  1247. getList (params = {}) {
  1248. var _this = this
  1249. _this.loading = true
  1250. // 合并基础参数
  1251. const baseParams = {
  1252. page: _this.current,
  1253. base_type: '1',
  1254. page_size: _this.pagination.rowsPerPage
  1255. }
  1256. // 创建URLSearchParams处理参数
  1257. const queryParams = new URLSearchParams({
  1258. ...baseParams,
  1259. ...params
  1260. })
  1261. console.log(queryParams)
  1262. // 过滤空值参数
  1263. Array.from(queryParams.entries()).forEach(([key, value]) => {
  1264. if (value === '' || value === null || value === undefined) {
  1265. queryParams.delete(key)
  1266. }
  1267. })
  1268. getauth(`${_this.pathname}?${queryParams}`)
  1269. .then((res) => {
  1270. _this.table_list = res.results
  1271. _this.total = res.count
  1272. _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0
  1273. _this.pathname_previous = res.previous
  1274. _this.pathname_next = res.next
  1275. })
  1276. .catch((err) => {
  1277. _this.$q.notify({
  1278. message: err.detail,
  1279. icon: 'close',
  1280. color: 'negative'
  1281. })
  1282. })
  1283. .finally(() => {
  1284. _this.loading = false
  1285. })
  1286. },
  1287. changePageEnter () {
  1288. if (Number(this.paginationIpt) < 1) {
  1289. this.current = 1
  1290. this.paginationIpt = 1
  1291. } else if (Number(this.paginationIpt) > this.max) {
  1292. this.current = this.max
  1293. this.paginationIpt = this.max
  1294. } else {
  1295. this.current = Number(this.paginationIpt)
  1296. }
  1297. this.getSearchList(this.current)
  1298. },
  1299. // 修改搜索方法以包含过滤条件
  1300. getSearchList (page = 1) {
  1301. this.current = page
  1302. this.paginationIpt = page
  1303. // 构建过滤参数
  1304. const filterParams = {}
  1305. for (const [key, value] of Object.entries(this.filterModels)) {
  1306. if (value !== null && value !== '') {
  1307. filterParams[key] = value
  1308. }
  1309. }
  1310. this.getList({
  1311. number__icontains: this.filter,
  1312. document_date__range: this.date_range,
  1313. ...filterParams // 添加过滤条件
  1314. })
  1315. },
  1316. getfileList () {
  1317. var _this = this
  1318. _this.loading = true
  1319. const params = {
  1320. goods_desc__icontains: _this.filter,
  1321. document_date__range: _this.date_range
  1322. }
  1323. const queryParams = new URLSearchParams({
  1324. ...params
  1325. })
  1326. console.log(queryParams)
  1327. // 过滤空值参数
  1328. Array.from(queryParams.entries()).forEach(([key, value]) => {
  1329. if (value === '' || value === null || value === undefined) {
  1330. queryParams.delete(key)
  1331. }
  1332. })
  1333. console.log(`${_this.pathfilename}?${queryParams}`)
  1334. getauth(`${_this.pathfilename}?${queryParams}`)
  1335. .then((res) => {
  1336. var timeStamp = Date.now()
  1337. var formattedString = date.formatDate(timeStamp, 'YYYYMMDDHHmmss')
  1338. const status = exportFile(
  1339. _this.pathfilename + 'list' + formattedString + '.csv',
  1340. '\uFEFF' + res,
  1341. 'text/csv'
  1342. )
  1343. if (status !== true) {
  1344. _this.$q.notify({
  1345. message: 'Browser denied file download...',
  1346. color: 'negative',
  1347. icon: 'warning'
  1348. })
  1349. }
  1350. })
  1351. .catch((err) => {
  1352. _this.$q.notify({
  1353. message: err.detail,
  1354. icon: 'close',
  1355. color: 'negative'
  1356. })
  1357. })
  1358. .finally(() => {
  1359. _this.loading = false
  1360. })
  1361. },
  1362. getListPrevious () {
  1363. var _this = this
  1364. if (LocalStorage.has('auth')) {
  1365. getauth(_this.pathname_previous, {})
  1366. .then((res) => {
  1367. _this.table_list = res.results
  1368. _this.pathname_previous = res.previous
  1369. _this.pathname_next = res.next
  1370. })
  1371. .catch((err) => {
  1372. _this.$q.notify({
  1373. message: err.detail,
  1374. icon: 'close',
  1375. color: 'negative'
  1376. })
  1377. })
  1378. } else {
  1379. }
  1380. },
  1381. getListNext () {
  1382. var _this = this
  1383. if (LocalStorage.has('auth')) {
  1384. getauth(_this.pathname_next, {})
  1385. .then((res) => {
  1386. _this.table_list = res.results
  1387. _this.pathname_previous = res.previous
  1388. _this.pathname_next = res.next
  1389. })
  1390. .catch((err) => {
  1391. _this.$q.notify({
  1392. message: err.detail,
  1393. icon: 'close',
  1394. color: 'negative'
  1395. })
  1396. })
  1397. }
  1398. },
  1399. reFresh () {
  1400. var _this = this
  1401. _this.getSearchList()
  1402. },
  1403. change_status (e) {
  1404. var _this = this
  1405. // _this.loading = true
  1406. _this.detailData(e)
  1407. _this.confirmForm = true
  1408. _this.choose_bill_id = e.billId
  1409. _this.choose_bill_code = e.number
  1410. },
  1411. confirm_status () {
  1412. var _this = this
  1413. _this.loading = true
  1414. const params = {
  1415. billId: _this.choose_bill_id
  1416. }
  1417. postauth('wms/generateoutbound', params)
  1418. .then((res) => {
  1419. if (res.code === 200) {
  1420. _this.$q.notify({
  1421. message: '出库库单生成成功,请到出库管理中查看',
  1422. icon: 'check',
  1423. color: 'green'
  1424. })
  1425. }
  1426. if (res.code === 400) {
  1427. _this.$q.notify({
  1428. message: res.error,
  1429. icon: 'info',
  1430. color: 'info'
  1431. })
  1432. }
  1433. })
  1434. .finally(() => {
  1435. _this.loading = false
  1436. _this.confirmForm = false
  1437. _this.getSearchList()
  1438. })
  1439. },
  1440. delete_data (e) {
  1441. var _this = this
  1442. // 设置要删除的数据ID(根据你的数据结构调整)
  1443. _this.deleteid = e.billId // 如果e是行数据对象,可能需要使用e.id或e.billId
  1444. _this.choose_bill_code = e.number // 保存单据编号用于显示
  1445. // 创建确认对话框
  1446. _this.$q
  1447. .dialog({
  1448. title: '确认删除',
  1449. message: `确定要删除单据编号为【${_this.choose_bill_code}】的记录吗?此操作不可撤销。`,
  1450. cancel: true,
  1451. persistent: true,
  1452. ok: {
  1453. push: true,
  1454. label: '删除',
  1455. color: 'negative'
  1456. },
  1457. cancel: {
  1458. push: true,
  1459. label: '取消',
  1460. color: 'primary'
  1461. }
  1462. })
  1463. .onOk(() => {
  1464. // 用户确认删除
  1465. _this.deleteDataSubmit()
  1466. })
  1467. .onCancel(() => {
  1468. // 用户取消删除
  1469. _this.deleteid = 0
  1470. _this.choose_bill_code = ''
  1471. _this.$q.notify({
  1472. message: '已取消删除操作',
  1473. icon: 'info',
  1474. color: 'info'
  1475. })
  1476. })
  1477. },
  1478. detailData (e) {
  1479. var _this = this
  1480. _this.detailForm = true
  1481. _this.detailid = e.billId
  1482. console.log('detail查询的id是:', _this.detailid)
  1483. getauth(_this.pathname + _this.detailid + '/')
  1484. .then((res) => {
  1485. _this.table_detail = res
  1486. })
  1487. .catch((err) => {
  1488. _this.$q.notify({
  1489. message: err.detail,
  1490. icon: 'close',
  1491. color: 'negative'
  1492. })
  1493. })
  1494. console.log('detail查询的结果是:', _this.table_detail)
  1495. getauth('wms/outmaterials/?bound_billId=' + _this.detailid)
  1496. .then((res) => {
  1497. _this.batch_detail = res.results
  1498. })
  1499. .catch((err) => {
  1500. _this.$q.notify({
  1501. message: err.detail,
  1502. icon: 'close',
  1503. color: 'negative'
  1504. })
  1505. })
  1506. console.log('batch查询的结果是:', _this.batch_detail)
  1507. console.log('batch长度查询的结果是:', _this.batch_detail.length)
  1508. _this.get_log_list()
  1509. },
  1510. deleteDataSubmit () {
  1511. var _this = this
  1512. deleteauth(_this.pathname + _this.deleteid + '/')
  1513. .then((res) => {
  1514. _this.getSearchList()
  1515. _this.$q.notify({
  1516. message: '成功删除数据',
  1517. icon: 'check',
  1518. color: 'green'
  1519. })
  1520. })
  1521. .catch((err) => {
  1522. _this.$q.notify({
  1523. message: err.detail,
  1524. icon: 'close',
  1525. color: 'negative'
  1526. })
  1527. })
  1528. },
  1529. deleteDataCancel () {
  1530. var _this = this
  1531. _this.deleteForm = false
  1532. _this.deleteid = 0
  1533. },
  1534. updateProxy () {
  1535. var _this = this
  1536. _this.proxyDate = _this.date
  1537. }
  1538. },
  1539. created () {
  1540. var _this = this
  1541. if (LocalStorage.has('openid')) {
  1542. _this.openid = LocalStorage.getItem('openid')
  1543. } else {
  1544. _this.openid = ''
  1545. LocalStorage.set('openid', '')
  1546. }
  1547. if (LocalStorage.has('warehouse_code')) {
  1548. _this.warehouse_code = LocalStorage.getItem('warehouse_code')
  1549. }
  1550. if (LocalStorage.has('warehouse_name')) {
  1551. _this.warehouse_name = LocalStorage.getItem('warehouse_name')
  1552. }
  1553. if (LocalStorage.has('login_name')) {
  1554. _this.login_name = LocalStorage.getItem('login_name')
  1555. } else {
  1556. _this.login_name = ''
  1557. LocalStorage.set('login_name', '')
  1558. }
  1559. if (LocalStorage.has('auth')) {
  1560. const timeStamp = Date.now()
  1561. const formattedString = date.formatDate(timeStamp, 'YYYY/MM/DD')
  1562. _this.date = formattedString
  1563. console.log(_this.date)
  1564. _this.authin = '1'
  1565. _this.getList()
  1566. } else {
  1567. _this.authin = '0'
  1568. }
  1569. getauth('warehouse/boundcodetype/', {})
  1570. .then((res) => {
  1571. _this.bound_code_type_list = res.results.map((item) => ({
  1572. label: item.bound_code_type_name,
  1573. value: item.bound_code_type_code
  1574. }))
  1575. // 编码 → 名称的映射(普通对象,确保响应式)
  1576. _this.bound_code_type_map = res.results.reduce((acc, item) => {
  1577. acc[item.bound_code_type_code] = item.bound_code_type_name
  1578. return acc
  1579. }, {})
  1580. })
  1581. .catch((err) => {
  1582. _this.$q.notify({
  1583. message: err.detail,
  1584. icon: 'close',
  1585. color: 'negative'
  1586. })
  1587. })
  1588. getauth('warehouse/boundtype/', {})
  1589. .then((res) => {
  1590. _this.bound_desc_list = res.results.map((item) => ({
  1591. label: item.bound_type_name,
  1592. value: item.bound_type_code
  1593. }))
  1594. // 编码 → 名称的映射(普通对象,确保响应式)
  1595. _this.bound_desc_map = res.results.reduce((acc, item) => {
  1596. acc[item.bound_type_code] = item.bound_type_name
  1597. return acc
  1598. }, {})
  1599. })
  1600. .catch((err) => {
  1601. _this.$q.notify({
  1602. message: err.detail,
  1603. icon: 'close',
  1604. color: 'negative'
  1605. })
  1606. })
  1607. getauth('warehouse/department/?max_page=1000', {})
  1608. .then((res) => {
  1609. _this.bound_department_list = res.results.map((item) => ({
  1610. label: item.department_name,
  1611. value: item.department_code
  1612. }))
  1613. _this.bound_department_map = res.results.reduce((acc, item) => {
  1614. acc[item.department_code] = item.department_name
  1615. return acc
  1616. }, {})
  1617. })
  1618. .catch((err) => {
  1619. _this.$q.notify({
  1620. message: err.detail,
  1621. icon: 'close',
  1622. color: 'negative'
  1623. })
  1624. })
  1625. getauth('warehouse/boundbusiness/', {})
  1626. .then((res) => {
  1627. _this.bound_bs_type_list = res.results.map((item) => ({
  1628. label: item.bound_bs_name,
  1629. value: item.bound_bs_code
  1630. }))
  1631. // 编码 → 名称的映射(普通对象,确保响应式)
  1632. _this.bound_bs_type_map = res.results.reduce((acc, item) => {
  1633. acc[item.bound_bs_code] = item.bound_bs_name
  1634. return acc
  1635. }, {})
  1636. })
  1637. .catch((err) => {
  1638. _this.$q.notify({
  1639. message: err.detail,
  1640. icon: 'close',
  1641. color: 'negative'
  1642. })
  1643. })
  1644. },
  1645. mounted () {
  1646. var _this = this
  1647. if (_this.$q.platform.is.electron) {
  1648. _this.height = String(_this.$q.screen.height - 290) + 'px'
  1649. } else {
  1650. _this.height = _this.$q.screen.height - 290 + '' + 'px'
  1651. }
  1652. _this.newFormData.creater = _this.login_name
  1653. },
  1654. updated () {},
  1655. destroyed () {}
  1656. }
  1657. </script>
  1658. <style scoped>
  1659. /* 添加在 <style> 中 */
  1660. .q-date__calendar-item--selected {
  1661. transition: all 0.3s ease;
  1662. background-color: #1976d2 !important;
  1663. }
  1664. .q-date__range {
  1665. background-color: rgba(25, 118, 210, 0.1);
  1666. }
  1667. :deep(.q-field__label) {
  1668. margin-top: 8px;
  1669. align-self: center;
  1670. }
  1671. :deep(.q-field__control-container) {
  1672. padding-left: 50px;
  1673. margin-top: -5px;
  1674. }
  1675. .q-timeline__subtitle {
  1676. font-size: 14px;
  1677. margin-bottom: 8px;
  1678. }
  1679. /* 修改滚动样式 */
  1680. .scrollable-table {
  1681. flex: 1; /* 允许表格填充剩余空间 */
  1682. display: flex;
  1683. flex-direction: column;
  1684. }
  1685. .scrollable-table .q-table__container {
  1686. flex: 1;
  1687. overflow: auto;
  1688. }
  1689. .scrollable-table .q-table__top {
  1690. position: sticky;
  1691. top: 0;
  1692. background: white;
  1693. z-index: 1;
  1694. }
  1695. .my-sticky-table .q-table__middle {
  1696. overflow-y: auto !important;
  1697. }
  1698. </style>