pickup_form.vue 63 KB

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