asn.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601
  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:top>
  20. <q-btn-group push>
  21. <q-btn
  22. :label="$t('new')"
  23. icon="add"
  24. @click="
  25. newForm = true;
  26. newFormData.creater = login_name;
  27. "
  28. >
  29. <q-tooltip
  30. content-class="bg-amber text-black shadow-4"
  31. :offset="[10, 10]"
  32. content-style="font-size: 12px"
  33. >{{ $t("newtip") }}</q-tooltip
  34. >
  35. </q-btn>
  36. <q-btn :label="$t('refresh')" icon="refresh" @click="reFresh()">
  37. <q-tooltip
  38. content-class="bg-amber text-black shadow-4"
  39. :offset="[10, 10]"
  40. content-style="font-size: 12px"
  41. >{{ $t("refreshtip") }}</q-tooltip
  42. >
  43. </q-btn>
  44. </q-btn-group>
  45. <q-space />
  46. <div class="flex items-center">
  47. <q-input
  48. outlined
  49. rounded
  50. dense
  51. debounce="200"
  52. color="primary"
  53. v-model="filter"
  54. :placeholder="'输入名称搜索'"
  55. @input="getSearchList()"
  56. @keyup.enter="getSearchList()"
  57. >
  58. <template v-slot:append>
  59. <q-icon name="search" />
  60. </template>
  61. </q-input>
  62. </div>
  63. </template>
  64. <template v-slot:body="props">
  65. <q-tr :props="props">
  66. <template v-if="props.row.id === editid">
  67. <q-td key="detail" :props="props">
  68. <q-btn
  69. round
  70. flat
  71. push
  72. color="black"
  73. icon="description"
  74. @click="detailData(props.row)"
  75. >
  76. <q-tooltip
  77. content-class="bg-amber text-black shadow-4"
  78. :offset="[10, 10]"
  79. content-style="font-size: 12px"
  80. >{{ "查看批次详情" }}</q-tooltip
  81. >
  82. </q-btn>
  83. </q-td>
  84. </template>
  85. <template v-else-if="props.row.id !== editid">
  86. <q-td key="detail" :props="props">
  87. <q-btn
  88. round
  89. flat
  90. push
  91. color="black"
  92. icon="description"
  93. @click="detailData(props.row)"
  94. >
  95. <q-tooltip
  96. content-class="bg-amber text-black shadow-4"
  97. :offset="[10, 10]"
  98. content-style="font-size: 12px"
  99. >{{ "查看批次详情" }}</q-tooltip
  100. >
  101. </q-btn>
  102. </q-td>
  103. </template>
  104. <template v-if="props.row.id === editid">
  105. <q-td key="bound_date" :props="props">{{
  106. props.row.bound_date
  107. }}</q-td>
  108. </template>
  109. <template v-else-if="props.row.id !== editid">
  110. <q-td key="bound_date" :props="props">{{
  111. props.row.bound_date
  112. }}</q-td>
  113. </template>
  114. <template v-if="props.row.id === editid">
  115. <q-td key="bound_code" :props="props">{{
  116. props.row.bound_code
  117. }}</q-td>
  118. </template>
  119. <template v-else-if="props.row.id !== editid">
  120. <q-td key="bound_code" :props="props">{{
  121. props.row.bound_code
  122. }}</q-td>
  123. </template>
  124. <template v-if="props.row.id === editid">
  125. <q-td key="bound_code_type" :props="props">
  126. <q-select
  127. dense
  128. outlined
  129. square
  130. v-model="editFormData.bound_code_type"
  131. :label="'单据类型'"
  132. autofocus
  133. :options="bound_code_type_list"
  134. option-label="label"
  135. option-value="value"
  136. emit-value
  137. map-options
  138. transition-show="scale"
  139. transition-hide="scale"
  140. :rules="[(val) => (val && val.length > 0) || error1]"
  141. />
  142. </q-td>
  143. </template>
  144. <template v-else-if="props.row.id !== editid">
  145. <q-td key="bound_code_type" :props="props">
  146. {{
  147. bound_code_type_map[props.row.bound_code_type] ||
  148. props.row.bound_code_type
  149. }}</q-td
  150. >
  151. </template>
  152. <template v-if="props.row.id === editid">
  153. <q-td key="bound_bs_type" :props="props">
  154. <q-select
  155. dense
  156. outlined
  157. square
  158. v-model="editFormData.bound_bs_type"
  159. :label="'单据类型'"
  160. :options="bound_bs_type_list"
  161. option-label="label"
  162. option-value="value"
  163. emit-value
  164. map-options
  165. transition-show="scale"
  166. transition-hide="scale"
  167. :rules="[(val) => (val && val.length > 0) || error1]"
  168. />
  169. </q-td>
  170. </template>
  171. <template v-else-if="props.row.id !== editid">
  172. <q-td key="bound_bs_type" :props="props">
  173. {{
  174. bound_bs_type_map[props.row.bound_bs_type] ||
  175. props.row.bound_bs_type
  176. }}</q-td
  177. >
  178. </template>
  179. <template v-if="props.row.id === editid">
  180. <q-td key="bound_desc" :props="props">
  181. <q-select
  182. dense
  183. outlined
  184. square
  185. v-model="editFormData.bound_desc"
  186. :label="'出入库类别'"
  187. :options="bound_desc_list"
  188. option-label="label"
  189. option-value="value"
  190. emit-value
  191. map-options
  192. transition-show="scale"
  193. transition-hide="scale"
  194. :rules="[(val) => (val && val.length > 0) || error1]"
  195. />
  196. </q-td>
  197. </template>
  198. <template v-else-if="props.row.id !== editid">
  199. <q-td key="bound_desc" :props="props">
  200. {{
  201. bound_desc_map[props.row.bound_desc] || props.row.bound_desc
  202. }}</q-td
  203. >
  204. </template>
  205. <template v-if="props.row.id === editid">
  206. <q-td key="bound_department" :props="props">
  207. <q-select
  208. dense
  209. outlined
  210. square
  211. v-model="editFormData.bound_department"
  212. :label="'部门'"
  213. :options="bound_department_list"
  214. option-label="label"
  215. option-value="value"
  216. emit-value
  217. map-options
  218. transition-show="scale"
  219. transition-hide="scale"
  220. :rules="[(val) => (val && val.length > 0) || error1]"
  221. />
  222. </q-td>
  223. </template>
  224. <template v-else-if="props.row.id !== editid">
  225. <q-td key="bound_department" :props="props">
  226. {{
  227. bound_department_map[props.row.bound_department] ||
  228. props.row.bound_department
  229. }}</q-td
  230. >
  231. </template>
  232. <template v-if="props.row.id === editid">
  233. <q-td key="creater" :props="props">
  234. <q-input
  235. dense
  236. outlined
  237. square
  238. v-model.number="editFormData.creater"
  239. :label="'经办人'"
  240. :rules="[(val) => (val && val > 0) || error1]"
  241. />
  242. </q-td>
  243. </template>
  244. <template v-else-if="props.row.id !== editid">
  245. <q-td key="creater" :props="props">{{ props.row.creater }}</q-td>
  246. </template>
  247. <template v-if="props.row.id === editid">
  248. <q-td key="bound_status" :props="props">
  249. {{
  250. bound_status_map[props.row.bound_status] ||
  251. props.row.bound_status
  252. }}</q-td
  253. >
  254. </template>
  255. <template v-else-if="props.row.id !== editid">
  256. <q-td key="bound_status" :props="props">
  257. {{
  258. bound_status_map[props.row.bound_status] ||
  259. props.row.bound_status
  260. }}</q-td
  261. >
  262. </template>
  263. <template v-if="!editMode">
  264. <q-td key="action" :props="props" style="width: 100px">
  265. <q-btn
  266. round
  267. flat
  268. push
  269. color="dark"
  270. icon="trolley"
  271. @click="change_status(props.row)"
  272. >
  273. <q-tooltip
  274. content-class="bg-amber text-black shadow-4"
  275. :offset="[10, 10]"
  276. content-style="font-size: 12px"
  277. >一键分拣</q-tooltip
  278. >
  279. </q-btn>
  280. </q-td>
  281. </template>
  282. <template v-else-if="editMode">
  283. <template v-if="props.row.id === editid">
  284. <q-td key="action" :props="props" style="width: 100px">
  285. <q-btn
  286. round
  287. flat
  288. push
  289. color="secondary"
  290. icon="check"
  291. @click="editDataSubmit()"
  292. >
  293. <q-tooltip
  294. content-class="bg-amber text-black shadow-4"
  295. :offset="[10, 10]"
  296. content-style="font-size: 12px"
  297. >{{ $t("confirmedit") }}</q-tooltip
  298. >
  299. </q-btn>
  300. <q-btn
  301. round
  302. flat
  303. push
  304. color="red"
  305. icon="close"
  306. @click="editDataCancel()"
  307. >
  308. <q-tooltip
  309. content-class="bg-amber text-black shadow-4"
  310. :offset="[10, 10]"
  311. content-style="font-size: 12px"
  312. >{{ $t("canceledit") }}</q-tooltip
  313. >
  314. </q-btn>
  315. </q-td>
  316. </template>
  317. <template v-else-if="props.row.id !== editid"></template>
  318. </template>
  319. </q-tr>
  320. </template>
  321. </q-table>
  322. </transition>
  323. <template>
  324. <div v-show="max !== 0" class="q-pa-lg flex flex-center">
  325. <div>{{ total }}</div>
  326. <q-pagination
  327. v-model="current"
  328. color="black"
  329. :max="max"
  330. :max-pages="6"
  331. boundary-links
  332. @click="
  333. getSearchList(current);
  334. paginationIpt = current;
  335. "
  336. />
  337. <div>
  338. <input
  339. v-model="paginationIpt"
  340. @blur="changePageEnter"
  341. @keyup.enter="changePageEnter"
  342. style="width: 60px; text-align: center"
  343. />
  344. </div>
  345. </div>
  346. <div v-show="max === 0" class="q-pa-lg flex flex-center">
  347. <q-btn flat push color="dark" :label="$t('no_data')"></q-btn>
  348. </div>
  349. </template>
  350. <q-dialog v-model="newForm">
  351. <q-card class="shadow-24">
  352. <q-bar
  353. class="bg-light-blue-10 text-white rounded-borders"
  354. style="height: 50px"
  355. >
  356. <div>{{ $t("newtip") }}</div>
  357. <q-space />
  358. <q-btn dense flat icon="close" v-close-popup>
  359. <q-tooltip content-class="bg-amber text-black shadow-4">{{
  360. $t("index.close")
  361. }}</q-tooltip>
  362. </q-btn>
  363. </q-bar>
  364. <q-card-section style="max-height: 325px; width: 400px" class="scroll">
  365. <q-select
  366. dense
  367. outlined
  368. square
  369. v-model="newFormData.bound_code_type"
  370. :label="'单据类型'"
  371. autofocus
  372. :options="bound_code_type_list"
  373. option-label="label"
  374. option-value="value"
  375. emit-value
  376. map-options
  377. transition-show="scale"
  378. transition-hide="scale"
  379. :rules="[(val) => (val && val.length > 0) || error1]"
  380. />
  381. <q-select
  382. dense
  383. outlined
  384. square
  385. v-model="newFormData.bound_bs_type"
  386. :label="'业务类型'"
  387. :options="bound_bs_type_list"
  388. option-label="label"
  389. option-value="value"
  390. emit-value
  391. map-options
  392. transition-show="scale"
  393. transition-hide="scale"
  394. :rules="[(val) => (val && val.length > 0) || error1]"
  395. />
  396. <q-select
  397. dense
  398. outlined
  399. square
  400. v-model="newFormData.bound_desc"
  401. :label="'出入库类别'"
  402. :options="bound_desc_list"
  403. option-label="label"
  404. option-value="value"
  405. emit-value
  406. map-options
  407. transition-show="scale"
  408. transition-hide="scale"
  409. :rules="[(val) => (val && val.length > 0) || error1]"
  410. />
  411. <q-select
  412. dense
  413. outlined
  414. square
  415. v-model="newFormData.bound_department"
  416. :label="'部门'"
  417. :options="bound_department_list"
  418. option-label="label"
  419. option-value="value"
  420. emit-value
  421. map-options
  422. transition-show="scale"
  423. transition-hide="scale"
  424. :rules="[(val) => (val && val.length > 0) || error1]"
  425. />
  426. <q-input
  427. dense
  428. outlined
  429. square
  430. v-model="newFormData.creater"
  431. :label="'经办人'"
  432. :rules="[(val) => (val && val.length > 0) || error1]"
  433. />
  434. </q-card-section>
  435. <div style="float: right; padding: 15px 15px 15px 0">
  436. <q-btn
  437. color="white"
  438. text-color="black"
  439. style="margin-right: 25px"
  440. @click="newDataCancel()"
  441. >{{ $t("cancel") }}</q-btn
  442. >
  443. <q-btn color="primary" @click="newDataSubmit()">{{
  444. $t("submit")
  445. }}</q-btn>
  446. </div>
  447. </q-card>
  448. </q-dialog>
  449. <q-dialog v-model="deleteForm">
  450. <q-card class="shadow-24">
  451. <q-bar
  452. class="bg-light-blue-10 text-white rounded-borders"
  453. style="height: 50px"
  454. >
  455. <div>{{ $t("delete") }}</div>
  456. <q-space />
  457. <q-btn dense flat icon="close" v-close-popup>
  458. <q-tooltip>{{ $t("index.close") }}</q-tooltip>
  459. </q-btn>
  460. </q-bar>
  461. <q-card-section
  462. style="max-height: 325px; width: 400px"
  463. class="scroll"
  464. >{{ $t("deletetip") }}</q-card-section
  465. >
  466. <div style="float: right; padding: 15px 15px 15px 0">
  467. <q-btn
  468. color="white"
  469. text-color="black"
  470. style="margin-right: 25px"
  471. @click="deleteDataCancel()"
  472. >{{ $t("cancel") }}</q-btn
  473. >
  474. <q-btn color="primary" @click="deleteDataSubmit()">{{
  475. $t("submit")
  476. }}</q-btn>
  477. </div>
  478. </q-card>
  479. </q-dialog>
  480. <q-dialog v-model="newBatchForm">
  481. <q-card class="shadow-24">
  482. <q-bar
  483. class="bg-light-blue-10 text-white rounded-borders"
  484. style="height: 50px"
  485. >
  486. <div>{{ "新建批次" }}</div>
  487. <q-space />
  488. <q-btn dense flat icon="close" v-close-popup>
  489. <q-tooltip content-class="bg-amber text-black shadow-4">{{
  490. $t("index.close")
  491. }}</q-tooltip>
  492. </q-btn>
  493. </q-bar>
  494. <q-card-section style="min-height: 325px; width: 500px" class="scroll">
  495. <div class="text-h6 q-mb-md">{{ "批次信息" }}</div>
  496. <div class="row q-gutter-x-md">
  497. <div class="col column q-gutter-y-md">
  498. <q-select
  499. dense
  500. outlined
  501. square
  502. v-model="newBatchFormData.goods_code"
  503. :label="'物料编码'"
  504. :options="product_list"
  505. option-label="value"
  506. option-value="value"
  507. emit-value
  508. map-options
  509. transition-show="scale"
  510. transition-hide="scale"
  511. :rules="[(val) => (val && val.length > 0) || error1]"
  512. />
  513. </div>
  514. <div class="col column q-gutter-y-md">
  515. <q-input
  516. outlined
  517. dense
  518. color="primary"
  519. v-model="product_filter"
  520. :placeholder="'搜索名称'"
  521. autofocus
  522. @input="getProductSearchList()"
  523. @keyup.enter="getProductSearchList()"
  524. >
  525. <template v-slot:append>
  526. <q-icon name="search" />
  527. </template>
  528. </q-input>
  529. </div>
  530. </div>
  531. <q-select
  532. dense
  533. outlined
  534. square
  535. v-model="newBatchFormData.goods_code"
  536. :label="'物料'"
  537. :options="product_list"
  538. option-label="label"
  539. option-value="value"
  540. emit-value
  541. map-options
  542. :readonly="true"
  543. transition-show="scale"
  544. transition-hide="scale"
  545. :rules="[(val) => (val && val.length > 0) || error1]"
  546. />
  547. <q-input
  548. dense
  549. outlined
  550. square
  551. v-model="newBatchFormData.goods_desc"
  552. :label="'名称'"
  553. :rules="[(val) => (val && val.length > 0) || error1]"
  554. />
  555. <div class="row q-gutter-x-md">
  556. <div class="col column q-gutter-y-md">
  557. <q-input
  558. dense
  559. outlined
  560. square
  561. v-model.number="newBatchFormData.goods_weight"
  562. :label="'单重'"
  563. type="number"
  564. :rules="[(val) => (val && val > 0) || error1]"
  565. />
  566. <q-input
  567. dense
  568. outlined
  569. square
  570. v-model="newBatchFormData.goods_std"
  571. :label="'规格/备注'"
  572. :rules="[(val) => (val && val.length > 0) || error1]"
  573. />
  574. </div>
  575. <div class="col column q-gutter-y-md">
  576. <q-input
  577. dense
  578. outlined
  579. square
  580. v-model="newBatchFormData.goods_unit"
  581. :label="'单位'"
  582. :rules="[(val) => (val && val.length > 0) || error1]"
  583. />
  584. <q-toggle
  585. v-model="isorder"
  586. :label="isorder ? '自动编码' : '手动编码(建议)'"
  587. />
  588. </div>
  589. </div>
  590. <q-input
  591. v-show="!isorder"
  592. dense
  593. outlined
  594. square
  595. v-model.number="newBatchFormData.bound_batch_order"
  596. :label="'批号——年月第几批(20250409)'"
  597. type="number"
  598. :rules="[(val) => (val && val > 0) || error1]"
  599. />
  600. <q-input
  601. dense
  602. outlined
  603. square
  604. v-model.number="newBatchFormData.goods_qty"
  605. :label="'数量'"
  606. type="number"
  607. :rules="[(val) => (val && val > 0) || error1]"
  608. />
  609. <q-input
  610. dense
  611. outlined
  612. square
  613. v-model="newBatchFormData.creater"
  614. :label="'经办人'"
  615. :rules="[(val) => (val && val.length > 0) || error1]"
  616. />
  617. </q-card-section>
  618. <div style="float: right; padding: 15px 15px 15px 0">
  619. <q-btn
  620. color="white"
  621. text-color="black"
  622. style="margin-right: 25px"
  623. @click="newBatchCancel()"
  624. >{{ $t("cancel") }}</q-btn
  625. >
  626. <q-btn color="primary" @click="newBatchSubmit()">{{
  627. $t("submit")
  628. }}</q-btn>
  629. </div>
  630. </q-card>
  631. </q-dialog>
  632. <q-dialog
  633. v-model="detailForm"
  634. transition-show="jump-down"
  635. transition-hide="jump-up"
  636. >
  637. <q-card style="min-width: 900px">
  638. <q-bar
  639. class="bg-light-blue-10 text-white rounded-borders"
  640. style="height: 50px"
  641. >
  642. <div>
  643. {{ "批次信息" }}
  644. </div>
  645. <q-space></q-space>
  646. <q-btn dense flat icon="close" v-close-popup>
  647. <q-tooltip
  648. content-class="bg-amber text-black shadow-4"
  649. :offset="[20, 20]"
  650. content-style="font-size: 12px"
  651. >
  652. {{ $t("index.close") }}</q-tooltip
  653. >
  654. </q-btn>
  655. </q-bar>
  656. <q-card-section class="q-pt-md">
  657. <q-tabs v-model="activeTab">
  658. <q-tab name="tab1" label="入库信息" />
  659. <!-- <q-tab name="tab2" label="货物信息" /> -->
  660. </q-tabs>
  661. </q-card-section>
  662. <!-- 选项卡内容 -->
  663. <q-tab-panels v-model="activeTab" animated>
  664. <q-tab-panel name="tab1" style="height: 70px">
  665. <div class="row q-gutter-x-md">
  666. <div class="col column q-gutter-y-md">
  667. <q-input
  668. dense
  669. outlined
  670. square
  671. v-model="table_detail.bound_date"
  672. :label="'单据时间'"
  673. :readonly="true"
  674. />
  675. </div>
  676. <div class="col column q-gutter-y-md">
  677. <q-input
  678. dense
  679. outlined
  680. square
  681. v-model="table_detail.bound_code"
  682. :label="'单据编码'"
  683. :readonly="true"
  684. />
  685. </div>
  686. </div>
  687. </q-tab-panel>
  688. </q-tab-panels>
  689. <div
  690. style="float: right; padding: 15px 15px 50px 15px; min-width: 100%"
  691. flow="row wrap"
  692. >
  693. <q-card class="q-mb-md" bordered>
  694. <q-card-actions
  695. class="q-px-none"
  696. style="position: absolute; right: 20px; top: 10px; z-index: 100"
  697. >
  698. <q-btn
  699. v-if="!onlyread"
  700. icon="add"
  701. flat
  702. dense
  703. color="primary"
  704. @click="addbatch(table_detail.id)"
  705. :label="$t('stock.add')"
  706. />
  707. </q-card-actions>
  708. <q-card-section>
  709. <template>
  710. <div class="text-h6 q-mb-md">{{ "批次信息" }}</div>
  711. <template v-if="batch_detail.length > 0">
  712. <div
  713. v-for="(item, index) in batch_detail"
  714. :key="index"
  715. class="row q-col-gutter-md q-mb-sm"
  716. >
  717. <div class="col-1">
  718. <q-btn icon="print" flat @click="print(item.id)"></q-btn>
  719. <q-tooltip
  720. content-class="bg-amber text-black shadow-4"
  721. :offset="[-0, 0]"
  722. content-style="font-size: 12px"
  723. >打印条码</q-tooltip
  724. >
  725. </div>
  726. <div class="col-3">
  727. <q-input
  728. v-model="item.bound_batch.sourced_number"
  729. :label="'批次'"
  730. :readonly="onlyread"
  731. dense
  732. outlined
  733. />
  734. </div>
  735. <div class="col-4">
  736. <q-input
  737. v-model="item.bound_batch.goods_desc"
  738. :label="'货物'"
  739. :readonly="onlyread"
  740. dense
  741. outlined
  742. />
  743. </div>
  744. <div class="col-2">
  745. <q-input
  746. v-model="item.bound_batch.goods_qty"
  747. :label="'数量'"
  748. :readonly="onlyread"
  749. dense
  750. outlined
  751. />
  752. </div>
  753. <div class="col-2">
  754. <q-input
  755. v-model="item.bound_batch.goods_unit"
  756. :label="'单位'"
  757. :readonly="onlyread"
  758. dense
  759. outlined
  760. />
  761. </div>
  762. <div class="col" style="max-width: 50px">
  763. <q-btn
  764. v-if="!onlyread"
  765. icon="delete"
  766. flat
  767. dense
  768. color="primary"
  769. @click="addbatch(table_detail.id)"
  770. style="margin-top: 1px"
  771. />
  772. </div>
  773. </div>
  774. </template>
  775. </template>
  776. </q-card-section>
  777. </q-card>
  778. </div>
  779. </q-card>
  780. </q-dialog>
  781. </div>
  782. </template>
  783. <router-view />
  784. <script>
  785. import { getauth, postauth, putauth, deleteauth } from "boot/axios_request";
  786. import { date, exportFile, LocalStorage } from "quasar";
  787. import { QToggle } from "quasar";
  788. export default {
  789. components: {
  790. QToggle,
  791. },
  792. name: "Pageasnlist",
  793. data() {
  794. return {
  795. createDate1: "",
  796. createDate2: "",
  797. date_range: "",
  798. proxyDate: "",
  799. date: "",
  800. goods_code: "",
  801. goods_desc: "",
  802. openid: "",
  803. login_name: "",
  804. authin: "0",
  805. warehouse_code: "",
  806. warehouse_name: "",
  807. searchUrl: "",
  808. pathname: "bound/list/",
  809. pathfilename: "bound/file/",
  810. pathname_previous: "",
  811. pathname_next: "",
  812. separator: "cell",
  813. loading: false,
  814. height: "",
  815. printObj: {
  816. id: "printMe",
  817. popTitle: this.$t("inbound.asn"),
  818. },
  819. table_list: [],
  820. table_detail: {},
  821. batch_detail: [],
  822. bound_code_type_list: [],
  823. bound_code_type_map: [],
  824. bound_bs_type_list: [],
  825. bound_bs_type_map: [],
  826. bound_desc_list: [],
  827. bound_desc_map: [],
  828. bound_department_list: [],
  829. bound_department_map: [],
  830. bound_status_list: [],
  831. bound_status_map: [],
  832. product_list: [],
  833. product_map: [],
  834. columns: [
  835. { name: "detail", label: "详情", field: "detail", align: "center" },
  836. {
  837. name: "bound_date",
  838. label: "单据日期",
  839. field: "bound_date",
  840. align: "center",
  841. },
  842. {
  843. name: "bound_code",
  844. label: "单据编号",
  845. field: "bound_code",
  846. align: "center",
  847. },
  848. {
  849. name: "bound_code_type",
  850. label: "单据类型",
  851. field: "bound_code_type",
  852. align: "center",
  853. },
  854. {
  855. name: "bound_bs_type",
  856. label: "业务类型",
  857. field: "bound_bs_type",
  858. align: "center",
  859. },
  860. {
  861. name: "bound_desc",
  862. label: "出入库类别",
  863. field: "bound_desc",
  864. align: "center",
  865. },
  866. {
  867. name: "bound_department",
  868. label: "部门",
  869. field: "bound_department",
  870. align: "center",
  871. },
  872. { name: "creater", label: "经办人", field: "creater", align: "center" },
  873. {
  874. name: "bound_status",
  875. label: "状态",
  876. field: "bound_status",
  877. align: "center",
  878. },
  879. { name: "action", label: "操作", align: "center" },
  880. ],
  881. filter: "",
  882. product_filter: "",
  883. pagination: {
  884. page: 1,
  885. rowsPerPage: 11,
  886. },
  887. newForm: false,
  888. newBatchForm: false,
  889. newFormData: {},
  890. newBatchFormData: {},
  891. newDetailFormData: {},
  892. editid: 0,
  893. editFormData: {},
  894. editMode: false,
  895. deleteForm: false,
  896. detailForm: false,
  897. deleteid: 0,
  898. detailid: 0,
  899. bar_code: "",
  900. error1: this.$t("goods.view_goodslist.error1"),
  901. max: 0,
  902. total: 0,
  903. paginationIpt: 1,
  904. current: 1,
  905. onlyread: true,
  906. bound_batch_list: [],
  907. activeTab: "tab1",
  908. isorder: false,
  909. order: "false",
  910. };
  911. },
  912. computed: {
  913. interval() {
  914. return (
  915. this.$t("download_center.start") +
  916. " - " +
  917. this.$t("download_center.end")
  918. );
  919. },
  920. },
  921. methods: {
  922. getList(params = {}) {
  923. var _this = this;
  924. _this.loading = true;
  925. // 合并基础参数
  926. const baseParams = {
  927. page: _this.current,
  928. base_type: "0",
  929. page_size: _this.pagination.rowsPerPage,
  930. };
  931. // 创建URLSearchParams处理参数
  932. const queryParams = new URLSearchParams({
  933. ...baseParams,
  934. ...params,
  935. });
  936. console.log(queryParams);
  937. // 过滤空值参数
  938. Array.from(queryParams.entries()).forEach(([key, value]) => {
  939. if (value === "" || value === null || value === undefined) {
  940. queryParams.delete(key);
  941. }
  942. });
  943. getauth(`${_this.pathname}?${queryParams}`)
  944. .then((res) => {
  945. _this.table_list = res.results;
  946. _this.total = res.count;
  947. _this.max = Math.ceil(res.count / _this.pagination.rowsPerPage) || 0;
  948. _this.pathname_previous = res.previous;
  949. _this.pathname_next = res.next;
  950. })
  951. .catch((err) => {
  952. _this.$q.notify({
  953. message: err.detail,
  954. icon: "close",
  955. color: "negative",
  956. });
  957. })
  958. .finally(() => {
  959. _this.loading = false;
  960. });
  961. },
  962. changePageEnter() {
  963. if (Number(this.paginationIpt) < 1) {
  964. this.current = 1;
  965. this.paginationIpt = 1;
  966. } else if (Number(this.paginationIpt) > this.max) {
  967. this.current = this.max;
  968. this.paginationIpt = this.max;
  969. } else {
  970. this.current = Number(this.paginationIpt);
  971. }
  972. this.getSearchList(this.current);
  973. },
  974. getProductSearchList() {
  975. var _this = this;
  976. _this.loading = true;
  977. const params = {
  978. product_name__icontains: _this.product_filter,
  979. max_page: 1000,
  980. };
  981. const queryParams = new URLSearchParams({
  982. ...params,
  983. });
  984. console.log(queryParams);
  985. // 过滤空值参数
  986. Array.from(queryParams.entries()).forEach(([key, value]) => {
  987. if (value === "" || value === null || value === undefined) {
  988. queryParams.delete(key);
  989. }
  990. });
  991. console.log(`warehouse/product/?${queryParams}`);
  992. getauth(`warehouse/product/?${queryParams}`)
  993. .then((res) => {
  994. _this.product_list = res.results.map((item) => ({
  995. label: item.product_name,
  996. value: item.product_code,
  997. }));
  998. _this.product_map = res.results.reduce((acc, item) => {
  999. acc[item.product_code] = item.product_name;
  1000. return acc;
  1001. }, {});
  1002. })
  1003. .catch((err) => {
  1004. _this.$q.notify({
  1005. message: err.detail,
  1006. icon: "close",
  1007. color: "negative",
  1008. });
  1009. })
  1010. .finally(() => {
  1011. _this.loading = false;
  1012. });
  1013. },
  1014. // 带搜索条件加载
  1015. getSearchList(page = 1) {
  1016. this.current = page;
  1017. this.paginationIpt = page;
  1018. this.getList({
  1019. goods_desc__icontains: this.filter,
  1020. document_date__range: this.date_range,
  1021. });
  1022. },
  1023. downloadlistData() {
  1024. this.getfileList();
  1025. },
  1026. getfileList() {
  1027. var _this = this;
  1028. _this.loading = true;
  1029. const params = {
  1030. goods_desc__icontains: _this.filter,
  1031. document_date__range: _this.date_range,
  1032. };
  1033. const queryParams = new URLSearchParams({
  1034. ...params,
  1035. });
  1036. console.log(queryParams);
  1037. // 过滤空值参数
  1038. Array.from(queryParams.entries()).forEach(([key, value]) => {
  1039. if (value === "" || value === null || value === undefined) {
  1040. queryParams.delete(key);
  1041. }
  1042. });
  1043. console.log(`${_this.pathfilename}?${queryParams}`);
  1044. getauth(`${_this.pathfilename}?${queryParams}`)
  1045. .then((res) => {
  1046. var timeStamp = Date.now();
  1047. var formattedString = date.formatDate(timeStamp, "YYYYMMDDHHmmss");
  1048. const status = exportFile(
  1049. _this.pathfilename + "list" + formattedString + ".csv",
  1050. "\uFEFF" + res,
  1051. "text/csv"
  1052. );
  1053. if (status !== true) {
  1054. _this.$q.notify({
  1055. message: "Browser denied file download...",
  1056. color: "negative",
  1057. icon: "warning",
  1058. });
  1059. }
  1060. })
  1061. .catch((err) => {
  1062. _this.$q.notify({
  1063. message: err.detail,
  1064. icon: "close",
  1065. color: "negative",
  1066. });
  1067. })
  1068. .finally(() => {
  1069. _this.loading = false;
  1070. });
  1071. },
  1072. getListPrevious() {
  1073. var _this = this;
  1074. if (LocalStorage.has("auth")) {
  1075. getauth(_this.pathname_previous, {})
  1076. .then((res) => {
  1077. _this.table_list = res.results;
  1078. _this.pathname_previous = res.previous;
  1079. _this.pathname_next = res.next;
  1080. })
  1081. .catch((err) => {
  1082. _this.$q.notify({
  1083. message: err.detail,
  1084. icon: "close",
  1085. color: "negative",
  1086. });
  1087. });
  1088. } else {
  1089. }
  1090. },
  1091. getListNext() {
  1092. var _this = this;
  1093. if (LocalStorage.has("auth")) {
  1094. getauth(_this.pathname_next, {})
  1095. .then((res) => {
  1096. _this.table_list = res.results;
  1097. _this.pathname_previous = res.previous;
  1098. _this.pathname_next = res.next;
  1099. })
  1100. .catch((err) => {
  1101. _this.$q.notify({
  1102. message: err.detail,
  1103. icon: "close",
  1104. color: "negative",
  1105. });
  1106. });
  1107. }
  1108. },
  1109. reFresh() {
  1110. var _this = this;
  1111. _this.getSearchList();
  1112. },
  1113. newDataSubmit() {
  1114. var _this = this;
  1115. _this.newFormData.bound_type = "in";
  1116. _this.newFormData.openid = _this.openid;
  1117. postauth(_this.pathname, _this.newFormData)
  1118. .then((res) => {
  1119. _this.getSearchList();
  1120. _this.newDataCancel();
  1121. if (res.status_code != 500) {
  1122. _this.$q.notify({
  1123. message: "成功新增数据",
  1124. icon: "check",
  1125. color: "green",
  1126. });
  1127. }
  1128. })
  1129. .catch((err) => {
  1130. _this.$q.notify({
  1131. message: err.detail,
  1132. icon: "close",
  1133. color: "negative",
  1134. });
  1135. });
  1136. },
  1137. newBatchSubmit() {
  1138. var _this = this;
  1139. _this.newBatchFormData.openid = _this.openid;
  1140. _this.newBatchFormData.warehouse_code = _this.warehouse_code;
  1141. _this.newBatchFormData.warehouse_name = _this.warehouse_name;
  1142. _this.newBatchFormData.order = _this.order;
  1143. console.log("当前的order是", _this.newBatchFormData.order);
  1144. postauth("bound/batch/", _this.newBatchFormData)
  1145. .then((res) => {
  1146. if (res.status_code != 500) {
  1147. _this.newDetailFormData.bound_batch = res.id;
  1148. _this.newDetailFormData.creater = _this.login_name;
  1149. postauth("bound/detail/", _this.newDetailFormData).then(
  1150. (res) => {
  1151. if (res.status_code != 500) {
  1152. _this.detailData(_this.newDetailFormData);
  1153. _this.$q.notify({
  1154. message: "成功新增数据",
  1155. icon: "check",
  1156. color: "green",
  1157. });
  1158. }
  1159. },
  1160. (err) => {
  1161. _this.$q.notify({
  1162. message: err.detail,
  1163. icon: "close",
  1164. color: "negative",
  1165. });
  1166. }
  1167. );
  1168. }
  1169. })
  1170. .catch((err) => {
  1171. _this.$q.notify({
  1172. message: err.detail,
  1173. icon: "close",
  1174. color: "negative",
  1175. });
  1176. });
  1177. },
  1178. newDataCancel() {
  1179. var _this = this;
  1180. _this.newForm = false;
  1181. _this.newFormData = {
  1182. bound_code_type: "",
  1183. bound_bs_type: "",
  1184. bound_desc: "",
  1185. bound_department: "",
  1186. creater: "",
  1187. };
  1188. },
  1189. addbatch(bound_number) {
  1190. var _this = this;
  1191. _this.newBatchForm = true;
  1192. _this.newDetailFormData = {
  1193. id: bound_number,
  1194. bound_list: bound_number,
  1195. };
  1196. },
  1197. editData(e) {
  1198. var _this = this;
  1199. _this.editMode = true;
  1200. _this.editid = e.id;
  1201. _this.editFormData = {
  1202. bound_date: e.bound_date,
  1203. bound_code: e.bound_code,
  1204. bound_code_type: e.bound_code_type,
  1205. bound_bs_type: e.bound_bs_type,
  1206. bound_desc: e.bound_desc,
  1207. bound_department: e.bound_department,
  1208. creater: _this.login_name,
  1209. };
  1210. },
  1211. change_status(e) {
  1212. var _this = this;
  1213. var status_FormData = {
  1214. bound_date: e.bound_date,
  1215. bound_code: e.bound_code,
  1216. bound_code_type: e.bound_code_type,
  1217. bound_bs_type: e.bound_bs_type,
  1218. bound_desc: e.bound_desc,
  1219. bound_department: e.bound_department,
  1220. creater: _this.login_name,
  1221. bound_type: "in",
  1222. bound_status: "101",
  1223. };
  1224. putauth(_this.pathname + e.id + "/", status_FormData)
  1225. .then((res) => {
  1226. _this.editDataCancel();
  1227. _this.getSearchList();
  1228. if (res.status_code != 500) {
  1229. _this.$q.notify({
  1230. message: "开始入库",
  1231. icon: "check",
  1232. color: "green",
  1233. });
  1234. }
  1235. })
  1236. .catch((err) => {
  1237. _this.$q.notify({
  1238. message: err.detail,
  1239. icon: "close",
  1240. color: "negative",
  1241. });
  1242. });
  1243. },
  1244. editDataSubmit() {
  1245. var _this = this;
  1246. _this.editFormData.bound_type = "in";
  1247. putauth(_this.pathname + _this.editid + "/", _this.editFormData)
  1248. .then((res) => {
  1249. _this.editDataCancel();
  1250. _this.getSearchList();
  1251. if (res.status_code != 500) {
  1252. _this.$q.notify({
  1253. message: "成功编辑数据",
  1254. icon: "check",
  1255. color: "green",
  1256. });
  1257. }
  1258. })
  1259. .catch((err) => {
  1260. _this.$q.notify({
  1261. message: err.detail,
  1262. icon: "close",
  1263. color: "negative",
  1264. });
  1265. });
  1266. },
  1267. editDataCancel() {
  1268. var _this = this;
  1269. _this.editMode = false;
  1270. _this.editid = 0;
  1271. _this.editFormData = {
  1272. bound_date: "",
  1273. bound_code: "",
  1274. bound_code_type: "",
  1275. bound_bs_type: "",
  1276. bound_desc: "",
  1277. bound_department: "",
  1278. creater: "",
  1279. };
  1280. },
  1281. deleteData(e) {
  1282. var _this = this;
  1283. _this.deleteForm = true;
  1284. _this.deleteid = e;
  1285. },
  1286. detailData(e) {
  1287. var _this = this;
  1288. _this.detailForm = true;
  1289. _this.detailid = e.id;
  1290. console.log("detail查询的id是:", _this.detailid);
  1291. getauth(_this.pathname + _this.detailid + "/")
  1292. .then((res) => {
  1293. _this.table_detail = res;
  1294. })
  1295. .catch((err) => {
  1296. _this.$q.notify({
  1297. message: err.detail,
  1298. icon: "close",
  1299. color: "negative",
  1300. });
  1301. });
  1302. console.log("detail查询的结果是:", _this.table_detail);
  1303. getauth("bound/detail/?bound_list=" + _this.detailid)
  1304. .then((res) => {
  1305. _this.batch_detail = res.results;
  1306. })
  1307. .catch((err) => {
  1308. _this.$q.notify({
  1309. message: err.detail,
  1310. icon: "close",
  1311. color: "negative",
  1312. });
  1313. });
  1314. console.log("batch查询的结果是:", _this.batch_detail);
  1315. console.log("batch长度查询的结果是:", _this.batch_detail.length);
  1316. },
  1317. deleteDataSubmit() {
  1318. var _this = this;
  1319. deleteauth(_this.pathname + _this.deleteid + "/")
  1320. .then((res) => {
  1321. _this.deleteDataCancel();
  1322. _this.getSearchList();
  1323. _this.$q.notify({
  1324. message: "成功删除数据",
  1325. icon: "check",
  1326. color: "green",
  1327. });
  1328. })
  1329. .catch((err) => {
  1330. _this.$q.notify({
  1331. message: err.detail,
  1332. icon: "close",
  1333. color: "negative",
  1334. });
  1335. });
  1336. },
  1337. deleteDataCancel() {
  1338. var _this = this;
  1339. _this.deleteForm = false;
  1340. _this.deleteid = 0;
  1341. },
  1342. updateProxy() {
  1343. var _this = this;
  1344. _this.proxyDate = _this.date;
  1345. },
  1346. },
  1347. created() {
  1348. var _this = this;
  1349. if (LocalStorage.has("openid")) {
  1350. _this.openid = LocalStorage.getItem("openid");
  1351. } else {
  1352. _this.openid = "";
  1353. LocalStorage.set("openid", "");
  1354. }
  1355. if (LocalStorage.has("warehouse_code")) {
  1356. _this.warehouse_code = LocalStorage.getItem("warehouse_code");
  1357. }
  1358. if (LocalStorage.has("warehouse_name")) {
  1359. _this.warehouse_name = LocalStorage.getItem("warehouse_name");
  1360. }
  1361. if (LocalStorage.has("login_name")) {
  1362. _this.login_name = LocalStorage.getItem("login_name");
  1363. } else {
  1364. _this.login_name = "";
  1365. LocalStorage.set("login_name", "");
  1366. }
  1367. if (LocalStorage.has("auth")) {
  1368. const timeStamp = Date.now();
  1369. const formattedString = date.formatDate(timeStamp, "YYYY/MM/DD");
  1370. _this.date = formattedString;
  1371. console.log(_this.date);
  1372. _this.authin = "1";
  1373. _this.getList();
  1374. } else {
  1375. _this.authin = "0";
  1376. }
  1377. getauth("warehouse/boundcodetype/", {})
  1378. .then((res) => {
  1379. _this.bound_code_type_list = res.results.map((item) => ({
  1380. label: item.bound_code_type_name,
  1381. value: item.bound_code_type_code,
  1382. }));
  1383. // 编码 → 名称的映射(普通对象,确保响应式)
  1384. _this.bound_code_type_map = res.results.reduce((acc, item) => {
  1385. acc[item.bound_code_type_code] = item.bound_code_type_name;
  1386. return acc;
  1387. }, {});
  1388. })
  1389. .catch((err) => {
  1390. _this.$q.notify({
  1391. message: err.detail,
  1392. icon: "close",
  1393. color: "negative",
  1394. });
  1395. });
  1396. getauth("warehouse/boundtype/", {})
  1397. .then((res) => {
  1398. _this.bound_desc_list = res.results.map((item) => ({
  1399. label: item.bound_type_name,
  1400. value: item.bound_type_code,
  1401. }));
  1402. // 编码 → 名称的映射(普通对象,确保响应式)
  1403. _this.bound_desc_map = res.results.reduce((acc, item) => {
  1404. acc[item.bound_type_code] = item.bound_type_name;
  1405. return acc;
  1406. }, {});
  1407. })
  1408. .catch((err) => {
  1409. _this.$q.notify({
  1410. message: err.detail,
  1411. icon: "close",
  1412. color: "negative",
  1413. });
  1414. });
  1415. getauth("warehouse/department/?max_page=1000", {})
  1416. .then((res) => {
  1417. _this.bound_department_list = res.results.map((item) => ({
  1418. label: item.department_name,
  1419. value: item.department_code,
  1420. }));
  1421. _this.bound_department_map = res.results.reduce((acc, item) => {
  1422. acc[item.department_code] = item.department_name;
  1423. return acc;
  1424. }, {});
  1425. })
  1426. .catch((err) => {
  1427. _this.$q.notify({
  1428. message: err.detail,
  1429. icon: "close",
  1430. color: "negative",
  1431. });
  1432. });
  1433. getauth("warehouse/boundbusiness/", {})
  1434. .then((res) => {
  1435. _this.bound_bs_type_list = res.results.map((item) => ({
  1436. label: item.bound_bs_name,
  1437. value: item.bound_bs_code,
  1438. }));
  1439. // 编码 → 名称的映射(普通对象,确保响应式)
  1440. _this.bound_bs_type_map = res.results.reduce((acc, item) => {
  1441. acc[item.bound_bs_code] = item.bound_bs_name;
  1442. return acc;
  1443. }, {});
  1444. })
  1445. .catch((err) => {
  1446. _this.$q.notify({
  1447. message: err.detail,
  1448. icon: "close",
  1449. color: "negative",
  1450. });
  1451. });
  1452. getauth("warehouse/status/", {})
  1453. .then((res) => {
  1454. _this.bound_status_list = res.results.map((item) => ({
  1455. label: item.bound_status_name,
  1456. value: item.bound_status_code,
  1457. }));
  1458. _this.bound_status_map = res.results.reduce((acc, item) => {
  1459. acc[item.bound_status_code] = item.bound_status_name;
  1460. return acc;
  1461. }, {});
  1462. })
  1463. .catch((err) => {
  1464. _this.$q.notify({
  1465. message: err.detail,
  1466. icon: "close",
  1467. color: "negative",
  1468. });
  1469. });
  1470. },
  1471. mounted() {
  1472. var _this = this;
  1473. if (_this.$q.platform.is.electron) {
  1474. _this.height = String(_this.$q.screen.height - 290) + "px";
  1475. } else {
  1476. _this.height = _this.$q.screen.height - 290 + "" + "px";
  1477. }
  1478. _this.newFormData.creater = _this.login_name;
  1479. },
  1480. updated() {},
  1481. destroyed() {},
  1482. watch: {
  1483. isorder: function (val) {
  1484. console.log(val);
  1485. if (val) {
  1486. this.order = "true";
  1487. } else {
  1488. this.order = "false";
  1489. }
  1490. },
  1491. createDate1(val) {
  1492. if (val) {
  1493. if (val.to) {
  1494. this.createDate2 = `${val.from} - ${val.to}`;
  1495. this.date_range = `${val.from},${val.to} `;
  1496. // this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__range=' + this.date_range
  1497. } else {
  1498. this.createDate2 = `${val}`;
  1499. this.dateArray = val.split("/");
  1500. this.searchUrl =
  1501. this.pathname +
  1502. "?" +
  1503. "document_date__year=" +
  1504. this.dateArray[0] +
  1505. "&" +
  1506. "document_date__month=" +
  1507. this.dateArray[1] +
  1508. "&" +
  1509. "document_date__day=" +
  1510. this.dateArray[2];
  1511. // this.downloadhUrl = this.pathname + 'filelist/?' + 'document_date__year=' + this.dateArray[0] + '&' + 'document_date__month=' + this.dateArray[1] + '&' + 'document_date__day=' + this.dateArray[2]
  1512. }
  1513. this.date_range = this.date_range.replace(/\//g, "-");
  1514. this.getSearchList();
  1515. this.$refs.qDateProxy.hide();
  1516. } else {
  1517. this.createDate2 = "";
  1518. this.date_range = "";
  1519. this.getSearchList();
  1520. }
  1521. },
  1522. },
  1523. };
  1524. </script>
  1525. <style scoped>
  1526. /* 添加在 <style> 中 */
  1527. .q-date__calendar-item--selected {
  1528. transition: all 0.3s ease;
  1529. background-color: #1976d2 !important;
  1530. }
  1531. .q-date__range {
  1532. background-color: rgba(25, 118, 210, 0.1);
  1533. }
  1534. :deep(.q-field__label) {
  1535. margin-top: 8px;
  1536. align-self: center;
  1537. }
  1538. :deep(.q-field__control-container) {
  1539. padding-left: 50px;
  1540. margin-top: -5px;
  1541. }
  1542. </style>