detailsPageEdit.vue 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667
  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. style="margin-right: 8px"
  17. >编 辑</el-button>
  18. <el-dropdown style="margin-right: 8px;">
  19. <el-button
  20. type="primary"
  21. size="small"
  22. >
  23. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  24. </el-button>
  25. <el-dropdown-menu slot="dropdown">
  26. <el-dropdown-item :disabled="browse || detailData.seeDisabled" @click.native="pleaseCheck">请核数据</el-dropdown-item>
  27. <el-dropdown-item v-if="form.status > 0" @click.native="checkScheduleDialog = true,checkId=form.id">审核进度</el-dropdown-item>
  28. <el-dropdown-item v-if="form.status == 1" @click.native="repealCancel">撤销请核</el-dropdown-item>
  29. <el-dropdown-item v-if="checkDisabled && form.status != 3" @click.native="changeApproveOpen">特殊审批</el-dropdown-item>
  30. <el-dropdown-item v-if="form.status == 3" :disabled="detailData.seeDisabled || form.specialCheckStatus > 0" @click.native="arrearsPleaseCheck">欠款发货审批</el-dropdown-item>
  31. </el-dropdown-menu>
  32. </el-dropdown>
  33. <el-dropdown style="margin-right: 8px;">
  34. <el-button
  35. type="warning"
  36. size="small"
  37. >
  38. 账单处理<i class="el-icon-arrow-down el-icon--right"></i>
  39. </el-button>
  40. <el-dropdown-menu slot="dropdown">
  41. <!-- <el-dropdown-item-->
  42. <!-- :disabled="detailData.seeDisabled || form.status != 3"-->
  43. <!-- @click.native="applySettlement('收费')">生成账单-->
  44. <!-- </el-dropdown-item>-->
  45. <el-dropdown-item
  46. @click.native="openApplicationDialog"
  47. :disabled="!form.id"
  48. >查看账单
  49. </el-dropdown-item>
  50. </el-dropdown-menu>
  51. </el-dropdown>
  52. <el-dropdown style="margin-right: 8px;">
  53. <el-button
  54. type="success"
  55. size="small"
  56. >
  57. 业务处理<i class="el-icon-arrow-down el-icon--right"></i>
  58. </el-button>
  59. <el-dropdown-menu slot="dropdown">
  60. <el-dropdown-item
  61. :disabled="detailData.seeDisabled || form.status != 3 || form.createPurchase == 1"
  62. @click.native="saveSell">生成采购
  63. </el-dropdown-item>
  64. <el-dropdown-item
  65. :disabled="detailData.seeDisabled || !this.form.id"
  66. @click.native="copyOrder"
  67. >复制单据</el-dropdown-item>
  68. </el-dropdown-menu>
  69. </el-dropdown>
  70. <el-button
  71. class="el-button--small-yh"
  72. type="primary"
  73. :disabled="disabled || detailData.seeDisabled"
  74. :loading="saveLoading"
  75. size="small"
  76. @click="editCustomer(false)"
  77. >保 存
  78. </el-button>
  79. <div v-if="checkDisabled" style="float: right;margin-left: 8px">
  80. <el-button type="primary"
  81. size="small"
  82. class="el-button--small-yh"
  83. @click.stop="openCheckDialog">
  84. 审批
  85. </el-button>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="customer-main">
  90. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  91. <containerTitle title="基础资料"></containerTitle>
  92. <basic-container :showBtn="true">
  93. <el-row>
  94. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8" :class="{isShow: item.display}">
  95. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  96. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  97. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="detailData.seeDisabled || browse"/>
  98. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  99. size="small" type="date" placeholder="选择日期"
  100. value-format="yyyy-MM-dd HH:mm:ss"
  101. :disabled="detailData.seeDisabled || browse"/>
  102. <crop-select
  103. v-else-if="item.prop === 'corpId'"
  104. v-model="form[item.prop]"
  105. @getCorpData="getCorpRow"
  106. corpType="KH"
  107. :disabled="detailData.seeDisabled || browse || !form.belongToCorpId"
  108. style="width: 100%"
  109. ref="KHSelect"
  110. :belongtocompany="form.belongToCorpId"
  111. ></crop-select>
  112. <crop-select
  113. v-else-if="item.prop === 'belongToCorpId'"
  114. v-model="form[item.prop]"
  115. @getCorpData="returnBack"
  116. corpType="GS"
  117. :disabled="detailData.seeDisabled || browse"
  118. ></crop-select>
  119. <crop-select
  120. v-else-if="item.prop === 'productionPlant'"
  121. v-model="form[item.prop]"
  122. @getCorpData="getPlantRow"
  123. corpType="GYS"
  124. :disabled="detailData.seeDisabled || browse"
  125. style="width: 100%"
  126. ></crop-select>
  127. <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse">
  128. <el-option v-for="(item,index) in paymentOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  129. </el-select>
  130. <el-select v-else-if="item.prop === 'packageRemarks'" v-model="form[item.prop]" placeholder="请选择" clearable filterable allow-create default-first-option style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse">
  131. <el-option v-for="(item,index) in packageOptions" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  132. </el-select>
  133. <el-select v-else-if="item.prop === 'arrivalAddress'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse" allow-create default-first-option>
  134. <el-option v-for="(item,index) in arrivalOptions" :key="index" :label="item.label" :value="item.label"></el-option>
  135. </el-select>
  136. <el-select v-else-if="item.prop === 'shippingAddress'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse" allow-create default-first-option>
  137. <el-option v-for="(item,index) in shippingOptions" :key="index" :label="item.label" :value="item.label"></el-option>
  138. </el-select>
  139. <el-select v-else-if="item.prop === 'banks'"
  140. v-model="form[item.prop]" placeholder="请选择"
  141. clearable
  142. filterable
  143. allow-create
  144. default-first-option
  145. size="small"
  146. style="width: 100%;"
  147. @change="banksChange"
  148. :disabled="detailData.seeDisabled || browse">
  149. <el-option v-for="(item,index) in bankList" :key="index" :label="item.accountNo" :value="item.accountNo"></el-option>
  150. </el-select>
  151. <el-select v-else-if="item.prop === 'corpAttn'"
  152. v-model="form[item.prop]" placeholder="请选择"
  153. clearable
  154. filterable
  155. allow-create
  156. default-first-option
  157. size="small"
  158. style="width: 100%;"
  159. @change="corpAttnChange"
  160. :disabled="detailData.seeDisabled || browse">
  161. <el-option v-for="(item,index) in khInfoList" :key="index" :label="item.cname" :value="item.id"></el-option>
  162. </el-select>
  163. <el-input
  164. v-else-if="item.type == 'number'"
  165. placeholder="请输入"
  166. v-input-limit="2"
  167. size="small"
  168. :disabled="item.disabled || detailData.seeDisabled || browse"
  169. v-model.trim="form[item.prop]"
  170. />
  171. <span v-else-if="item.type == 'radio'">
  172. <el-radio
  173. size="small"
  174. :disabled="item.disabled || detailData.seeDisabled || browse"
  175. v-model.trim="form[item.prop]"
  176. :label="1"
  177. >含</el-radio>
  178. <el-radio
  179. size="small"
  180. :disabled="item.disabled || detailData.seeDisabled || browse"
  181. v-model.trim="form[item.prop]"
  182. :label="0"
  183. >不含</el-radio>
  184. </span>
  185. <el-select v-else-if="item.prop === 'chargeMember'"
  186. v-model="form[item.prop]" placeholder="请选择"
  187. filterable
  188. size="small"
  189. style="width: 100%;"
  190. :disabled="detailData.seeDisabled || browse">
  191. <el-option v-for="(item,index) in userList" :key="index" :label="item.realName" :value="item.realName"></el-option>
  192. </el-select>
  193. <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 || browse"></el-input>
  194. <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || browse" clearable></el-input>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. </basic-container>
  199. <containerTitle title="发货信息"></containerTitle>
  200. <basic-container :showBtn="true">
  201. <el-row>
  202. <el-col v-for="(item,index) in contactInformation.column" :key="index" :span="item.span?item.span:8" :class="{isShow: item.display == false}">
  203. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  204. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled || browse"/>
  205. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  206. size="small" type="date" placeholder="选择日期"
  207. value-format="yyyy-MM-dd HH:mm:ss"
  208. :disabled="detailData.seeDisabled || browse"/>
  209. <el-input
  210. v-else-if="(item.prop === 'advancePayment') || (item.prop === 'orderAmount') ||
  211. (item.prop === 'settlmentAmount') || (item.prop === 'caseOverPayment') || (item.prop === 'thisUsedProfit') ||
  212. (item.prop === 'createProfit')"
  213. v-model.trim="form[item.prop]" size="small" autocomplete="off"
  214. @change="computedCost"
  215. :disabled="detailData.seeDisabled || item.disabled || browse"
  216. v-input-limit="2"
  217. ></el-input>
  218. <el-select v-else-if="item.prop === 'orderStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || item.disabled || browse">
  219. <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  220. </el-select>
  221. <el-input type="age" v-else-if="item.prop === 'grossProfitRate'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
  222. <template slot="append">%</template>
  223. </el-input>
  224. <el-input type="age" v-else-if="item.prop === 'specialOfferOf'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
  225. <template slot="append">%</template>
  226. </el-input>
  227. <el-input type="age" v-else-if="item.prop === 'largeScale'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
  228. <template slot="append">%</template>
  229. </el-input>
  230. <el-input
  231. v-else-if="item.type == 'number'"
  232. placeholder="请输入"
  233. v-input-limit="2"
  234. size="small"
  235. :disabled="item.disabled || detailData.seeDisabled || browse"
  236. v-model.trim="form[item.prop]"
  237. />
  238. <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 || browse"></el-input>
  239. <el-input v-else type="age" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || browse"></el-input>
  240. </el-form-item>
  241. </el-col>
  242. </el-row>
  243. </basic-container>
  244. <containerTitle title="商品信息"></containerTitle>
  245. <basic-container style="margin-bottom: 10px">
  246. <avue-crud
  247. :option="customerContact"
  248. v-model="contactsForm"
  249. :data="goodsShowData"
  250. ref="crudContact"
  251. @row-save="rowSave"
  252. @row-click="handleRowClick"
  253. @row-update="rowUpdate"
  254. @selection-change="productSelection"
  255. @row-del="rowDel"
  256. @saveColumn="saveColumn('goods')"
  257. @resetColumn="resetColumn"
  258. :summary-method="summaryMethod"
  259. :table-loading="goodsLoading"
  260. >
  261. <template slot="headerSerial">
  262. <span class="order_number">序号</span>
  263. <el-button class="number_button" type="primary" icon="el-icon-circle-plus-outline" circle size="mini" @click="$refs.crudContact.rowCellAdd()"></el-button>
  264. </template>
  265. <!-- <template slot="corpId" slot-scope="{ row, index }">-->
  266. <!-- <crop-select-->
  267. <!-- v-if="row.$cellEdit"-->
  268. <!-- v-model="row.corpId"-->
  269. <!-- :cropIndex="index"-->
  270. <!-- corpType="GYS"-->
  271. <!-- @getCorpData="getcorpId"-->
  272. <!-- :disabled="detailData.seeDisabled || browse"-->
  273. <!-- ></crop-select>-->
  274. <!-- <span v-else>{{ row.corpName }}</span>-->
  275. <!-- </template>-->
  276. <template slot="code" slot-scope="{row}">
  277. <el-button
  278. type="text"
  279. size="mini"
  280. style="padding:4px 10px;float:left"
  281. @click="commodityChoice(row)"
  282. :disabled="detailData.seeDisabled || !row.$cellEdit || browse">选择</el-button>
  283. <span>{{ row.code }}</span>
  284. </template>
  285. <template slot="purchaseAmount" slot-scope="{ row }">
  286. <el-select
  287. v-if="row.$cellEdit"
  288. v-model="row.purchaseAmount"
  289. @focus="getPurchasePrice(row)"
  290. allow-create
  291. filterable
  292. v-input-limit="2"
  293. default-first-option
  294. >
  295. <el-option
  296. v-for="(item, index) in purchasePriceOption"
  297. :key="index"
  298. :label="item.purchasePrice"
  299. :value="item.purchasePrice"></el-option>
  300. </el-select>
  301. <span v-else>{{ row.purchaseAmount }}</span>
  302. </template>
  303. <template slot="price" slot-scope="{ row }">
  304. <el-select
  305. v-if="false"
  306. v-model="row.price"
  307. @focus="getMarketPrice(row)"
  308. @input="priceChange(row)"
  309. allow-create
  310. filterable
  311. v-input-limit="2"
  312. default-first-option
  313. >
  314. <el-option
  315. v-for="(item, index) in salesPriceOtion"
  316. :key="index"
  317. :label="item.salePrice"
  318. :value="item.salePrice"></el-option>
  319. </el-select>
  320. <span v-else>{{ row.price }}</span>
  321. </template>
  322. <template slot="amount" slot-scope="{ row }">
  323. <span>{{ row.amount | decimalFormat }}</span>
  324. </template>
  325. <template slot="actualQuantity" slot-scope="{ row }">
  326. <span>{{ row.actualQuantity | IntegerFormat }}</span>
  327. </template>
  328. <template slot="orderQuantity" slot-scope="{ row }">
  329. <el-input
  330. v-if="row.$cellEdit"
  331. v-model.trim="row.orderQuantity"
  332. oninput='this.value=this.value.replace(/[^(\d)]/g,"")'
  333. size="small"
  334. @input="quantityChange(row)"
  335. ></el-input>
  336. <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
  337. </template>
  338. <template slot="shopQuality" slot-scope="{ row }">
  339. <el-switch
  340. v-model="row.shopQuality"
  341. :disabled="!row.$cellEdit"
  342. :active-value="1"
  343. :inactive-value="0"
  344. @change="(val) => shopQualityChange(val, row)"
  345. ></el-switch>
  346. </template>
  347. <template slot-scope="{row,index}" slot="menu">
  348. <el-button
  349. type="text"
  350. size="small"
  351. @click="rowCell(row,index)"
  352. :disabled="detailData.seeDisabled || browse"
  353. >{{ row.$cellEdit ? '保 存' : '修 改' }}
  354. </el-button>
  355. <el-button
  356. size="small"
  357. icon="el-icon-delete"
  358. type="text"
  359. @click="rowDel(row, index)"
  360. :disabled="detailData.seeDisabled || browse"
  361. >删 除</el-button>
  362. </template>
  363. <template slot="menuLeft" slot-scope="{size}">
  364. <el-tabs v-model="goodsActives" @tab-click="handleClick" :before-leave="beforeLeave">
  365. <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
  366. </el-tab-pane>
  367. <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
  368. </el-tab-pane>
  369. </el-tabs>
  370. <el-button type="primary"
  371. icon="el-icon-plus"
  372. size="small"
  373. @click="commoditySelection"
  374. :disabled="detailData.seeDisabled || browse">录入明细
  375. </el-button>
  376. <el-button type="primary"
  377. icon="el-icon-plus"
  378. size="small"
  379. @click="policy"
  380. :disabled="detailData.seeDisabled || !form.corpId || browse"
  381. v-show="goodsActives == 'goods'"
  382. >政策
  383. </el-button>
  384. <!-- 禁用规则:未选择明细,未点击编辑按钮,未进行审批,已经生成过-->
  385. <el-button type="warning"
  386. icon="el-icon-plus"
  387. size="small"
  388. :disabled="selection.length < 1 || detailData.seeDisabled || !form.status || form.status < 3 || form.createFreight == 1"
  389. @click="getShipmentD"
  390. v-show="goodsActives == 'goods'">生成客户收货
  391. </el-button>
  392. <el-button type="info"
  393. :size="size"
  394. icon="el-icon-printer"
  395. @click.stop="openReport()"
  396. v-show="goodsActives == 'goods'"
  397. >报表打印</el-button>
  398. <el-button
  399. type="primary"
  400. size="small"
  401. icon="el-icon-download"
  402. @click="downloadHandle"
  403. v-show="goodsActives == 'goods'"
  404. >下载模板</el-button>
  405. <el-upload
  406. :action="baseURL"
  407. :headers="headers"
  408. :disabled="detailData.seeDisabled || browse"
  409. :on-progress="uploading"
  410. :show-file-list=false
  411. accept=".xls,.xlsx"
  412. multiple
  413. :on-success="importTemplate"
  414. :on-error="uploadError"
  415. style="float: right"
  416. >
  417. <el-button
  418. type="primary"
  419. size="small"
  420. icon="el-icon-upload"
  421. v-show="goodsActives == 'goods'"
  422. :disabled="detailData.seeDisabled || browse"
  423. >导 入</el-button>
  424. </el-upload>
  425. <el-button
  426. type="warning"
  427. icon="el-icon-refresh"
  428. size="small"
  429. @click="resetStock"
  430. >库存刷新</el-button>
  431. </template>
  432. </avue-crud>
  433. </basic-container>
  434. <fee-info
  435. ref="feeInfo"
  436. :orderFeesList="advantageProjectData"
  437. :disabled="detailData.seeDisabled || form.status >= 3"
  438. feeUrl="/blade-purchase-sales/orderfees/update"
  439. optionType="GN"
  440. itemType="销售"
  441. @beforeFinance="beforeFinance"
  442. :corpId="form.corpId"
  443. :financeDisabled="false"
  444. :tabShow="2"
  445. />
  446. <containerTitle title="上传附件"></containerTitle>
  447. <c-upload
  448. :data="bankOfDepositData"
  449. deleteUrl="/api/blade-client/corpsbank/update"
  450. :enumerationValue="77"
  451. />
  452. </el-form>
  453. </div>
  454. <el-dialog
  455. title="导入商品"
  456. append-to-body
  457. class="el-dialogDeep"
  458. :visible.sync="dialogVisible"
  459. width="80%"
  460. :close-on-click-modal="false"
  461. :destroy-on-close="true"
  462. :close-on-press-escape="false"
  463. @close="closeGoods">
  464. <el-row :style="{height: rowHeight}">
  465. <el-col :span="5" style="height: 100%;overflow-y: auto">
  466. <div>
  467. <el-scrollbar>
  468. <basic-container>
  469. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick"/>
  470. </basic-container>
  471. </el-scrollbar>
  472. </div>
  473. </el-col>
  474. <el-col :span="19">
  475. <basic-container>
  476. <avue-crud :option="optionTwo"
  477. :table-loading="loading"
  478. :data="goodsListShow"
  479. ref="crud"
  480. @refresh-change="refreshChange"
  481. @selection-change="selectionChange"
  482. @search-change="goodsSearch"
  483. :page.sync="page"
  484. @on-load="onLoad">
  485. <template slot="menuLeft">
  486. <el-tabs v-model="activeName" @tab-click="tabHandle">
  487. <el-tab-pane label="查询结果" name="searchList"/>
  488. <el-tab-pane label="已选定数据" name="importStaging"/>
  489. </el-tabs>
  490. </template>
  491. <template slot="orderQuantity" slot-scope="{row}">
  492. <el-input-number
  493. v-model="row.orderQuantity"
  494. size="small"
  495. :controls="false"
  496. :precision="0"
  497. @input="amountChange(row)"
  498. style="width: 100%"
  499. />
  500. </template>
  501. <template slot-scope="scope" slot="menu">
  502. <el-button
  503. type="text"
  504. icon="el-icon-edit"
  505. size="small"
  506. @click.stop="importStagList(scope.row,scope.index)"
  507. v-if="activeName=='searchList'"
  508. :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1"
  509. >选择</el-button>
  510. <el-button
  511. type="text"
  512. icon="el-icon-delete"
  513. size="small"
  514. @click.stop="removeStagList(scope.row,scope.index)"
  515. v-else
  516. >移除</el-button>
  517. </template>
  518. </avue-crud>
  519. </basic-container>
  520. </el-col>
  521. </el-row>
  522. <span slot="footer" class="dialog-footer">
  523. <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
  524. <el-button type="primary" @click="importGoods" v-if="commodityData !== true" :loading="saveLoading">导入</el-button>
  525. <el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading" :disabled="tableData.length !== 1">导入</el-button>
  526. </span>
  527. </el-dialog>
  528. <el-dialog
  529. title="导入政策"
  530. append-to-body
  531. class="el-dialogDeep"
  532. :visible.sync="policyDialog"
  533. width="80%"
  534. :close-on-click-modal="false"
  535. :destroy-on-close="true"
  536. :close-on-press-escape="false"
  537. @close="closePolicy">
  538. <el-row :style="{height: rowHeight}">
  539. <el-col :span="5" style="height: 100%;overflow-y: auto">
  540. <div>
  541. <el-scrollbar>
  542. <basic-container>
  543. <avue-tree :option="policyOption" :data="treeDataPolicy" @node-click="policyNodeClick"/>
  544. </basic-container>
  545. </el-scrollbar>
  546. </div>
  547. </el-col>
  548. <el-col :span="19">
  549. <containerTitle title="特价促销"></containerTitle>
  550. <basic-container style="margin-bottom: 10px">
  551. <avue-crud :option="optionPolicy"
  552. :table-loading="loadingPolicy"
  553. :data="dataPolicy"
  554. ref="crud"
  555. @selection-change="selectionChangePolicy"
  556. :page.sync="pagePolicy">
  557. <template slot="orderQuantity" slot-scope="{row}">
  558. <el-input-number
  559. v-model="row.orderQuantity"
  560. size="small"
  561. :controls="false"
  562. :precision="0"
  563. style="width: 100%"
  564. placeholder="请输入"
  565. />
  566. </template>
  567. </avue-crud>
  568. </basic-container>
  569. <containerTitle title="买赠促销"></containerTitle>
  570. <basic-container>
  571. <avue-crud
  572. :option="customerBuyFree"
  573. :data="contactsDataBuyFree"
  574. @selection-change="selectionChangePolicyTwo"
  575. :table-loading="loadingPolicy"
  576. ref="crudContactE">
  577. </avue-crud>
  578. </basic-container>
  579. </el-col>
  580. </el-row>
  581. <span slot="footer" class="dialog-footer">
  582. <el-button @click="policyDialog = false">取 消</el-button>
  583. <el-button
  584. type="primary"
  585. @click="importPolicy"
  586. :disabled="this.policyData.length == 0 && this.policyDataTwo.length == 0"
  587. :loading="saveLoading">导入</el-button>
  588. </span>
  589. </el-dialog>
  590. <el-dialog
  591. title="导入费用"
  592. append-to-body
  593. class="el-dialogDeep"
  594. :visible.sync="dialogCost"
  595. width="80%"
  596. top="8vh"
  597. :close-on-click-modal="false"
  598. :destroy-on-close="true"
  599. :close-on-press-escape="false"
  600. @close="closeFees">
  601. <el-row :style="{height: rowHeight}">
  602. <el-col :span="5" style="height: 100%;overflow-y: auto">
  603. <div>
  604. <el-scrollbar>
  605. <basic-container>
  606. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  607. </basic-container>
  608. </el-scrollbar>
  609. </div>
  610. </el-col>
  611. <el-col :span="19">
  612. <basic-container>
  613. <avue-crud :option="optionTwoCost"
  614. :table-loading="loadingCost"
  615. :data="dataCost"
  616. ref="crud"
  617. @refresh-change="refreshChangeCost"
  618. @selection-change="selectionChangeCost"
  619. :page.sync="pageCost"
  620. @search-change="feesSearch"
  621. @on-load="onLoadCost">
  622. </avue-crud>
  623. </basic-container>
  624. </el-col>
  625. </el-row>
  626. <span slot="footer" class="dialog-footer">
  627. <el-button @click="dialogCost = false">取 消</el-button>
  628. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  629. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  630. :disabled="tableDataCost.length !== 1">导入</el-button>
  631. </span>
  632. </el-dialog>
  633. <el-dialog
  634. title="账单"
  635. append-to-body
  636. class="el-dialogDeep"
  637. :visible.sync="applySettlementDialog"
  638. width="60%"
  639. :close-on-click-modal="false"
  640. :destroy-on-close="true"
  641. :close-on-press-escape="false"
  642. v-dialog-drag
  643. >
  644. <apply-payment
  645. :billType="billType"
  646. :billData="{}"
  647. itemType="销售"
  648. :arrList="applyPaymentList"
  649. @choceFun="choceFun"
  650. >
  651. </apply-payment>
  652. </el-dialog>
  653. <report-dialog
  654. :switchDialog="switchDialog"
  655. :reportId="form.id"
  656. reportName="销售明细(N)"
  657. @onClose="onClose()"
  658. />
  659. <el-dialog
  660. append-to-body
  661. title="账单"
  662. class="el-dialogDeep"
  663. :visible.sync="financialAccountDialog"
  664. width="70%"
  665. :close-on-click-modal="false"
  666. :destroy-on-close="true"
  667. :close-on-press-escape="false"
  668. v-dialog-drag
  669. >
  670. <financial-account
  671. v-if="financialAccountDialog"
  672. :billType="billType"
  673. :billData="{}"
  674. :arrList="applyPaymentList"
  675. :belongCompany="form.belongCompany"
  676. @choceFun="choceFun"
  677. @submit="feeSubmit"
  678. >
  679. </financial-account>
  680. </el-dialog>
  681. <el-dialog
  682. title="申请记录"
  683. append-to-body
  684. class="el-dialogDeep"
  685. :visible.sync="applicationDialog"
  686. width="60%"
  687. :close-on-click-modal="false"
  688. :destroy-on-close="true"
  689. :close-on-press-escape="false"
  690. v-dialog-drag
  691. >
  692. <bill-application
  693. :billId="form.id"
  694. @choceApplication="choceApplication"
  695. >
  696. </bill-application>
  697. </el-dialog>
  698. <el-dialog
  699. append-to-body
  700. title="审批"
  701. class="el-dialogDeep"
  702. :visible.sync="checkDialog"
  703. width="50%"
  704. :close-on-click-modal="false"
  705. :destroy-on-close="true"
  706. :close-on-press-escape="false"
  707. v-dialog-drag
  708. >
  709. <check
  710. :checkData="checkData"
  711. :checkDetail="false"
  712. :idList="[]"
  713. @choceCheckFun="choceCheckFun"
  714. >
  715. </check>
  716. </el-dialog>
  717. <el-dialog
  718. append-to-body
  719. title="审批进度"
  720. class="el-dialogDeep"
  721. :visible.sync="checkScheduleDialog"
  722. width="40%"
  723. :close-on-click-modal="false"
  724. :destroy-on-close="true"
  725. :close-on-press-escape="false"
  726. v-dialog-drag
  727. >
  728. <check-schedule
  729. :checkId="checkId"
  730. :batchNo="batchNo"
  731. @choceScheduleFun="choceScheduleFun"
  732. >
  733. </check-schedule>
  734. </el-dialog>
  735. <messagePost
  736. v-if="messageVisble"
  737. ref="messagePost"
  738. @closeDialog="closeDialog"
  739. />
  740. <changeApprove
  741. v-if="changeApproveVis"
  742. ref="changeApprove"
  743. @closeDialog="closeChangeApprove"
  744. :auditId="detailData.auditId"
  745. url="/api/blade-check/auditproecess/changeAuditUser"
  746. />
  747. </div>
  748. </template>
  749. <script>
  750. import {
  751. typeSave, detail, deleteDetails,
  752. corpstypeTree,
  753. corpsattn,
  754. corpsbank,
  755. corpsfiles,
  756. corpsitem,
  757. // getList,
  758. detailList,
  759. generateShipment,
  760. saveSell,
  761. getlistBankBy,
  762. getProfit,
  763. pleaseCheck,
  764. repealCancel
  765. } from "@/api/basicData/configuration"
  766. import {getList} from "@/api/basicData/commodityType";
  767. import {getCorpDetail} from "@/api/maintenance/overpayment"
  768. import {integralDetail} from "@/api/maintenance/integral"
  769. import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
  770. import customerContact from "./configuration/customerContact.json"
  771. import advantageProject from "./configuration/advantageProject.json"
  772. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  773. import commodity from "./configuration/commodity.json"
  774. import optionTwoCost from "./configuration/mainListCost.json"
  775. import optionPolicy from "./configuration/optionPolicy.json"
  776. import BuyFree from "./configuration/BuyFree.json"
  777. import {
  778. getDeptLazyTree,
  779. getDeptLazyTreeTwo,
  780. customerList,
  781. policyList,
  782. policyColumn
  783. } from "@/api/basicData/basicFeesDesc";
  784. import _ from "lodash";
  785. import option from "./configuration/mainList.json";
  786. import { contrastObj, contrastList } from "@/util/contrastData";
  787. import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
  788. import customerDialog from "@/components/customer-dialog/main";
  789. //账单组件
  790. import ApplyPayment from "../../../components/finance/applyPayment";
  791. import reportDialog from "@/components/report-dialog/main";
  792. import { getToken } from "@/util/auth";
  793. import Cookies from 'js-cookie'
  794. import feeInfo from "@/components/fee-info/main";
  795. import {corpsAddrSelect, customerList as getKHList, detail as khDetail} from "@/api/basicData/customerInformation";
  796. import billApplication from "@/components/bill/billApplication";
  797. import {
  798. isDiscount,
  799. isPercentage,
  800. micrometerFormat,
  801. IntegerFormat
  802. } from "@/util/validate";
  803. import financialAccount from "../../../components/finance/financialAccount";
  804. import { gainUser } from "@/api/basicData/customerInquiry";
  805. import check from "@/components/check/check";
  806. import checkSchedule from "@/components/check/checkSchedule";
  807. import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
  808. import {mapGetters} from "vuex";
  809. export default {
  810. name: "detailsPage",
  811. props: {
  812. detailData: {
  813. type: Object
  814. }
  815. },
  816. components:{
  817. customerDialog,
  818. ApplyPayment,
  819. reportDialog,
  820. feeInfo,
  821. billApplication,
  822. financialAccount,
  823. check,
  824. checkSchedule,
  825. },
  826. data() {
  827. return {
  828. saveLoading: false,
  829. disabled: false,
  830. form: {
  831. corpId: null,
  832. },
  833. billType:"收费", //账单类型
  834. billData:{}, //账单需要数据
  835. applySettlementDialog:false,//生成账单组件
  836. financialAccountDialog:false,
  837. configuration: {
  838. multipleChoices: false,
  839. multiple: false,
  840. collapseTags: false,
  841. placeholder: '请点击右边按钮选择',
  842. dicData: []
  843. },
  844. goodsConfiguration: {
  845. multipleChoices: false,
  846. multiple: false,
  847. collapseTags: false,
  848. placeholder: '请点击右边按钮选择',
  849. dicData: []
  850. },
  851. plantConfiguration: {
  852. multipleChoices: false,
  853. multiple: false,
  854. collapseTags: false,
  855. placeholder: '请点击右边按钮选择',
  856. dicData: []
  857. },
  858. companyConfiguration: {
  859. multipleChoices: false,
  860. multiple: false,
  861. collapseTags: false,
  862. placeholder: '请点击右边按钮选择',
  863. dicData: []
  864. },
  865. data: [],
  866. policyForm: {},
  867. dataPolicy: [],
  868. contactsDataBuyFree: [],
  869. loadingCost: false,
  870. customerDivide: '',
  871. choiceData: false,
  872. commodityData: false,
  873. dataCost: [],
  874. treeDataPolicy: [],
  875. treeDataGoods: [],
  876. choiceIndex: '',
  877. dialogCost: false,
  878. treeDeptId: '',
  879. treeDeptIdCost: '',
  880. treePolicyId: '',
  881. pageCost: {
  882. pageSize: 10,
  883. currentPage: 1,
  884. total: 0
  885. },
  886. page: {
  887. pageSize: 10,
  888. currentPage: 1,
  889. total: 0,
  890. pageSizes: [10,50,100,300,500]
  891. },
  892. pageList: {
  893. pageSize: 10,
  894. currentPage: 1,
  895. total: 0
  896. },
  897. pagePolicy: {
  898. pageSize: 10,
  899. currentPage: 1,
  900. total: 0
  901. },
  902. loading: false,
  903. loadingPolicy: false,
  904. contactsForm: {},
  905. optionPolicy: optionPolicy,
  906. optionTwo: commodity,
  907. optionTwoCost: optionTwoCost,
  908. customerBuyFree: BuyFree,
  909. policyOption: {
  910. nodeKey: 'id',
  911. lazy: true,
  912. treeLoad: (node, resolve)=> {
  913. const parentId = (node.level === 0) ? 0 : node.data.id;
  914. const newTime = new Date().toLocaleString('chinese',{hour12:false})
  915. policyColumn({newTime: newTime,parentId: parentId,corps: this.form.corpId}).then(res => {
  916. resolve(res.data.data.map(item => {
  917. console.log(item)
  918. return {
  919. ...item,
  920. leaf: !item.hasChildren
  921. }
  922. }))
  923. });
  924. },
  925. addBtn: false,
  926. menu: false,
  927. size: 'small',
  928. props: {
  929. labelText: '标题',
  930. label: 'title',
  931. value: 'value',
  932. children: 'children'
  933. }
  934. },
  935. treeOptionCost: {
  936. nodeKey: 'id',
  937. lazy: true,
  938. treeLoad: function (node, resolve) {
  939. const parentId = (node.level === 0) ? 0 : node.data.id;
  940. getDeptLazyTree(parentId).then(res => {
  941. resolve(res.data.data.map(item => {
  942. return {
  943. ...item,
  944. leaf: !item.hasChildren
  945. }
  946. }))
  947. });
  948. },
  949. addBtn: false,
  950. menu: false,
  951. size: 'small',
  952. props: {
  953. labelText: '标题',
  954. label: 'title',
  955. value: 'value',
  956. children: 'children'
  957. }
  958. },
  959. treeOption: {
  960. nodeKey: 'id',
  961. lazy: true,
  962. treeLoad: function (node, resolve) {
  963. const parentId = (node.level === 0) ? 0 : node.data.id;
  964. getDeptLazyTreeTwo(parentId).then(res => {
  965. resolve(res.data.data.map(item => {
  966. return {
  967. ...item,
  968. leaf: !item.hasChildren
  969. }
  970. }))
  971. });
  972. },
  973. addBtn: false,
  974. menu: false,
  975. size: 'small',
  976. props: {
  977. labelText: '标题',
  978. label: 'title',
  979. value: 'value',
  980. children: 'children'
  981. }
  982. },
  983. dialogVisible: false,
  984. policyDialog: false,
  985. advantageProjectForm: {},
  986. selection: [],
  987. bankOfDepositForm: {},
  988. contactsData: [],
  989. advantageProjectData: [],
  990. bankOfDepositData: [],
  991. tableDataCost: [],
  992. dic: [],
  993. tableData: [],
  994. policyData: [],
  995. policyDataTwo: [],
  996. customerContact: {},
  997. advantageProject: {},
  998. bankOfDeposit: bankOfDeposit,
  999. contactInformation: {
  1000. column: [
  1001. {
  1002. label: '销售金额',
  1003. prop: 'orderAmount',
  1004. type: 'number',
  1005. rules: [
  1006. {
  1007. required: false,
  1008. message: ' ',
  1009. trigger: 'blur'
  1010. }
  1011. ]
  1012. }, {
  1013. label: '其他费用',
  1014. prop: 'otherAmount',
  1015. type: 'number',
  1016. rules: [
  1017. {
  1018. required: false,
  1019. message: ' ',
  1020. trigger: 'blur'
  1021. }
  1022. ]
  1023. },{
  1024. label: '总溢付款',
  1025. prop: 'overPayment',
  1026. disabled: true,
  1027. rules: [
  1028. {
  1029. required: false,
  1030. message: ' ',
  1031. trigger: 'blur'
  1032. }
  1033. ]
  1034. }, {
  1035. label: '返利余额',
  1036. prop: 'profit',
  1037. disabled: true,
  1038. rules: [
  1039. {
  1040. required: false,
  1041. message: ' ',
  1042. trigger: 'blur'
  1043. }
  1044. ]
  1045. }, {
  1046. label: '产生返利',
  1047. prop: 'createProfit',
  1048. disabled: false,
  1049. rules: [
  1050. {
  1051. required: false,
  1052. message: ' ',
  1053. trigger: 'blur'
  1054. }
  1055. ]
  1056. }, {
  1057. label: '本次使用返利',
  1058. prop: 'thisUsedProfit',
  1059. disabled: false,
  1060. rules: [
  1061. {
  1062. required: false,
  1063. message: ' ',
  1064. trigger: 'blur'
  1065. }
  1066. ]
  1067. },{
  1068. label: '应收账款',
  1069. prop: 'debitAmount',
  1070. type: 'number',
  1071. disabled: true,
  1072. rules: [
  1073. {
  1074. required: false,
  1075. message: ' ',
  1076. trigger: 'blur'
  1077. }
  1078. ]
  1079. }, {
  1080. label: '已收款',
  1081. prop: 'settlmentAmount',
  1082. disabled: true,
  1083. rules: [
  1084. {
  1085. required: false,
  1086. message: ' ',
  1087. trigger: 'blur'
  1088. }
  1089. ]
  1090. }, {
  1091. label: '应收未收款',
  1092. prop: 'balanceAmount',//无
  1093. disabled: true,
  1094. rules: [
  1095. {
  1096. required: false,
  1097. message: ' ',
  1098. trigger: 'blur'
  1099. }
  1100. ]
  1101. },
  1102. {
  1103. label: '保证金',
  1104. prop: 'deposit',
  1105. type: 'number',
  1106. rules: [
  1107. {
  1108. required: false,
  1109. message: ' ',
  1110. trigger: 'blur'
  1111. }
  1112. ]
  1113. }, {
  1114. label: '逾期账款',
  1115. prop: 'overDueAccounts',
  1116. type: 'number',
  1117. rules: [
  1118. {
  1119. required: false,
  1120. message: ' ',
  1121. trigger: 'blur'
  1122. }
  1123. ]
  1124. }, {
  1125. label: '实际发货日期',
  1126. prop: 'actualDeliveryDate',
  1127. type: 'datetime',
  1128. rules: [
  1129. {
  1130. required: false,
  1131. message: ' ',
  1132. trigger: 'blur'
  1133. }
  1134. ]
  1135. }, {
  1136. label: '合同日期',
  1137. prop: 'businesDate',
  1138. type: 'date',
  1139. rules: [
  1140. {
  1141. required: false,
  1142. message: ' ',
  1143. trigger: 'blur'
  1144. }
  1145. ]
  1146. }, {
  1147. label: '到货日期',
  1148. prop: 'arrivalDate',
  1149. type: 'datetime',
  1150. rules: [
  1151. {
  1152. required: false,
  1153. message: ' ',
  1154. trigger: 'blur'
  1155. }
  1156. ]
  1157. }, {
  1158. label: '毛利率',
  1159. prop: 'grossProfitRate',
  1160. display: true,
  1161. rules: [
  1162. {
  1163. required: false,
  1164. message: ' ',
  1165. trigger: 'blur'
  1166. }
  1167. ]
  1168. }, {
  1169. label: '毛利额',
  1170. prop: 'grossProfit',
  1171. type: 'number',
  1172. display: true,
  1173. rules: [
  1174. {
  1175. required: false,
  1176. message: ' ',
  1177. trigger: 'blur'
  1178. }
  1179. ]
  1180. }, {
  1181. label: '历史运费(元/条)',
  1182. prop: 'freightAmountHistory',
  1183. type: 'number',
  1184. rules: [
  1185. {
  1186. required: false,
  1187. message: ' ',
  1188. trigger: 'blur'
  1189. }
  1190. ]
  1191. }, {
  1192. label: '预收款日期',
  1193. type: 'datetime',
  1194. prop: 'advanceCollectionDate',
  1195. rules: [
  1196. {
  1197. required: false,
  1198. message: ' ',
  1199. trigger: 'blur'
  1200. }
  1201. ]
  1202. }, {
  1203. label: '特价占比',
  1204. prop: 'specialOfferOf',
  1205. disabled: false,
  1206. rules: [
  1207. {
  1208. required: false,
  1209. message: ' ',
  1210. trigger: 'blur'
  1211. }
  1212. ]
  1213. }, {
  1214. label: '大尺寸占比',
  1215. prop: 'largeScale',
  1216. disabled: false,
  1217. }, {
  1218. label: '单据状态',
  1219. prop: 'orderStatus',
  1220. disabled: true,
  1221. rules: [
  1222. {
  1223. required: false,
  1224. message: ' ',
  1225. trigger: 'blur'
  1226. }
  1227. ]
  1228. },{
  1229. label: '积分余额',
  1230. prop: 'pointMutiple',
  1231. disabled: true,
  1232. rules: [
  1233. {
  1234. required: false,
  1235. message: ' ',
  1236. trigger: 'blur'
  1237. }
  1238. ]
  1239. }, {
  1240. label: '赠送积分',
  1241. prop: 'presenterIntegral',
  1242. disabled: true,
  1243. rules: [
  1244. {
  1245. required: false,
  1246. message: ' ',
  1247. trigger: 'blur'
  1248. }
  1249. ]
  1250. },{
  1251. label: '兑换积分',
  1252. prop: 'convertIntegral',
  1253. disabled: true,
  1254. rules: [
  1255. {
  1256. required: false,
  1257. message: ' ',
  1258. trigger: 'blur'
  1259. }
  1260. ]
  1261. }, {
  1262. label: '制单人',
  1263. prop: 'createUserName',
  1264. disabled: true,
  1265. rules: [
  1266. {
  1267. required: false,
  1268. message: ' ',
  1269. trigger: 'blur'
  1270. }
  1271. ]
  1272. },{
  1273. label: '制单日期',
  1274. prop: 'createTime',
  1275. type: 'datetime',
  1276. disabled:true,
  1277. rules: [
  1278. {
  1279. required: false,
  1280. message: ' ',
  1281. trigger: 'blur'
  1282. }
  1283. ]
  1284. }, {
  1285. label: '特别提醒',
  1286. prop: 'specialRemarks',
  1287. type: 'textarea',
  1288. span: 24,
  1289. rules: [
  1290. {
  1291. required: false,
  1292. message: ' ',
  1293. trigger: 'blur'
  1294. }
  1295. ]
  1296. }
  1297. ]
  1298. },
  1299. basicData: {
  1300. column: [
  1301. {
  1302. label: '所属公司',
  1303. prop: 'belongToCorpId',
  1304. span: 8,
  1305. rules: [
  1306. {
  1307. required: true,
  1308. message: ' ',
  1309. trigger: 'change'
  1310. }
  1311. ]
  1312. }, {
  1313. label: '付款方式',
  1314. prop: 'paymentType',
  1315. rules: [
  1316. {
  1317. required: true,
  1318. message: ' ',
  1319. trigger: 'change'
  1320. }
  1321. ]
  1322. },{
  1323. label: '包装要求',
  1324. prop: 'packageRemarks',
  1325. rules: [
  1326. {
  1327. required: true,
  1328. message: ' ',
  1329. trigger: 'change'
  1330. }
  1331. ]
  1332. },
  1333. {
  1334. label: '银行帐号',
  1335. prop: 'banks',
  1336. type: 'select',
  1337. rules: [
  1338. {
  1339. required: true,
  1340. message: ' ',
  1341. trigger: 'change'
  1342. }
  1343. ]
  1344. }, {
  1345. label: '公司户头',
  1346. prop: 'banksAccountName',
  1347. rules: [
  1348. {
  1349. required: false,
  1350. message: ' ',
  1351. trigger: 'blur'
  1352. }
  1353. ]
  1354. }, {
  1355. label: '开户银行',
  1356. prop: 'accountBank',
  1357. rules: [
  1358. {
  1359. required: false,
  1360. message: ' ',
  1361. trigger: 'blur'
  1362. }
  1363. ]
  1364. },
  1365. {
  1366. label: '客户全称',
  1367. prop: 'corpId',
  1368. span: 8,
  1369. rules: [
  1370. {
  1371. required: true,
  1372. message: ' ',
  1373. trigger: 'change'
  1374. }
  1375. ]
  1376. }, {
  1377. label: '到货地址',
  1378. prop: 'arrivalAddress',
  1379. span:16,
  1380. rules: [
  1381. {
  1382. required: true,
  1383. message: ' ',
  1384. trigger: 'change'
  1385. }
  1386. ]
  1387. }, {
  1388. label: '生产工厂',
  1389. prop: 'productionPlant',
  1390. span: 8,
  1391. rules: [
  1392. {
  1393. required: true,
  1394. message: ' ',
  1395. trigger: 'change'
  1396. }
  1397. ]
  1398. },
  1399. {
  1400. label: '发货地址',
  1401. prop: 'shippingAddress',
  1402. disabled: false,
  1403. span: 16,
  1404. rules: [
  1405. {
  1406. required: true,
  1407. message: ' ',
  1408. trigger: 'change'
  1409. }
  1410. ]
  1411. }, {
  1412. label: '销售订单号',
  1413. prop: 'orderNo',
  1414. disabled: true,
  1415. rules: [
  1416. {
  1417. required: false,
  1418. message: ' ',
  1419. trigger: 'blur'
  1420. }
  1421. ]
  1422. }, {
  1423. label: '主订单号',
  1424. prop: 'morderNo',
  1425. rules: [
  1426. {
  1427. required: false,
  1428. message: ' ',
  1429. trigger: 'blur'
  1430. }
  1431. ]
  1432. },
  1433. {
  1434. label: '是否包含标签',
  1435. prop: 'isLabel',
  1436. type: 'radio',
  1437. },
  1438. {
  1439. label: '是否包含运费',
  1440. prop: 'isFreight',
  1441. type: 'radio',
  1442. },
  1443. {
  1444. label: '预估运费',
  1445. prop: 'predictOceanFreight',
  1446. type: 'number',
  1447. rules: [
  1448. {
  1449. required: true,
  1450. message: ' ',
  1451. trigger: 'blur'
  1452. }
  1453. ]
  1454. },
  1455. {
  1456. label: '要求发货日期',
  1457. prop: 'requiredDeliveryDate',
  1458. type: 'date',
  1459. rules: [
  1460. {
  1461. required: true,
  1462. message: ' ',
  1463. trigger: 'blur'
  1464. }
  1465. ]
  1466. }, {
  1467. label: '要求到货日期',
  1468. prop: 'requiredArrivalDate',
  1469. type: 'date',
  1470. rules: [
  1471. {
  1472. required: true,
  1473. message: ' ',
  1474. trigger: 'blur'
  1475. }
  1476. ]
  1477. },{
  1478. label: '业务员',
  1479. prop: 'chargeMember',
  1480. rules: [
  1481. {
  1482. required: false,
  1483. message: ' ',
  1484. trigger: 'change'
  1485. }
  1486. ]
  1487. }, {
  1488. label: '联系人',
  1489. prop: 'corpAttn',
  1490. rules: [
  1491. {
  1492. required: false,
  1493. message: ' ',
  1494. trigger: 'change'
  1495. }
  1496. ]
  1497. }, {
  1498. label: '联系电话',
  1499. prop: 'corpTel',
  1500. rules: [
  1501. {
  1502. required: false,
  1503. message: ' ',
  1504. trigger: 'change'
  1505. }
  1506. ]
  1507. }, {
  1508. label: "订单备注",
  1509. type: 'textarea',
  1510. span: 24,
  1511. prop: "orderRemark",
  1512. mock: {
  1513. type: 'county'
  1514. }
  1515. }
  1516. ]
  1517. },
  1518. // 银行账号下拉
  1519. bankList: [],
  1520. paymentOption: [],
  1521. statusOption: [],
  1522. // 费用信息排序的最大值
  1523. maxFeeNum: 0,
  1524. maxGoodsNum: 0,
  1525. oldForm: {
  1526. orderStatus: "录入"
  1527. },
  1528. oldGoodsList: [],
  1529. oldGiftList: [],
  1530. oldFeesList: [],
  1531. oldUploadList: [],
  1532. // 采购价格
  1533. purchasePriceOption: [],
  1534. // 销售价格
  1535. salesPriceOtion: [],
  1536. // 弹窗高度
  1537. rowHeight: '',
  1538. // 查询时loading页面
  1539. pageLoading: false,
  1540. switchDialog: false,
  1541. // 商品信息表格loading
  1542. goodsLoading: false,
  1543. baseURL: '/api/blade-purchase-sales/orderitems/importPrice',
  1544. headers: { "Blade-Auth": 'Bearer ' + getToken()},
  1545. activeName: 'searchList',
  1546. // 商品列表数据合计
  1547. goodsListShow: [],
  1548. // 商品列表暂存
  1549. goodsListSave: [],
  1550. goodsListTotal: 0,
  1551. goodsListSaveTotal: 0,
  1552. goodsActives: 'goods',
  1553. saveActives: '',
  1554. goodsDisabled: false,
  1555. // 赠品信息数据
  1556. giftData: [],
  1557. // 商品信息展示数据
  1558. goodsShowData: [],
  1559. arrivalOptions: [],
  1560. shippingOptions: [],
  1561. applicationDialog:false,
  1562. itemType: '销售',
  1563. packageOptions: [],
  1564. // 请核状态禁用
  1565. browse: false,
  1566. roleName: '',
  1567. userList: [],
  1568. feesOption: [],
  1569. checkDisabled: false,
  1570. checkData: {},
  1571. checkDialog: false,
  1572. checkScheduleDialog: false,
  1573. checkId: '',
  1574. batchNo:'',
  1575. applyPaymentList: [],
  1576. khInfoList: [],
  1577. messageVisble: false, //消息弹窗开关
  1578. changeApproveVis: false, // 更换审批人弹窗
  1579. arrearsCheck: false, // 是否欠款发货审批
  1580. }
  1581. },
  1582. mounted() {
  1583. this.$nextTick(() => {
  1584. // 监听浏览器高度变化,改变表格高度
  1585. window.onresize = () => {
  1586. this.rowHeight = (window.innerHeight - 130) + 'px'
  1587. }
  1588. })
  1589. },
  1590. filters: {
  1591. IntegerFormat(num) {
  1592. return IntegerFormat(num);
  1593. },
  1594. decimalFormat(num) {
  1595. return num ? Number(num).toFixed(2) : "0.00";
  1596. }
  1597. },
  1598. //初始化查询
  1599. async created() {
  1600. this.rowHeight = (window.innerHeight - 130) + 'px'
  1601. // this.customerContact = customerContact
  1602. this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
  1603. this.getWorkDicts("payment_term").then(res => {
  1604. this.paymentOption = res.data.data
  1605. })
  1606. this.getWorkDicts("order_status").then(res => {
  1607. this.statusOption = res.data.data
  1608. })
  1609. this.getWorkDicts("packageRemarks").then(res => {
  1610. this.packageOptions = res.data.data;
  1611. });
  1612. // 获取角色
  1613. this.roleName = localStorage.getItem('roleName')
  1614. if (this.roleName !== 'admin') {
  1615. this.contactInformation.column.forEach(item => {
  1616. if (item.prop == 'grossProfitRate' || item.prop == 'grossProfit') item.display = false
  1617. })
  1618. }
  1619. if (this.roleName == 'salesman') {
  1620. this.customerContact.column.forEach(item => {
  1621. if (item.prop == 'purchaseAmount') {
  1622. item.hide = true;
  1623. item.showColumn = false;
  1624. }
  1625. })
  1626. }
  1627. this.getDefault()
  1628. if (this.detailData.id) {
  1629. this.queryData(this.detailData.id)
  1630. }
  1631. if (this.detailData.check) {
  1632. this.checkDisabled = true
  1633. this.batchNo = this.detailData.check.batchNo
  1634. }
  1635. gainUser().then(res => {
  1636. this.userList = res.data.data;
  1637. });
  1638. feeList().then(res => {
  1639. this.feesOption = res.data.data.records
  1640. })
  1641. if (this.detailData.seeDisabled) {
  1642. // this.bankOfDeposit.column.forEach(item => {
  1643. // item.editDisabled = true
  1644. // item.addDisabled = true
  1645. // })
  1646. }
  1647. if (this.detailData.copyId) {
  1648. this.queryData(this.detailData.copyId, true)
  1649. }
  1650. this.oldForm = Object.assign({}, this.form);
  1651. this.customerBuyFree.height = (window.innerHeight - 330) / 2;
  1652. this.optionPolicy.height = (window.innerHeight - 330) / 2;
  1653. },
  1654. methods: {
  1655. getGoodsRow(event,row) {
  1656. row.priceCategory = event.goodsTypeName
  1657. row.code = event.code
  1658. row.typeno = event.typeno
  1659. row.itemType = event.typeno
  1660. row.itemId = event.id
  1661. row.corpId = event.corpId
  1662. row.corpName = event.corpName
  1663. selectGoodsNum({
  1664. goodsId: event.id,
  1665. itemType: event.typeno,
  1666. tradeType: 'GN'
  1667. }).then(res => {
  1668. row.storageQuantity = res.data.data
  1669. })
  1670. row.integralMultiples = event.integralMultiples
  1671. this.quantityChange(row)
  1672. },
  1673. queryData(id, isCopy = false){
  1674. this.pageLoading = true
  1675. detail(id).then(async res => {
  1676. this.form = res.data.data;
  1677. this.browse = this.form.status > 0? true: false;
  1678. this.arrearsCheck = this.form.specialCheckStatus == 3? true: false;
  1679. await getProfit({Id: this.form.corpId}).then(res => {
  1680. this.$set(this.form, 'profit',res.data.data.surplusProfit? res.data.data.surplusProfit: '0.00')
  1681. })
  1682. this.contactsData = this.form.orderItemsList.filter(item => {
  1683. return item.goodType == 0
  1684. })
  1685. this.giftData = this.form.orderItemsList.filter(item => {
  1686. return item.goodType == 1
  1687. })
  1688. this.goodsShowData = this.giftData;
  1689. this.goodsActives = 'goods';
  1690. this.handleClick({name: this.goodsActives})
  1691. // this.contactsData = this.form.orderItemsList
  1692. this.advantageProjectData = this.form.orderFeesList
  1693. this.bankOfDepositData = this.form.orderFilesList
  1694. this.configuration.dicData = this.form.corpName
  1695. let feesData = []
  1696. this.form.orderFeesList.forEach(item => {
  1697. let a = {
  1698. cname: item.corpName,
  1699. id: item.corpId
  1700. }
  1701. feesData.push(a)
  1702. })
  1703. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  1704. // 去重
  1705. this.removeRepeat()
  1706. let goodsData = []
  1707. this.form.orderItemsList.forEach(item => {
  1708. let a = {
  1709. cname: item.cname,
  1710. }
  1711. goodsData.push(a)
  1712. })
  1713. this.goodsConfiguration.dicData = [].concat(goodsData)
  1714. this.removeGoodsRepeat()
  1715. delete this.form.orderItemsList
  1716. delete this.form.orderFeesList
  1717. delete this.form.orderFilesList
  1718. // delete this.form.corpName
  1719. delete this.form.belongToCorpList
  1720. // 获取最大值
  1721. let num = []
  1722. this.advantageProjectData.forEach(item => {
  1723. num.push(item.sort)
  1724. })
  1725. if (num.length == 0) {
  1726. this.maxFeeNum = 0;
  1727. } else {
  1728. this.maxFeeNum = num.reduce((a, b) => {
  1729. return b > a? b: a;
  1730. })
  1731. }
  1732. let goodsNum = []
  1733. let purchaseAmount = 0
  1734. this.contactsData.forEach(item => {
  1735. goodsNum.push(item.sort)
  1736. purchaseAmount += Number(item.purchaseAmount)
  1737. })
  1738. if (goodsNum.length == 0) {
  1739. this.maxGoodsNum = 0;
  1740. } else {
  1741. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  1742. return b > a? b: a;
  1743. })
  1744. }
  1745. this.oldForm = Object.assign({}, this.form)
  1746. this.oldGoodsList = []
  1747. this.oldGiftList = []
  1748. this.oldFeesList = []
  1749. this.oldUploadList = []
  1750. this.oldGoodsList = this.deepClone(this.contactsData)
  1751. this.oldGiftList = this.deepClone(this.giftData)
  1752. this.oldFeesList = this.deepClone(this.advantageProjectData)
  1753. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  1754. if (isCopy) {
  1755. this.$set(this.form, 'orderStatus', '录入')
  1756. this.form.status = 0
  1757. this.browse = false
  1758. delete this.form.id
  1759. delete this.form.orgOrderNo
  1760. delete this.form.orderNo
  1761. delete this.form.morderNo
  1762. delete this.form.createUserName
  1763. delete this.form.createTime
  1764. delete this.form.businesDate
  1765. this.contactsData.forEach(item => {
  1766. delete item.id
  1767. delete item.pid
  1768. delete item.itemId
  1769. })
  1770. this.goodsShowData.forEach(item => {
  1771. delete item.id
  1772. delete item.pid
  1773. delete item.itemId
  1774. })
  1775. this.giftData.forEach(item => {
  1776. delete item.id
  1777. delete item.pid
  1778. delete item.itemId
  1779. })
  1780. this.advantageProjectData = []
  1781. this.bankOfDepositData = []
  1782. this.bankOfDepositData.forEach(item => {
  1783. delete item.id
  1784. delete item.pid
  1785. })
  1786. }
  1787. }).finally(() => {
  1788. this.saveLoading = false
  1789. this.pageLoading = false
  1790. });
  1791. },
  1792. getDefault() {
  1793. let date = new Date();
  1794. let year = date.getFullYear();
  1795. let month = date.getMonth() + 1;
  1796. let day = date.getDate();
  1797. if (month < 10) {
  1798. month = "0" + month;
  1799. }
  1800. if (day < 10) {
  1801. day = "0" + day;
  1802. }
  1803. let nowDate = year + "-" + month + "-" + day + ' 00:00:00';
  1804. this.$set(this.form, 'businesDate', nowDate)
  1805. this.$set(this.form, 'orderStatus', '录入')
  1806. this.$set(this.form, 'caseOverPayment', 0)
  1807. this.$set(this.form, 'overPayment', 0)
  1808. this.$set(this.form, 'orderAmount', 0)
  1809. this.$set(this.form, 'predictOceanFreight', 0)
  1810. this.$set(this.form, 'presenterIntegral' , 0)
  1811. this.$set(this.form, 'convertIntegral' , 0)
  1812. this.$set(this.form, 'profit' , 0)
  1813. this.$set(this.form, 'paymentType', '预付')
  1814. this.$set(this.form, 'thisUsedProfit' , 0)
  1815. this.$set(this.form, 'createProfit' , 0)
  1816. this.$set(this.form, 'isFreight' , 0)
  1817. this.$set(this.form, 'isLabel' , 0)
  1818. },
  1819. // 复制新单
  1820. copyOrder() {
  1821. this.saveActives = ''
  1822. this.queryData(this.form.id, true)
  1823. },
  1824. getcorpId(row) {
  1825. this.goodsShowData[row.index].corpId = row.id;
  1826. this.goodsShowData[row.index].corpName = row.cname;
  1827. },
  1828. // 采购金额获取
  1829. getPurchasePrice(row) {
  1830. getPurchasePrice({code: row.code}).then(res => {
  1831. this.purchasePriceOption = res.data.data
  1832. })
  1833. },
  1834. // 销售金额获取
  1835. getMarketPrice(row) {
  1836. getMarketPrice({code: row.code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(res => {
  1837. this.salesPriceOtion = res.data.data
  1838. })
  1839. },
  1840. // 生成采购单
  1841. saveSell() {
  1842. let getGoodsList = []
  1843. let getGiftList = []
  1844. let getFeeList = this.$refs.feeInfo.submitData()
  1845. if (this.goodsActives == 'gift') {
  1846. getGiftList = this.goodsShowData
  1847. getGoodsList = this.contactsData
  1848. } else {
  1849. getGoodsList = this.goodsShowData
  1850. getGiftList = this.giftData
  1851. }
  1852. if (contrastObj(this.form, this.oldForm) ||
  1853. contrastList(getGoodsList, this.oldGoodsList) ||
  1854. contrastList(getGiftList, this.oldGiftList) ||
  1855. // contrastList(getFeeList, this.oldFeesList) ||
  1856. contrastList(this.bankOfDepositData, this.oldUploadList)
  1857. ) {
  1858. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1859. confirmButtonText: "确定",
  1860. cancelButtonText: "取消",
  1861. type: "warning"
  1862. }).then(async () => {
  1863. await this.editCustomer(false, '采购')
  1864. }).catch(() => {
  1865. this.$message.info('已取消')
  1866. })
  1867. } else {
  1868. if ((Number(this.form.settlmentAmount) < Number(this.form.debitAmount)) && !this.arrearsCheck) return this.$message.error('收款未收齐,禁止生成采购单');
  1869. this.$confirm("是否生成采购单?", {
  1870. confirmButtonText: "确定",
  1871. cancelButtonText: "取消",
  1872. type: "warning"
  1873. }).then(() => {
  1874. saveSell(this.form.id).then(res => {
  1875. if (res.data.code == 200) {
  1876. this.$message.success("生成成功");
  1877. this.messageVisble = true
  1878. this.$nextTick(() => {
  1879. this.$refs.messagePost.init()
  1880. })
  1881. }
  1882. });
  1883. });
  1884. }
  1885. },
  1886. closeDialog() {
  1887. this.messageVisble = false
  1888. },
  1889. //点击行可编辑
  1890. handleRowClick(row, event, column) {
  1891. },
  1892. //商品编辑
  1893. rowCell(row, index) {
  1894. if (row.$cellEdit) {
  1895. if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
  1896. return this.$message.error('订货数量不能小于发货数量')
  1897. }
  1898. }
  1899. this.$refs.crudContact.rowCell(row, row.$index)
  1900. },
  1901. //费用编辑
  1902. rowCellTwo(row, index) {
  1903. this.$refs.crudProject.rowCell(row, row.$index)
  1904. },
  1905. //费用新增触发
  1906. costIncrease() {
  1907. this.dialogCost = !this.dialogCost
  1908. this.choiceData = false
  1909. },
  1910. //商品新增触发
  1911. commoditySelection() {
  1912. this.dialogVisible = !this.dialogVisible
  1913. this.tableData = []
  1914. this.commodityData = false
  1915. this.goodsListSave = [];
  1916. },
  1917. //政策价格导入
  1918. policy() {
  1919. this.policyDialog = !this.policyDialog
  1920. },
  1921. // 报表
  1922. openReport() {
  1923. this.switchDialog =! this.switchDialog;
  1924. },
  1925. // 导出
  1926. exportHandle() {
  1927. this.$confirm('是否导出产品信息?', '提示', {
  1928. confirmButtonText: '确定',
  1929. cancelButtonText: '取消',
  1930. type: 'warning'
  1931. }).then(() => {
  1932. window.open(
  1933. `/api/blade-client/goodsdesc/export-out-info?${
  1934. this.website.tokenHeader
  1935. }=${getToken()}`
  1936. );
  1937. }).catch(() => {
  1938. this.$message({
  1939. type: 'info',
  1940. message: '已取消'
  1941. });
  1942. })
  1943. },
  1944. // 下载模板
  1945. downloadHandle() {
  1946. this.$confirm('是否下载模板文件?', '提示', {
  1947. confirmButtonText: '确定',
  1948. cancelButtonText: '取消',
  1949. type: 'warning'
  1950. }).then(() => {
  1951. window.open(
  1952. `/api/blade-purchase-sales/orderitems/exportPrice?${
  1953. this.website.tokenHeader
  1954. }=${getToken()}`
  1955. );
  1956. }).catch(() => {
  1957. this.$message({
  1958. type: 'info',
  1959. message: '已取消'
  1960. });
  1961. })
  1962. },
  1963. //文件上传时
  1964. uploading(event, file, fileList) {
  1965. this.openFullScreen(false, '文件正在解析中');
  1966. },
  1967. importTemplate(res, file) {
  1968. this.openFullScreen(true)
  1969. let goodsData = []
  1970. res.data.forEach(item => {
  1971. getMarketPrice({code: item.code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(response => {
  1972. if (response.data.data.length > 0) {
  1973. this.$set(item, 'price', response.data.data[0].salePrice)
  1974. } else {
  1975. this.$set(item, 'price', '0')
  1976. }
  1977. this.priceChange(item)
  1978. // this.$set(item, 'amount', (Number(item.price) * Number(item.orderQuantity)).toFixed(2))
  1979. })
  1980. getPurchasePrice({code: item.code}).then(response => {
  1981. if (response.data.data.length > 0) {
  1982. this.$set(item, 'purchaseAmount', response.data.data[0].purchasePrice)
  1983. } else {
  1984. this.$set(item, 'purchaseAmount', '0')
  1985. }
  1986. })
  1987. this.$set(item, 'actualQuantity', '0')
  1988. this.$set(item, 'purchaseAmount', '0')
  1989. this.$set(item, 'price', '0')
  1990. this.$set(item, 'amount', '0')
  1991. this.$set(item, 'sort', this.maxFeeNum + 1)
  1992. this.maxFeeNum++
  1993. let a = {
  1994. cname: item.cname,
  1995. }
  1996. goodsData.push(a)
  1997. })
  1998. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.concat(goodsData)
  1999. this.removeGoodsRepeat()
  2000. this.goodsShowData = this.goodsShowData.concat(res.data)
  2001. },
  2002. uploadError(err, file, fileList) {
  2003. this.openFullScreen(true)
  2004. this.$message.error(JSON.parse(err.message).msg)
  2005. },
  2006. //遮罩层
  2007. openFullScreen(res, text) {
  2008. const loading = this.$loading({
  2009. lock: true,
  2010. text: text,
  2011. spinner: 'el-icon-loading',
  2012. background: 'rgba(0, 0, 0, 0.7)'
  2013. });
  2014. if (res === true) loading.close();
  2015. },
  2016. onClose(val) {
  2017. this.switchDialog = val;
  2018. },
  2019. getShipmentD() {
  2020. for (let item in this.selection) {
  2021. if (!this.selection[item].id) {
  2022. return this.$message.error('选中数据有新数据,请先保存')
  2023. }
  2024. }
  2025. if (this.$store.getters.inStatus) {
  2026. this.$alert("客户收货存在,请保存客户收货再进行操作", "温馨提示", {
  2027. confirmButtonText: "确定",
  2028. type: "warning",
  2029. callback: action => {
  2030. console.log(action);
  2031. }
  2032. });
  2033. } else {
  2034. this.generateShipmentD();
  2035. }
  2036. },
  2037. //生成发货单
  2038. async generateShipmentD() {
  2039. let getGoodsList = []
  2040. let getGiftList = []
  2041. let getFeeList = this.$refs.feeInfo.submitData()
  2042. if (this.goodsActives == 'gift') {
  2043. getGiftList = this.goodsShowData
  2044. getGoodsList = this.contactsData
  2045. } else {
  2046. getGoodsList = this.goodsShowData
  2047. getGiftList = this.giftData
  2048. }
  2049. if (contrastObj(this.form, this.oldForm) ||
  2050. contrastList(getGoodsList, this.oldGoodsList) ||
  2051. contrastList(getGiftList, this.oldGiftList) ||
  2052. // contrastList(getFeeList, this.oldFeesList) ||
  2053. contrastList(this.bankOfDepositData, this.oldUploadList)
  2054. ) {
  2055. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  2056. confirmButtonText: "确定",
  2057. cancelButtonText: "取消",
  2058. type: "warning"
  2059. }).then(() => {
  2060. this.editCustomer(false, '发货')
  2061. }).catch(() => {
  2062. this.$message({
  2063. type: 'info',
  2064. message: '已取消'
  2065. });
  2066. })
  2067. } else {
  2068. // if (Number(this.form.debitAmount) > Number(this.form.settlmentAmount)) {
  2069. // return this.$message.error('已收款小于未收款,不能生成客户确认单')
  2070. // }
  2071. let lsit = []
  2072. this.selection = this.selection.concat(this.giftData)
  2073. this.selection.forEach(item => {
  2074. lsit.push(item.id)
  2075. })
  2076. let data = {
  2077. id: this.form.id,
  2078. orderItemIds: lsit
  2079. }
  2080. generateShipment(data).then(res => {
  2081. this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
  2082. this.$router.push({
  2083. path: "/businessManagement/deliveryNotice/index",
  2084. query: {
  2085. form: JSON.stringify(res.data.data),
  2086. pageType: "Generate",
  2087. },
  2088. });
  2089. })
  2090. }
  2091. },
  2092. // 生成结算
  2093. applySettlement(type) {
  2094. let getGoodsList = []
  2095. let getGiftList = []
  2096. let getFeeList = this.$refs.feeInfo.submitData()
  2097. if (this.goodsActives == 'gift') {
  2098. getGiftList = this.goodsShowData
  2099. getGoodsList = this.contactsData
  2100. } else {
  2101. getGoodsList = this.goodsShowData
  2102. getGiftList = this.giftData
  2103. }
  2104. if (contrastObj(this.form, this.oldForm) ||
  2105. contrastList(getGoodsList, this.oldGoodsList) ||
  2106. contrastList(getGiftList, this.oldGiftList) ||
  2107. // contrastList(getFeeList, this.oldFeesList) ||
  2108. contrastList(this.bankOfDepositData, this.oldUploadList)
  2109. ) {
  2110. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2111. confirmButtonText: "确定",
  2112. cancelButtonText: "取消",
  2113. type: "warning"
  2114. }).then(() => {
  2115. this.editCustomer(false, type)
  2116. }).catch(() => {
  2117. })
  2118. } else {
  2119. this.beforeBillData(true,type)
  2120. this.financialAccountDialog = true;
  2121. }
  2122. },
  2123. //生成账单 拿到主表信息
  2124. beforeBillData(bool,type){
  2125. this.applyPaymentList = [];
  2126. let arr = [];
  2127. this.billType = type
  2128. const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData
  2129. data.map(e => {
  2130. if (e.submitPay != 1) {
  2131. const form = {
  2132. belongCompany: this.form.belongCompany,
  2133. srcOrderno:this.form.orgOrderNo,
  2134. itemType:"销售",
  2135. corpsName:this.form.corpName,
  2136. corpId:this.form.corpId,
  2137. srcParentId: this.form.id,
  2138. currency: 'CNY',
  2139. exchangeRate: '1',
  2140. taxRate: '0',
  2141. accDate: this.form.businesDate,
  2142. srcType: 1,
  2143. tradeType: 'GN',
  2144. optionType: 'GN',
  2145. chargeMember: this.form.chargeMember,
  2146. amount: e.amount,
  2147. quantity: e.orderQuantity, // 数量
  2148. price: e.price,
  2149. unit: e.unit,
  2150. goodName: e.cname,
  2151. srcFeesId: e.id,
  2152. costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
  2153. }
  2154. arr.push(form)
  2155. }
  2156. })
  2157. let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 1 && item.submitPay != 1)
  2158. getFeeList.forEach(item => {
  2159. let form = {
  2160. srcOrderno:this.form.orgOrderNo,
  2161. itemType:"销售",
  2162. corpsName:this.form.corpName,
  2163. corpId:this.form.corpId,
  2164. srcParentId: this.form.id,
  2165. currency: 'CNY',
  2166. exchangeRate: '1',
  2167. taxRate: '0',
  2168. accDate: this.form.businesDate,
  2169. srcType: 2,
  2170. tradeType: 'GN',
  2171. optionType: 'GN',
  2172. chargeMember: this.form.chargeMember,
  2173. parentId: this.form.id,
  2174. amount: item.amount,
  2175. costType: item.itemId,
  2176. srcFeesId: item.id,
  2177. quantity: item.quantity, // 数量
  2178. price: item.price,
  2179. }
  2180. arr.push(form)
  2181. })
  2182. this.applyPaymentList = [...arr]
  2183. if(bool){ //申请货款
  2184. // this.billData.srcId = -1
  2185. }
  2186. },
  2187. //关闭账单
  2188. choceFun(){
  2189. this.financialAccountDialog = false
  2190. },
  2191. feeSubmit() {
  2192. this.saveActives = ''
  2193. this.queryData(this.form.id);
  2194. },
  2195. //商品选中触发
  2196. productSelection(selection) {
  2197. this.selection = selection
  2198. },
  2199. //点击费用明细选择触发
  2200. choice(row) {
  2201. this.dialogCost = !this.dialogCost
  2202. this.choiceData = true
  2203. this.choiceIndex = row.$index
  2204. },
  2205. // 去重
  2206. removeRepeat() {
  2207. let obj = []
  2208. this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
  2209. obj[next.id] ? '': obj[next.id] = true && current.push(next)
  2210. return current
  2211. }, [])
  2212. },
  2213. removeGoodsRepeat() {
  2214. let obj = []
  2215. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
  2216. obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
  2217. return current
  2218. }, [])
  2219. },
  2220. //
  2221. receiveList(data){
  2222. this.configuration.dicData = this.configuration.dicData.concat(data)
  2223. this.removeRepeat()
  2224. },
  2225. receiveGoodList(data) {
  2226. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.concat(data)
  2227. this.removeGoodsRepeat()
  2228. },
  2229. async getCorpRow(data) {
  2230. khDetail(data.id).then(res => {
  2231. if (res.data.data.adminProfiles) {
  2232. res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
  2233. let arr = [];
  2234. res.data.data.adminProfiles.forEach(e => {
  2235. arr.push(this.userList.find(item => item.id == e).realName)
  2236. })
  2237. this.$set(this.form, 'chargeMember', arr[0])
  2238. }
  2239. if (res.data.data.corpsAttnList.length > 0) {
  2240. this.khInfoList = res.data.data.corpsAttnList;
  2241. this.$set(this.form, 'corpAttn', res.data.data.corpsAttnList[0].cname);
  2242. this.$set(this.form, 'corpTel', res.data.data.corpsAttnList[0].tel);
  2243. } else {
  2244. this.khInfoList = [];
  2245. this.$set(this.form, 'corpAttn', null);
  2246. this.$set(this.form, 'corpTel', null);
  2247. }
  2248. })
  2249. if (data.belongtocompany) {
  2250. // this.form.belongToCorpId = data.belongtocompany
  2251. // this.returnBack({id: this.form.belongToCorpId})
  2252. }
  2253. getCorpDetail({corpId:data.id}).then(res => {
  2254. this.form.overPayment = res.data.data? res.data.data.balanceOverpaymen: 0
  2255. })
  2256. integralDetail({corpId:data.id}).then(res => {
  2257. this.form.pointMutiple = res.data.data? res.data.data.balancePoints: 0
  2258. })
  2259. getProfit({Id: data.id}).then(res => {
  2260. this.form.profit = res.data.data.surplusProfit? res.data.data.surplusProfit: '0.00'
  2261. })
  2262. this.arrivalOptions = [];
  2263. this.arrivalOptions = await this.corpAddr(data.id)
  2264. this.$set(this.form, 'paymentType', data.paymentType? data.paymentType: '预付')
  2265. this.$set(this.form, 'packageRemarks', data.packageRemarks? data.packageRemarks: '无包装')
  2266. if (this.arrivalOptions.length > 0) {
  2267. this.$set(this.form, 'arrivalAddress', this.arrivalOptions[0].label)
  2268. } else {
  2269. this.$set(this.form, 'arrivalAddress', null)
  2270. }
  2271. },
  2272. async getPlantRow(data) {
  2273. this.shippingOptions = [];
  2274. this.shippingOptions = await this.corpAddr(data.id)
  2275. if (this.shippingOptions.length > 0) {
  2276. this.$set(this.form, 'shippingAddress', this.shippingOptions[0].label)
  2277. } else {
  2278. this.$set(this.form, 'shippingAddress', null)
  2279. }
  2280. },
  2281. getRow(event,row) {
  2282. row.priceCategory = event[0].goodsTypeName
  2283. row.code = event[0].code
  2284. row.typeno = event[0].typeno
  2285. row.itemType = event[0].typeno
  2286. row.itemId = event[0].id
  2287. row.corpId = event[0].corpId
  2288. row.corpName = event[0].corpName
  2289. selectGoodsNum({
  2290. goodsId: event[0].id,
  2291. itemType: event[0].typeno,
  2292. tradeType: 'GN'
  2293. }).then(res => {
  2294. row.storageQuantity = res.data.data
  2295. })
  2296. row.integralMultiples = event[0].integralMultiples
  2297. this.quantityChange(row)
  2298. },
  2299. //点击商品明细选择触发
  2300. commodityChoice(row) {
  2301. this.dialogVisible = !this.dialogVisible
  2302. this.commodityData = true
  2303. this.choiceIndexT = row.$index
  2304. },
  2305. //导入商品触发
  2306. importChoice() {
  2307. // this.contactsData = this.contactsData.concat(this.tableData)
  2308. if (this.tableData.length === 1) {
  2309. this.goodsShowData[this.choiceIndexT].cname = this.tableData[0].cname
  2310. this.goodsShowData[this.choiceIndexT].code = this.tableData[0].code
  2311. this.goodsShowData[this.choiceIndexT].typeno = this.tableData[0].typeno
  2312. this.goodsShowData[this.choiceIndexT].itemType = this.tableData[0].typeno
  2313. this.goodsShowData[this.choiceIndexT].itemId = this.tableData[0].id
  2314. this.goodsShowData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
  2315. this.goodsShowData[this.choiceIndexT].integralMultiples = this.tableData[0].integralMultiples
  2316. this.goodsShowData[this.choiceIndexT].corpId = this.tableData[0].corpId
  2317. this.goodsShowData[this.choiceIndexT].corpName = this.tableData[0].corpName
  2318. this.quantityChange(this.goodsShowData[this.choiceIndexT])
  2319. selectGoodsNum({
  2320. goodsId: this.tableData[0].id,
  2321. itemType: this.tableData[0].typeno,
  2322. tradeType: 'GN'
  2323. }).then(res => {
  2324. this.goodsShowData[this.choiceIndexT].storageQuantity = res.data.data
  2325. })
  2326. }
  2327. this.dialogVisible = !this.dialogVisible
  2328. this.commodityData = false
  2329. },
  2330. //费用编辑导入触发
  2331. choiceCost() {
  2332. if (this.tableDataCost.length === 1) {
  2333. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  2334. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  2335. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  2336. }
  2337. this.dialogCost = !this.dialogCost
  2338. this.choiceData = false
  2339. },
  2340. //费用导入触发
  2341. importCost() {
  2342. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  2343. if (this.tableDataCost.length > 0) {
  2344. for (let item in this.tableDataCost) {
  2345. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  2346. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  2347. this.$set(this.tableDataCost[item], 'amount', 0)
  2348. this.$set(this.tableDataCost[item], 'settlmentAmount', 0)
  2349. this.$set(this.tableDataCost[item], 'corpId', this.form.corpId)
  2350. this.tableDataCost[item].sort = this.maxFeeNum + 1
  2351. this.maxFeeNum++
  2352. delete this.tableDataCost[item].id
  2353. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  2354. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  2355. }
  2356. }
  2357. this.tableDataCost = []
  2358. this.dialogCost = false
  2359. },
  2360. //确认导入触发
  2361. async importGoods() {
  2362. if (this.goodsListSave.length > 0) {
  2363. this.goodsListSaveHandle()
  2364. } else {
  2365. if (this.tableData.length > 0) {
  2366. this.tableDataHandle()
  2367. }
  2368. }
  2369. },
  2370. goodsListSaveHandle() {
  2371. this.saveLoading = true;
  2372. for (let item in this.goodsListSave) {
  2373. getMarketPrice({code: this.goodsListSave[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(res => {
  2374. if (res.data.data.length > 0) {
  2375. this.$set(this.goodsListSave[item], 'price', res.data.data[0].salePrice)
  2376. } else {
  2377. this.$set(this.goodsListSave[item], 'price', '0')
  2378. }
  2379. this.priceChange(this.goodsListSave[item])
  2380. })
  2381. getPurchasePrice({code: this.goodsListSave[item].code}).then(res => {
  2382. if (res.data.data.length > 0) {
  2383. this.$set(this.goodsListSave[item], 'purchaseAmount', res.data.data[0].purchasePrice)
  2384. } else {
  2385. this.$set(this.goodsListSave[item], 'purchaseAmount', '0')
  2386. }
  2387. })
  2388. selectGoodsNum({
  2389. goodsId: this.goodsListSave[item].id,
  2390. itemType: this.goodsListSave[item].typeno,
  2391. tradeType: 'GN'
  2392. }).then(res => {
  2393. this.$set(this.goodsListSave[item], 'storageQuantity', res.data.data)
  2394. // this.goodsListSave[item].storageQuantity = res.data.data
  2395. this.$set(this.goodsListSave[item], 'priceCategory', this.goodsListSave[item].goodsTypeName)
  2396. // this.goodsListSave[item].priceCategory = this.goodsListSave[item].goodsTypeName
  2397. delete this.goodsListSave[item].goodsTypeName
  2398. this.goodsListSave[item].itemId = this.goodsListSave[item].id
  2399. this.$set(this.goodsListSave[item], 'corpName', this.goodsListSave[item].corpName)
  2400. this.$set(this.goodsListSave[item], 'itemType', this.goodsListSave[item].typeno)
  2401. // this.$set(this.goodsListSave[item], 'orderQuantity', 1)
  2402. this.$set(this.goodsListSave[item], 'actualQuantity', 0)
  2403. this.$set(this.goodsListSave[item], 'invoiceWeight', this.goodsListSave[item].cartonWeight)
  2404. this.$set(this.goodsListSave[item], 'shopQuality', 0)
  2405. this.$set(this.goodsListSave[item], 'inputMold', 0) // 判断是商品还是政策 商品 0 特价 1 买赠2
  2406. // this.$set(this.goodsListSave[item], 'priceType', this.goodsListSave[item].policyName)
  2407. this.goodsListSave[item].amount = 0
  2408. if (this.goodsActives == "goods") {
  2409. this.$set(this.goodsListSave[item], 'goodType', 0)
  2410. } else {
  2411. this.$set(this.goodsListSave[item], 'goodType', 1)
  2412. this.$set(this.goodsListSave[item], 'integralMultiples', this.goodsListSave[item].integral)
  2413. }
  2414. this.$set(this.goodsListSave[item], 'integral', '0')
  2415. this.goodsListSave[item].sort = this.maxGoodsNum + 1
  2416. if (this.form.packageRemarks) {
  2417. this.goodsListSave[item].packageRemarks = this.form.packageRemarks
  2418. }
  2419. delete this.goodsListSave[item].id
  2420. delete this.goodsListSave[item].pid
  2421. delete this.goodsListSave[item].isDeleted
  2422. delete this.goodsListSave[item].status
  2423. delete this.goodsListSave[item].tenantId
  2424. delete this.goodsListSave[item].updateTime
  2425. delete this.goodsListSave[item].updateUser
  2426. delete this.goodsListSave[item].updateUserName
  2427. this.maxGoodsNum++
  2428. this.quantityChange(this.goodsListSave[item])
  2429. this.$refs.crudContact.rowCellAdd(this.goodsListSave[item]);
  2430. this.$nextTick(() => {
  2431. this.quantityChange(this.goodsListSave[item])
  2432. })
  2433. // this.$refs.crudContact.rowCell(this.goodsListSave[item], this.goodsListSave.length - 1)
  2434. })
  2435. }
  2436. this.saveLoading = false;
  2437. this.dialogVisible = false
  2438. },
  2439. tableDataHandle() {
  2440. this.saveLoading = true;
  2441. for (let item=0;item<this.tableData.length;item++) {
  2442. getMarketPrice({code: this.tableData[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(res => {
  2443. if (res.data.data.length > 0) {
  2444. this.$set(this.tableData[item], 'price', res.data.data[0].salePrice)
  2445. } else {
  2446. this.$set(this.tableData[item], 'price', '0')
  2447. }
  2448. this.priceChange(this.tableData[item])
  2449. })
  2450. getPurchasePrice({code: this.tableData[item].code}).then(res => {
  2451. if (res.data.data.length > 0) {
  2452. this.$set(this.tableData[item], 'purchaseAmount', res.data.data[0].purchasePrice)
  2453. } else {
  2454. this.$set(this.tableData[item], 'purchaseAmount', '0')
  2455. }
  2456. })
  2457. selectGoodsNum({
  2458. goodsId: this.tableData[item].id,
  2459. itemType: this.tableData[item].typeno,
  2460. tradeType: 'GN'
  2461. }).then(res => {
  2462. this.tableData[item].priceCategory = this.tableData[item].goodsTypeName;
  2463. this.tableData[item].storageQuantity = res.data.data;
  2464. delete this.tableData[item].goodsTypeName;
  2465. this.tableData[item].itemId = this.tableData[item].id;
  2466. this.$set(this.tableData[item], 'corpName', this.tableData[item].corpName);
  2467. this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno);
  2468. // this.$set(this.tableData[item], 'orderQuantity', 1);
  2469. this.$set(this.tableData[item], 'actualQuantity', 0);
  2470. this.$set(this.tableData[item], 'shopQuality', 0);
  2471. this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight);
  2472. this.$set(this.tableData[item], 'inputMold', 0);
  2473. // this.$set(this.tableData[item], 'priceType', this.tableData[item].policyName);
  2474. this.tableData[item].amount = 0;
  2475. if (this.goodsActives == "goods") {
  2476. this.$set(this.tableData[item], 'goodType', 0)
  2477. } else {
  2478. this.$set(this.tableData[item], 'goodType', 1)
  2479. this.$set(this.tableData[item], 'integralMultiples', this.tableData[item].integral)
  2480. }
  2481. this.$set(this.tableData[item], 'integral', '0')
  2482. this.tableData[item].sort = this.maxGoodsNum + 1
  2483. if (this.form.packageRemarks) {
  2484. this.tableData[item].packageRemarks = this.form.packageRemarks
  2485. }
  2486. delete this.tableData[item].id
  2487. delete this.tableData[item].pid
  2488. delete this.tableData[item].isDeleted
  2489. delete this.tableData[item].status
  2490. delete this.tableData[item].tenantId
  2491. delete this.tableData[item].updateTime
  2492. delete this.tableData[item].updateUser
  2493. delete this.tableData[item].updateUserName
  2494. this.maxGoodsNum++
  2495. this.quantityChange(this.tableData[item])
  2496. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  2497. this.$nextTick(() => {
  2498. this.quantityChange(this.tableData[item])
  2499. })
  2500. // this.$refs.crudContact.rowCell(this.tableData[item], this.tableData.length - 1)
  2501. })
  2502. }
  2503. this.saveLoading = false;
  2504. this.dialogVisible = false
  2505. },
  2506. closeGoods() {
  2507. this.treeDataGoods = [];
  2508. this.treeDeptId = "";
  2509. this.activeName = "searchList";
  2510. },
  2511. closeFees() {
  2512. this.treeDeptIdCost = "";
  2513. this.treeData = [];
  2514. },
  2515. closePolicy() {
  2516. this.treePolicyId = '';
  2517. this.dataPolicy = [];
  2518. this.contactsDataBuyFree = [];
  2519. this.policyData = []
  2520. this.policyDataTwo = []
  2521. },
  2522. //选中触发
  2523. selectionChange(list) {
  2524. this.tableData = list
  2525. },
  2526. //费用选中触发
  2527. selectionChangeCost(list) {
  2528. this.tableDataCost = list
  2529. },
  2530. //导入页左商品类型查询
  2531. nodeClick(data) {
  2532. this.treeDeptId = data.id;
  2533. this.page.currentPage = 1;
  2534. this.onLoad(this.page);
  2535. },
  2536. //导入页销售政策查询
  2537. policyNodeClick(data) {
  2538. this.treePolicyId = data.id
  2539. // detailList(data.id).then(res => {
  2540. // //特价促销
  2541. // this.dataPolicy = res.data.data.specialItemList
  2542. // //买赠促销
  2543. // this.contactsDataBuyFree = res.data.data.presentItemList
  2544. // })
  2545. this.policyOnLoad()
  2546. },
  2547. //导入页左费用类型查询
  2548. nodeClickCost(data) {
  2549. this.treeDeptIdCost = data.id;
  2550. this.pageCost.currentPage = 1;
  2551. this.onLoadCost(this.pageCost);
  2552. },
  2553. //刷新触发
  2554. refreshChange() {
  2555. this.treeDeptId = ''
  2556. this.page.currentPage = 1;
  2557. this.onLoad(this.page);
  2558. },
  2559. //销售政策特价促销选中触发
  2560. selectionChangePolicy(list) {
  2561. this.policyData = list
  2562. // this.policyData.forEach(item => {
  2563. // this.$set(item, 'price', item.specialOffer)
  2564. // })
  2565. if (this.policyData.length > 0) {
  2566. this.customerBuyFree.selection = false
  2567. } else {
  2568. this.customerBuyFree.selection = true
  2569. }
  2570. },
  2571. //销售政策买赠促销选中触发
  2572. selectionChangePolicyTwo(list) {
  2573. this.policyDataTwo = list
  2574. // this.policyDataTwo.forEach(item => {
  2575. // this.$set(item, 'price', item.salePrice)
  2576. // })
  2577. if (this.policyDataTwo.length > 0) {
  2578. this.optionPolicy.selection = false
  2579. } else {
  2580. this.optionPolicy.selection = true
  2581. }
  2582. },
  2583. //导入商品政策
  2584. importPolicy() {
  2585. let list = this.deepClone(this.policyData.concat(this.policyDataTwo))
  2586. let listLength = this.policyDataTwo.length
  2587. // 买赠额外加一条
  2588. let buyFree = []
  2589. if (this.policyDataTwo.length > 0) {
  2590. buyFree = this.deepClone(this.policyDataTwo)
  2591. }
  2592. for (let item in list) {
  2593. if (this.policyData.length > 0) {
  2594. if (!list[item].specialOffer) {
  2595. getMarketPrice({code: list[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(response => {
  2596. if (response.data.data.length > 0) {
  2597. this.$set(list[item], 'price', response.data.data[0].salePrice)
  2598. } else {
  2599. this.$set(list[item], 'price', '0')
  2600. }
  2601. this.priceChange(list[item])
  2602. })
  2603. } else {
  2604. this.$set(list[item], 'price', list[item].specialOffer)
  2605. this.priceChange(list[item])
  2606. }
  2607. this.$set(list[item], 'inputMold', 1)
  2608. this.$set(list[item], 'goodType', 0)
  2609. } else {
  2610. if (!list[item].salePrice) {
  2611. getMarketPrice({code: list[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(response => {
  2612. if (response.data.data.length > 0) {
  2613. this.$set(list[item], 'price', response.data.data[0].salePrice)
  2614. } else {
  2615. this.$set(list[item], 'price', '0')
  2616. }
  2617. this.priceChange(list[item])
  2618. })
  2619. } else {
  2620. this.$set(list[item], 'price', list[item].salePrice)
  2621. this.priceChange(list[item])
  2622. }
  2623. this.$set(list[item], 'inputMold', 2)
  2624. this.$set(buyFree[item], 'inputMold', 2)
  2625. this.$set(buyFree[item], 'price', '0')
  2626. this.$set(buyFree[item], 'orderQuantity', list[item].salesVolume)
  2627. this.$set(buyFree[item], 'itemType', list[item].typeno)
  2628. }
  2629. selectGoodsNum({
  2630. goodsId: list[item].itemId,
  2631. itemType: list[item].typeno,
  2632. tradeType: 'GN'
  2633. }).then(res => {
  2634. this.$set(list[item], 'storageQuantity', res.data.data)
  2635. if (listLength != 0) {
  2636. this.$set(buyFree[item], 'storageQuantity', res.data.data)
  2637. }
  2638. this.$set(list[item], 'itemType', list[item].typeno)
  2639. this.$set(list[item], 'actualQuantity', 0)
  2640. this.$set(list[item], 'orderQuantity', list[item].orderQuantity? list[item].orderQuantity: 0)
  2641. // this.$set(list[item], 'amount', 0)
  2642. this.$set(list[item], 'priceCategory', list[item].productCategory)
  2643. this.$set(list[item], 'priceType', this.policyForm.cname)
  2644. this.$set(list[item], 'cname', list[item].productCategory)
  2645. this.$set(list[item], 'sort', this.maxGoodsNum + 1)
  2646. this.$set(list[item], 'purchaseAmount', list[item].purchasePrice)
  2647. // 积分
  2648. this.$set(list[item], 'integralMultiples', 0)
  2649. this.$set(list[item], 'integral', 0)
  2650. this.$set(list[item], 'shopQuality', 0)
  2651. if (listLength != 0) {
  2652. this.$set(buyFree[item], 'actualQuantity', 0)
  2653. this.$set(buyFree[item], 'orderQuantity', 0)
  2654. // this.$set(buyFree[item], 'amount', 0)
  2655. this.$set(buyFree[item], 'priceCategory', list[item].productCategory)
  2656. this.$set(buyFree[item], 'priceType', this.policyForm.cname)
  2657. this.$set(buyFree[item], 'cname', list[item].productCategory)
  2658. this.$set(buyFree[item], 'sort', this.maxGoodsNum + 2)
  2659. this.$set(buyFree[item], 'purchaseAmount', list[item].purchasePrice)
  2660. // 积分
  2661. this.$set(buyFree[item], 'integralMultiples', 0)
  2662. this.$set(buyFree[item], 'integral', 0)
  2663. this.$set(buyFree[item], 'shopQuality', 0)
  2664. this.maxGoodsNum++
  2665. delete buyFree[item].id
  2666. delete buyFree[item].pid
  2667. delete buyFree[item].isDeleted
  2668. delete buyFree[item].status
  2669. delete buyFree[item].tenantId
  2670. delete buyFree[item].updateTime
  2671. delete buyFree[item].updateUser
  2672. delete buyFree[item].updateUserName
  2673. }
  2674. delete list[item].id
  2675. delete list[item].pid
  2676. delete list[item].isDeleted
  2677. delete list[item].status
  2678. delete list[item].tenantId
  2679. delete list[item].updateTime
  2680. delete list[item].updateUser
  2681. delete list[item].updateUserName
  2682. this.maxGoodsNum++
  2683. this.$refs.crudContact.rowCellAdd(list[item]);
  2684. this.$nextTick(() => {
  2685. this.quantityChange(list[item])
  2686. })
  2687. if (listLength != 0) {
  2688. this.$refs.crudContact.rowCellAdd(buyFree[item]);
  2689. this.quantityChange(buyFree[item])
  2690. }
  2691. })
  2692. }
  2693. this.policyDialog = false
  2694. },
  2695. //费用刷新触发
  2696. refreshChangeCost() {
  2697. this.treeDeptIdCost = '';
  2698. this.pageCost.currentPage = 1;
  2699. this.onLoadCost(this.pageCost);
  2700. },
  2701. //新增商品信息保存触发
  2702. rowSave(row, done, loading) {
  2703. // this.contactsData.push(row)
  2704. done()
  2705. },
  2706. //修改商品信息触发
  2707. rowUpdate(row, index, done, loading) {
  2708. done(row);
  2709. },
  2710. //删除商品信息触发
  2711. rowDel(row, index, donerowDel) {
  2712. this.$confirm("确定将选择数据删除?", {
  2713. confirmButtonText: "确定",
  2714. cancelButtonText: "取消",
  2715. type: "warning"
  2716. }).then(() => {
  2717. //商品判断是否需要调用删除接口
  2718. if (row.id) {
  2719. corpsattn(row.id).then(res => {
  2720. this.$message({
  2721. type: "success",
  2722. message: "操作成功!"
  2723. });
  2724. this.goodsShowData.splice(row.$index, 1);
  2725. if (this.goodsActives == 'goods') {
  2726. this.form.presenterIntegral = 0;
  2727. this.form.orderAmount = 0;
  2728. this.goodsShowData.forEach(item => {
  2729. this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
  2730. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  2731. })
  2732. this.computedCost()
  2733. } else {
  2734. this.form.convertIntegral = 0;
  2735. this.goodsShowData.forEach(item => {
  2736. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  2737. })
  2738. }
  2739. })
  2740. } else {
  2741. this.$message({
  2742. type: "success",
  2743. message: "操作成功!"
  2744. });
  2745. this.goodsShowData.splice(row.$index, 1);
  2746. if (this.goodsActives == 'goods') {
  2747. this.form.presenterIntegral = 0;
  2748. this.form.orderAmount = 0;
  2749. this.goodsShowData.forEach(item => {
  2750. this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
  2751. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  2752. })
  2753. this.computedCost()
  2754. } else {
  2755. this.form.convertIntegral = 0;
  2756. this.goodsShowData.forEach(item => {
  2757. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  2758. })
  2759. }
  2760. }
  2761. })
  2762. },
  2763. //新增费用明细保存触发
  2764. rowSaveProject(row, done, loading) {
  2765. // this.advantageProjectData.push(row)
  2766. done()
  2767. },
  2768. //修改费用明细触发
  2769. rowUpdateProject(row, index, done, loading) {
  2770. done(row);
  2771. },
  2772. policyOnLoad(params = {}) {
  2773. this.loadingPolicy = true;
  2774. this.policyForm = {};
  2775. detailList(this.treePolicyId).then(res => {
  2776. this.policyForm = res.data.data;
  2777. //特价促销
  2778. if(res.data.data.specialItemList) {
  2779. this.dataPolicy = res.data.data.specialItemList
  2780. } else {
  2781. this.dataPolicy = []
  2782. }
  2783. //买赠促销
  2784. if (res.data.data.presentItemList) {
  2785. this.contactsDataBuyFree = res.data.data.presentItemList
  2786. } else {
  2787. this.contactsDataBuyFree = []
  2788. }
  2789. }).finally(() => {
  2790. this.loadingPolicy = false;
  2791. })
  2792. },
  2793. //
  2794. goodsSearch(params, done) {
  2795. this.treeDeptId = ''
  2796. params = {
  2797. ...params,
  2798. artsVision: this.form.belongToCorpId
  2799. }
  2800. this.onLoad(this.page, params);
  2801. done()
  2802. },
  2803. //商品列表查询
  2804. onLoad(page, params = {artsVision: this.form.belongToCorpId}) {
  2805. this.loading = true;
  2806. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId, null).then(res => {
  2807. const data = res.data.data;
  2808. this.page.total = data.total;
  2809. this.pageList.total = data.total
  2810. this.data = data.records;
  2811. this.goodsListShow = data.records;
  2812. this.loading = false;
  2813. });
  2814. },
  2815. // 费用查询按钮
  2816. feesSearch(params, done) {
  2817. this.treeDeptIdCost = '';
  2818. this.onLoadCost(this.pageCost, params)
  2819. done()
  2820. },
  2821. //费用查询
  2822. onLoadCost(page, params = {}) {
  2823. this.loadingCost = true;
  2824. let queryParams = Object.assign({}, params, {
  2825. pageSize: page.pageSize,
  2826. pageNum: page.currentPage,
  2827. parentId: 0,
  2828. feesTypeId: this.treeDeptIdCost
  2829. })
  2830. customerList(queryParams).then(res => {
  2831. const data = res.data.data;
  2832. this.pageCost.total = data.total;
  2833. this.dataCost = data.records;
  2834. this.loadingCost = false;
  2835. });
  2836. },
  2837. //删除费用明细触发
  2838. rowDelProject(row, index, donerowDel) {
  2839. this.$confirm("确定将选择数据删除?", {
  2840. confirmButtonText: "确定",
  2841. cancelButtonText: "取消",
  2842. type: "warning"
  2843. }).then(() => {
  2844. //费用判断是否需要调用删除接口
  2845. if (row.id) {
  2846. corpsitem(row.id).then(res => {
  2847. this.$message({
  2848. type: "success",
  2849. message: "操作成功!"
  2850. });
  2851. this.advantageProjectData.splice(row.$index, 1);
  2852. })
  2853. } else {
  2854. this.$message({
  2855. type: "success",
  2856. message: "操作成功!"
  2857. });
  2858. this.advantageProjectData.splice(row.$index, 1);
  2859. }
  2860. })
  2861. },
  2862. //修改提交触发
  2863. editCustomer(isBack = false, type) {
  2864. this.$refs["form"].validate((valid) => {
  2865. if (valid) {
  2866. const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
  2867. for (let i = 0;i < length;i++) {
  2868. const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
  2869. if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
  2870. return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
  2871. }
  2872. }
  2873. //商品信息
  2874. if (this.goodsActives == 'gift') {
  2875. this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
  2876. } else {
  2877. this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
  2878. }
  2879. // 判断是否能保存
  2880. let goodsData = this.form.orderItemsList.filter(item => item.goodType == 0)
  2881. // 计算特价占比
  2882. let allNum = 0; // 总数量
  2883. let specialNum = 0; // 特价数量
  2884. let sizeNum = 0; // 大尺寸数量
  2885. goodsData.forEach(item => allNum += Number(item.orderQuantity));
  2886. goodsData.filter(item => item.inputMold === 1).forEach(item => specialNum += Number(item.orderQuantity));
  2887. goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
  2888. this.$set(this.form, 'specialOfferOf', allNum == 0? '0.00': (specialNum / allNum * 100).toFixed(2));
  2889. this.$set(this.form, 'largeScale', allNum == 0? '0.00': (sizeNum / allNum * 100).toFixed(2));
  2890. for (let item in this.goodsData) {
  2891. if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
  2892. return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
  2893. }
  2894. }
  2895. this.form.orderFeesList = this.$refs.feeInfo.submitData()
  2896. let packFee;
  2897. if (this.form.packageRemarks && this.form.packageRemarks !== '无包装' && this.form.packageRemarks !== '不包装') {
  2898. let arr = this.form.orderFeesList.filter(item => item.feesType == 1)
  2899. packFee = arr.findIndex(item => item.feeName == '包装费')
  2900. }
  2901. if (packFee == -1) {
  2902. return this.$message.error('费用明细未有包装费')
  2903. }
  2904. // 产生返利、本次使用返利为空 默认为0
  2905. this.form.createProfit = this.form.createProfit? this.form.createProfit: 0
  2906. this.form.thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
  2907. // 计算毛利额
  2908. this.$set(this.form, 'orderAmount', 0)
  2909. // 成本价
  2910. let purchaseAmount = 0
  2911. if (this.form.orderAmount && this.form.settlmentAmount) {
  2912. this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
  2913. }
  2914. // 销售金额
  2915. this.form.orderAmount = 0;
  2916. // 计算销售金额
  2917. this.form.orderItemsList.forEach(item => {
  2918. if (item.goodType == 0) {
  2919. if (item.purchaseAmount) {
  2920. purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
  2921. }
  2922. this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
  2923. }
  2924. })
  2925. this.computedCost()
  2926. // 判断订货数量不能小于等于0
  2927. for (let item in this.form.orderItemsList) {
  2928. if (Number(this.form.orderItemsList[item].orderQuantity) <= 0) {
  2929. return this.$message.error('订货数量不能小于等于0')
  2930. }
  2931. }
  2932. // this.form.orderFeesList = this.advantageProjectData
  2933. this.form.orderFilesList = this.bankOfDepositData
  2934. if (typeof this.form.corpsTypeId == 'object') {
  2935. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  2936. }
  2937. this.form.billType = 'XS'
  2938. // 如果有id解锁,没有跳过
  2939. // this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
  2940. this.saveLoading = true
  2941. typeSave(this.form).then(res => {
  2942. // this.$set(this.detailData, 'seeDisabled', true);
  2943. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  2944. if (isBack) {
  2945. //成功关闭此页面回到列表页
  2946. this.$emit("goBack");
  2947. this.leaveDetailsKey(this.$route.name)
  2948. } else {
  2949. this.saveActives = ''
  2950. this.queryData(res.data.data.id)
  2951. }
  2952. if (type == '发货') {
  2953. let lsit = []
  2954. this.selection = this.selection.concat(this.giftData)
  2955. this.selection.forEach(item => {
  2956. lsit.push(item.id)
  2957. })
  2958. let data = {
  2959. id: this.form.id,
  2960. orderItemIds: lsit
  2961. }
  2962. generateShipment(data).then(res => {
  2963. this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
  2964. this.$router.push({
  2965. path: "/businessManagement/deliveryNotice/index",
  2966. query: {form: JSON.stringify(res.data.data),pageType: "Generate",},
  2967. });
  2968. })
  2969. } else if (type == '采购') {
  2970. if ((Number(this.form.settlmentAmount) < Number(this.form.debitAmount)) && !this.arrearsCheck) return this.$message.error('收款未收齐,禁止生成采购单');
  2971. this.$confirm("是否生成采购单?", {
  2972. confirmButtonText: "确定",
  2973. cancelButtonText: "取消",
  2974. type: "warning"
  2975. }).then(() => {
  2976. saveSell(this.form.id).then(res => {
  2977. if (res.data.code == 200) {
  2978. this.$message.success("生成成功");
  2979. this.messageVisble = true
  2980. this.$nextTick(() => {
  2981. this.$refs.messagePost.init()
  2982. })
  2983. }
  2984. });
  2985. });
  2986. } else if (type == '收费') {
  2987. this.beforeBillData(true,type)
  2988. this.applySettlementDialog = true;
  2989. }
  2990. }).finally(() => {
  2991. this.saveLoading = false
  2992. })
  2993. } else {
  2994. return this.$message.error('存在漏填必填项,请补全');
  2995. }
  2996. });
  2997. },
  2998. // 计算应收未收款
  2999. computedCost() {
  3000. // if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
  3001. // this.form.caseOverPayment = 0;
  3002. // return this.$message.error('本次使用的溢付款不能超过总溢付款')
  3003. // }
  3004. if (Number(this.form.thisUsedProfit) > Number(this.form.profit)) {
  3005. this.form.thisUsedProfit = 0;
  3006. return this.$message.error('本次使用的返利不能超过返利余额')
  3007. }
  3008. // 销售金额
  3009. let orderAmount = this.form.orderAmount? this.form.orderAmount: 0
  3010. // 已收款
  3011. let settlmentAmount = this.form.settlmentAmount? this.form.settlmentAmount: 0
  3012. // 本次溢付款
  3013. // let caseOverPayment = this.form.caseOverPayment? this.form.caseOverPayment: 0
  3014. // 本次试用返利
  3015. let thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
  3016. let feeAmountD = 0; //费用明细应收
  3017. let feeAmountC = 0; //费用明细应付
  3018. this.$refs.feeInfo.submitData().filter(item => item.feesType == 1).forEach(item => {
  3019. feeAmountD += Number(item.amount)
  3020. })
  3021. this.$refs.feeInfo.submitData().filter(item => item.feesType == 2).forEach(item => {
  3022. feeAmountC += Number(item.amount)
  3023. })
  3024. this.$set(this.form, 'debitAmount', ((Number(orderAmount) - Number(thisUsedProfit) + Number(feeAmountD) - Number(feeAmountC)).toFixed(2)))
  3025. this.$set(this.form, "balanceAmount", (Number(this.form.debitAmount) - Number(settlmentAmount)).toFixed(2));
  3026. },
  3027. quantityChange(row) {
  3028. if (!row.orderQuantity) {
  3029. row.orderQuantity = 0;
  3030. } else {
  3031. // row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
  3032. row.amount = (row.price * row.orderQuantity).toFixed(2)
  3033. }
  3034. if (!row.integralMultiples) {
  3035. row.integralMultiples = 0
  3036. }
  3037. row.integral = (Number(row.orderQuantity) * Number(row.integralMultiples)).toFixed(2)
  3038. if (this.goodsActives == 'goods') {
  3039. // 计算销售金额
  3040. this.form.orderAmount = 0
  3041. // 计算赠送积分
  3042. this.form.presenterIntegral = 0;
  3043. this.goodsShowData.forEach(item => {
  3044. this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
  3045. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  3046. })
  3047. this.computedCost()
  3048. } else {
  3049. this.form.convertIntegral = 0;
  3050. this.goodsShowData.forEach(item => {
  3051. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  3052. })
  3053. }
  3054. },
  3055. priceChange(row) {
  3056. if (!row.price) {
  3057. row.price = 0;
  3058. row.amount = '0.00'
  3059. } else {
  3060. row.amount = (row.price * row.orderQuantity).toFixed(2)
  3061. }
  3062. if (this.goodsActives == 'goods') {
  3063. // 计算销售金额
  3064. this.form.orderAmount = 0
  3065. this.goodsShowData.forEach(item => {
  3066. this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
  3067. })
  3068. this.computedCost()
  3069. }
  3070. },
  3071. //返回列表
  3072. backToList() {
  3073. let getGoodsList = []
  3074. let getGiftList = []
  3075. let getFeeList = this.$refs.feeInfo.submitData()
  3076. if (this.goodsActives == 'gift') {
  3077. getGiftList = this.goodsShowData
  3078. getGoodsList = this.contactsData
  3079. } else {
  3080. getGoodsList = this.goodsShowData
  3081. getGiftList = this.giftData
  3082. }
  3083. if (contrastObj(this.form, this.oldForm) ||
  3084. contrastList(getGoodsList, this.oldGoodsList) ||
  3085. contrastList(getGiftList, this.oldGiftList) ||
  3086. // contrastList(getFeeList, this.oldFeesList) ||
  3087. contrastList(this.bankOfDepositData, this.oldUploadList)
  3088. ) {
  3089. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  3090. confirmButtonText: "确定",
  3091. cancelButtonText: "取消",
  3092. type: "warning"
  3093. }).then(() => {
  3094. this.editCustomer(true)
  3095. }).catch(() => {
  3096. !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
  3097. this.$emit("goBack");
  3098. this.leaveDetailsKey(this.$route.name)
  3099. })
  3100. } else {
  3101. !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
  3102. this.$emit("goBack");
  3103. this.leaveDetailsKey(this.$route.name)
  3104. }
  3105. },
  3106. // 保存列设置
  3107. async saveColumn(name) {
  3108. if (name == 'goods') {
  3109. const inSave = await this.saveColumnData(
  3110. this.getColumnName(15),
  3111. this.customerContact
  3112. );
  3113. if (inSave) {
  3114. this.$message.success("保存成功");
  3115. //关闭窗口
  3116. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  3117. this.$nextTick(() => {
  3118. this.$refs.crudContact.doLayout()
  3119. })
  3120. }
  3121. } else if (name === 'fees') {
  3122. const inSave = await this.saveColumnData(
  3123. this.getColumnName(16),
  3124. this.advantageProject
  3125. );
  3126. if (inSave) {
  3127. this.$message.success("保存成功");
  3128. //关闭窗口
  3129. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  3130. }
  3131. }
  3132. },
  3133. async resetColumn() {
  3134. this.customerContact = customerContact
  3135. const inSave = await this.delColumnData(
  3136. this.getColumnName(15),
  3137. customerContact
  3138. );
  3139. if (inSave) {
  3140. this.$nextTick(() => {
  3141. this.$refs.crudContact.doLayout()
  3142. })
  3143. this.$message.success("重置成功");
  3144. //关闭窗口
  3145. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  3146. }
  3147. },
  3148. returnBack(row) {
  3149. this.$refs.KHSelect[0].updateData(row.id)
  3150. getKHList({corpType: 'KH', belongtocompany: row.id}).then(res => {
  3151. this.form.corpId = res.data.data.records.length > 0? res.data.data.records[0].id: null
  3152. if (this.form.corpId) {
  3153. this.getCorpRow({adminProfiles: res.data.data.records[0].adminProfiles,
  3154. id: res.data.data.records[0].id,
  3155. packageRemarks: res.data.data.records[0].packageRemarks,
  3156. paymentType: res.data.data.records[0].paymentType})
  3157. }
  3158. })
  3159. getKHList({corpType: 'GYS', belongtocompany: row.id}).then(res => {
  3160. this.form.productionPlant = res.data.data.records.length > 0? res.data.data.records[0].id: null;
  3161. if (this.form.productionPlant) {
  3162. this.getPlantRow({id: this.form.productionPlant})
  3163. }
  3164. })
  3165. this.form.belongCompany = row.cname
  3166. getlistBankBy(row.id).then(res =>{
  3167. this.$set(this.form, 'banks', null)
  3168. this.$set(this.form, 'banksAccountName', null)
  3169. this.$set(this.form, 'accountBank', null)
  3170. this.bankList = res.data
  3171. if (this.bankList.length > 0) {
  3172. this.form.banks = this.bankList[0].accountNo
  3173. this.form.banksAccountName = this.bankList[0].accountName
  3174. this.form.accountBank = this.bankList[0].accountBank
  3175. }
  3176. })
  3177. },
  3178. // 银行账号变化
  3179. banksChange(val) {
  3180. let isTrue = false
  3181. this.bankList.forEach(item => {
  3182. if (val == item.accountNo) {
  3183. this.$set(this.form, 'banksAccountName', item.accountName)
  3184. this.$set(this.form, 'accountBank', item.accountBank)
  3185. isTrue = true
  3186. }
  3187. })
  3188. if (!isTrue) {
  3189. this.$set(this.form, 'banksAccountName', null)
  3190. this.$set(this.form, 'accountBank', null)
  3191. }
  3192. },
  3193. // 联系人变化
  3194. corpAttnChange(val) {
  3195. let isTrue = false
  3196. this.khInfoList.forEach(item => {
  3197. if (val == item.id) {
  3198. this.$set(this.form, 'corpTel', item.tel)
  3199. isTrue = true
  3200. }
  3201. })
  3202. if (!isTrue) {
  3203. this.$set(this.form, 'corpTel', null)
  3204. }
  3205. },
  3206. // 合计计算
  3207. summaryMethod({ columns, data }) {
  3208. const sums = [];
  3209. if (columns.length > 0) {
  3210. columns.forEach((item, index) => {
  3211. sums[0] = '合计'
  3212. if (
  3213. item.property == "amount" ||
  3214. item.property == "orderQuantity" ||
  3215. item.property == "actualQuantity" ||
  3216. item.property == "integral"
  3217. ) {
  3218. let amountSum = 0;
  3219. let orderQuantitySum = 0;
  3220. let actualQuantitySum = 0;
  3221. let integralSum = 0;
  3222. if (this.selection.length > 0) {
  3223. this.selection.forEach(e => {
  3224. amountSum = _.add(amountSum, Number(e.amount));
  3225. orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
  3226. actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
  3227. integralSum = _.add(integralSum, Number(e.integral));
  3228. })
  3229. }
  3230. // 订货数量合计
  3231. if (item.property == "orderQuantity") {
  3232. sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(2) : "0.00";
  3233. }
  3234. // 发货数量合计
  3235. if (item.property == "actualQuantity") {
  3236. sums[index] = actualQuantitySum ? actualQuantitySum.toFixed(2) : "0.00";
  3237. }
  3238. // 金额合计
  3239. if (item.property == "amount") {
  3240. sums[index] = amountSum ? amountSum.toFixed(2) : "0.00";
  3241. }
  3242. // 积分合计
  3243. if (item.property == "integral") {
  3244. sums[index] = integralSum ? integralSum.toFixed(2) : "0.00";
  3245. }
  3246. }
  3247. })
  3248. }
  3249. return sums;
  3250. },
  3251. // 标签页切换
  3252. tabHandle(data) {
  3253. if (data.name == 'searchList') {
  3254. this.goodsListShow = this.data;
  3255. this.page.total = this.pageList.total
  3256. } else if (data.name == 'importStaging') {
  3257. this.goodsListShow = this.goodsListSave;
  3258. this.page.total = 0
  3259. }
  3260. },
  3261. removeStagList(row, index) {
  3262. this.goodsListSave.splice(row.$index, 1)
  3263. },
  3264. importStagList(row, index) {
  3265. this.goodsListSave.push(row);
  3266. },
  3267. // 商品信息标签页切换
  3268. handleClick(data) {
  3269. if (this.saveActives == data.name) return
  3270. this.saveActives = data.name
  3271. this.goodsDisabled = true
  3272. if (data.name == 'goods') {
  3273. this.giftData = this.goodsShowData.filter(item => item.goodType == 1)
  3274. // 显示
  3275. this.customerContact.column.forEach(item => {
  3276. if (item.prop == 'integralMultiples') item.label = '积分倍数'
  3277. if (item.prop == 'integral') item.label = '赠送积分'
  3278. if (item.prop == 'orderQuantity') item.label = '订货数量'
  3279. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  3280. || item.prop == 'actualQuantity' || item.prop == 'storageQuantity'
  3281. || item.prop == 'purchaseAmount' || item.prop == 'price' || item.prop == 'amount'
  3282. || item.prop == 'shopQuality'
  3283. ) {
  3284. item.hide = false;
  3285. item.showColumn = true;
  3286. if (!this.permission.show_purPrice) {
  3287. if (item.prop == 'purchaseAmount') {
  3288. item.hide = true;
  3289. item.showColumn = false;
  3290. }
  3291. }
  3292. }
  3293. })
  3294. // contactsData它是商品的数组 giftData它是赠品的数组 goodsShowData它是展示页面的数组一共三个
  3295. this.goodsShowData = this.deepClone(this.contactsData);
  3296. setTimeout(() => {
  3297. this.goodsDisabled = false
  3298. },500)
  3299. } else {
  3300. // 隐藏字段
  3301. this.contactsData = this.goodsShowData.filter(item => item.goodType == 0)
  3302. this.customerContact.column.forEach(item => {
  3303. if (item.prop == 'deliveryAmount') item.label = '积分'
  3304. if (item.prop == 'actualQuantity') item.label = '数量'
  3305. if (item.prop == 'integralMultiples') item.label = '积分'
  3306. if (item.prop == 'integral') item.label = '兑换积分'
  3307. if (item.prop == 'orderQuantity') item.label = '数量'
  3308. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  3309. || item.prop == 'actualQuantity' || item.prop == 'storageQuantity'
  3310. || item.prop == 'purchaseAmount' || item.prop == 'price' || item.prop == 'amount'
  3311. || item.prop == 'shopQuality'
  3312. ) {
  3313. item.hide = true;
  3314. item.showColumn = false;
  3315. }
  3316. })
  3317. // this.giftData=this.goodsShowData.filter(e=>e.typegood==1)
  3318. this.goodsShowData = this.deepClone(this.giftData);
  3319. setTimeout(() => {
  3320. this.goodsDisabled = false
  3321. },500)
  3322. }
  3323. },
  3324. // 切换之前
  3325. beforeLeave(activeName, oldActiveName) {
  3326. },
  3327. // 查看账单
  3328. // 查看申请记录
  3329. openApplicationDialog(){
  3330. this.applicationDialog = true
  3331. },
  3332. //关闭记录
  3333. choceApplication(){
  3334. this.applicationDialog = false
  3335. },
  3336. //费用明细回调
  3337. beforeFinance(feesData,callback){
  3338. this.advantageProjectData = feesData;
  3339. let params = {}
  3340. //暂时默认通过 之后优化
  3341. params.valid = true
  3342. params.parentId = this.form.id
  3343. params.srcOrderno = this.form.orderNo
  3344. callback(params)
  3345. },
  3346. // 请核
  3347. pleaseCheck() {
  3348. const giftList = this.goodsActives == 'gift'? this.goodsShowData: this.giftData
  3349. if (this.verification()) {
  3350. this.$confirm(giftList.length == 0?"此单没有赠品,确定提交此次审批吗?": "您确定提交此次申请吗?", {
  3351. confirmButtonText: "确定",
  3352. cancelButtonText: "取消",
  3353. type: "warning"
  3354. }).then(() => {
  3355. const data = {
  3356. id : this.form.id,
  3357. checkType: 'xsqh',
  3358. url: '/businessManagement/salesOrder/index',
  3359. pageStatus:"this.$store.getters.domSaleStatus",
  3360. pageLabel:"销售订单(N)",
  3361. checkFlag: 2,
  3362. }
  3363. this.pageLoading = true
  3364. pleaseCheck(data).then(res => {
  3365. this.$message.success('请核成功')
  3366. this.saveActives = ''
  3367. this.queryData(this.form.id)
  3368. }).finally(() => {
  3369. this.pageLoading = false
  3370. })
  3371. })
  3372. }
  3373. },
  3374. repealCancel(){
  3375. this.$confirm("您确定撤回此次申请吗?", {
  3376. confirmButtonText: "确定",
  3377. cancelButtonText: "取消",
  3378. type: "warning"
  3379. }).then(() => {
  3380. const data = {
  3381. id : this.form.id,
  3382. checkType: 'xsqh',
  3383. pageLabel:"销售订单(N)",
  3384. checkFlag: 2,
  3385. }
  3386. this.pageLoading = true
  3387. repealCancel(data).then(res => {
  3388. this.$message.success('撤回成功')
  3389. this.saveActives = ''
  3390. this.queryData(this.form.id)
  3391. }).finally(() => {
  3392. this.pageLoading = false
  3393. })
  3394. })
  3395. },
  3396. // 欠款发货审批
  3397. arrearsPleaseCheck() {
  3398. if (this.verification()) {
  3399. const data = {
  3400. id : this.form.id,
  3401. checkType: 'xstpqh',
  3402. url: '/businessManagement/salesOrder/index',
  3403. pageStatus:"this.$store.getters.domSaleStatus",
  3404. pageLabel:"销售订单(N)",
  3405. checkFlag: 3
  3406. }
  3407. this.pageLoading = true
  3408. pleaseCheck(data).then(res => {
  3409. this.$message.success('请核成功')
  3410. this.saveActives = ''
  3411. this.queryData(this.form.id)
  3412. }).finally(() => {
  3413. this.pageLoading = false
  3414. })
  3415. }
  3416. },
  3417. // 验证新旧值对比
  3418. verification() {
  3419. let getGoodsList = []
  3420. let getGiftList = []
  3421. let getFeeList = this.$refs.feeInfo.submitData()
  3422. // this.goodsShowData.findIndex(item => item.goodType == 0) == -1
  3423. if (this.goodsActives == 'gift') {
  3424. getGiftList = this.goodsShowData
  3425. getGoodsList = this.contactsData
  3426. } else {
  3427. getGoodsList = this.goodsShowData
  3428. getGiftList = this.giftData
  3429. }
  3430. if (contrastObj(this.form, this.oldForm) ||
  3431. contrastList(getGoodsList, this.oldGoodsList) ||
  3432. contrastList(getGiftList, this.oldGiftList) ||
  3433. // contrastList(getFeeList, this.oldFeesList) ||
  3434. contrastList(this.bankOfDepositData, this.oldUploadList)
  3435. ) {
  3436. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  3437. confirmButtonText: "确定",
  3438. cancelButtonText: "取消",
  3439. type: "warning"
  3440. }).then(() => {
  3441. this.editCustomer(false)
  3442. }).catch(() => {
  3443. return false; //取消改动数据
  3444. })
  3445. } else {
  3446. return true; //没有动过数据
  3447. }
  3448. },
  3449. //打开审核
  3450. openCheckDialog(){
  3451. this.checkData = this.detailData.check
  3452. this.checkDialog = true;
  3453. },
  3454. //关闭审核
  3455. choceCheckFun(){
  3456. this.checkDialog = false;
  3457. },
  3458. choceScheduleFun(){
  3459. this.checkScheduleDialog = false
  3460. },
  3461. shopQualityChange(val, row) {
  3462. (val == 1) && (row.price = 0)
  3463. this.priceChange(row)
  3464. },
  3465. editHandle() {
  3466. const data = {
  3467. moduleName: 'xs',
  3468. tableName: 'business_order',
  3469. billId: this.form.id,
  3470. no: localStorage.getItem('browserID'),
  3471. billNo: this.form.orderNo
  3472. }
  3473. this.saveLoading = true
  3474. this.checkLock(data).then(res => {
  3475. if (res.data.code == 200) {
  3476. this.onLock(data).then(response => {
  3477. this.saveActives = ''
  3478. this.queryData(this.form.id)
  3479. })
  3480. this.inDetailsKey(this.$route.name, {
  3481. moduleName: 'xs',
  3482. tableName: 'business_order',
  3483. billId: this.form.id,
  3484. })
  3485. this.detailData.seeDisabled = false;
  3486. }
  3487. }).catch(error => {
  3488. }).finally(() => {
  3489. this.saveLoading = false
  3490. })
  3491. },
  3492. cellStyle() {
  3493. return "padding:0;height:40px;";
  3494. },
  3495. changeApproveOpen() {
  3496. this.changeApproveVis = true
  3497. this.$nextTick(() => {
  3498. this.$refs.changeApprove.init()
  3499. })
  3500. },
  3501. closeChangeApprove() {
  3502. this.changeApproveVis = false
  3503. },
  3504. // 商品信息价格计算
  3505. amountChange(row) {
  3506. if (!row.orderQuantity) {
  3507. row.orderQuantity = 0;
  3508. }
  3509. if (!row.price) {
  3510. row.price = 0;
  3511. }
  3512. row.amount = Number(row.price) * Number(row.orderQuantity)
  3513. },
  3514. // 库存刷新
  3515. resetStock() {
  3516. this.goodsShowData.forEach(item => {
  3517. selectGoodsNum({
  3518. goodsId: item.itemId,
  3519. itemType: item.itemType? item.itemType: item.typeno,
  3520. tradeType: 'GN',
  3521. storageId: this.form.storageId
  3522. }).then(res => {
  3523. item.storageQuantity = res.data.data
  3524. })
  3525. })
  3526. this.$message.success('刷新成功')
  3527. },
  3528. },
  3529. computed: {
  3530. ...mapGetters(["userInfo", "permission"])
  3531. },
  3532. watch: {
  3533. customerContact(oldVal, newVal) {
  3534. if (!this.permission.show_purPrice) {
  3535. oldVal.column.forEach(item => {
  3536. if (item.prop == 'purchaseAmount') {
  3537. item.hide = true;
  3538. item.showColumn = false;
  3539. }
  3540. })
  3541. }
  3542. }
  3543. }
  3544. }
  3545. </script>
  3546. <style lang="scss" scoped>
  3547. //.customer-head {
  3548. // position: fixed;
  3549. // top: 105px;
  3550. // width: 100%;
  3551. // margin-left: -10px;
  3552. // height: 62px;
  3553. // background: #ffffff;
  3554. // box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  3555. // z-index: 999;
  3556. // /* display: flex;
  3557. // justify-content: left; */
  3558. //}
  3559. //
  3560. //.customer-back {
  3561. // cursor: pointer;
  3562. // line-height: 62px;
  3563. // font-size: 16px;
  3564. // color: #323233;
  3565. // font-weight: 400;
  3566. //}
  3567. .back-icon {
  3568. line-height: 64px;
  3569. font-size: 20px;
  3570. margin-right: 8px;
  3571. }
  3572. //.add-customer-btn {
  3573. // position: fixed;
  3574. // right: 36px;
  3575. // top: 115px;
  3576. //}
  3577. ::v-deep .el-form-item {
  3578. margin-bottom: 0;
  3579. }
  3580. .el-dialogDeep {
  3581. ::v-deep .el-dialog {
  3582. margin: 1vh auto 0 !important;
  3583. padding-bottom: 10px !important;
  3584. .el-dialog__body, .el-dialog__footer {
  3585. padding-bottom: 0 !important;
  3586. padding-top: 0 !important;
  3587. }
  3588. }
  3589. }
  3590. .print-div {
  3591. color: #000;
  3592. }
  3593. .print_table {
  3594. table {
  3595. border-right: 1px solid #000;
  3596. border-bottom: 1px solid #000;
  3597. font-size: 12px;
  3598. margin-bottom: 5px;
  3599. }
  3600. table td {
  3601. border-left: 1px solid #000;
  3602. border-top: 1px solid #000;
  3603. vertical-align: middle;
  3604. padding: 2px;
  3605. text-align: center;
  3606. }
  3607. }
  3608. .table {
  3609. border-collapse: collapse;
  3610. border-spacing: 0;
  3611. background-color: transparent;
  3612. display: table;
  3613. width: 99%;
  3614. max-width: 100%;
  3615. margin: 0 auto;
  3616. }
  3617. .table td {
  3618. text-align: left;
  3619. vertical-align: middle;
  3620. font-size: 14px;
  3621. color: #000000;
  3622. padding: 10.5px 0 10.5px 30px;
  3623. //border: 1px solid #000;
  3624. }
  3625. ::v-deep .el-form-item {
  3626. margin-bottom: 0;
  3627. }
  3628. ::v-deep .el-form-item__content{
  3629. line-height: 32px;
  3630. }
  3631. .isShow {
  3632. display: none;
  3633. }
  3634. .order_number:hover {
  3635. display: none;
  3636. }
  3637. .number_button {
  3638. display: none;
  3639. }
  3640. .order_number:hover + .number_button {
  3641. display: block;
  3642. }
  3643. </style>