detailsPageEdit.vue 110 KB

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