pickup_form.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header :content="listItem ? (flag ? '详情' : '编辑') : '新增'" @back="goBack" />
  4. <el-divider />
  5. <div>
  6. <el-form
  7. ref="mainForm"
  8. :model="mainForm"
  9. :rules="mainFormRules"
  10. label-width="80px"
  11. size="small"
  12. label-position="left"
  13. >
  14. <el-row :gutter="20">
  15. <el-col :xs="24" :sm="12" :lg="8">
  16. <el-form-item label="选择仓库" prop="warehouse">
  17. <el-select
  18. v-model="mainForm.warehouse"
  19. placeholder="请选择仓库"
  20. style="width: 100%"
  21. :disabled="!!listItem"
  22. >
  23. <el-option
  24. v-for="(item, index) in warehouseList"
  25. :key="index"
  26. :label="item.name"
  27. :value="item.id"
  28. />
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="8">
  33. <el-button size="small" type="primary" :disabled="!!listItem" @click="getDeliverList">确定</el-button>
  34. </el-col>
  35. </el-row>
  36. <el-row :gutter="20">
  37. <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
  38. <el-form-item label="预约日期" prop="date">
  39. <el-date-picker
  40. v-model="mainForm.date"
  41. :disabled="flag"
  42. type="date"
  43. value-format="yyyy-MM-dd"
  44. style="width: 100%"
  45. :picker-options="setDisabled"
  46. placeholder="选择日期"
  47. />
  48. </el-form-item>
  49. </el-col>
  50. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px">
  51. <el-form-item label="预约时段" prop="timeSlot">
  52. <el-radio-group v-model="mainForm.timeSlot" :disabled="flag">
  53. <el-radio :label="1">上午</el-radio>
  54. <el-radio :label="2">下午</el-radio>
  55. </el-radio-group>
  56. </el-form-item>
  57. </el-col>
  58. </el-row>
  59. <el-row :gutter="20">
  60. <el-col :xs="24" :sm="12" :lg="8">
  61. <el-form-item label="提货方式" prop="pickupWay">
  62. <el-radio-group v-model="mainForm.pickupWay" :disabled="flag">
  63. <el-radio
  64. v-for="(item, index) in pickupWayList"
  65. :key="index"
  66. :label="item.dictCode"
  67. :disabled="item.disabled"
  68. >{{ item.dictValue }}
  69. </el-radio>
  70. </el-radio-group>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :xs="24" :sm="12" :lg="8">
  74. <el-form-item v-if="mainForm.pickupWay == '1'" label="提货人" prop="pickupMan">
  75. <el-select v-model="mainForm.pickupMan" placeholder="全部" :disabled="flag" style="width: 100%">
  76. <el-option
  77. v-for="(item, index) in pickupManList"
  78. :key="index"
  79. :label="item.takerName"
  80. :value="item.id"
  81. />
  82. </el-select>
  83. </el-form-item>
  84. </el-col>
  85. <el-col v-if="mainForm.pickupWay == '1'" :xs="24" :sm="12" :lg="8">
  86. <el-form-item label="提货车辆" prop="pickupCar">
  87. <el-select v-model="mainForm.pickupCar" placeholder="全部" style="width: 100%" :disabled="flag">
  88. <el-option
  89. v-for="(item, index) in pickupCarList"
  90. :key="index"
  91. :label="item.carBrand"
  92. :value="item.id"
  93. />
  94. </el-select>
  95. </el-form-item>
  96. </el-col>
  97. <template v-if="mainForm.pickupWay == '2'">
  98. <el-col :xs="24" :sm="12" :lg="8">
  99. <el-form-item label="物流公司" prop="company">
  100. <el-select
  101. v-model="mainForm.logisticsId"
  102. placeholder="全部"
  103. style="width: 100%"
  104. :disabled="flag"
  105. @change="getLogisticsId"
  106. >
  107. <el-option
  108. v-for="(item, index) in companyList"
  109. :key="index"
  110. :label="item.logisticsCompany"
  111. :value="item.id"
  112. />
  113. </el-select>
  114. </el-form-item>
  115. </el-col>
  116. <el-col class="pd-lr" :span="16">
  117. <el-col :xs="24" :sm="12" :lg="12">
  118. <el-form-item label="是否上楼" prop="isUp">
  119. <el-radio-group v-model="mainForm.isUp" :disabled="flag">
  120. <el-radio label="YES"> 是 </el-radio>
  121. <el-radio label="NO"> 否 </el-radio>
  122. </el-radio-group>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :xs="24" :sm="12" :lg="12">
  126. <el-form-item label="是否卸货" prop="isDischarge">
  127. <el-radio-group v-model="mainForm.isDischarge" :disabled="flag">
  128. <el-radio label="YES"> 是 </el-radio>
  129. <el-radio label="NO"> 否 </el-radio>
  130. </el-radio-group>
  131. </el-form-item>
  132. </el-col>
  133. </el-col>
  134. </template>
  135. <el-col :xs="24" :sm="12" :lg="8">
  136. <el-form-item label="备注" prop="remark">
  137. <el-input v-model="mainForm.remark" placeholder="请输入备注" :disabled="flag" />
  138. </el-form-item>
  139. </el-col>
  140. </el-row>
  141. <!-- <el-row :gutter="20">-->
  142. <!-- <template v-if="logisticsNumber === '001'">-->
  143. <!-- <el-col :xs="24" :sm="8" :lg="8">-->
  144. <!-- <el-form-item label="收货客户" :prop="logisticsNumber === '001' ? 'receivingName' : ''">-->
  145. <!-- <el-input v-model="mainForm.receivingName" :disabled="flag" placeholder="请输入收货客户"></el-input>-->
  146. <!-- </el-form-item>-->
  147. <!-- </el-col>-->
  148. <!-- <el-col :xs="24" :sm="8" :lg="8">-->
  149. <!-- <el-form-item label="电话" :prop="logisticsNumber === '001' ? 'phone' : ''">-->
  150. <!-- <el-input v-model="mainForm.phone" :disabled="flag" placeholder="请输入电话"></el-input>-->
  151. <!-- </el-form-item>-->
  152. <!-- </el-col>-->
  153. <!-- <el-col :xs="24" :sm="8" :lg="8">-->
  154. <!-- <el-form-item label="收货地址" :prop="logisticsNumber === '001' ? 'address' : ''">-->
  155. <!-- <el-input v-model="mainForm.address" :disabled="flag" placeholder="请输入收货地址"></el-input>-->
  156. <!-- </el-form-item>-->
  157. <!-- </el-col>-->
  158. <!-- </template>-->
  159. <!-- <el-col :xs="24" :sm="24" :lg="24">-->
  160. <!-- <el-form-item label="备注内容" prop="remark">-->
  161. <!-- <el-input v-model="mainForm.remark" :disabled="flag" placeholder="请输入备注内容"></el-input>-->
  162. <!-- </el-form-item>-->
  163. <!-- </el-col>-->
  164. <!-- </el-row>-->
  165. </el-form>
  166. </div>
  167. <div class="mymain-container">
  168. <div class="table">
  169. <el-table
  170. ref="table"
  171. v-loading="listLoading"
  172. :data="deliverList"
  173. element-loading-text="Loading"
  174. border
  175. fit
  176. height="520"
  177. highlight-current-row
  178. stripe
  179. @select="handleSelect"
  180. @select-all="handleSelectAll"
  181. >
  182. <el-table-column align="center" type="selection" width="55" />
  183. <template v-if="logisticsNumber === '001' && mainForm.pickupWay == 2">
  184. <el-table-column align="left" label="仓库" prop="invoiceId" min-width="160" show-overflow-tooltip>
  185. <template v-slot="{ row }">
  186. <el-select
  187. v-model="row.warehouseFlag"
  188. value-key=""
  189. placeholder=""
  190. :disabled="flag"
  191. filterable
  192. size="mini"
  193. @change="storeChange($event, row)"
  194. >
  195. <el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value" />
  196. </el-select>
  197. </template>
  198. </el-table-column>
  199. <el-table-column align="left" label="收货客户" prop="orderTime" min-width="100" show-overflow-tooltip>
  200. <template slot-scope="scope">
  201. <el-input
  202. v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
  203. v-model="scope.row.receivingName"
  204. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  205. size="mini"
  206. @input="handleInput($event, scope.row.invoiceId, 1)"
  207. />
  208. <template v-else>
  209. <template v-if="listItem">
  210. <el-input
  211. v-model="scope.row.receivingName"
  212. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  213. size="mini"
  214. />
  215. </template>
  216. <template v-else>
  217. <el-input
  218. v-model="scope.row.refLinkman"
  219. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  220. size="mini"
  221. />
  222. </template>
  223. </template>
  224. </template>
  225. </el-table-column>
  226. <el-table-column align="left" label="电话" prop="orderTime" min-width="150" show-overflow-tooltip>
  227. <template slot-scope="scope">
  228. <el-input
  229. v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
  230. v-model="scope.row.phone"
  231. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  232. size="mini"
  233. @input="handleInput($event, scope.row.invoiceId, 2)"
  234. />
  235. <template v-else>
  236. <template v-if="listItem">
  237. <el-input
  238. v-model="scope.row.phone"
  239. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  240. size="mini"
  241. />
  242. </template>
  243. <template v-else>
  244. <el-input
  245. v-model="scope.row.refPhone"
  246. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  247. size="mini"
  248. />
  249. </template>
  250. </template>
  251. </template>
  252. </el-table-column>
  253. <el-table-column align="left" label="收货地址" prop="orderTime" min-width="200" show-overflow-tooltip>
  254. <template slot-scope="scope">
  255. <el-input
  256. v-if="!(scope.row.orderType === 'TRADE' || scope.row.orderType === 'HOME')"
  257. v-model="scope.row.address"
  258. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  259. size="mini"
  260. @input="handleInput($event, scope.row.invoiceId, 3)"
  261. />
  262. <template v-else>
  263. <template v-if="listItem">
  264. <el-input
  265. v-model="scope.row.address"
  266. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  267. size="mini"
  268. />
  269. </template>
  270. <template v-else>
  271. <el-input
  272. v-model="scope.row.refInstallAddress"
  273. :disabled="flag || scope.row.warehouseFlag == 0 || scope.row.warehouseFlag == null"
  274. size="mini"
  275. />
  276. </template>
  277. </template>
  278. </template>
  279. </el-table-column>
  280. </template>
  281. <el-table-column
  282. align="left"
  283. label="经销商订单"
  284. prop="customerOrderId"
  285. min-width="160"
  286. show-overflow-tooltip
  287. >
  288. <template slot-scope="scope">
  289. <el-input v-model="scope.row.customerOrderId" placeholder="请输入" size="mini" clearable @input="handleOrderIdChange($event, scope.row)" />
  290. </template>
  291. </el-table-column>
  292. <el-table-column
  293. align="left"
  294. label="发货申请单"
  295. prop="invoiceId"
  296. min-width="160"
  297. show-overflow-tooltip
  298. />
  299. <el-table-column
  300. align="right"
  301. label="数量"
  302. prop="refundableQty"
  303. min-width="100"
  304. show-overflow-tooltip
  305. />
  306. <el-table-column align="left" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
  307. <template slot-scope="scope">
  308. {{ scope.row.orderTime | dateToDayFilter }}
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. align="left"
  313. label="工程登录编号"
  314. prop="refEnginRecordNo"
  315. min-width="160"
  316. show-overflow-tooltip
  317. >
  318. <template v-if="scope.row" slot-scope="scope">
  319. <CopyButton
  320. :copy-text="scope.row.refEnginRecordNo"
  321. />
  322. <span>{{
  323. scope.row.refEnginRecordNo
  324. }}</span>
  325. </template>
  326. </el-table-column>
  327. <el-table-column align="left" label="销售订单号" min-width="160" show-overflow-tooltip>
  328. <template v-if="scope.row" slot-scope="scope">
  329. <CopyButton
  330. :copy-text="
  331. scope.row.orderType === 'TRADE' ||
  332. scope.row.orderType === 'HOME' ||
  333. scope.row.orderType === 'REQUISITION_TRADE' ||
  334. scope.row.orderType === 'REQUISITION_HOME'
  335. ? scope.row.enginOrderNo
  336. : scope.row.mainOrderId
  337. "
  338. />
  339. <span>{{
  340. (scope.row.orderType === 'TRADE' ||
  341. scope.row.orderType === 'HOME' ||
  342. scope.row.orderType === 'REQUISITION_TRADE' ||
  343. scope.row.orderType === 'REQUISITION_HOME')
  344. ? scope.row.enginOrderNo
  345. : scope.row.mainOrderId
  346. }}</span>
  347. </template>
  348. </el-table-column>
  349. <!-- <el-table-column align="left" label="工程编号" prop="enginOrderNo" min-width="140" show-overflow-tooltip></el-table-column> -->
  350. <el-table-column
  351. align="left"
  352. label="销售类型"
  353. prop="saleTypeName"
  354. min-width="160"
  355. show-overflow-tooltip
  356. />
  357. <el-table-column
  358. align="left"
  359. label="物料编码"
  360. prop="materialCode"
  361. min-width="160"
  362. show-overflow-tooltip
  363. />
  364. <el-table-column
  365. align="left"
  366. label="产品名称"
  367. prop="materialName"
  368. min-width="160"
  369. show-overflow-tooltip
  370. />
  371. <el-table-column
  372. align="left"
  373. label="规格型号"
  374. prop="specification"
  375. min-width="160"
  376. show-overflow-tooltip
  377. />
  378. <el-table-column
  379. align="left"
  380. label="单位"
  381. prop="unit"
  382. min-width="100"
  383. show-overflow-tooltip
  384. />
  385. <el-table-column v-if="flag && mainForm.pickupWay == '2'" fixed="right" label="操作" width="250">
  386. <template slot-scope="scope">
  387. <el-button type="text" size="small" @click="handLogistics(scope.row)">物流信息</el-button>
  388. <el-button type="text" size="small" @click="getListCostBillV2(scope.row)">物流费用</el-button>
  389. <el-button type="text" size="small" @click="getListCodeV2(scope.row)">出库条码</el-button>
  390. </template>
  391. </el-table-column>
  392. </el-table>
  393. </div>
  394. </div>
  395. <div class="page-footer">
  396. <div class="footer" :class="classObj">
  397. <el-button
  398. v-if="!flag"
  399. type="primary"
  400. :loading="formLoading"
  401. @click="clickSubmitForm"
  402. >{{ formLoading ? '提交中 ...' : '提 交' }}
  403. </el-button>
  404. <el-popconfirm v-if="!listItem" title="确定重置吗?" style="margin-left: 10px" @onConfirm="resetForm">
  405. <el-button slot="reference">重 置</el-button>
  406. </el-popconfirm>
  407. </div>
  408. </div>
  409. <el-dialog
  410. title="物流信息"
  411. append-to-body
  412. :visible.sync="visible"
  413. width="60%"
  414. :close-on-click-modal="false"
  415. @close="onClose"
  416. >
  417. <el-timeline v-if="logisticsDetail.length" class="logistics" :reverse="false">
  418. <el-timeline-item
  419. v-for="(item, index) in logisticsDetail"
  420. :key="index"
  421. placement="top"
  422. type="success"
  423. :timestamp="item.time"
  424. >
  425. <el-row :gutter="20">
  426. <el-col class="logistics-title"> {{ item.status }} </el-col>
  427. <el-col>
  428. <div class="flex">
  429. <div>{{ item.context }}</div>
  430. <!-- <div>{{ item.createTime }}</div> -->
  431. </div>
  432. </el-col>
  433. </el-row>
  434. </el-timeline-item>
  435. </el-timeline>
  436. <div v-else class="tip">暂无物流信息</div>
  437. </el-dialog>
  438. <el-dialog
  439. title="物流费用"
  440. append-to-body
  441. :visible.sync="logisticsVisible"
  442. width="60%"
  443. :close-on-click-modal="false"
  444. @close="onClose"
  445. >
  446. <zj-table
  447. :table-attributes="defaultTableAttributes"
  448. :is-drop="true"
  449. :columns="formLogistics"
  450. :table-data="logisticsData"
  451. />
  452. </el-dialog>
  453. <el-dialog
  454. title="出库条码"
  455. append-to-body
  456. :visible.sync="outboundVisible"
  457. width="60%"
  458. :close-on-click-modal="false"
  459. @close="onClose"
  460. >
  461. <zj-table
  462. :table-attributes="defaultTableAttributes"
  463. :is-drop="true"
  464. :columns="formOutbound"
  465. :table-data="outboundData"
  466. />
  467. </el-dialog>
  468. </div>
  469. </template>
  470. <script>
  471. import {
  472. getWarehouseList,
  473. getDeliverList,
  474. getPickupManList,
  475. getPickupCarList,
  476. getCompanyList,
  477. addPickupBook,
  478. editPickupBook,
  479. getDetail,
  480. checkStock,
  481. getListOrderTrack
  482. } from '@/api/supply/pickup'
  483. import { getListCostBillV2 } from '@/api/logisticsBill'
  484. import { getListCodeV2 } from '@/api/barcode'
  485. import { getDictList } from '@/api/common'
  486. import { mapGetters } from 'vuex'
  487. export default {
  488. name: 'PickupForm',
  489. componentName: 'PickupForm',
  490. props: ['listItem', 'flag'],
  491. data() {
  492. return {
  493. deliverList: null, // 列表数据
  494. listLoading: false, // 列表加载loading
  495. mainForm: {
  496. // 筛选表单数据
  497. warehouse: '',
  498. date: '',
  499. timeSlot: '',
  500. pickupWay: '',
  501. pickupMan: '',
  502. pickupCar: '',
  503. company: '',
  504. remark: '',
  505. logisticsId: '',
  506. receivingName: '',
  507. phone: '',
  508. address: '',
  509. isUp: 'NO',
  510. isDischarge: 'NO'
  511. },
  512. mainFormRules: {
  513. date: [{ required: true, message: '请选择预约日期', trigger: 'change' }],
  514. timeSlot: [{ required: true, message: '请选择预约时段', trigger: 'change' }],
  515. pickupWay: [{ required: true, message: '请选择提货方式', trigger: 'change' }],
  516. pickupMan: [{ required: true, message: '请选择提货人', trigger: 'change' }],
  517. company: [{ required: true, message: '请选择物流公司', trigger: 'change' }]
  518. // receivingName: [{ required: true, message: '请填写收货客户', trigger: 'change' }],
  519. // phone: [{ required: true, message: '请填写电话', trigger: 'change' }]
  520. // address: [{ required: true, message: '请填写收货地址', trigger: 'change' }]
  521. },
  522. formLoading: false,
  523. tableSelection: [],
  524. warehouseList: [],
  525. pickupWayList: [],
  526. pickupManList: [],
  527. pickupCarList: [],
  528. companyList: [],
  529. defaultTableAttributes: {
  530. border: true,
  531. headerCellClassName: 'headerRowColor',
  532. size: 'mini',
  533. 'summary-method': this.$getSummaries,
  534. 'show-summary': true
  535. },
  536. logisticsNumber: '',
  537. storeList: [
  538. {
  539. label: '前置仓',
  540. value: 0
  541. },
  542. {
  543. label: '工程机',
  544. value: 1
  545. },
  546. {
  547. label: '商家仓',
  548. value: 2
  549. }
  550. ],
  551. setDisabled: {
  552. disabledDate: time => {
  553. return time.getTime() < new Date() - 24 * 3600 * 1000
  554. }
  555. },
  556. visible: false,
  557. logisticsVisible: false,
  558. outboundVisible: false,
  559. orderId: '',
  560. logisticsDetail: [],
  561. frontPickType: null,
  562. isFront: null,
  563. isPick: null,
  564. isPickUpGoods: false,
  565. logisticsData: [],
  566. outboundData: []
  567. }
  568. },
  569. computed: {
  570. sidebar() {
  571. return this.$store.state.app.sidebar
  572. },
  573. classObj() {
  574. return {
  575. hideSidebar: !this.sidebar.opened,
  576. openSidebar: this.sidebar.opened
  577. }
  578. },
  579. ...mapGetters(['userInfo']),
  580. formLogistics() {
  581. return [
  582. {
  583. columnAttributes: {
  584. label: '补贴费用',
  585. prop: 'allowanceCost',
  586. width: 200
  587. }
  588. },
  589. {
  590. columnAttributes: {
  591. label: '所属销售公司类型',
  592. prop: 'belongCompanyType',
  593. width: 200
  594. },
  595. render: (h, { row }) => {
  596. const { belongCompanyType } = row
  597. const typeObj = {
  598. GE_JIANG: '格匠',
  599. GUANG_ZHOU: '广州销售公司',
  600. FO_SHAN: '佛山销售公司',
  601. OTHER: '其他销售公司'
  602. }
  603. return <div>{typeObj[belongCompanyType]}</div>
  604. }
  605. },
  606. {
  607. columnAttributes: {
  608. label: '运费结算系数',
  609. prop: 'coefficient',
  610. width: 200
  611. }
  612. },
  613. {
  614. columnAttributes: {
  615. label: '备注',
  616. prop: 'comment',
  617. width: 200
  618. }
  619. },
  620. {
  621. columnAttributes: {
  622. label: '最终运费',
  623. prop: 'cost',
  624. width: 200
  625. }
  626. },
  627. {
  628. columnAttributes: {
  629. label: '客户名称',
  630. prop: 'customerName',
  631. width: 200
  632. }
  633. },
  634. {
  635. columnAttributes: {
  636. label: '客户电话',
  637. prop: 'customerPhone',
  638. width: 200
  639. }
  640. },
  641. {
  642. columnAttributes: {
  643. label: '无法生成的原因',
  644. prop: 'errorResult',
  645. width: 200
  646. }
  647. },
  648. {
  649. columnAttributes: {
  650. label: '是否已经对过帐',
  651. prop: 'isAccountChecking',
  652. width: 200
  653. },
  654. render: (h, { row }) => {
  655. const { isAccountChecking } = row
  656. return <div>{+isAccountChecking ? '是' : '否'}</div>
  657. }
  658. },
  659. {
  660. columnAttributes: {
  661. label: '是否已经审核',
  662. prop: 'isAudit',
  663. width: 200
  664. },
  665. render: (h, { row }) => {
  666. const { isAudit } = row
  667. return <div>{+isAudit ? '是' : '否'}</div>
  668. }
  669. },
  670. {
  671. columnAttributes: {
  672. label: '是否完结',
  673. prop: 'isFinish',
  674. width: 200
  675. },
  676. render: (h, { row }) => {
  677. const { isFinish } = row
  678. return <div>{+isFinish ? '已经完结' : '未完结'}</div>
  679. }
  680. },
  681. {
  682. columnAttributes: {
  683. label: '实际是否卸货',
  684. prop: 'isRealUnload',
  685. width: 200
  686. },
  687. render: (h, { row }) => {
  688. const { isRealUnload } = row
  689. return <div>{+isRealUnload ? '是' : '否'}</div>
  690. }
  691. },
  692. {
  693. columnAttributes: {
  694. label: '实际是否上楼',
  695. prop: 'isRealUpstairs',
  696. width: 200
  697. },
  698. render: (h, { row }) => {
  699. const { isRealUpstairs } = row
  700. return <div>{+isRealUpstairs ? '是' : '否'}</div>
  701. }
  702. },
  703. {
  704. columnAttributes: {
  705. label: '是否卸货',
  706. prop: 'isUnload',
  707. width: 200
  708. },
  709. render: (h, { row }) => {
  710. const { isUnload } = row
  711. return <div>{+isUnload ? '是' : '否'}</div>
  712. }
  713. },
  714. {
  715. columnAttributes: {
  716. label: '是否上楼',
  717. prop: 'isUpstairs',
  718. width: 200
  719. },
  720. render: (h, { row }) => {
  721. const { isUpstairs } = row
  722. return <div>{+isUpstairs ? '是' : '否'}</div>
  723. }
  724. },
  725. {
  726. columnAttributes: {
  727. label: '物料名称',
  728. prop: 'materialCode',
  729. width: 200
  730. }
  731. },
  732. {
  733. columnAttributes: {
  734. label: '计费分类',
  735. prop: 'materialCostType',
  736. width: 200
  737. }
  738. },
  739. {
  740. columnAttributes: {
  741. label: '产品名称',
  742. prop: 'materialName',
  743. width: 200
  744. }
  745. },
  746. {
  747. columnAttributes: {
  748. label: '规格型号',
  749. prop: 'materialSpecification',
  750. width: 350
  751. }
  752. },
  753. {
  754. columnAttributes: {
  755. label: '物料类型',
  756. prop: 'materialType',
  757. width: 200
  758. }
  759. },
  760. {
  761. columnAttributes: {
  762. label: '商家编码',
  763. prop: 'merchantCode',
  764. width: 200
  765. }
  766. },
  767. {
  768. columnAttributes: {
  769. label: '商家名称',
  770. prop: 'merchantName',
  771. width: 200
  772. }
  773. },
  774. {
  775. columnAttributes: {
  776. label: '订单号',
  777. prop: 'orderCode',
  778. width: 200
  779. }
  780. },
  781. {
  782. columnAttributes: {
  783. label: '订单时间',
  784. prop: 'orderDate',
  785. width: 200
  786. }
  787. },
  788. {
  789. columnAttributes: {
  790. label: '订单类型',
  791. prop: 'orderType',
  792. width: 200
  793. },
  794. render: (h, { row }) => {
  795. const { orderType } = row
  796. const typeObj = {
  797. TOB: '商家机工程机类型',
  798. ALL: '所有类型,广州的订单统一 开单价',
  799. TOC: '佛山销售销售订单类型公司'
  800. }
  801. return <div>{typeObj[orderType]}</div>
  802. }
  803. },
  804. {
  805. columnAttributes: {
  806. label: '订单类型细分',
  807. prop: 'orderTypeDetail',
  808. width: 200
  809. },
  810. render: (h, { row }) => {
  811. const { orderType } = row
  812. const typeObj = {
  813. PICKING_UP_ORDER: '前置仓提货订单',
  814. SALE_ORDER: '销售订单',
  815. MERCHANT_WAREHOUSE_ORDER: '商家仓订单',
  816. PROJECT_ORDER: '工程机订单',
  817. SALE_RETURN_ORDER: '销售退货单'
  818. }
  819. return <div>{typeObj[orderType]}</div>
  820. }
  821. },
  822. {
  823. columnAttributes: {
  824. label: '收货送货地址',
  825. prop: 'receiptAddress',
  826. width: 200
  827. }
  828. },
  829. {
  830. columnAttributes: {
  831. label: '退货单号',
  832. prop: 'returnOrderCode',
  833. width: 200
  834. }
  835. },
  836. {
  837. columnAttributes: {
  838. label: '补贴结算系数',
  839. prop: 'subsidyCoefficient',
  840. width: 200
  841. }
  842. },
  843. {
  844. columnAttributes: {
  845. label: '嘉贤创建时间',
  846. prop: 'time',
  847. width: 200
  848. }
  849. },
  850. {
  851. columnAttributes: {
  852. label: '费用汇总',
  853. prop: 'totalCost',
  854. width: 200
  855. }
  856. },
  857. {
  858. columnAttributes: {
  859. label: '单价计算',
  860. prop: 'unitPrice',
  861. width: 200
  862. }
  863. },
  864. {
  865. columnAttributes: {
  866. label: '卸货上楼结算系数',
  867. prop: 'unloadUpstairsCoefficient',
  868. width: 200
  869. }
  870. },
  871. {
  872. columnAttributes: {
  873. label: '上楼卸货费用',
  874. prop: 'unloadUpstairsCost',
  875. width: 200
  876. }
  877. },
  878. {
  879. columnAttributes: {
  880. label: '发货仓库编码',
  881. prop: 'warehouseCode',
  882. width: 200
  883. }
  884. },
  885. {
  886. columnAttributes: {
  887. label: '发货仓库名称',
  888. prop: 'warehouseName',
  889. width: 200
  890. }
  891. }
  892. ]
  893. },
  894. formOutbound() {
  895. return [
  896. {
  897. columnAttributes: {
  898. label: '条码',
  899. prop: 'barCode',
  900. width: 200
  901. }
  902. },
  903. {
  904. columnAttributes: {
  905. label: '出库时间',
  906. prop: 'consignerTime',
  907. width: 200
  908. }
  909. },
  910. {
  911. columnAttributes: {
  912. label: '出库时间',
  913. prop: 'consignerTimeV2',
  914. width: 200
  915. }
  916. },
  917. {
  918. columnAttributes: {
  919. label: '创建人',
  920. prop: 'createBy',
  921. width: 200
  922. }
  923. },
  924. {
  925. columnAttributes: {
  926. label: '创建时间',
  927. prop: 'createTime',
  928. width: 200
  929. }
  930. },
  931. {
  932. columnAttributes: {
  933. label: '送货时间',
  934. prop: 'deliveryTime',
  935. width: 200
  936. }
  937. },
  938. {
  939. columnAttributes: {
  940. label: '送货时间',
  941. prop: 'deliveryTimeV2',
  942. width: 200
  943. }
  944. },
  945. {
  946. columnAttributes: {
  947. label: '条码唯一id',
  948. prop: 'id',
  949. width: 200
  950. }
  951. },
  952. {
  953. columnAttributes: {
  954. label: '物料代码',
  955. prop: 'materialCode',
  956. width: 200
  957. }
  958. },
  959. {
  960. columnAttributes: {
  961. label: '物料类型',
  962. prop: 'materialType',
  963. width: 200
  964. }
  965. },
  966. {
  967. columnAttributes: {
  968. label: '销售订单号',
  969. prop: 'orderNumber',
  970. width: 200
  971. }
  972. },
  973. {
  974. columnAttributes: {
  975. label: '收货人',
  976. prop: 'receiptCompany',
  977. width: 200
  978. }
  979. },
  980. {
  981. columnAttributes: {
  982. label: '商家名称',
  983. prop: 'salesCompany',
  984. width: 200
  985. }
  986. },
  987. {
  988. columnAttributes: {
  989. label: '规格',
  990. prop: 'specification',
  991. width: 350
  992. }
  993. },
  994. {
  995. columnAttributes: {
  996. label: '更新人',
  997. prop: 'updateBy',
  998. width: 200
  999. }
  1000. },
  1001. {
  1002. columnAttributes: {
  1003. label: '修改时间',
  1004. prop: 'updateTime',
  1005. width: 200
  1006. }
  1007. },
  1008. {
  1009. columnAttributes: {
  1010. label: '发货仓库名称',
  1011. prop: 'warehouse',
  1012. width: 200
  1013. }
  1014. }
  1015. ]
  1016. }
  1017. },
  1018. created() {
  1019. this.getWarehouseList()
  1020. this.getPickupWayList()
  1021. this.getPickupManList()
  1022. this.getPickupCarList()
  1023. this.getCompanyList()
  1024. if (this.listItem) {
  1025. this.getDetail()
  1026. }
  1027. },
  1028. methods: {
  1029. // 查询按钮权限
  1030. checkBtnRole(value) {
  1031. // let btnRole = this.$route.meta.roles;
  1032. // if(!btnRole) {return true}
  1033. // let index = btnRole.indexOf(value);
  1034. // return index >= 0;
  1035. return true
  1036. },
  1037. // 返回列表
  1038. goBack() {
  1039. this.$emit('backListFormDetail')
  1040. },
  1041. storeChange(e, row) {
  1042. console.log(e, row)
  1043. this.deliverList.forEach(item => {
  1044. if (item.invoiceId === row.invoiceId) {
  1045. this.$set(item, 'warehouseFlag', e)
  1046. if (e == 0) {
  1047. if (!(item.orderType === 'TRADE' || item.orderType === 'HOME')) {
  1048. if (item.receivingName && item.phone && item.address) {
  1049. item.copyReceivingName = item.receivingName
  1050. item.copyPhone = item.phone
  1051. item.copyAddress = item.address
  1052. item.receivingName = ''
  1053. item.phone = ''
  1054. item.address = ''
  1055. }
  1056. } else {
  1057. if (item.refLinkman && item.refPhone && item.refInstallAddress) {
  1058. item.copyRefLinkman = item.refLinkman
  1059. item.copyRefPhone = item.refPhone
  1060. item.copyRefInstallAddress = item.refInstallAddress
  1061. item.refLinkman = ''
  1062. item.refPhone = ''
  1063. item.refInstallAddress = ''
  1064. }
  1065. }
  1066. }
  1067. if (e == 1) {
  1068. item.refLinkman = item.copyRefLinkman || item.copyReceivingName || item.refLinkman
  1069. item.refPhone = item.copyRefPhone || item.copyPhone || item.refPhone
  1070. item.refInstallAddress = item.copyRefInstallAddress || item.copyAddress || item.refInstallAddress
  1071. }
  1072. if (e == 2) {
  1073. item.receivingName = item.copyReceivingName
  1074. item.phone = item.copyPhone
  1075. item.address = item.copyAddress
  1076. }
  1077. }
  1078. })
  1079. },
  1080. handleOrderIdChange(e, row) {
  1081. this.deliverList.forEach(item => {
  1082. if (item.invoiceId === row.invoiceId) {
  1083. this.$set(item, 'customerOrderId', e)
  1084. }
  1085. })
  1086. },
  1087. handleInput(e, id, type) {
  1088. console.log(e)
  1089. this.deliverList.forEach(k => {
  1090. if (k.invoiceId === id) {
  1091. switch (type) {
  1092. case 1:
  1093. k.receivingName = e
  1094. break
  1095. case 2:
  1096. k.phone = e
  1097. break
  1098. default:
  1099. k.address = e
  1100. }
  1101. }
  1102. })
  1103. },
  1104. // 获取详情
  1105. getDetail() {
  1106. getDetail({ id: this.listItem.id }).then(res => {
  1107. const data = res.data
  1108. this.mainForm.warehouse = data.correspondId
  1109. this.mainForm.date = data.pickTime.slice(0, 10)
  1110. this.mainForm.timeSlot = Number(data.pickStatus)
  1111. this.mainForm.pickupWay = String(data.pickType)
  1112. this.mainForm.pickupMan = data.takerId
  1113. this.mainForm.pickupCar = data.takerCarId
  1114. this.mainForm.company = data.pickLogistics
  1115. this.mainForm.remark = data.remark
  1116. this.mainForm.logisticsId = data.logisticsId
  1117. this.mainForm.isUp = data.isUp
  1118. this.mainForm.isDischarge = data.isDischarge
  1119. if (this.mainForm.pickupWay == 2) {
  1120. const item = this.companyList.find(k => k.id === data.logisticsId)
  1121. this.logisticsNumber = item.logisticsNumber
  1122. }
  1123. data.invoicePickBeans.forEach(k => {
  1124. if (k.warehouseFlag == 0) {
  1125. if (!(k.orderType === 'TRADE' || k.orderType === 'HOME')) {
  1126. if (k.receivingName && k.phone && k.address) {
  1127. k.copyReceivingName = k.receivingName
  1128. k.copyPhone = k.phone
  1129. k.copyAddress = k.address
  1130. k.receivingName = ''
  1131. k.phone = ''
  1132. k.address = ''
  1133. }
  1134. } else {
  1135. if (k.refLinkman && k.refPhone && k.refInstallAddress) {
  1136. k.copyRefLinkman = k.refLinkman
  1137. k.copyRefPhone = k.refPhone
  1138. k.copyRefInstallAddress = k.refInstallAddress
  1139. k.refLinkman = ''
  1140. k.refPhone = ''
  1141. k.refInstallAddress = ''
  1142. }
  1143. }
  1144. }
  1145. })
  1146. this.deliverList = data.invoicePickBeans
  1147. })
  1148. },
  1149. // 获取仓库列表
  1150. getWarehouseList() {
  1151. getWarehouseList({
  1152. pageNum: 1,
  1153. pageSize: -1
  1154. }).then(res => {
  1155. this.warehouseList = res.data.records
  1156. })
  1157. },
  1158. // 获取提货方式列表
  1159. getPickupWayList() {
  1160. getDictList({ sysDictEnum: 'PICK' }).then(res => {
  1161. console.log(this.userInfo)
  1162. this.frontPickType = this.userInfo.frontPickType
  1163. this.isFront = this.userInfo.isFront
  1164. this.isPick = this.userInfo.isPick
  1165. res.data.forEach(k => {
  1166. if (this.frontPickType) {
  1167. if (!this.isFront && k.dictCode == 2) {
  1168. k.disabled = true
  1169. }
  1170. if (!this.isPick && k.dictCode == 1) {
  1171. k.disabled = true
  1172. }
  1173. }
  1174. })
  1175. this.pickupWayList = res.data
  1176. // if (this.isFront === true) {
  1177. // this.mainForm.pickupWay = '2'
  1178. // this.mainForm.logisticsId = '1574563841707114498'
  1179. // getCompanyList({
  1180. // pageNum: 1,
  1181. // pageSize: -1
  1182. // }).then(res => {
  1183. // this.companyList = res.data.records
  1184. // const item = this.companyList.find(k => k.id === this.mainForm.logisticsId)
  1185. // this.mainForm.company = item.logisticsCompany
  1186. // this.logisticsNumber = item.logisticsNumber
  1187. // if (this.logisticsNumber === '001' && this.deliverList && this.deliverList.length) {
  1188. // if (!this.listItem) {
  1189. // this.deliverList.forEach(k => {
  1190. // this.$set(k, 'receivingName', '')
  1191. // this.$set(k, 'phone', '')
  1192. // this.$set(k, 'address', '')
  1193. // })
  1194. // }
  1195. // }
  1196. // })
  1197. // } else if (this.isFront === false) {
  1198. // this.mainForm.pickupWay = '1'
  1199. // }
  1200. })
  1201. },
  1202. // 获取提货人列表
  1203. getPickupManList() {
  1204. getPickupManList({
  1205. pageNum: 1,
  1206. pageSize: -1
  1207. }).then(res => {
  1208. this.pickupManList = res.data.records
  1209. })
  1210. },
  1211. // 获取提货车辆列表
  1212. getPickupCarList() {
  1213. getPickupCarList({
  1214. pageNum: 1,
  1215. pageSize: -1
  1216. }).then(res => {
  1217. this.pickupCarList = res.data.records
  1218. })
  1219. },
  1220. // 获取物流公司列表
  1221. getCompanyList() {
  1222. getCompanyList({
  1223. pageNum: 1,
  1224. pageSize: -1
  1225. }).then(res => {
  1226. this.companyList = res.data.records
  1227. console.log(this.companyList)
  1228. })
  1229. },
  1230. getLogisticsId(e) {
  1231. console.log(this.companyList)
  1232. const item = this.companyList.find(k => k.id === e)
  1233. this.mainForm.company = item.logisticsCompany
  1234. this.logisticsNumber = item.logisticsNumber
  1235. if (this.logisticsNumber === '001' && this.deliverList && this.deliverList.length) {
  1236. this.deliverList.forEach(k => {
  1237. this.$set(k, 'receivingName', '')
  1238. this.$set(k, 'phone', '')
  1239. this.$set(k, 'address', '')
  1240. })
  1241. } else {
  1242. if (this.deliverList && !this.deliverList.length) return
  1243. this.deliverList.forEach(k => {
  1244. delete k.receivingName
  1245. delete k.phone
  1246. delete k.address
  1247. })
  1248. }
  1249. this.deliverList.forEach(k => {
  1250. if (!k.warehouseFlag) {
  1251. this.$set(k, 'warehouseFlag', null)
  1252. if (this.mainForm.pickupWay == 2 && this.logisticsNumber === '001') {
  1253. // 注释默认不选择仓库
  1254. // if (k.refLinkman || k.refPhone || k.refInstallAddress) {
  1255. // this.$set(k, 'warehouseFlag', 1)
  1256. // } else {
  1257. // this.$set(k, 'warehouseFlag', 0)
  1258. // }
  1259. }
  1260. }
  1261. })
  1262. },
  1263. // 查询列表
  1264. getDeliverList() {
  1265. if (!this.mainForm.warehouse) {
  1266. return this.$errorMsg('请选择仓库')
  1267. }
  1268. this.listLoading = true
  1269. getDeliverList({ correspondId: this.mainForm.warehouse }).then(res => {
  1270. this.deliverList = res.data
  1271. this.deliverList.forEach(k => {
  1272. this.$set(k, 'warehouseFlag', null)
  1273. this.$set(k, 'customerOrderId', k.customerOrderId || null)
  1274. // 注释默认不选择仓库
  1275. // if (this.mainForm.pickupWay == 2 && this.logisticsNumber === '001') {
  1276. // if (k.refLinkman || k.refPhone || k.refInstallAddress) {
  1277. // this.$set(k, 'warehouseFlag', 1)
  1278. // } else {
  1279. // this.$set(k, 'warehouseFlag', 0)
  1280. // }
  1281. // }
  1282. })
  1283. this.listLoading = false
  1284. })
  1285. },
  1286. handleSelect(selection, row) {
  1287. this.$refs.table.toggleRowSelection(row)
  1288. this.deliverList.forEach(item => {
  1289. if (item.invoiceId === row.invoiceId) {
  1290. this.$refs.table.toggleRowSelection(item)
  1291. }
  1292. })
  1293. this.tableSelection = this.$refs.table.selection
  1294. // this.tableSelection = this.$refs.table.selection;
  1295. },
  1296. handleSelectAll(selection) {
  1297. this.tableSelection = this.$refs.table.selection
  1298. },
  1299. clickSubmitForm() {
  1300. this.$refs.mainForm.validate(valid => {
  1301. if (valid) {
  1302. if (this.tableSelection.length < 1) {
  1303. return this.$errorMsg('请选择发货申请单')
  1304. }
  1305. if (this.mainForm.pickupWay == 2 && this.logisticsNumber === '001') {
  1306. for (let i = 0; i < this.tableSelection.length; i++) {
  1307. if (this.tableSelection[i].warehouseFlag == null) {
  1308. this.$errorMsg('仓库必选')
  1309. return
  1310. }
  1311. }
  1312. }
  1313. for (let i = 0; i < this.tableSelection.length; i++) {
  1314. if (this.tableSelection[i].warehouseFlag == 2) {
  1315. const el = this.tableSelection[i]
  1316. if (!(el.orderType === 'TRADE' || el.orderType === 'HOME')) {
  1317. if (!(el.receivingName && el.phone && el.address)) {
  1318. return this.$errorMsg('商家仓必须填写收货地址、电话、收货地址')
  1319. }
  1320. } else {
  1321. if (this.listItem) {
  1322. if (!(el.receivingName && el.phone && el.address)) {
  1323. return this.$errorMsg('商家仓必须填写收货地址、电话、收货地址')
  1324. }
  1325. } else {
  1326. if (!(el.refLinkman && el.refPhone && el.refInstallAddress)) {
  1327. return this.$errorMsg('商家仓必须填写收货地址、电话、收货地址')
  1328. }
  1329. }
  1330. }
  1331. }
  1332. }
  1333. const orderList = []
  1334. this.tableSelection.forEach(item => {
  1335. orderList.push(item.invoiceOrderId)
  1336. })
  1337. const params = {
  1338. correspondId: this.mainForm.warehouse,
  1339. pickTime: this.mainForm.date + ' 00:00:00',
  1340. invoiceOrderIds: orderList.join(',')
  1341. }
  1342. checkStock(params).then(res => {
  1343. if (res.data) {
  1344. this.$confirm(res.data, '提示', {
  1345. confirmButtonText: '确定',
  1346. cancelButtonText: '取消',
  1347. type: 'warning'
  1348. })
  1349. .then(() => {
  1350. this.submitForm()
  1351. })
  1352. .catch(() => {})
  1353. } else {
  1354. this.submitForm()
  1355. }
  1356. })
  1357. }
  1358. })
  1359. },
  1360. submitForm() {
  1361. this.formLoading = true
  1362. let takerName
  1363. if (this.mainForm.pickupWay == '1') {
  1364. takerName = this.pickupManList.find(o => o.id == this.mainForm.pickupMan).takerName
  1365. }
  1366. // let correspondName = this.warehouseList.find(o => o.id == this.mainForm.warehouse).name;
  1367. const orderList = []
  1368. this.tableSelection.forEach(item => {
  1369. if (!(item.orderType === 'TRADE' || item.orderType === 'HOME')) {
  1370. } else {
  1371. if (this.listItem) {
  1372. } else {
  1373. if (item.refLinkman && item.refPhone && item.refInstallAddress) {
  1374. item.receivingName = item.refLinkman
  1375. item.phone = item.refPhone
  1376. item.address = item.refInstallAddress
  1377. }
  1378. }
  1379. }
  1380. orderList.push({
  1381. warehouseFlag: item.warehouseFlag,
  1382. customerOrderId: item.customerOrderId,
  1383. address: item.address,
  1384. id: this.listItem ? item.id : '',
  1385. invoiceOrderId: item.invoiceOrderId,
  1386. materialCode: item.materialCode,
  1387. materialId: item.materialId,
  1388. materialName: item.materialName,
  1389. materialOldNumber: item.materialOldNumber,
  1390. phone: item.phone,
  1391. pickActualTime: item.pickActualTime,
  1392. pickId: item.pickId,
  1393. printNum: item.printNum,
  1394. printTime: item.printTime,
  1395. receivingName: item.receivingName,
  1396. status: item.status
  1397. })
  1398. })
  1399. const params = {
  1400. correspondId: this.mainForm.warehouse,
  1401. // correspondName,
  1402. pickTime: this.mainForm.date + ' 00:00:00',
  1403. pickStatus: Number(this.mainForm.timeSlot),
  1404. pickType: Number(this.mainForm.pickupWay),
  1405. takerId: this.mainForm.pickupMan,
  1406. takerName: takerName || '',
  1407. remark: this.mainForm.remark,
  1408. invoiceOrderIds: orderList
  1409. }
  1410. if (this.mainForm.pickupWay == '1') {
  1411. params.takerCarId = this.mainForm.pickupCar
  1412. }
  1413. if (this.mainForm.pickupWay == '2') {
  1414. params.pickLogistics = this.mainForm.company
  1415. params.logisticsId = this.mainForm.logisticsId
  1416. params.isUp = this.mainForm.isUp
  1417. params.isDischarge = this.mainForm.isDischarge
  1418. // params.receivingName = this.mainForm.receivingName
  1419. // params.phone = this.mainForm.phone
  1420. // params.address = this.mainForm.address
  1421. }
  1422. if (this.listItem) {
  1423. params.id = this.listItem.id
  1424. editPickupBook(params)
  1425. .then(res => {
  1426. this.$successMsg('提交成功')
  1427. this.goBack()
  1428. })
  1429. .finally(res => {
  1430. this.formLoading = false
  1431. })
  1432. } else {
  1433. addPickupBook(params)
  1434. .then(res => {
  1435. this.$successMsg('提交成功')
  1436. this.goBack()
  1437. })
  1438. .finally(res => {
  1439. this.formLoading = false
  1440. })
  1441. }
  1442. },
  1443. getListCostBillV2(row) {
  1444. this.logisticsVisible = true
  1445. getListCostBillV2({
  1446. pageNum: 1,
  1447. pageSize: -1,
  1448. params: [
  1449. {
  1450. param: 'order_code',
  1451. compare: '=',
  1452. value: row.invoiceId
  1453. }
  1454. ]
  1455. }).then(res => {
  1456. res.data.records.forEach(item => {
  1457. item.sums1 = ['orderHasSendQty', 'subsidyCoefficient', 'unloadUpstairsCoefficient', 'coefficient']
  1458. item.sums2 = ['cost', 'unitPrice', 'totalCost', 'allowanceCost']
  1459. })
  1460. this.logisticsData = res.data.records
  1461. })
  1462. },
  1463. getListCodeV2(row) {
  1464. this.outboundVisible = true
  1465. getListCodeV2({
  1466. pageNum: 1,
  1467. pageSize: -1,
  1468. params: [
  1469. {
  1470. param: 'order_number',
  1471. compare: '=',
  1472. value: row.invoiceId
  1473. }
  1474. ]
  1475. }).then(res => {
  1476. this.outboundData = res.data.records
  1477. })
  1478. },
  1479. resetForm() {
  1480. this.$refs.mainForm.resetFields()
  1481. // if (this.isFront === true) {
  1482. // this.mainForm.pickupWay = '2'
  1483. // }
  1484. // if (this.isFront === false) {
  1485. // this.mainForm.pickupWay = '1'
  1486. // }
  1487. this.deliverList = []
  1488. },
  1489. handLogistics(row) {
  1490. getListOrderTrack({ orderId: row.invoiceId }).then(res => {
  1491. this.logisticsDetail = res.data
  1492. })
  1493. this.orderId = row.id
  1494. this.visible = true
  1495. },
  1496. onClose() {
  1497. this.logisticsDetail = []
  1498. this.outboundData = []
  1499. this.logisticsData = []
  1500. this.orderId = ''
  1501. this.visible = false
  1502. this.logisticsVisible = false
  1503. this.outboundVisible = false
  1504. }
  1505. }
  1506. }
  1507. </script>
  1508. <style lang="scss" scoped>
  1509. .flex {
  1510. display: flex;
  1511. div {
  1512. flex: 1;
  1513. }
  1514. }
  1515. ::v-deep .el-timeline-item__tail {
  1516. border-left: 2px solid #67c23a;
  1517. }
  1518. ::v-deep .el-form-item__content {
  1519. line-height: 33px;
  1520. }
  1521. .logistics-title {
  1522. padding: 10px;
  1523. }
  1524. .tip {
  1525. height: 200px;
  1526. text-align: center;
  1527. line-height: 200px;
  1528. }
  1529. .pd-lr {
  1530. padding-left: 0 !important;
  1531. padding-right: 0 !important;
  1532. }
  1533. </style>