detailsPageEdit.vue 69 KB

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