detailsPageEdit.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <el-button
  12. v-if="detailData.seeDisabled"
  13. size="small"
  14. @click="detailData.seeDisabled = false"
  15. type="primary"
  16. >编辑</el-button>
  17. <el-button
  18. class="el-button--small-yh"
  19. type="primary"
  20. size="small"
  21. :disabled="detailData.seeDisabled"
  22. v-if="form.deliveryStatus == '已到货'"
  23. @click="cancelArrival"
  24. >撤销到货</el-button>
  25. <el-button
  26. class="el-button--small-yh"
  27. type="primary"
  28. size="small"
  29. :disabled="detailData.seeDisabled || arrivalDisabled"
  30. v-if="form.deliveryStatus == '已发货'"
  31. @click="confirmArrival"
  32. >确认到货</el-button>
  33. <el-button
  34. class="el-button--small-yh"
  35. type="primary"
  36. @click="revokeOutGoods"
  37. size="small"
  38. v-if="form.deliveryStatus == '已发货'"
  39. :disabled="detailData.seeDisabled || arrivalDisabled"
  40. >撤销发货</el-button>
  41. <el-button
  42. class="el-button--small-yh"
  43. type="primary"
  44. @click="sendOutGoods"
  45. size="small"
  46. v-if="form.deliveryStatus == '录入'"
  47. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled"
  48. >确认发货</el-button>
  49. <el-button
  50. class="el-button--small-yh"
  51. size="small"
  52. type="success" @click="copyOrder"
  53. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled">
  54. 复制单据
  55. </el-button>
  56. <el-button
  57. class="el-button--small-yh"
  58. type="primary"
  59. :disabled="disabled || detailData.seeDisabled || arrivalDisabled"
  60. @click="editCustomer(false)"
  61. :loading="saveLoading"
  62. size="small"
  63. >保 存
  64. </el-button>
  65. </div>
  66. </div>
  67. <div class="customer-main">
  68. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  69. <containerTitle title="基础资料"></containerTitle>
  70. <basic-container style="margin-bottom: 10px">
  71. <el-row>
  72. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
  73. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  74. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  75. <!-- ></avue-input-tree>-->
  76. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  77. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  78. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  79. size="small" type="date" placeholder="选择日期"
  80. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  81. <crop-select
  82. v-else-if="item.prop === 'corpId'"
  83. v-model="form[item.prop]"
  84. corpType="KH"
  85. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  86. style="width: 100%"
  87. ></crop-select>
  88. <crop-select
  89. v-else-if="item.prop === 'salesCompany'"
  90. v-model="form[item.prop]"
  91. corpType="GS"
  92. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  93. ></crop-select>
  94. <!-- <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"-->
  95. <!-- :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>-->
  96. <!-- <selectComponent v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" typeData="GS"-->
  97. <!-- :configuration="companyConfiguration" style="width: 100%" :disabled="detailData.seeDisabled"/>-->
  98. <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled">
  99. <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue" size="small"></el-option>
  100. </el-select>
  101. <el-select v-else-if="item.prop === 'warehouseType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled">
  102. <el-option v-for="(item,index) in warehouseTypeOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  103. </el-select>
  104. <!-- <avue-input-tree-->
  105. <!-- v-else-if="item.prop === 'warehouseType'"-->
  106. <!-- leaf-only-->
  107. <!-- placeholder="请选择内容"-->
  108. <!-- :dic="warehouseType"-->
  109. <!-- type="tree"-->
  110. <!-- v-model="form[item.prop]"-->
  111. <!-- style="width: 100%"-->
  112. <!-- size="small"-->
  113. <!-- @change="warehouseTreeChange"-->
  114. <!-- >-->
  115. <!-- </avue-input-tree>-->
  116. <warehouse-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]"
  117. :configuration="configurationWarehouse" style="width: 100%" :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  118. <el-input
  119. v-else-if="item.type == 'number'"
  120. placeholder="请输入"
  121. v-input-limit="2"
  122. size="small"
  123. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  124. v-model.trim="form[item.prop]"
  125. />
  126. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"></el-input>
  127. <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"></el-input>
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. </basic-container>
  132. <containerTitle title="商品信息"></containerTitle>
  133. <basic-container style="margin-bottom: 10px">
  134. <avue-crud
  135. :option="customerContact"
  136. v-model="contactsForm"
  137. :data="goodsShowData"
  138. ref="crudContact"
  139. @row-save="rowSave"
  140. @row-click="handleRowClick"
  141. @row-update="rowUpdate"
  142. @row-del="rowDel"
  143. @saveColumn="saveColumn('goods')"
  144. :cell-style="goodsRowClassName"
  145. >
  146. <template slot="code" slot-scope="{row,index}">
  147. <!-- <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit || arrivalDisabled || deliverDisabled">选择</el-button>-->
  148. <span>{{ row.code }}</span>
  149. </template>
  150. <template slot-scope="{row,index}" slot="menu">
  151. <el-button
  152. type="text"
  153. size="small"
  154. @click="rowCell(row,index)"
  155. :disabled="detailData.seeDisabled || arrivalDisabled"
  156. >{{ row.$cellEdit ? '保存' : '修改' }}
  157. </el-button>
  158. <el-button
  159. size="small"
  160. icon="el-icon-delete"
  161. type="text"
  162. @click="rowDel(row, index)"
  163. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  164. v-if="!row.$cellEdit"
  165. >删 除</el-button>
  166. </template>
  167. <template slot="menuLeft" slot-scope="{size}">
  168. <el-tabs v-model="goodsActives" @tab-click="handleClick">
  169. <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
  170. </el-tab-pane>
  171. <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
  172. </el-tab-pane>
  173. </el-tabs>
  174. <el-button type="primary"
  175. icon="el-icon-plus"
  176. size="small"
  177. @click="marketDialog = true"
  178. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  179. v-if="goodsActives == 'goods'"
  180. >录入明细
  181. </el-button>
  182. <el-button type="primary"
  183. icon="el-icon-plus"
  184. size="small"
  185. @click="commoditySelection"
  186. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  187. v-if="goodsActives == 'gift'"
  188. >录入明细
  189. </el-button>
  190. <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
  191. <el-button
  192. type="warning"
  193. icon="el-icon-refresh"
  194. size="small"
  195. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  196. @click="resetStock"
  197. >库存刷新</el-button>
  198. </template>
  199. <template slot="actualQuantity" slot-scope="{ row }">
  200. <el-input
  201. v-if="row.$cellEdit"
  202. v-model.trim="row.actualQuantity"
  203. v-input-limit="0"
  204. @change="actualQuantityChange(row)"
  205. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  206. ></el-input>
  207. <span v-else>{{ row.actualQuantity | IntegerFormat }}</span>
  208. </template>
  209. <!-- 到货数量-->
  210. <template slot="arrivalQuantity" slot-scope="{ row }">
  211. <el-input
  212. v-if="row.$cellEdit"
  213. v-model.trim="row.arrivalQuantity"
  214. v-input-limit="0"
  215. @input="arrivalQuantityChange(row)"
  216. ></el-input>
  217. <span v-else>{{ row.arrivalQuantity }}</span>
  218. </template>
  219. <template slot="corpId" slot-scope="{ row, index }">
  220. <crop-select
  221. v-if="row.$cellEdit"
  222. v-model="row.corpId"
  223. :cropIndex="index"
  224. corpType="GYS"
  225. @getCorpData="getcorpId"
  226. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  227. ></crop-select>
  228. <span v-else>{{ row.corpName }}</span>
  229. </template>
  230. </avue-crud>
  231. </basic-container>
  232. <fee-info
  233. ref="feeInfo"
  234. :orderFeesList="advantageProjectData"
  235. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  236. feeUrl="/blade-deliver-goods/deliveryfees/update"
  237. />
  238. <!-- <containerTitle title="费用明细"></containerTitle>-->
  239. <!-- <basic-container style="margin-bottom: 10px">-->
  240. <!-- <avue-crud-->
  241. <!-- :option="advantageProject"-->
  242. <!-- v-model="advantageProjectForm"-->
  243. <!-- :data="advantageProjectData"-->
  244. <!-- ref="crudProject"-->
  245. <!-- @row-save="rowSaveProject"-->
  246. <!-- @row-update="rowUpdateProject"-->
  247. <!-- @row-del="rowDelProject"-->
  248. <!-- @saveColumn="saveColumn('fees')"-->
  249. <!-- >-->
  250. <!-- <template slot="code" slot-scope="{row,index}">-->
  251. <!-- <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>-->
  252. <!-- <span>{{ row.code }}</span>-->
  253. <!-- </template>-->
  254. <!-- <template slot="corpId" slot-scope="{ row }">-->
  255. <!-- <selectComponent v-if="row.$cellEdit" v-model="row.corpId"-->
  256. <!-- :configuration="configuration" @receiveList="receiveList"/>-->
  257. <!-- <span v-else>-->
  258. <!-- <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>-->
  259. <!-- </span>-->
  260. <!-- </template>-->
  261. <!-- <template slot="amount" slot-scope="{ row }">-->
  262. <!-- <el-input v-if="row.$cellEdit" v-model.trim="row.amount"-->
  263. <!-- size="small" v-input-limit="2"-->
  264. <!-- ></el-input>-->
  265. <!-- <span v-else>{{ row.amount }}</span>-->
  266. <!-- </template>-->
  267. <!-- <template slot="settlmentAmount" slot-scope="{ row }">-->
  268. <!-- <el-input v-if="row.$cellEdit" v-model.trim="row.settlmentAmount"-->
  269. <!-- size="small" v-input-limit="2"-->
  270. <!-- ></el-input>-->
  271. <!-- <span v-else>{{ row.settlmentAmount }}</span>-->
  272. <!-- </template>-->
  273. <!-- <template slot-scope="{row,index}" slot="menu">-->
  274. <!-- <el-button-->
  275. <!-- type="text"-->
  276. <!-- size="small"-->
  277. <!-- @click="rowCellTwo(row,index)"-->
  278. <!-- :disabled="detailData.seeDisabled"-->
  279. <!-- >{{ row.$cellEdit ? '保存' : '修改' }}-->
  280. <!-- </el-button>-->
  281. <!-- <el-button-->
  282. <!-- size="small"-->
  283. <!-- icon="el-icon-delete"-->
  284. <!-- type="text"-->
  285. <!-- @click="rowDelProject(row, index)"-->
  286. <!-- :disabled="detailData.seeDisabled"-->
  287. <!-- v-if="!row.$cellEdit"-->
  288. <!-- >删 除</el-button>-->
  289. <!-- </template>-->
  290. <!-- <template slot="menuLeft" slot-scope="{size}">-->
  291. <!-- <el-button type="primary"-->
  292. <!-- icon="el-icon-plus"-->
  293. <!-- size="small"-->
  294. <!-- @click="costIncrease"-->
  295. <!-- :disabled="detailData.seeDisabled"-->
  296. <!-- >录入明细-->
  297. <!-- </el-button>-->
  298. <!-- </template>-->
  299. <!-- </avue-crud>-->
  300. <!-- </basic-container>-->
  301. <containerTitle title="附件上传"></containerTitle>
  302. <basic-container style="margin-bottom: 40px">
  303. <avue-crud
  304. :option="bankOfDeposit"
  305. v-model="bankOfDepositForm"
  306. :data="bankOfDepositData"
  307. @row-save="rowSaveBankOfDeposit"
  308. @row-update="rowUpdateBankOfDeposit"
  309. @row-del="rowDelBankOfDeposit"
  310. :upload-after="uploadAfter"
  311. ref="uploadCrud"
  312. >
  313. <template slot="menuLeft">
  314. <el-button
  315. type="primary"
  316. icon="el-icon-plus"
  317. size="small"
  318. @click.stop="$refs.uploadCrud.rowAdd()"
  319. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  320. >上传</el-button
  321. >
  322. </template>
  323. <template slot="menu" slot-scope="{ row, index }">
  324. <el-button
  325. size="small"
  326. icon="el-icon-edit"
  327. type="text"
  328. @click="$refs.uploadCrud.rowEdit(row, index)"
  329. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  330. >编 辑</el-button
  331. >
  332. <el-button
  333. size="small"
  334. icon="el-icon-delete"
  335. type="text"
  336. @click="rowDelBankOfDeposit(row, index)"
  337. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  338. >删 除</el-button
  339. >
  340. </template>
  341. </avue-crud>
  342. </basic-container>
  343. </el-form>
  344. </div>
  345. <el-dialog
  346. title="导入商品"
  347. append-to-body
  348. class="el-dialogDeep"
  349. :visible.sync="dialogVisible"
  350. width="80%"
  351. :close-on-click-modal="false"
  352. :destroy-on-close="true"
  353. :close-on-press-escape="false"
  354. @close="closeGoods">
  355. <el-row :style="{height: rowHeight}">
  356. <el-col :span="5" style="height: 100%;overflow-y: auto">
  357. <div>
  358. <el-scrollbar>
  359. <basic-container>
  360. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick"/>
  361. </basic-container>
  362. </el-scrollbar>
  363. </div>
  364. </el-col>
  365. <el-col :span="19">
  366. <basic-container>
  367. <avue-crud :option="optionTwo"
  368. :table-loading="loading"
  369. :data="data"
  370. ref="crud"
  371. @refresh-change="refreshChange"
  372. @selection-change="selectionChange"
  373. :page.sync="page"
  374. @search-change="goodsSearch"
  375. @on-load="onLoad"></avue-crud>
  376. </basic-container>
  377. </el-col>
  378. </el-row>
  379. <span slot="footer" class="dialog-footer">
  380. <el-button @click="dialogVisible = false">取 消</el-button>
  381. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  382. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  383. :disabled="tableData.length !== 1">导入</el-button>
  384. </span>
  385. </el-dialog>
  386. <el-dialog
  387. title="导入费用"
  388. append-to-body
  389. class="el-dialogDeep"
  390. :visible.sync="dialogCost"
  391. width="80%"
  392. :close-on-click-modal="false"
  393. :destroy-on-close="true"
  394. :close-on-press-escape="false"
  395. @close="closeFees">
  396. <el-row :style="{height: rowHeight}">
  397. <el-col :span="5" style="height: 100%;overflow-y: auto">
  398. <div>
  399. <el-scrollbar>
  400. <basic-container>
  401. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  402. </basic-container>
  403. </el-scrollbar>
  404. </div>
  405. </el-col>
  406. <el-col :span="19">
  407. <basic-container>
  408. <avue-crud :option="optionTwoCost"
  409. :table-loading="loadingCost"
  410. :data="dataCost"
  411. ref="crud"
  412. @refresh-change="refreshChangeCost"
  413. @selection-change="selectionChangeCost"
  414. :page.sync="pageCost"
  415. @searchChange="feesSearch"
  416. @on-load="onLoadCost">
  417. </avue-crud>
  418. </basic-container>
  419. </el-col>
  420. </el-row>
  421. <span slot="footer" class="dialog-footer">
  422. <el-button @click="dialogCost = false">取 消</el-button>
  423. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  424. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  425. :disabled="tableDataCost.length !== 1">导入</el-button>
  426. </span>
  427. </el-dialog>
  428. <!-- 导入销售明细-->
  429. <el-dialog
  430. title="导入销售"
  431. append-to-body
  432. class="el-dialogDeep"
  433. :visible.sync="marketDialog"
  434. width="60%"
  435. :close-on-click-modal="false"
  436. :destroy-on-close="true"
  437. :modal-append-to-body='false'
  438. :close-on-press-escape="false"
  439. v-dialog-drag>
  440. <market-detail
  441. @importMarket="importMarket"
  442. @close="closeMarkeDialog"
  443. systemType="GN"
  444. >
  445. </market-detail>
  446. </el-dialog>
  447. </div>
  448. </template>
  449. <script>
  450. import {
  451. typeSave, detail,
  452. corpstypeTree,
  453. corpsattn,
  454. corpsbank,
  455. corpsitem,
  456. // getList,
  457. sendOutGoods,
  458. revokeOutGoods,
  459. confirmArrival,
  460. cancelArrival
  461. } from "@/api/basicData/deliveryNotice"
  462. import {getList} from "@/api/basicData/commodityType";
  463. import customerContact from "./configuration/customerContact.json"
  464. import advantageProject from "./configuration/advantageProject.json"
  465. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  466. import commodity from "./configuration/commodity.json"
  467. import optionTwoCost from "./configuration/mainListCost.json"
  468. import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/basicFeesDesc";
  469. import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
  470. import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
  471. import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
  472. import { contrastObj, contrastList } from "@/util/contrastData";
  473. import marketDetail from "@/components/procurement/market";
  474. import feeInfo from "@/components/fee-info/main";
  475. import {
  476. isDiscount,
  477. isPercentage,
  478. micrometerFormat,
  479. IntegerFormat
  480. } from "@/util/validate";
  481. export default {
  482. name: "detailsPage",
  483. props: {
  484. detailData: {
  485. type: Object
  486. }
  487. },
  488. components: {
  489. marketDetail,
  490. feeInfo,
  491. },
  492. data() {
  493. return {
  494. configuration: {
  495. multipleChoices: false,
  496. multiple: false,
  497. collapseTags: false,
  498. placeholder: '请点击右边按钮选择',
  499. dicData: []
  500. },
  501. companyConfiguration: {
  502. multipleChoices: false,
  503. multiple: false,
  504. collapseTags: false,
  505. placeholder: '请点击右边按钮选择',
  506. dicData: []
  507. },
  508. configurationWarehouse: {
  509. multipleChoices: false,
  510. multiple: false,
  511. collapseTags: false,
  512. placeholder: "请点击右边按钮选择",
  513. dicData: [],
  514. clearable: true,
  515. },
  516. form: {},
  517. data: [],
  518. loadingCost: false,
  519. choiceData: false,
  520. commodityData: false,
  521. dataCost: [],
  522. treeDataGoods: [],
  523. treeData: [],
  524. choiceIndex: '',
  525. dialogCost: false,
  526. treeDeptId: '',
  527. treeDeptIdCost: '',
  528. pageCost: {
  529. pageSize: 10,
  530. currentPage: 1,
  531. total: 0
  532. },
  533. page: {
  534. pageSize: 10,
  535. currentPage: 1,
  536. total: 0
  537. },
  538. loading: false,
  539. contactsForm: {},
  540. optionTwo: commodity,
  541. optionTwoCost: optionTwoCost,
  542. treeOptionCost: {
  543. nodeKey: 'id',
  544. lazy: true,
  545. treeLoad: function (node, resolve) {
  546. const parentId = (node.level === 0) ? 0 : node.data.id;
  547. getDeptLazyTree(parentId).then(res => {
  548. resolve(res.data.data.map(item => {
  549. return {
  550. ...item,
  551. leaf: !item.hasChildren
  552. }
  553. }))
  554. });
  555. },
  556. addBtn: false,
  557. menu: false,
  558. size: 'small',
  559. props: {
  560. labelText: '标题',
  561. label: 'title',
  562. value: 'value',
  563. children: 'children'
  564. }
  565. },
  566. treeOption: {
  567. nodeKey: 'id',
  568. lazy: true,
  569. treeLoad: function (node, resolve) {
  570. const parentId = (node.level === 0) ? 0 : node.data.id;
  571. getDeptLazyTreeTwo(parentId).then(res => {
  572. resolve(res.data.data.map(item => {
  573. return {
  574. ...item,
  575. leaf: !item.hasChildren
  576. }
  577. }))
  578. });
  579. },
  580. addBtn: false,
  581. menu: false,
  582. size: 'small',
  583. props: {
  584. labelText: '标题',
  585. label: 'title',
  586. value: 'value',
  587. children: 'children'
  588. }
  589. },
  590. dialogVisible: false,
  591. advantageProjectForm: {},
  592. bankOfDepositForm: {},
  593. contactsData: [],
  594. advantageProjectData: [],
  595. disabled: false,
  596. saveLoading: false,
  597. bankOfDepositData: [],
  598. tableDataCost: [],
  599. dic: [],
  600. tableData: [],
  601. customerContact: {},
  602. advantageProject: {},
  603. bankOfDeposit: bankOfDeposit,
  604. basicData: {
  605. column: [
  606. {
  607. label: '系统编号',//发货通知(点击)
  608. prop: 'sysNo',
  609. disabled: true,
  610. rules: [
  611. {
  612. required: false,
  613. message: ' ',
  614. trigger: 'blur'
  615. }
  616. ]
  617. }, {
  618. label: '客户名称',
  619. prop: 'corpId',
  620. span: 16,
  621. rules: [
  622. {
  623. required: true,
  624. message: ' ',
  625. trigger: 'blur'
  626. }
  627. ]
  628. }, {
  629. label: '单据状态',
  630. prop: 'deliveryStatus',
  631. disabled: true,
  632. rules: [
  633. {
  634. required: true,
  635. message: ' ',
  636. trigger: 'blur'
  637. }
  638. ]
  639. }, {
  640. label: '所属公司',
  641. prop: 'salesCompany', //salesCompany
  642. span: 16,
  643. rules: [
  644. {
  645. required: true,
  646. message: ' ',
  647. trigger: 'blur'
  648. }
  649. ]
  650. }, {
  651. label: '仓库类型',
  652. prop: 'warehouseType',//字典表
  653. rules: [
  654. {
  655. required: true,
  656. message: ' ',
  657. trigger: 'blur'
  658. }
  659. ]
  660. }, {
  661. label: '仓库名称',
  662. prop: 'storageId',
  663. span: 16,
  664. rules: [
  665. {
  666. required: true,
  667. message: ' ',
  668. trigger: 'blur'
  669. }
  670. ]
  671. },{
  672. label: '匹配订单号',
  673. prop: 'srcOrderNo',
  674. rules: [
  675. {
  676. required: false,
  677. message: ' ',
  678. trigger: 'blur'
  679. }
  680. ]
  681. }, {
  682. label: '出库金额',
  683. prop: 'deliveryAmount',
  684. disabled: false,
  685. rules: [
  686. {
  687. required: false,
  688. message: ' ',
  689. trigger: 'blur'
  690. }
  691. ]
  692. }, {
  693. label: '出库数量',
  694. prop: 'totalQuantity',
  695. disabled: false,
  696. rules: [
  697. {
  698. required: false,
  699. message: ' ',
  700. trigger: 'blur'
  701. }
  702. ]
  703. }, {
  704. label: '出库日期',
  705. prop: 'businessDate',
  706. type: 'datetime',
  707. rules: [
  708. {
  709. required: true,
  710. message: ' ',
  711. trigger: 'blur'
  712. }
  713. ]
  714. }, {
  715. label: '制单时间',
  716. type: 'datetime',
  717. prop: 'createTime',
  718. disabled: true,
  719. rules: [
  720. {
  721. required: false,
  722. message: ' ',
  723. trigger: 'blur'
  724. }
  725. ]
  726. }, {
  727. label: '费用合计',
  728. prop: 'totalCost',
  729. rules: [
  730. {
  731. required: false,
  732. message: ' ',
  733. trigger: 'blur'
  734. }
  735. ]
  736. },{
  737. label: '收货地址',
  738. prop: 'arrivalAddress',
  739. rules: [
  740. {
  741. required: false,
  742. message: ' ',
  743. trigger: 'blur'
  744. }
  745. ]
  746. }, {
  747. label: '收货人',
  748. prop: 'arrivalContact',
  749. rules: [
  750. {
  751. required: false,
  752. message: ' ',
  753. trigger: 'blur'
  754. }
  755. ]
  756. }, {
  757. label: '收货电话',
  758. prop: 'arrivalTel',
  759. rules: [
  760. {
  761. required: false,
  762. message: ' ',
  763. trigger: 'blur'
  764. }
  765. ]
  766. }, {
  767. label: '包装要求',
  768. prop: 'packageRemarks',
  769. rules: [
  770. {
  771. required: false,
  772. message: ' ',
  773. trigger: 'blur'
  774. }
  775. ]
  776. },{
  777. label: '赠送积分',
  778. prop: 'presenterIntegral',
  779. disabled: true,
  780. rules: [
  781. {
  782. required: false,
  783. message: ' ',
  784. trigger: 'blur'
  785. }
  786. ]
  787. },{
  788. label: '兑换积分',
  789. prop: 'convertIntegral',
  790. disabled: true,
  791. rules: [
  792. {
  793. required: false,
  794. message: ' ',
  795. trigger: 'blur'
  796. }
  797. ]
  798. }, {
  799. label: "备注",
  800. span: 24,
  801. type: 'textarea',
  802. prop: "otherRemarks",
  803. mock: {
  804. type: 'county'
  805. }
  806. }
  807. ]
  808. },
  809. statusOption: [],
  810. warehouseTypeOption: [],
  811. // 仓库类型
  812. warehouseType: [],
  813. // 仓库名称
  814. warehouseName: [],
  815. maxFeeNum: 0,
  816. maxGoodsNum: 0,
  817. oldForm: {
  818. orderStatus: "录入"
  819. },
  820. oldGoodsList: [],
  821. oldGiftList: [],
  822. oldFeesList: [],
  823. oldUploadList: [],
  824. // 导入销售订单明细
  825. marketDialog: false,
  826. // 弹窗高度
  827. rowHeight: '',
  828. // 查询时loading页面
  829. pageLoading: false,
  830. goodsActives: 'goods',
  831. // 用于判断 tab是否是当前
  832. saveActives: '',
  833. goodsDisabled: false,
  834. // 赠品信息数据
  835. giftData: [],
  836. // 商品信息展示数据
  837. goodsShowData: [],
  838. // 确认收货禁用
  839. deliverDisabled: false,
  840. // 确认到货禁用
  841. arrivalDisabled: false,
  842. }
  843. },
  844. mounted() {
  845. this.$nextTick(() => {
  846. // 监听浏览器高度变化,改变表格高度
  847. window.onresize = () => {
  848. this.rowHeight = (window.innerHeight - 130) + 'px'
  849. }
  850. })
  851. },
  852. filters: {
  853. IntegerFormat(num) {
  854. return IntegerFormat(num);
  855. }
  856. },
  857. //初始化查询
  858. async created() {
  859. this.rowHeight = (window.innerHeight - 130) + 'px'
  860. this.customerContact = await this.getColumnData(this.getColumnName(21), customerContact);
  861. this.advantageProject = await this.getColumnData(this.getColumnName(22), advantageProject);
  862. this.getWorkDicts("order_status").then(res => {
  863. this.statusOption = res.data.data
  864. })
  865. this.getWorkDicts("warehouseType").then(res => {
  866. this.warehouseTypeOption = res.data.data
  867. })
  868. this.$set(this.form,'deliveryStatus','录入')
  869. this.$set(this.form, 'presenterIntegral' , 0)
  870. this.$set(this.form, 'convertIntegral' , 0)
  871. wareHouseType().then(res => {
  872. this.warehouseType = res.data.data.records
  873. this.warehouseType.forEach(item => {
  874. this.$set(item, 'label', item.cname)
  875. this.$set(item, 'value', item.id)
  876. if (item.hasChildren) {
  877. this.$set(item, 'children', [])
  878. }
  879. })
  880. let result = [], temp = {}
  881. for(let i = 0; i < this.warehouseType.length;i++) {
  882. temp[this.warehouseType[i].id] = this.warehouseType[i]
  883. }
  884. for (let j = 0;j < this.warehouseType.length;j++) {
  885. let current = this.warehouseType[j]
  886. let tempCurrentParent = temp[current.parentId]
  887. if (tempCurrentParent) {
  888. if (!tempCurrentParent["children"]) {
  889. tempCurrentParent["children"] = []
  890. }
  891. tempCurrentParent["children"].push(current)
  892. } else {
  893. result.push(current)
  894. }
  895. }
  896. this.warehouseType = result
  897. });
  898. selectWareHouse().then(res => {
  899. this.warehouseName = res.data.data.records
  900. })
  901. if (this.detailData.id) {
  902. let id = this.detailData.id
  903. this.queryData(id)
  904. }else if (this.detailData.form){
  905. this.form = JSON.parse(this.detailData.form);
  906. delete this.form.createTime
  907. delete this.form.id
  908. delete this.form.sysNo
  909. this.$set(this.form, 'deliveryStatus', '录入')
  910. this.$set(this.form, 'srcOrderNo', this.form.orgOrderNo)
  911. this.form.orderItemsList.forEach(item => {
  912. this.$set(item, 'contractNumber', this.form.orgOrderNo)
  913. })
  914. this.contactsData = this.form.orderItemsList.filter(item => {
  915. return item.goodType == 0
  916. })
  917. this.giftData = this.form.orderItemsList.filter(item => {
  918. return item.goodType == 1
  919. })
  920. this.giftData.forEach(item => {
  921. this.$set(item, 'deliveryAmount', item.amount)
  922. this.$set(item, 'specificationAndModel', item.itemType)
  923. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  924. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  925. this.$set(item, "srcId", item.id)
  926. this.$set(item, 'actualQuantity', item.orderQuantity)
  927. delete item.id
  928. delete item.pid
  929. delete item.createTime
  930. delete item.createUser
  931. delete item.status
  932. delete item.updateTime
  933. delete item.updateUser
  934. })
  935. this.goodsShowData = this.giftData;
  936. this.goodsActives = 'goods';
  937. this.handleClick({name: this.goodsActives})
  938. // this.contactsData = this.form.orderItemsList
  939. delete this.form.orderItemsList
  940. this.configuration.dicData = this.form.corpName
  941. delete this.form.corpName
  942. if (this.form.belongToCorpList) {
  943. this.$set(this.form, 'salesCompany', this.form.belongToCorpId)
  944. delete this.form.belongToCorpId
  945. this.companyConfiguration.dicData = this.companyConfiguration.dicData.concat(this.form.belongToCorpList)
  946. }
  947. delete this.form.belongToCorpList
  948. this.$set(this.form, 'deliveryAmount', 0)
  949. this.$set(this.form, 'totalQuantity', 0)
  950. this.$set(this.form, 'totalCost', 0)
  951. this.advantageProjectData = this.form.orderFeesList;
  952. delete this.form.orderFeesList
  953. this.advantageProjectData.forEach(item => {
  954. delete item.createDept
  955. delete item.createTime
  956. delete item.createUser
  957. delete item.id
  958. delete item.isDeleted
  959. delete item.pid
  960. delete item.status
  961. delete item.tenantId
  962. delete item.updateTime
  963. delete item.updateUser
  964. })
  965. this.contactsData.forEach(item => {
  966. this.$set(item, 'specificationAndModel', item.itemType)
  967. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  968. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  969. this.$set(item, "srcId", item.id)
  970. this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
  971. this.$set(item, "arrivalQuantity", item.actualQuantity)
  972. this.$set(item, "deliveryAmount", item.amount)
  973. this.$set(item, "deliveryAmount", item.amount)
  974. this.$set(item, "inventoryNumber", item.storageQuantity)
  975. this.form.deliveryAmount += Number(item.deliveryAmount)
  976. this.form.totalQuantity += Number(item.actualQuantity)
  977. this.form.totalCost += Number(item.deliveryAmount)
  978. // 出库数量和出库金额的比例
  979. this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  980. delete item.id
  981. delete item.pid
  982. delete item.createTime
  983. delete item.createUser
  984. delete item.status
  985. delete item.updateTime
  986. delete item.updateUser
  987. })
  988. } else if (this.detailData.copyId) {
  989. let id = this.detailData.copyId
  990. this.queryData(id, true)
  991. }
  992. this.oldForm = Object.assign({}, this.form)
  993. },
  994. watch: {
  995. },
  996. methods: {
  997. queryData(id, isCopy = false, type) {
  998. this.pageLoading = true
  999. detail(id).then(res => {
  1000. this.form = res.data.data;
  1001. if (this.form.deliveryStatus == '已发货') {
  1002. this.deliverDisabled = true;
  1003. this.arrivalDisabled = false;
  1004. } else if (this.form.deliveryStatus == '已到货') {
  1005. this.arrivalDisabled = true;
  1006. this.deliverDisabled = false;
  1007. } else {
  1008. this.arrivalDisabled = false;
  1009. this.deliverDisabled = false;
  1010. }
  1011. if (this.deliverDisabled) {
  1012. this.customerContact.column.forEach(item => {
  1013. if (item.prop == 'arrivalQuantity') {
  1014. item.disabled = false
  1015. } else {
  1016. item.disabled = true
  1017. }
  1018. })
  1019. } else {
  1020. this.customerContact.column.forEach(item => {
  1021. item.disabled = false
  1022. })
  1023. }
  1024. // this.contactsData = this.form.deliveryItemsList
  1025. this.contactsData = this.form.deliveryItemsList.filter(item => {
  1026. return item.goodType == 0
  1027. })
  1028. this.giftData = this.form.deliveryItemsList.filter(item => {
  1029. return item.goodType == 1
  1030. })
  1031. this.giftData.forEach(item => {
  1032. this.$set(item, 'deliveryAmount', item.amount)
  1033. })
  1034. this.goodsShowData = this.giftData;
  1035. this.goodsActives = 'goods';
  1036. this.handleClick({name: this.goodsActives})
  1037. this.advantageProjectData = this.form.deliveryFeesList
  1038. this.bankOfDepositData = this.form.deliveryFilesList
  1039. this.configuration.dicData = this.form.corpName
  1040. this.form.deliveryAmount = 0
  1041. this.form.totalQuantity = 0
  1042. this.contactsData.forEach(item => {
  1043. this.form.deliveryAmount += Number(item.deliveryAmount)
  1044. this.form.totalQuantity += Number(item.actualQuantity)
  1045. // 出库金额和出库数量的比例
  1046. this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  1047. })
  1048. if (this.form.companyName) {
  1049. this.companyConfiguration.dicData = this.companyConfiguration.dicData.concat(this.form.companyName)
  1050. }
  1051. if (this.form.storageMap) {
  1052. this.configurationWarehouse.dicData = this.form.storageMap
  1053. }
  1054. let feesData = []
  1055. this.form.deliveryFeesList.forEach(item => {
  1056. let a = {
  1057. cname: item.corpName,
  1058. id: item.corpId
  1059. }
  1060. feesData.push(a)
  1061. })
  1062. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  1063. // 去重
  1064. this.removeRepeat()
  1065. delete this.form.deliveryItemsList
  1066. delete this.form.deliveryFeesList
  1067. delete this.form.deliveryFilesList
  1068. delete this.form.corpName
  1069. delete this.form.companyName
  1070. // 获取最大值
  1071. let num = []
  1072. this.advantageProjectData.forEach(item => {
  1073. num.push(item.sort)
  1074. })
  1075. if (num.length == 0) {
  1076. this.maxFeeNum = 0;
  1077. } else {
  1078. this.maxFeeNum = num.reduce((a, b) => {
  1079. return b > a? b: a;
  1080. })
  1081. }
  1082. let goodsNum = []
  1083. this.contactsData.forEach(item => {
  1084. goodsNum.push(item.sort)
  1085. })
  1086. if (goodsNum.length == 0) {
  1087. this.maxGoodsNum = 0;
  1088. } else {
  1089. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  1090. return b > a? b: a;
  1091. })
  1092. }
  1093. this.oldGoodsList = []
  1094. this.oldGiftList = []
  1095. this.oldFeesList = []
  1096. this.oldUploadList = []
  1097. this.oldForm = Object.assign({}, this.form)
  1098. this.oldGoodsList = this.deepClone(this.contactsData)
  1099. this.oldGiftList = this.deepClone(this.giftData)
  1100. this.oldFeesList = this.deepClone(this.advantageProjectData)
  1101. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  1102. if (isCopy) {
  1103. delete this.form.sysNo
  1104. delete this.form.id
  1105. this.contactsData.forEach(item => {
  1106. delete item.id
  1107. delete item.pid
  1108. })
  1109. this.advantageProjectData.forEach(item => {
  1110. delete item.id
  1111. delete item.pid
  1112. })
  1113. this.bankOfDepositData.forEach(item => {
  1114. delete item.id
  1115. delete item.pid
  1116. })
  1117. this.form.deliveryStatus == '录入'
  1118. }
  1119. if (type == '发货') {
  1120. this.$nextTick(() => {
  1121. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1122. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1123. this.form.deliveryFilesList = this.bankOfDepositData
  1124. if (typeof this.form.corpsTypeId == 'object') {
  1125. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1126. }
  1127. this.pageLoading = true
  1128. this.saveActives = ''
  1129. sendOutGoods(this.form).then(res => {
  1130. this.$message.success('发货成功')
  1131. this.queryData(res.data.data.id)
  1132. }).finally(() => {
  1133. this.pageLoading = false
  1134. })
  1135. })
  1136. } else if (type == '到货') {
  1137. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1138. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1139. } else {
  1140. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1141. }
  1142. this.pageLoading = true
  1143. this.saveActives = ''
  1144. confirmArrival(this.form).then(res => {
  1145. this.$message.success('已确认到货')
  1146. this.queryData(this.form.id)
  1147. }).catch(() => {
  1148. this.pageLoading = false
  1149. })
  1150. }
  1151. }).finally(() => {
  1152. this.saveLoading = false
  1153. this.pageLoading = false
  1154. });
  1155. },
  1156. getcorpId(row) {
  1157. this.contactsData[row.index].corpId = row.id;
  1158. this.contactsData[row.index].corpName = row.cname;
  1159. },
  1160. // 出库数量变化时调用
  1161. actualQuantityChange(row) {
  1162. // if (row.scale) {
  1163. // row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
  1164. // }
  1165. if (this.goodsActives == 'goods') {
  1166. if (Number(row.actualQuantity) < Number(row.arrivalQuantity)) {
  1167. row.arrivalQuantity = row.actualQuantity
  1168. }
  1169. row.deliveryAmount = Number(row.actualQuantity) * Number(row.price)
  1170. this.form.deliveryAmount = 0
  1171. this.form.totalQuantity = 0
  1172. this.contactsData.forEach(item => {
  1173. this.form.deliveryAmount += Number(item.deliveryAmount)
  1174. this.form.totalQuantity += Number(item.actualQuantity)
  1175. })
  1176. } else {
  1177. row.integral = Number(row.integralMultiples) * Number(row.actualQuantity)
  1178. this.$set(this.form, 'convertIntegral' , 0)
  1179. this.goodsShowData.forEach(item => {
  1180. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1181. })
  1182. }
  1183. },
  1184. // 到货数量变化计算
  1185. arrivalQuantityChange(row) {
  1186. if (this.goodsActives == 'goods') {
  1187. if (Number(row.arrivalQuantity) > Number(row.actualQuantity)) {
  1188. this.$message.error('到货数量不能超过出库数量')
  1189. row.arrivalQuantity = 0
  1190. }
  1191. row.integral = Number(row.integralMultiples) * Number(row.arrivalQuantity)
  1192. this.$set(this.form, 'presenterIntegral' , 0)
  1193. this.goodsShowData.forEach(item => {
  1194. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1195. })
  1196. } else {
  1197. }
  1198. },
  1199. // 类别变换时触发
  1200. warehouseTreeChange(id) {
  1201. this.warehouseName = []
  1202. if (this.firstComing) {
  1203. if (!this.form.storageId) {
  1204. this.$set(this.form, 'storageId', null)
  1205. } else {
  1206. this.form.storageId = null
  1207. }
  1208. }
  1209. let data = {
  1210. storageTypeId: id
  1211. }
  1212. selectWareHouse(data).then(res => {
  1213. this.warehouseName = res.data.data.records
  1214. })
  1215. this.firstComing = true
  1216. },
  1217. //点击行可编辑
  1218. handleRowClick(row, event, column) {
  1219. },
  1220. //商品编辑
  1221. rowCell(row, index) {
  1222. this.$refs.crudContact.rowCell(row, index)
  1223. },
  1224. //费用编辑
  1225. rowCellTwo(row, index) {
  1226. this.$refs.crudProject.rowCell(row, index)
  1227. },
  1228. //费用新增触发
  1229. costIncrease() {
  1230. this.dialogCost = !this.dialogCost
  1231. this.choiceData = false
  1232. },
  1233. //商品新增触发
  1234. commoditySelection() {
  1235. this.dialogVisible = !this.dialogVisible
  1236. this.tableData = []
  1237. this.commodityData = false
  1238. },
  1239. //点击费用明细选择触发
  1240. choice(row) {
  1241. this.dialogCost = !this.dialogCost
  1242. this.choiceData = true
  1243. this.choiceIndex = row.$index
  1244. },
  1245. //点击商品明细选择触发
  1246. commodityChoice(row) {
  1247. this.dialogVisible = !this.dialogVisible
  1248. this.commodityData = true
  1249. this.choiceIndexT = row.$index
  1250. },
  1251. //导入商品触发
  1252. importChoice() {
  1253. if (this.tableData.length === 1) {
  1254. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  1255. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  1256. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  1257. this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].typeno
  1258. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  1259. this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
  1260. selectGoodsNum({
  1261. goodsId: this.tableData[0].id,
  1262. itemType: this.tableData[0].typeno,
  1263. tradeType: 'GN'
  1264. }).then(res => {
  1265. this.contactsData[this.choiceIndexT].storageQuantity = res.data.data
  1266. })
  1267. }
  1268. this.dialogVisible = !this.dialogVisible
  1269. this.commodityData = false
  1270. },
  1271. //费用编辑导入触发
  1272. choiceCost() {
  1273. if (this.tableDataCost.length === 1) {
  1274. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  1275. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  1276. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  1277. }
  1278. this.dialogCost = !this.dialogCost
  1279. this.choiceData = false
  1280. },
  1281. //费用导入触发
  1282. importCost() {
  1283. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  1284. if (this.tableDataCost.length > 0) {
  1285. for (let item in this.tableDataCost) {
  1286. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  1287. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  1288. this.tableDataCost[item].sort = this.maxFeeNum + 1
  1289. this.maxFeeNum++
  1290. delete this.tableDataCost[item].id
  1291. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  1292. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  1293. }
  1294. }
  1295. this.tableDataCost = []
  1296. this.dialogCost = false
  1297. },
  1298. //确认导入触发
  1299. importGoods() {
  1300. // this.contactsData = this.contactsData.concat(this.tableData)
  1301. if (this.tableData.length > 0) {
  1302. for (let item in this.tableData) {
  1303. selectGoodsNum({
  1304. goodsId: this.tableData[item].id,
  1305. itemType: this.tableData[item].typeno,
  1306. tradeType: 'GN'
  1307. }).then(res =>{
  1308. this.tableData[item].storageQuantity = res.data.data
  1309. this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].typeno)
  1310. this.tableData[item].itemId = this.tableData[item].id
  1311. this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
  1312. delete this.tableData[item].goodsTypeName
  1313. delete this.tableData[item].id
  1314. delete this.tableData[item].status
  1315. delete this.tableData[item].isDeleted
  1316. this.$set(this.tableData[item], 'inventoryNumber', 0)
  1317. this.$set(this.tableData[item], 'actualQuantity', 0)
  1318. this.$set(this.tableData[item], 'inventoryAmount', 0)
  1319. this.$set(this.tableData[item], 'deliveryAmount', 0)
  1320. this.tableData[item].price = 0
  1321. this.tableData[item].amount = 0
  1322. if (this.goodsActives == "goods") {
  1323. this.$set(this.tableData[item], 'goodType', 0)
  1324. this.arrivalQuantityChange(this.tableData[item])
  1325. } else {
  1326. this.$set(this.tableData[item], 'goodType', 1)
  1327. this.$set(this.tableData[item], 'integralMultiples', this.tableData[item].integral)
  1328. this.actualQuantityChange(this.tableData[item])
  1329. }
  1330. this.$set(this.tableData[item], 'integral', '0')
  1331. this.tableData[item].sort = this.maxGoodsNum + 1
  1332. this.maxGoodsNum++
  1333. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  1334. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  1335. if (this.goodsActives == "goods") {
  1336. this.arrivalQuantityChange(this.tableData[item])
  1337. } else {
  1338. this.actualQuantityChange(this.tableData[item])
  1339. }
  1340. })
  1341. }
  1342. }
  1343. this.dialogVisible = false
  1344. },
  1345. closeGoods() {
  1346. this.treeDataGoods = [];
  1347. this.treeDeptId = "";
  1348. },
  1349. closeFees() {
  1350. this.treeDeptIdCost = "";
  1351. this.treeData = [];
  1352. },
  1353. //选中触发
  1354. selectionChange(list) {
  1355. this.tableData = list
  1356. },
  1357. //费用选中触发
  1358. selectionChangeCost(list) {
  1359. this.tableDataCost = list
  1360. },
  1361. //导入页左商品类型查询
  1362. nodeClick(data) {
  1363. this.treeDeptId = data.id;
  1364. this.page.currentPage = 1;
  1365. this.onLoad(this.page);
  1366. },
  1367. //导入页左费用类型查询
  1368. nodeClickCost(data) {
  1369. this.treeDeptIdCost = data.id;
  1370. this.pageCost.currentPage = 1;
  1371. this.onLoadCost(this.pageCost);
  1372. },
  1373. //刷新触发
  1374. refreshChange() {
  1375. this.treeDeptId = '';
  1376. this.page.currentPage = 1;
  1377. this.onLoad(this.page);
  1378. },
  1379. //费用刷新触发
  1380. refreshChangeCost() {
  1381. this.treeDeptIdCost = '';
  1382. this.pageCost.currentPage = 1;
  1383. this.onLoadCost(this.pageCost);
  1384. },
  1385. //新增商品信息保存触发
  1386. rowSave(row, done, loading) {
  1387. // this.contactsData.push(row)
  1388. done()
  1389. },
  1390. //修改商品信息触发
  1391. rowUpdate(row, index, done, loading) {
  1392. done(row);
  1393. },
  1394. //删除商品信息触发
  1395. rowDel(row, index, donerowDel) {
  1396. this.$confirm("确定将选择数据删除?", {
  1397. confirmButtonText: "确定",
  1398. cancelButtonText: "取消",
  1399. type: "warning"
  1400. }).then(() => {
  1401. //商品判断是否需要调用删除接口
  1402. if (row.id) {
  1403. corpsattn(row.id).then(res => {
  1404. this.$message({
  1405. type: "success",
  1406. message: "操作成功!"
  1407. });
  1408. this.goodsShowData.splice(index, 1);
  1409. // 删除时主表积分跟着改变
  1410. if (this.goodsActives == 'goods') {
  1411. this.form.presenterIntegral = 0;
  1412. this.goodsShowData.forEach(item => {
  1413. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1414. })
  1415. } else {
  1416. this.form.convertIntegral = 0;
  1417. this.goodsShowData.forEach(item => {
  1418. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1419. })
  1420. }
  1421. })
  1422. } else {
  1423. this.$message({
  1424. type: "success",
  1425. message: "操作成功!"
  1426. });
  1427. this.goodsShowData.splice(index, 1);
  1428. // 删除时主表积分跟着改变
  1429. if (this.goodsActives == 'goods') {
  1430. this.form.presenterIntegral = 0;
  1431. this.goodsShowData.forEach(item => {
  1432. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1433. })
  1434. } else {
  1435. this.form.convertIntegral = 0;
  1436. this.goodsShowData.forEach(item => {
  1437. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1438. })
  1439. }
  1440. }
  1441. })
  1442. },
  1443. //新增费用明细保存触发
  1444. rowSaveProject(row, done, loading) {
  1445. // this.advantageProjectData.push(row)
  1446. done()
  1447. },
  1448. //修改费用明细触发
  1449. rowUpdateProject(row, index, done, loading) {
  1450. done(row);
  1451. },
  1452. goodsSearch(params, done) {
  1453. this.treeDeptId = '';
  1454. this.onLoad(this.page, params);
  1455. done()
  1456. },
  1457. //商品列表查询
  1458. onLoad(page, params = {}) {
  1459. this.loading = true;
  1460. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  1461. const data = res.data.data;
  1462. this.page.total = data.total;
  1463. this.data = data.records;
  1464. this.loading = false;
  1465. });
  1466. },
  1467. // 费用查询按钮
  1468. feesSearch(params, done) {
  1469. this.treeDeptIdCost = '';
  1470. this.onLoadCost(this.pageCost, params)
  1471. done()
  1472. },
  1473. //费用查询
  1474. onLoadCost(page, params = {}) {
  1475. this.loadingCost = true;
  1476. let queryParams = Object.assign({}, params, {
  1477. pageSize: page.pageSize,
  1478. pageNum: page.currentPage,
  1479. parentId: 0,
  1480. feesTypeId: this.treeDeptIdCost
  1481. })
  1482. customerList(queryParams).then(res => {
  1483. const data = res.data.data;
  1484. this.pageCost.total = data.total;
  1485. this.dataCost = data.records;
  1486. this.loadingCost = false;
  1487. });
  1488. },
  1489. //删除费用明细触发
  1490. rowDelProject(row, index, donerowDel) {
  1491. this.$confirm("确定将选择数据删除?", {
  1492. confirmButtonText: "确定",
  1493. cancelButtonText: "取消",
  1494. type: "warning"
  1495. }).then(() => {
  1496. //费用判断是否需要调用删除接口
  1497. if (row.id) {
  1498. corpsitem(row.id).then(res => {
  1499. this.$message({
  1500. type: "success",
  1501. message: "操作成功!"
  1502. });
  1503. this.advantageProjectData.splice(index, 1);
  1504. })
  1505. } else {
  1506. this.$message({
  1507. type: "success",
  1508. message: "操作成功!"
  1509. });
  1510. this.advantageProjectData.splice(index, 1);
  1511. }
  1512. })
  1513. },
  1514. //新增附件上传保存触发
  1515. rowSaveBankOfDeposit(row, done, loading) {
  1516. this.bankOfDepositData.push(row)
  1517. done()
  1518. },
  1519. //修改附件上传触发
  1520. rowUpdateBankOfDeposit(row, index, done, loading) {
  1521. done(row);
  1522. },
  1523. //删除附件上传触发
  1524. rowDelBankOfDeposit(row, index, donerowDel) {
  1525. this.$confirm("确定将选择数据删除?", {
  1526. confirmButtonText: "确定",
  1527. cancelButtonText: "取消",
  1528. type: "warning"
  1529. }).then(() => {
  1530. //附件判断是否需要调用删除接口
  1531. if (row.id) {
  1532. corpsbank(row.id).then(res => {
  1533. this.$message({
  1534. type: "success",
  1535. message: "操作成功!"
  1536. });
  1537. this.bankOfDepositData.splice(index, 1);
  1538. })
  1539. } else {
  1540. this.$message({
  1541. type: "success",
  1542. message: "操作成功!"
  1543. });
  1544. this.bankOfDepositData.splice(index, 1);
  1545. }
  1546. })
  1547. },
  1548. uploadAfter(res, done) {
  1549. if (res.originalName) {
  1550. this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
  1551. ? this.bankOfDepositForm.fileName
  1552. : res.originalName;
  1553. }
  1554. done();
  1555. },
  1556. // 去重
  1557. removeRepeat() {
  1558. let obj = []
  1559. this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
  1560. obj[next.id] ? '': obj[next.id] = true && current.push(next)
  1561. return current
  1562. }, [])
  1563. },
  1564. //
  1565. receiveList(data){
  1566. this.configuration.dicData = this.configuration.dicData.concat(data)
  1567. this.removeRepeat()
  1568. },
  1569. //修改提交触发
  1570. editCustomer(isBack = false, type) {
  1571. this.$refs["form"].validate((valid) => {
  1572. if (valid) {
  1573. //商品信息
  1574. this.contactsData.forEach(item => {
  1575. this.$set(item, 'contractAmount', item.deliveryAmount)
  1576. })
  1577. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1578. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1579. } else {
  1580. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1581. }
  1582. this.form.deliveryItemsList.forEach(item => {
  1583. if (item.orderNo) {
  1584. this.$set(item, 'contractNumber', item.orderNo)
  1585. this.$set(item, 'srcOrderNo', item.orderNo)
  1586. }
  1587. this.$set(item, 'contractAmount', item.deliveryAmount)
  1588. })
  1589. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1590. // this.form.deliveryFeesList = this.advantageProjectData
  1591. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1592. this.form.deliveryFilesList = this.bankOfDepositData
  1593. if (typeof this.form.corpsTypeId == 'object') {
  1594. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1595. }
  1596. this.saveLoading = true
  1597. this.form.billType = 'FH'
  1598. typeSave(this.form).then(res => {
  1599. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  1600. // this.disabled = false
  1601. if (isBack) {
  1602. //成功关闭此页面回到列表页
  1603. this.$emit("goBack");
  1604. } else {
  1605. this.saveActives = ''
  1606. this.queryData(res.data.data.id, false, type)
  1607. }
  1608. }).catch(() => {
  1609. this.saveLoading = false
  1610. })
  1611. } else {
  1612. return false;
  1613. }
  1614. });
  1615. },
  1616. //复制新单
  1617. copyOrder() {
  1618. this.queryData(this.form.id, true)
  1619. },
  1620. //返回列表
  1621. backToList() {
  1622. let getGoodsList = []
  1623. let getGiftList = []
  1624. let getFeeList = this.$refs.feeInfo.submitData()
  1625. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1626. getGiftList = this.goodsShowData
  1627. getGoodsList = this.contactsData
  1628. } else {
  1629. getGoodsList = this.goodsShowData
  1630. getGiftList = this.giftData
  1631. }
  1632. if (contrastObj(this.form, this.oldForm) ||
  1633. contrastList(getGoodsList, this.oldGoodsList) ||
  1634. contrastList(getGiftList, this.oldGiftList) ||
  1635. contrastList(getFeeList, this.oldFeesList) ||
  1636. contrastList(this.bankOfDepositData, this.oldUploadList)
  1637. ) {
  1638. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1639. confirmButtonText: "确定",
  1640. cancelButtonText: "取消",
  1641. type: "warning"
  1642. }).then(() => {
  1643. this.editCustomer(true)
  1644. }).catch(() => {
  1645. this.$emit("goBack");
  1646. })
  1647. } else {
  1648. this.$emit("goBack");
  1649. }
  1650. },
  1651. // 确认发货
  1652. sendOutGoods() {
  1653. this.$refs["form"].validate((valid) => {
  1654. if (valid) {
  1655. if (this.contactsData.length == 0) {
  1656. return this.$message.error('商品信息为空')
  1657. }
  1658. let getGoodsList = []
  1659. let getGiftList = []
  1660. let getFeeList = this.$refs.feeInfo.submitData()
  1661. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1662. getGiftList = this.goodsShowData
  1663. getGoodsList = this.contactsData
  1664. } else {
  1665. getGoodsList = this.goodsShowData
  1666. getGiftList = this.giftData
  1667. }
  1668. if (contrastObj(this.form, this.oldForm) ||
  1669. contrastList(getGoodsList, this.oldGoodsList) ||
  1670. contrastList(getGiftList, this.oldGiftList) ||
  1671. contrastList(getFeeList, this.oldFeesList) ||
  1672. contrastList(this.bankOfDepositData, this.oldUploadList)
  1673. ) {
  1674. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1675. confirmButtonText: "确定",
  1676. cancelButtonText: "取消",
  1677. type: "warning"
  1678. }).then(async () => {
  1679. await this.editCustomer(false, '发货')
  1680. }).catch(() => {
  1681. this.$message.info('已取消')
  1682. })
  1683. } else {
  1684. //商品信息
  1685. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1686. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1687. } else {
  1688. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1689. }
  1690. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1691. this.form.deliveryFilesList = this.bankOfDepositData
  1692. if (typeof this.form.corpsTypeId == 'object') {
  1693. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1694. }
  1695. this.pageLoading = true
  1696. this.saveActives = ''
  1697. sendOutGoods(this.form).then(res => {
  1698. this.$message.success('发货成功')
  1699. this.queryData(res.data.data.id)
  1700. }).finally(() => {
  1701. this.pageLoading = false
  1702. })
  1703. }
  1704. } else {
  1705. return false;
  1706. }
  1707. });
  1708. },
  1709. // 撤销发货
  1710. revokeOutGoods() {
  1711. this.$refs["form"].validate((valid) => {
  1712. if (valid) {
  1713. //商品信息
  1714. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1715. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1716. } else {
  1717. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1718. }
  1719. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1720. this.form.deliveryFilesList = this.bankOfDepositData
  1721. if (typeof this.form.corpsTypeId == 'object') {
  1722. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1723. }
  1724. this.pageLoading = true
  1725. this.saveActives = ''
  1726. revokeOutGoods(this.form).then(res => {
  1727. this.$message.success('撤销成功')
  1728. this.queryData(res.data.data.id)
  1729. }).finally(() => {
  1730. this.pageLoading = false
  1731. })
  1732. } else {
  1733. return false;
  1734. }
  1735. });
  1736. },
  1737. // 确认到货
  1738. confirmArrival() {
  1739. let getGoodsList = []
  1740. let getGiftList = []
  1741. let getFeeList = this.$refs.feeInfo.submitData()
  1742. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1743. getGiftList = this.goodsShowData
  1744. getGoodsList = this.contactsData
  1745. } else {
  1746. getGoodsList = this.goodsShowData
  1747. getGiftList = this.giftData
  1748. }
  1749. if (contrastObj(this.form, this.oldForm) ||
  1750. contrastList(getGoodsList, this.oldGoodsList) ||
  1751. contrastList(getGiftList, this.oldGiftList) ||
  1752. contrastList(getFeeList, this.oldFeesList) ||
  1753. contrastList(this.bankOfDepositData, this.oldUploadList)
  1754. ) {
  1755. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1756. confirmButtonText: "确定",
  1757. cancelButtonText: "取消",
  1758. type: "warning"
  1759. }).then(() => {
  1760. this.editCustomer(false, '到货')
  1761. }).catch(() => {
  1762. this.$message.info('已取消')
  1763. })
  1764. } else {
  1765. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1766. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1767. } else {
  1768. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1769. }
  1770. this.pageLoading = true
  1771. this.saveActives = ''
  1772. confirmArrival(this.form).then(res => {
  1773. this.$message.success('已确认到货')
  1774. this.queryData(this.form.id)
  1775. }).catch(() => {
  1776. this.pageLoading = false
  1777. })
  1778. }
  1779. },
  1780. // 撤销到货
  1781. cancelArrival() {
  1782. if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
  1783. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1784. } else {
  1785. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1786. }
  1787. this.pageLoading = true
  1788. this.saveActives = ''
  1789. cancelArrival(this.form).then(res => {
  1790. this.$message.success('撤销到货成功')
  1791. this.queryData(this.form.id)
  1792. }).catch(() => {
  1793. this.pageLoading = false
  1794. })
  1795. },
  1796. // 导入销售明细
  1797. importMarket(list) {
  1798. list.forEach(item => {
  1799. item.cname = item.cname
  1800. this.$set(item, 'specificationAndModel', item.itemType)
  1801. if (this.goodsActives == 'goods') {
  1802. this.$set(item, 'deliveryAmount', item.amount)
  1803. } else {
  1804. this.$set(item, 'deliveryAmount', 0)
  1805. }
  1806. this.$set(item, 'actualQuantity', item.orderQuantity)
  1807. this.$set(item, 'inventoryNumber', item.storageQuantity)
  1808. this.$set(item, 'integral', 0)
  1809. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  1810. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  1811. this.$set(item, 'arrivalQuantity', item.actualQuantity)
  1812. this.$set(item, "srcId", item.id)
  1813. if (this.goodsActives == "goods") {
  1814. this.$set(item, 'goodType', 0)
  1815. } else {
  1816. this.$set(item, 'goodType', 1)
  1817. }
  1818. delete item.id
  1819. delete item.createTime
  1820. delete item.createUser
  1821. delete item.pid
  1822. this.arrivalQuantityChange(item)
  1823. this.$refs.crudContact.rowCellAdd(item);
  1824. this.arrivalQuantityChange(item)
  1825. })
  1826. this.marketDialog = false;
  1827. },
  1828. // 关闭销售弹窗
  1829. closeMarkeDialog() {
  1830. this.marketDialog = false;
  1831. },
  1832. // 保存列设置
  1833. async saveColumn(name) {
  1834. /**
  1835. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1836. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1837. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1838. */
  1839. if (name == 'goods') {
  1840. const inSave = await this.saveColumnData(
  1841. this.getColumnName(21),
  1842. this.customerContact
  1843. );
  1844. if (inSave) {
  1845. this.$message.success("保存成功");
  1846. //关闭窗口
  1847. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1848. }
  1849. } else if (name === 'fees') {
  1850. const inSave = await this.saveColumnData(
  1851. this.getColumnName(22),
  1852. this.advantageProject
  1853. );
  1854. if (inSave) {
  1855. this.$message.success("保存成功");
  1856. //关闭窗口
  1857. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  1858. }
  1859. }
  1860. },
  1861. // 商品表格加色
  1862. goodsRowClassName({row, column, rowIndex, columnIndex}) {
  1863. if (Number(row.actualQuantity) > Number(row.inventoryNumber) && column.property == 'inventoryNumber') {
  1864. return "color: #fff;background:#a4cf57"
  1865. }
  1866. return '';
  1867. },
  1868. // 库存刷新
  1869. resetStock() {
  1870. this.contactsData.forEach(item => {
  1871. selectGoodsNum({
  1872. goodsId: item.itemId,
  1873. itemType: item.itemType? item.itemType: item.typeno,
  1874. tradeType: 'GN',
  1875. storageId: this.form.storageId
  1876. }).then(res => {
  1877. item.inventoryNumber = res.data.data
  1878. })
  1879. })
  1880. this.$message.success('刷新成功')
  1881. },
  1882. // 商品信息标签页切换
  1883. handleClick(data) {
  1884. if (this.saveActives == data.name) return
  1885. this.saveActives = data.name
  1886. this.goodsDisabled = true
  1887. if (data.name == 'goods') {
  1888. this.giftData = this.goodsShowData
  1889. // 显示
  1890. this.customerContact.column.forEach(item => {
  1891. if (item.prop == 'integralMultiples') item.label = '积分倍数'
  1892. if (item.prop == 'integral') item.label = '赠送积分'
  1893. if (item.prop == 'actualQuantity') item.label = '出库数量'
  1894. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1895. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight'
  1896. || item.prop == 'inventoryNumber' || item.prop == 'inventoryAmount'
  1897. || item.prop == 'arrivalQuantity'
  1898. ) {
  1899. item.hide = false;
  1900. item.showColumn = true;
  1901. }
  1902. })
  1903. this.goodsShowData = this.contactsData;
  1904. setTimeout(() => {
  1905. this.goodsDisabled = false
  1906. },500)
  1907. } else {
  1908. // 隐藏字段
  1909. this.contactsData = this.goodsShowData
  1910. this.customerContact.column.forEach(item => {
  1911. if (item.prop == 'integralMultiples') item.label = '积分单价'
  1912. if (item.prop == 'integral') item.label = '兑换积分'
  1913. if (item.prop == 'actualQuantity') item.label = '数量'
  1914. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1915. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight' || item.prop == 'inventoryNumber'
  1916. || item.prop == 'inventoryAmount' || item.prop == 'arrivalQuantity'
  1917. ) {
  1918. item.hide = true;
  1919. item.showColumn = false;
  1920. }
  1921. })
  1922. this.goodsShowData = this.giftData;
  1923. setTimeout(() => {
  1924. this.goodsDisabled = false
  1925. },500)
  1926. }
  1927. },
  1928. }
  1929. }
  1930. </script>
  1931. <style lang="scss" scoped>
  1932. //.customer-head {
  1933. // position: fixed;
  1934. // top: 105px;
  1935. // width: 100%;
  1936. // margin-left: -10px;
  1937. // height: 62px;
  1938. // background: #ffffff;
  1939. // box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1940. // z-index: 999;
  1941. //}
  1942. //
  1943. //.customer-back {
  1944. // cursor: pointer;
  1945. // line-height: 62px;
  1946. // font-size: 16px;
  1947. // color: #323233;
  1948. // font-weight: 400;
  1949. //}
  1950. .back-icon {
  1951. line-height: 64px;
  1952. font-size: 20px;
  1953. margin-right: 8px;
  1954. }
  1955. //.add-customer-btn {
  1956. // position: fixed;
  1957. // right: 36px;
  1958. // top: 115px;
  1959. //}
  1960. ::v-deep .el-form-item {
  1961. margin-bottom: 0;
  1962. }
  1963. .el-dialogDeep {
  1964. ::v-deep .el-dialog {
  1965. margin: 1vh auto 0 !important;
  1966. padding-bottom: 10px !important;
  1967. .el-dialog__body, .el-dialog__footer {
  1968. padding-bottom: 0 !important;
  1969. padding-top: 0 !important;
  1970. }
  1971. }
  1972. }
  1973. .print-div {
  1974. color: #000;
  1975. }
  1976. .print_table {
  1977. table {
  1978. border-right: 1px solid #000;
  1979. border-bottom: 1px solid #000;
  1980. font-size: 12px;
  1981. margin-bottom: 5px;
  1982. }
  1983. table td {
  1984. border-left: 1px solid #000;
  1985. border-top: 1px solid #000;
  1986. vertical-align: middle;
  1987. padding: 2px;
  1988. text-align: center;
  1989. }
  1990. }
  1991. .table {
  1992. border-collapse: collapse;
  1993. border-spacing: 0;
  1994. background-color: transparent;
  1995. display: table;
  1996. width: 99%;
  1997. max-width: 100%;
  1998. margin: 0 auto;
  1999. }
  2000. .table td {
  2001. text-align: left;
  2002. vertical-align: middle;
  2003. font-size: 14px;
  2004. color: #000000;
  2005. padding: 10.5px 0 10.5px 30px;
  2006. //border: 1px solid #000;
  2007. }
  2008. ::v-deep .el-form-item {
  2009. margin-bottom: 0;
  2010. }
  2011. ::v-deep .el-form-item__content{
  2012. line-height: 32px;
  2013. }
  2014. </style>