detailsPageEdit.vue 69 KB

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