detailsPage.vue 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button&#45;&#45;small-yh" :disabled="isEditButton" style="margin-left: 6px;"
  11. type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
  12. </el-button>
  13. <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
  14. :disabled="isSaveBtn" @click="editCustomer">保 存
  15. </el-button>
  16. <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
  17. :disabled="isDisabledTask" @click="generateOutbound" v-if="form.taskWhetherAdopt != '审核提交'">
  18. {{ buttonText }}
  19. </el-button>
  20. <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
  21. v-if="form.taskWhetherAdopt == '审核提交'" @click="revokeTask">
  22. 撤销出库任务审批
  23. </el-button>
  24. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
  25. :disabled="form.status != '已发货' || form.returnsNumber == form.goodsTotalNum || editButton"
  26. @click="getReturns">
  27. 销售退货
  28. </el-button>
  29. <el-dropdown style="padding: 0 6px;line-height: 0">
  30. <el-button v-show="!(!form.id || viewDisabled)" type="danger" :loading="buttonLoading"
  31. :disabled="!form.id || viewDisabled" size="small">
  32. 售 后<i class="el-icon-arrow-down el-icon--right"></i>
  33. </el-button>
  34. <el-dropdown-menu slot="dropdown">
  35. <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement">申请退款
  36. </el-dropdown-item>
  37. <!-- <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
  38. </el-dropdown-item>-->
  39. <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
  40. </el-dropdown-item>
  41. </el-dropdown-menu>
  42. </el-dropdown>
  43. <el-dropdown style="line-height: 0">
  44. <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled"
  45. size="small">
  46. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  47. </el-button>
  48. <el-dropdown-menu slot="dropdown">
  49. <el-dropdown-item @click.native="examineBtn('审批')"
  50. :disabled="isExamineBtn && !detailData.check || form.checkStatus == '审核完成'">审批
  51. </el-dropdown-item>
  52. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  53. </el-dropdown-item>
  54. </el-dropdown-menu>
  55. </el-dropdown>
  56. </div>
  57. </div>
  58. <div style="margin-top: 50px">
  59. <trade-card title="基础信息">
  60. <avue-form :option="optionForm" v-model="form" ref="form">
  61. <tempalte slot="customerName" slot-scope="{ row }">
  62. <search-query :datalist="customerData" :selectValue="form.customerName" :clearable="true"
  63. :buttonIf="false" :filterable="true" :remote="true"
  64. :disabled="findObject(optionForm.column, 'customerName').disabled || form.businessSource == '外部销售' || isDisabledTask"
  65. placeholder="请选择客户" :forParameter="{ key: 'id', label: 'cname', value: 'cname' }"
  66. @corpFocus="KHgetListfun" @remoteMethod="KHgetListfun" @corpChange="KHcorpChange"
  67. @corpClear="KHClear">
  68. </search-query>
  69. </tempalte>
  70. <template slot-scope="{row,index}" slot="contacts">
  71. <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
  72. filterable allow-create default-first-option @change="contactsChange($event)"
  73. :disabled=isContacts>
  74. <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
  75. :value="item.contacts" />
  76. </el-select>
  77. </template>
  78. </avue-form>
  79. </trade-card>
  80. <trade-card title="明细信息">
  81. <el-tabs v-model="activeName" type="card">
  82. <el-tab-pane label="销售明细" name="sale_detail">
  83. <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
  84. :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
  85. @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
  86. @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)"
  87. @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
  88. <template slot-scope="{scope,row}" slot="menuLeft">
  89. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
  90. @click="rowAdd(row, 1)">添加商品</el-button>
  91. <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
  92. @click="excelDialogfun('名称')">按名称导入
  93. </el-button>
  94. <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
  95. @click="excelDialogfun('code')">按Code导入
  96. </el-button>
  97. <el-button type="primary" icon="el-icon-printer" size="small"
  98. @click="handlePrint">打印</el-button>
  99. <el-button type="danger" plain size="small" @click="batchDelete"
  100. :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售'">一键删除</el-button>
  101. <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
  102. <el-popover width="600" trigger="click">
  103. <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
  104. <el-button type="primary" plain size="small" slot="reference" @click="viewInventory"
  105. :disabled="selectionMultilist.length != 1">查看库存</el-button>
  106. </el-popover>
  107. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
  108. @click="rowAdd(row, 2)">无库存商品</el-button>
  109. <el-popover width="600" trigger="click">
  110. <avue-crud :data="inventoryData2" :option="inventoryOption2">
  111. <template slot-scope="{row}" slot="menu">
  112. <el-button type="text" icon="el-icon-refresh" size="small"
  113. :disabled="row.storageId != form.storageId"
  114. @click.stop="synchronous(row)">更新库存
  115. </el-button>
  116. </template>
  117. </avue-crud>
  118. <el-button type="primary" plain size="small" slot="reference"
  119. @click="viewInventory2"
  120. :disabled="selectionMultilist.length != 1 || isAddBtn">同步库存</el-button>
  121. </el-popover>
  122. </template>
  123. <template slot="goodsId" slot-scope="{ row }">
  124. {{ row.goodsName }}
  125. </template>
  126. <template slot="goodsNum" slot-scope="{ row }">
  127. <el-input-number v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
  128. v-model="row.goodsNum" :precision="numberDecimal" :controls="false"
  129. @blur="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
  130. <span v-else>{{ row.goodsNum }}</span>
  131. </template>
  132. <template slot="price" slot-scope="{ row }">
  133. <el-input v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
  134. v-model="row.price" style="width: 100%"></el-input>
  135. <span v-else>{{ row.price }}</span>
  136. </template>
  137. <template slot="dot" slot-scope="{ row }">
  138. <el-select v-if="!mingxibaocun" v-model="row.dot" filterable default-first-option
  139. @focus="picihaolistfun(row.goodsId)" @change="dotchangefun($event, row)">
  140. <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
  141. :value="item.dot"></el-option>
  142. </el-select>
  143. <span v-else>{{ row.dot }}</span>
  144. </template>
  145. <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
  146. }}</template>
  147. <template slot="remarks" slot-scope="{ row }">
  148. <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
  149. style="width: 100%"></el-input>
  150. <span v-else>{{ row.remarks }}</span>
  151. </template>
  152. <!-- <template slot-scope="{scope,row}" slot="goodsNum">
  153. <el-input size="small" v-model="formContacts.goodsNum" style="width: 100%">
  154. <template slot="inventory">{{ inventory }}吨</template>
  155. </el-input>
  156. </template> -->
  157. <!--<template slot="goodsId" slot-scope="{ row, index }">-->
  158. <!-- <span v-if="!mingxibaocun" style="display:flex">-->
  159. <!-- <el-select v-model="row.goodsId" placeholder="请选择" size="small" filterable-->
  160. <!-- style="width:60%">-->
  161. <!-- <el-option v-for="item in goodsListShow" :key="item.id" :label="item.cname"-->
  162. <!-- :value="item.id">-->
  163. <!-- </el-option>-->
  164. <!-- </el-select>-->
  165. <!-- &lt;!&ndash;<el-button icon="el-icon-search" size="small" @click="canmefalse()"></el-button>&ndash;&gt;-->
  166. <!-- </span>-->
  167. <!-- <span v-else>{{row.goodsName}}</span>-->
  168. <!--</template>-->
  169. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  170. <el-button v-if="mingxibaocun" :size="size" :disabled="disabled || isAdd" :type="type"
  171. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  172. @click="hangeditBtn(row, index)">编辑
  173. </el-button>
  174. <el-button v-else :size="size" :disabled="disabled || isAdd" :type="type"
  175. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  176. @click="hangbaocun(row, index)">保存
  177. </el-button>
  178. <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
  179. :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
  180. </el-button>
  181. </template>
  182. </avue-crud>
  183. <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
  184. :close-on-click-modal="false" v-dialog-drag>
  185. <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
  186. :upload-before="uploadBefore" :upload-after="uploadAfter">
  187. <template slot="excelTemplate">
  188. <el-button type="primary" @click="derivation">
  189. 点击下载<i class="el-icon-download el-icon--right"></i>
  190. </el-button>
  191. </template>
  192. </avue-form>
  193. <p style="text-align: center;color: #DC0505">
  194. 温馨提示 第一次导入时请先下载模板
  195. </p>
  196. </el-dialog>
  197. </el-tab-pane>
  198. <el-tab-pane label="支付明细" name="payment_details">
  199. <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
  200. :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
  201. @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
  202. @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
  203. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  204. <el-button :size="size" :disabled="disabled" :type="type"
  205. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  206. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  207. </el-button>
  208. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  209. @click="rowDelBox(row, index, 'paymentRecordsList')">删除
  210. </el-button>
  211. </template> -->
  212. </avue-crud>
  213. </el-tab-pane>
  214. <el-tab-pane label="出库记录" name="outbound_records">
  215. <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
  216. :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
  217. @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
  218. @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
  219. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  220. <el-button :size="size" :disabled="disabled" :type="type"
  221. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  222. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  223. </el-button>
  224. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  225. @click="rowDelBox(row, index)">删除
  226. </el-button>
  227. </template> -->
  228. </avue-crud>
  229. </el-tab-pane>
  230. </el-tabs>
  231. </trade-card>
  232. <report-dialog :switchDialog="switchDialog" :reportName="reportName" :reportId="form.id"
  233. @onClose="onClose()"></report-dialog>
  234. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  235. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  236. <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
  237. @choceCheckFun="choceCheckFun">
  238. </check>
  239. </el-dialog>
  240. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  241. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  242. <check-schedule :checkId="checkId" :batchNo="batchNo"
  243. @choceScheduleFun="choceScheduleFun"></check-schedule>
  244. </el-dialog>
  245. </div>
  246. <el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
  247. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
  248. <el-row :style="{ height: rowHeight }">
  249. <el-col :span="5" style="height: 100%;overflow-y: auto">
  250. <div>
  251. <el-scrollbar>
  252. <basic-container>
  253. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick" />
  254. </basic-container>
  255. </el-scrollbar>
  256. </div>
  257. </el-col>
  258. <el-col :span="19">
  259. <basic-container>
  260. <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
  261. :search.sync="SelectSearch" @refresh-change="refreshChange"
  262. @selection-change="selectionChange" @search-change="goodsSearch" :page.sync="page"
  263. @on-load="onLoadfun" @resetColumn="resetCrud" @saveColumn="saveCrud">
  264. <template slot="menuLeft">
  265. <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
  266. <el-tab-pane label="查询结果" name="searchList" />
  267. <el-tab-pane label="已选定数据" name="importStaging" />
  268. </el-tabs>
  269. </template>
  270. <template slot="goodsNum" slot-scope="{row}">
  271. <el-input-number v-model="row.goodsNum" size="small" :controls="false"
  272. :precision="numberDecimal" @input="amountChange($event, row)" style="width: 100%" />
  273. </template>
  274. <template slot="dot" slot-scope="{row}">
  275. <!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
  276. <!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
  277. <!--无需使用鼠标或键盘方向键进行定位。-->
  278. <!--allow-create filterable default-first-option-->
  279. <el-select v-model="row.dot" filterable default-first-option
  280. @focus="picihaolistfun(row.id)" @change="dotchangefun($event, row)">
  281. <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
  282. :value="item.dot"></el-option>
  283. </el-select>
  284. <!--<span v-else>{{ row.dot }}</span>-->
  285. </template>
  286. <template slot="price" slot-scope="{row}">
  287. <el-input-number v-model="row.price" size="small" :controls="false"
  288. style="width: 100%" />
  289. </template>
  290. <template slot-scope="scope" slot="menu">
  291. <el-button type="text" icon="el-icon-edit" size="small"
  292. @click.stop="importStagList(scope.row, scope.index)"
  293. v-if="activeNameTabs == 'searchList'"
  294. :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
  295. </el-button>
  296. <el-button type="text" icon="el-icon-delete" size="small"
  297. @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
  298. </el-button>
  299. </template>
  300. <template slot="inventory" slot-scope="scope">
  301. <span style="color: #489fef">
  302. {{ Number(scope.row.inventory) }}
  303. </span>
  304. </template>
  305. </avue-crud>
  306. </basic-container>
  307. </el-col>
  308. </el-row>
  309. <span slot="footer" class="dialog-footer">
  310. <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
  311. <el-button type="primary" @click="importGoods" v-if="commodityData !== true"
  312. :loading="saveLoading">导入</el-button>
  313. <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
  314. <!-- :disabled="tableData.length !== 1">导入</el-button>-->
  315. </span>
  316. </el-dialog>
  317. </div>
  318. </template>
  319. <script>
  320. import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
  321. import { getDetails as getDetailsGods } from '@/api/tirePartsMall/basicData/commodityInformation'
  322. import {
  323. getDetails,
  324. submit,
  325. generateShipTask,
  326. tradingBox,
  327. delOrderItem,
  328. checkOrder,
  329. confirmRefund,
  330. revokeCheckOrder,
  331. goodsListXs,
  332. revokeGenerateShipTask,
  333. goodsPageXs,
  334. getGoodAllList,
  335. generateReturns,
  336. whetherExistenceFinancing,
  337. checkOrderRW,
  338. revokeCheckOrderRW,
  339. getParamservice
  340. } from "@/api/tirePartsMall/salesManagement/saleOrder";
  341. import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  342. import reportDialog from "@/components/report-dialog/main";
  343. import { dateFormat } from "@/util/date";
  344. import checkSchedule from "@/components/checkL/checkSchedule";
  345. import check from "@/components/checkL/check";
  346. import { getList, listAll } from "@/api/tirePartsMall/basicData/listingManagement"
  347. import commodityxsho from '../../configuration/commodityxsho.json'
  348. import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
  349. import M from "minimatch";
  350. import da from "element-ui/src/locale/lang/da";
  351. import { number } from "echarts";
  352. import { getCorpTypes } from "@/api/tirePartsMall/basicData/commodityInformation";
  353. import { getWorkDicts } from "../../../../api/system/dictbiz";
  354. import losbfeestemplate from "@/views/iosBasicData/losbfeestemplate/index.vue";
  355. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  356. import {
  357. getList as KHgetList
  358. } from "@/api/tirePartsMall/basicData/customerInformation";
  359. import { getToken } from "@/util/auth";
  360. import { isProcurement } from "@/api/basicData/configuration";
  361. import { getList as inventoryList } from "@/api/tirePartsMall/inventory";
  362. export default {
  363. name: "detailsPage",
  364. data() {
  365. return {
  366. inventoryData2: [],
  367. numberDecimal: 0,
  368. goodsType: 1,
  369. inventoryOption: {
  370. header: false,
  371. menu: false,
  372. column: [
  373. {
  374. label: '商品名称',
  375. prop: 'cname',
  376. overHidden: true,
  377. }, {
  378. label: '仓库',
  379. prop: 'storageName',
  380. overHidden: true,
  381. }, {
  382. label: '库存数量',
  383. prop: 'balanceQuantity',
  384. overHidden: true,
  385. }, {
  386. label: '批次号',
  387. prop: 'dot',
  388. overHidden: true,
  389. }
  390. ]
  391. },
  392. inventoryOption2: {
  393. header: false,
  394. menu: true,
  395. menuWidth: 90,
  396. editBtn: false,
  397. delBtn: false,
  398. column: [
  399. {
  400. label: '商品名称',
  401. prop: 'cname',
  402. overHidden: true,
  403. }, {
  404. label: '仓库',
  405. prop: 'storageName',
  406. overHidden: true,
  407. }, {
  408. label: '库存数量',
  409. prop: 'balanceQuantity',
  410. overHidden: true,
  411. }, {
  412. label: '批次号',
  413. prop: 'dot',
  414. overHidden: true,
  415. }
  416. ]
  417. },
  418. inventoryData: [],
  419. excelBox: false,
  420. reportName: '', // 打印传的名字
  421. SelectSearch: {}, // 添加商品检索
  422. // 编辑还是保存
  423. mingxibaocun: true,
  424. // 批次号请求到的数据
  425. picihaolist: [],
  426. // 添加商品弹窗
  427. dialogVisible: false,
  428. // 弹窗高度
  429. rowHeight: '',
  430. // 左侧选择搜索
  431. treeDataGoods: [],
  432. treeDeptId: '',
  433. page: {
  434. pageSize: 10,
  435. currentPage: 1,
  436. total: 0,
  437. pageSizes: [10, 50, 100, 300, 500]
  438. },
  439. pageList: {
  440. pageSize: 10,
  441. currentPage: 1,
  442. total: 0
  443. },
  444. // 左侧选择
  445. treeOption: {
  446. addBtn: false,
  447. menu: false,
  448. size: "small",
  449. props: {
  450. labelText: "标题",
  451. label: "title",
  452. value: "id",
  453. }
  454. },
  455. templateUrl: '', // 模板url
  456. // 表格需要的配置
  457. optionTwo: commodityxsho,
  458. loading: false,
  459. // 商品列表数据合计
  460. goodsListShow: [],
  461. // 商品列表暂存
  462. goodsListSave: [],
  463. saveLoading: false,
  464. commodityData: false,
  465. surplusRouteQuantityOption: [],
  466. tableData: [],
  467. // tabs切换
  468. activeNameTabs: 'searchList',
  469. data: [],
  470. courierCompaniesList: [],
  471. inventory: 0,
  472. isStatus: 1,
  473. goodsIdoptions: [],
  474. dataList: [],
  475. dicUrlWithCustomId: '',
  476. sharedCompanyId: 0,
  477. isAddBtn: true, // 添加商品的是否禁用
  478. isSaveBtn: false, // 大保存的是否禁用
  479. viewDisabled: false, // 大审批的是否禁用
  480. isAdd: false, // 表格按钮的是否点击
  481. editButton: true, // 大编辑大隐藏显示
  482. isEditButton: false, // 大编辑是否禁用
  483. goods: [],
  484. isDisabled: false, // 表格删除的是否禁用
  485. isDisabledTask: false, // 撤销任务和生成任务的是否禁用
  486. contactsOption: [],
  487. isContacts: false, // 表单的联系人是否禁用
  488. checkData: {},
  489. buttonText: '生成任务', // 生成任务和撤销任务文本
  490. buttonColor: 'success', // 初始颜色为success 生成任务和撤销任务颜色状态
  491. checkScheduleDialog: false, // 审批进度的弹窗开启关闭
  492. isApplySettlement: true, // 申请退款的是否禁用
  493. isConfirmRefundBtn: true, // 确认退款的是否禁用
  494. isExamineBtn: true, // 审批是否禁用
  495. isRevocationRequest: true, // 撤销审核是否禁用
  496. checkDialog: false, // 审核弹窗的开启关闭
  497. checkId: '',
  498. batchNo: '',
  499. switchDialog: false, // 打印弹窗的开启和关闭
  500. activeName: "sale_detail",
  501. disabled: false, // 表格按钮的禁用
  502. key: 0,
  503. form: {
  504. orderItemsList: [],
  505. paymentRecordsList: [],
  506. outboundRecordsList: [],
  507. freight: 5,
  508. },
  509. excelOption: {
  510. submitBtn: false,
  511. emptyBtn: false,
  512. column: [
  513. {
  514. label: "模板下载",
  515. prop: "excelTemplate",
  516. formslot: true,
  517. span: 24
  518. },
  519. {
  520. label: "导入明细",
  521. prop: "excelFile",
  522. type: "upload",
  523. drag: true,
  524. loadText: "上传中,请稍等",
  525. accept: '.xls,.xlsx',
  526. span: 24,
  527. propsHttp: {
  528. res: "data"
  529. },
  530. tip: "请上传 .xls,.xlsx 标准格式文件",
  531. action: "/api/blade-sales-part/ship/import-item"
  532. }
  533. ]
  534. },
  535. customerData: [], // 客户数据
  536. optionForm: {
  537. menuBtn: false,
  538. span: 8,
  539. disabled: false,
  540. column: [{
  541. label: '客户',
  542. prop: "customerName",
  543. disabled: false,
  544. formslot: true,
  545. rules: [{
  546. required: true,
  547. message: " ",
  548. trigger: "blur"
  549. }]
  550. },
  551. // {
  552. // label: '客户',
  553. // prop: "customerId",
  554. // disabled: false,
  555. // remote: true,
  556. // type: 'select',
  557. // props: {
  558. // label: 'cname',
  559. // value: 'id',
  560. // res:'data.records'
  561. // },
  562. // cascader: ['recAddress'],
  563. // click: () => {
  564. // this.$refs.form.dicInit()
  565. // },
  566. // change: (data) => {
  567. // if (!this.onLoad.id) {
  568. // // this.$set(this.optionContactsBack, "addBtn", true)
  569. // // this['optionContacts'] = this['optionContactsBack'];
  570. // // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
  571. // }
  572. // if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
  573. // getCustom({ id: data.value }).then(res => {
  574. // if (res.data.data) {
  575. // this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
  576. // // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
  577. // // this.form.storageId = res.data.data.deliveryWarehouseId
  578. // this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
  579. // this.form.contacts = res.data.data.corpsAttnList[0].cname
  580. // this.form.phone = res.data.data.corpsAttnList[0].tel
  581. // this.contactsOption = res.data.data.corpsAddrList
  582. // this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
  583. // this.form.salerId = res.data.data.salesmanId?res.data.data.salesmanId:''
  584. // }
  585. // })
  586. // }
  587. //
  588. // // if (this.$refs.form.DIC.customerId || data.value) {
  589. // // for (let item of this.$refs.form.DIC.customerId) {
  590. // // if (item.id == data.value) {
  591. // // console.log(data);
  592. // // console.log(this.$refs.form);
  593. // // console.log(item);
  594. // // // 后端返回数据暂无联系人、地址等数据,无法下拉默认
  595. // // this.form.phone = item.tel
  596. // // }
  597. // // }
  598. // // }
  599. // },
  600. // // dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
  601. // dicUrl: '/api/blade-sales-part/corpsDesc/list?cname={{key}}&corpType=KH',
  602. // rules: [{
  603. // required: true,
  604. // message: " ",
  605. // trigger: "blur"
  606. // }]
  607. // },
  608. {
  609. label: '业务员',
  610. disabled: false,
  611. prop: "salerId",
  612. type: "select",
  613. props: {
  614. label: "name",
  615. value: "id"
  616. },
  617. dicUrl: "/api/blade-user/salerList",
  618. filterable: true,
  619. // rules: [{
  620. // required: true,
  621. // message: " ",
  622. // trigger: "blur"
  623. // }]
  624. }, {
  625. label: '仓库',
  626. prop: "storageId",
  627. type: 'select',
  628. disabled: false,
  629. placeholder: '仓库为空即为异地销售',
  630. props: {
  631. label: 'cname',
  632. value: 'id'
  633. },
  634. dicUrl: '/api/blade-sales-part/storageDesc/listAll',
  635. // rules: [{
  636. // required: true,
  637. // message: " ",
  638. // trigger: "blur"
  639. // }]
  640. },
  641. {
  642. label: '联系人',
  643. type: "select",
  644. prop: "contacts",
  645. disabled: false,
  646. allowCreate: true,
  647. filterable: true,
  648. dicData: [],
  649. props: {
  650. label: 'address',
  651. value: 'id'
  652. },
  653. dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
  654. }, {
  655. label: '电话',
  656. disabled: false,
  657. prop: "phone",
  658. }, {
  659. label: '收货地址',
  660. prop: "recAddress",
  661. type: 'select',
  662. allowCreate: true,
  663. filterable: true,
  664. disabled: false,
  665. props: {
  666. label: 'address',
  667. value: 'address'
  668. },
  669. dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
  670. }, {
  671. label: '业务日期',
  672. prop: "businesDate",
  673. searchProp: "businesDateList",
  674. disabled: false,
  675. type: "datetime",
  676. value: dateFormat(new Date(), 'yyyy-MM-dd'),
  677. format: "yyyy-MM-dd",
  678. valueFormat: "yyyy-MM-dd",
  679. rules: [
  680. {
  681. required: true,
  682. message: "",
  683. trigger: "blur"
  684. }
  685. ]
  686. }, {
  687. label: '收款方式',
  688. prop: "receivableType",
  689. type: "select",
  690. disabled: false,
  691. dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
  692. props: {
  693. label: "dictValue",
  694. value: "dictValue"
  695. },
  696. value: '网络支付'
  697. },
  698. {
  699. label: '业务来源',
  700. prop: "businessSource",
  701. disabled: true
  702. }, {
  703. label: '配送方式',
  704. type: 'select',
  705. prop: "shipType",
  706. disabled: false,
  707. dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
  708. props: {
  709. label: "dictValue",
  710. value: "dictValue"
  711. },
  712. value: '物流',
  713. }, {
  714. label: '货运公司',
  715. type: 'select',
  716. prop: "logisticsCorpName",
  717. allowCreate: true,
  718. filterable: true,
  719. disabled: false,
  720. dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company",
  721. props: {
  722. label: "dictValue",
  723. value: "dictValue"
  724. }
  725. },
  726. {
  727. label: '货运单号',
  728. disabled: false,
  729. prop: "expressNo"
  730. },
  731. {
  732. label: '成本',
  733. prop: "cost",
  734. display: false,
  735. disabled: true
  736. }, {
  737. label: '毛利',
  738. prop: "grossProfit",
  739. display: false,
  740. disabled: true
  741. }, {
  742. label: '销售金额',
  743. prop: "salesAmount",
  744. disabled: true
  745. }, {
  746. label: '运费',
  747. prop: "freight",
  748. disabled: true
  749. }, {
  750. label: '总金额',
  751. prop: "totalMoney",
  752. disabled: true
  753. }, {
  754. label: '已收金额',
  755. prop: "paymentAmountTl",
  756. disabled: true
  757. }, {
  758. label: '单据编号',
  759. prop: "ordNo",
  760. disabled: true
  761. }, {
  762. label: '来源单号',
  763. prop: "srcOrdNo",
  764. disabled: true
  765. }, {
  766. label: '退货数量',
  767. prop: "returnsNumber",
  768. disabled: true
  769. }, {
  770. label: '退货金额',
  771. prop: "returnsAmount",
  772. disabled: true
  773. }, {
  774. label: '备注',
  775. prop: "remarks",
  776. type: 'textarea',
  777. disabled: false,
  778. span: 16,
  779. minRows: 1
  780. }]
  781. },
  782. formContacts: {},
  783. optionContacts: {},
  784. optionContactsBack: {
  785. disabled: false,
  786. goodsId: '',
  787. border: true,
  788. align: 'center',
  789. index: true,
  790. addBtnText: "添加商品",
  791. updateBtnText: '保存',
  792. refreshBtn: false,
  793. dialogDrag: true,
  794. addBtn: false,
  795. // 航编辑开启
  796. cellBtn: true,
  797. span: 8,
  798. height: 500,
  799. addRowBtn: false,
  800. editBtn: false,
  801. delBtn: false,
  802. menuWidth: 140,
  803. dialogTop: 25,
  804. dialogWidth: "80%",
  805. summaryText: "合计",
  806. showSummary: true,
  807. selection: true,
  808. sumColumnList: [{
  809. name: "goodsNum",
  810. type: "sum"
  811. }, {
  812. name: "sendNum",
  813. type: "sum"
  814. }, {
  815. name: "profit",
  816. type: "sum"
  817. }, {
  818. name: "subTotalMoney",
  819. type: "sum"
  820. }, {
  821. name: "thisAmount",
  822. type: "sum"
  823. }, {
  824. name: "costprie",
  825. type: "sum"
  826. }, {
  827. name: "grossProfit",
  828. type: "sum"
  829. }, {
  830. name: "returnsNumber",
  831. type: "sum"
  832. }, {
  833. name: "returnsAmount",
  834. type: "sum"
  835. }],
  836. column: [{
  837. label: '商品名称',
  838. prop: 'goodsId',
  839. width: 250,
  840. disabled: false,
  841. remote: true,
  842. overHidden: true,
  843. hide: true,
  844. type: 'select',
  845. dicData: [],
  846. props: {
  847. label: 'goodsName',
  848. value: 'goodsId'
  849. },
  850. // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
  851. dicUrl: `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=&enableOrNot=1&stock=${this.goodsId}`
  852. // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
  853. }, {
  854. label: '商品名称',
  855. prop: 'goodsName',
  856. width: 250,
  857. disabled: false,
  858. remote: true,
  859. overHidden: true,
  860. }, {
  861. label: '库存',
  862. prop: 'inventory',
  863. width: 250,
  864. disabled: false,
  865. remote: true,
  866. overHidden: true,
  867. }, {
  868. label: '数量',
  869. prop: 'goodsNum',
  870. overHidden: true,
  871. disabled: false,
  872. cell: true,
  873. width: 100,
  874. rules: [{
  875. required: true,
  876. message: " ",
  877. trigger: "blur"
  878. }, {
  879. validator: (rule, value, callback) => {
  880. console.log(this.formContacts.inventory);
  881. if (value < 0) {
  882. callback(new Error("数量不能小于0"));
  883. } else if (Number(value) > Number(this.formContacts.inventory)) {
  884. callback(new Error("数量不能大于库存"));
  885. } else {
  886. callback();
  887. }
  888. },
  889. trigger: "blur"
  890. }]
  891. },
  892. {
  893. label: '价格',
  894. prop: 'price',
  895. overHidden: true,
  896. width: 100,
  897. disabled: false,
  898. cell: true,
  899. rules: [{
  900. required: true,
  901. message: " ",
  902. trigger: "blur"
  903. }, {
  904. validator: (rule, value, callback) => {
  905. if (value < 0) {
  906. callback(new Error("价格不能小于0"));
  907. } else {
  908. callback();
  909. }
  910. },
  911. trigger: "blur"
  912. }]
  913. },
  914. {
  915. label: '库存',
  916. prop: 'inventory',
  917. overHidden: true,
  918. hide: true,
  919. width: 100
  920. }, {
  921. label: '批次号',
  922. prop: 'dot',
  923. cell: true,
  924. type: "select",
  925. width: 120,
  926. disabled: true,
  927. allowCreate: true,
  928. filterable: true,
  929. dicData: [],
  930. props: {
  931. label: "dot",
  932. value: "dot"
  933. },
  934. dicUrl: "/api/blade-sales-part/stockDesc/dotList",
  935. overHidden: true,
  936. },
  937. // {
  938. // label: '单号',
  939. // prop: 'poNo',
  940. // overHidden: true,
  941. // disabled: false,
  942. // width: 100
  943. // },
  944. {
  945. label: '商品编码',
  946. prop: 'goodsNo',
  947. overHidden: true,
  948. disabled: false,
  949. width: 100
  950. },
  951. {
  952. label: '品牌',
  953. prop: 'brandId',
  954. disabled: false,
  955. width: 100,
  956. overHidden: true,
  957. type: 'select',
  958. props: {
  959. label: 'cname',
  960. value: 'id'
  961. },
  962. dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1'
  963. },
  964. {
  965. label: '规格型号',
  966. prop: 'propertyName',
  967. overHidden: true,
  968. disabled: false,
  969. width: 100
  970. }, {
  971. label: '花纹',
  972. prop: 'pattern',
  973. overHidden: true,
  974. disabled: false,
  975. width: 100
  976. }, {
  977. label: '商品描述',
  978. prop: 'goodsDescription',
  979. disabled: false,
  980. overHidden: true,
  981. width: 100
  982. },
  983. {
  984. label: '单位',
  985. prop: 'units',
  986. type: "select",
  987. disabled: false,
  988. props: {
  989. label: "dictValue",
  990. value: "dictValue"
  991. },
  992. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  993. overHidden: true,
  994. width: 100
  995. },
  996. {
  997. label: '发货数量',
  998. prop: 'sendNum',
  999. overHidden: true,
  1000. width: 100,
  1001. disabled: true,
  1002. editDisplay: false,
  1003. addDisplay: false
  1004. },
  1005. // {
  1006. // label: '利润',
  1007. // prop: 'profit',
  1008. // overHidden: true,
  1009. // width: 100
  1010. // },
  1011. {
  1012. label: '小计',
  1013. prop: 'subTotalMoney',
  1014. overHidden: true,
  1015. width: 100,
  1016. disabled: true,
  1017. editDisplay: false,
  1018. addDisplay: false
  1019. },
  1020. // {
  1021. // label: '返利',
  1022. // prop: 'thisAmount',
  1023. // overHidden: true,
  1024. // width: 100
  1025. // },
  1026. {
  1027. label: '成本',
  1028. prop: 'costprie',
  1029. overHidden: true,
  1030. width: 100,
  1031. disabled: true,
  1032. editDisplay: false,
  1033. addDisplay: false
  1034. },
  1035. {
  1036. label: '毛利',
  1037. prop: 'grossProfit',
  1038. overHidden: true,
  1039. width: 100,
  1040. disabled: true,
  1041. editDisplay: false,
  1042. addDisplay: false
  1043. },
  1044. // {
  1045. // label: '返利后单价',
  1046. // prop: 'rebatePrice',
  1047. // overHidden: true,
  1048. // width: 100,
  1049. // disabled: true,
  1050. // editDisplay: false,
  1051. // addDisplay: false
  1052. // },
  1053. // {
  1054. // label: '返利后成本价',
  1055. // prop: 'rebateCostprie',
  1056. // overHidden: true,
  1057. // width: 100,
  1058. // disabled: true,
  1059. // editDisplay: false,
  1060. // addDisplay: false
  1061. // },
  1062. // {
  1063. // label: '返利后利润',
  1064. // prop: 'rebateProfit',
  1065. // overHidden: true,
  1066. // width: 100,
  1067. // disabled: true,
  1068. // editDisplay: false,
  1069. // addDisplay: false
  1070. // },
  1071. {
  1072. label: '退货数量',
  1073. prop: "returnsNumber",
  1074. overHidden: true,
  1075. width: 100,
  1076. disabled: true,
  1077. },
  1078. {
  1079. label: '退货金额',
  1080. prop: "returnsAmount",
  1081. overHidden: true,
  1082. width: 100,
  1083. disabled: true,
  1084. },
  1085. {
  1086. label: '备注',
  1087. prop: "remarks",
  1088. overHidden: true,
  1089. width: 100,
  1090. disabled: false,
  1091. }
  1092. ]
  1093. },
  1094. selectionMultilist: [], // 多选数据
  1095. optionPaymentDetails: {},
  1096. optionPaymentDetailsBack: {
  1097. align: 'center',
  1098. index: true,
  1099. addBtnText: "录入明细",
  1100. menu: false,
  1101. refreshBtn: false,
  1102. dialogDrag: true,
  1103. addBtn: false,
  1104. span: 8,
  1105. height: 600,
  1106. addRowBtn: false,
  1107. editBtn: false,
  1108. delBtn: false,
  1109. menuWidth: 140,
  1110. dialogTop: 25,
  1111. dialogWidth: "80%",
  1112. column: [{
  1113. label: '支付编号',
  1114. prop: 'serialNumber'
  1115. }, {
  1116. label: '金额',
  1117. prop: 'amount'
  1118. }, {
  1119. label: '类型',
  1120. prop: 'type'
  1121. }, {
  1122. label: '支付时间',
  1123. prop: 'createTime'
  1124. }]
  1125. },
  1126. optionOutboundRecords: {},
  1127. optionOutboundRecordsBack: {
  1128. align: 'center',
  1129. index: true,
  1130. menu: false,
  1131. addBtnText: "录入明细",
  1132. refreshBtn: false,
  1133. dialogDrag: true,
  1134. addBtn: false,
  1135. span: 8,
  1136. height: 600,
  1137. addRowBtn: false,
  1138. editBtn: false,
  1139. delBtn: false,
  1140. // menuWidth: 140,
  1141. dialogTop: 25,
  1142. dialogWidth: "80%",
  1143. column: [{
  1144. label: '出库单号',
  1145. prop: 'billno'
  1146. },
  1147. // {
  1148. // label: '来源单号',
  1149. // prop: 'ordNo'
  1150. // },
  1151. {
  1152. label: '数量',
  1153. prop: 'goodsTotalNum'
  1154. }, {
  1155. label: '实际数量',
  1156. prop: 'sendTotalNum'
  1157. }, {
  1158. label: '业务类型',
  1159. prop: 'bizTypeName'
  1160. }, {
  1161. label: '状态',
  1162. prop: 'statusName'
  1163. }, {
  1164. label: '业务时间',
  1165. prop: 'createTime'
  1166. }]
  1167. }
  1168. }
  1169. },
  1170. components: { SearchQuery, reportDialog, check, checkSchedule },
  1171. props: {
  1172. onLoad: Object,
  1173. detailData: Object
  1174. },
  1175. async created() {
  1176. console.log(this.detailData.id)
  1177. console.log(JSON.parse(localStorage.getItem('saber-tenantId')).content, 959)
  1178. if (JSON.parse(localStorage.getItem('saber-tenantId')).content == '069164') {
  1179. this.reportName = '轮胎商城-玉玲珑销售单'
  1180. } else {
  1181. this.reportName = '轮胎商城-销售订单'
  1182. }
  1183. // console.log(this.$route);
  1184. // if(this.$route.query.check.actId){
  1185. // this.isExamineBtn = false
  1186. // }
  1187. getWorkDicts("tyre_express_company").then(res => {
  1188. this.courierCompaniesList = res.data.data;
  1189. })
  1190. this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
  1191. if (this.formContacts.goodsId !== value) {
  1192. goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
  1193. this.goods = res.data.data
  1194. this.formContacts.goodsNo = res.data.data.code
  1195. this.formContacts.brandId = res.data.data.brandId
  1196. this.formContacts.inventory = res.data.data.inventory
  1197. // this.formContacts.brandId = res.data.data.brandName
  1198. // this.formContacts.brandName = res.data.data.brandId
  1199. this.formContacts.propertyName = res.data.data.specificationAndModel
  1200. this.formContacts.pattern = res.data.data.brandItem
  1201. this.formContacts.goodsDescription = res.data.data.goodsDescription
  1202. this.formContacts.units = res.data.data.unit
  1203. this.formContacts.price = res.data.data.price
  1204. //
  1205. this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
  1206. console.log(res.data.data.sharedCompanyId);
  1207. console.log(res.data.data.sharedCompanyName);
  1208. this.form.sharedCompanyId = res.data.data.sharedCompanyId
  1209. this.form.sharedCompanyName = res.data.data.sharedCompanyName
  1210. this.sharedCompanyId = res.data.data.sharedCompanyId
  1211. console.log(res.data.data.sharedCompanyId);
  1212. console.log(this.form.orderItemsList);
  1213. for (let i = 0; i < this.form.orderItemsList.length; i++) {
  1214. console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
  1215. if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
  1216. this.isStatus = 0
  1217. }
  1218. }
  1219. if (res.data.data.whether == 0) {
  1220. this.findObject(this.optionContactsBack.column, "dot").disabled = true
  1221. } else {
  1222. this.findObject(this.optionContactsBack.column, "dot").disabled = false
  1223. dotList({
  1224. storageId: this.form.storageId,
  1225. goodsId: this.formContacts.goodsId
  1226. }).then(res => {
  1227. this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
  1228. })
  1229. }
  1230. // this.formContacts.goodsId = res.data.data.cname
  1231. // this.formContacts.goodsName = res.data.data.id
  1232. })
  1233. }
  1234. }
  1235. this.optionContacts = await this.getColumnData(this.getColumnName(269.6), this.optionContactsBack);
  1236. isProcurement({ "param": "whether.model" }).then(res => {
  1237. if (res.data.data == 1) {
  1238. this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
  1239. this.findObject(this.optionTwo.column, "brandItem").label = '规格型号1'
  1240. this.findObject(this.optionTwo.column, "originalFactory").search = false
  1241. this.findObject(this.optionTwo.column, "explosionProof").search = false
  1242. this.findObject(this.optionTwo.column, "selfRecovery").search = false
  1243. this.findObject(this.optionTwo.column, "explosionProof").hide = true
  1244. this.findObject(this.optionTwo.column, "originalFactory").hide = true
  1245. this.findObject(this.optionTwo.column, "selfRecovery").hide = true
  1246. this.findObject(this.optionTwo.column, "explosionProof").showColumn = false
  1247. this.findObject(this.optionTwo.column, "originalFactory").showColumn = false
  1248. this.findObject(this.optionTwo.column, "selfRecovery").showColumn = false
  1249. }
  1250. })
  1251. this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
  1252. if (this.formContacts.goodsId !== value) {
  1253. goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
  1254. this.goods = res.data.data
  1255. this.formContacts.goodsNo = res.data.data.code
  1256. this.formContacts.brandId = res.data.data.brandId
  1257. this.formContacts.inventory = res.data.data.inventory
  1258. // this.formContacts.brandId = res.data.data.brandName
  1259. // this.formContacts.brandName = res.data.data.brandId
  1260. this.formContacts.propertyName = res.data.data.specificationAndModel
  1261. this.formContacts.pattern = res.data.data.brandItem
  1262. this.formContacts.goodsDescription = res.data.data.goodsDescription
  1263. this.formContacts.dotListunits = res.data.data.unit
  1264. this.sharedCompanyId = res.data.data.sharedCompanyId
  1265. this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
  1266. //
  1267. this.form.sharedCompanyId = res.data.data.sharedCompanyId
  1268. this.form.sharedCompanyName = res.data.data.sharedCompanyName
  1269. for (let i = 0; i < this.form.orderItemsList.length; i++) {
  1270. if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
  1271. this.isStatus = 0
  1272. }
  1273. }
  1274. if (res.data.data.whether == 0) {
  1275. this.findObject(this.optionContacts.column, "dot").disabled = true
  1276. } else {
  1277. this.findObject(this.optionContacts.column, "dot").disabled = false
  1278. dotList({
  1279. storageId: this.form.storageId,
  1280. goodsId: this.formContacts.goodsId
  1281. }).then(res => {
  1282. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
  1283. })
  1284. }
  1285. // this.formContacts.goodsId = res.data.data.cname
  1286. // this.formContacts.goodsName = res.data.data.id
  1287. })
  1288. }
  1289. }
  1290. this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
  1291. this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
  1292. this.key++
  1293. if (this.onLoad.id && this.detailData.id) {
  1294. this.$set(this.optionForm, 'disabled', true)
  1295. this.$set(this.optionContactsBack, 'disabled', true)
  1296. this.isContacts = true
  1297. this.isDisabled = true
  1298. //添加删除按钮禁用
  1299. this.isAdd = true
  1300. this.refresh(this.onLoad.id, true)
  1301. } else if (this.onLoad.id) {
  1302. console.log(2);
  1303. this.refresh(this.onLoad.id, true)
  1304. }
  1305. if (!this.form.id) {
  1306. console.log(3);
  1307. this.optionContactsBack.column.forEach(its => {
  1308. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  1309. its.disabled = false
  1310. } else {
  1311. its.disabled = true
  1312. }
  1313. })
  1314. this.isSaveBtn = true;
  1315. this.isDisabledTask = true;
  1316. this.viewDisabled = true;
  1317. // this.$set(this.optionContactsBack, "addBtn", false)
  1318. // this['optionContacts'] = this['optionContactsBack'];
  1319. // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
  1320. }
  1321. if (!this.detailData.id) {
  1322. this.editButton = false
  1323. this.isAddBtn = false
  1324. this.isDisabledTask = false;
  1325. this.isSaveBtn = false
  1326. this.viewDisabled = false;
  1327. this.form.businessSource = '内部销售'
  1328. isProcurement({ "param": "freight" }).then(res => {
  1329. // res.data.data === '1'
  1330. this.form.freight = res.data.data
  1331. })
  1332. }
  1333. if (this.detailData.check) {
  1334. this.isExamineBtn = false
  1335. // this.batchNo = this.detailData.check.batchNo
  1336. }
  1337. //成本、毛利对业务员隐藏
  1338. this.optionForm.column.forEach(its => {
  1339. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  1340. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  1341. this.$set(its, 'display', false)
  1342. }
  1343. } else {
  1344. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  1345. this.$set(its, 'display', true)
  1346. }
  1347. }
  1348. })
  1349. // 明细信息成本、毛利对业务员隐藏
  1350. this.optionContacts.column.forEach(its => {
  1351. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  1352. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  1353. this.$set(its, 'hide', true)
  1354. }
  1355. } else {
  1356. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  1357. this.$set(its, 'hide', false)
  1358. }
  1359. }
  1360. })
  1361. if (this.detailData.id) {
  1362. this.getDetailsfun()
  1363. }
  1364. isProcurement({ "param": "number.decimal" }).then(res => {
  1365. this.numberDecimal = res.data.data ? Number(res.data.data) : 0
  1366. })
  1367. },
  1368. watch: {
  1369. dicUrlWithCustomId() {
  1370. console.log(this.form);
  1371. // this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
  1372. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
  1373. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  1374. })
  1375. },
  1376. 'form.storageId'(newStorageId, oldStorageId) {
  1377. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
  1378. console.log(res.data.data, '2');
  1379. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  1380. })
  1381. },
  1382. // 'form.orderItemsList.length'(newformContacts, oldformContacts) {
  1383. // console.log(this.formContacts);
  1384. // console.log(this.form.orderItemsList);
  1385. // // for (let i = 0; i < this.form.orderItemsList.length - 1; i++) {
  1386. // // const currentItem = this.form.orderItemsList[i];
  1387. // // const nextItem = this.form.orderItemsList[i + 1];
  1388. // // if (currentItem.sharedCompanyId !== nextItem.sharedCompanyId) {
  1389. // // console.log('不能添加');
  1390. // // }
  1391. // // }
  1392. // if (this.form.orderItemsList.length) {
  1393. // this.findObject(this.optionForm.column, 'storageId').disabled = true
  1394. // } else {
  1395. // this.findObject(this.optionForm.column, 'storageId').disabled = false
  1396. // }
  1397. // },
  1398. 'form.sharedCompanyId'(newSharedCompanyId, oldSharedCompanyId) {
  1399. console.log(newSharedCompanyId, oldSharedCompanyId);
  1400. if (newSharedCompanyId != oldSharedCompanyId) {
  1401. console.log('不能添加');
  1402. }
  1403. console.log(this.sharedCompanyId);
  1404. },
  1405. $route(to, from) {
  1406. if (this.onLoad.id && this.detailData.id) {
  1407. this.$set(this.optionForm, 'disabled', true)
  1408. this.$set(this.optionContactsBack, 'disabled', true)
  1409. this.isContacts = true
  1410. this.isDisabled = true
  1411. this.isAdd = true
  1412. this.refresh(this.onLoad.id, true)
  1413. } else if (this.onLoad.id) {
  1414. this.refresh(this.onLoad.id, true)
  1415. }
  1416. // if (!this.form.id) {
  1417. // console.log(3);
  1418. // // this.$set(this.optionContactsBack, "addBtn", false)
  1419. // this['optionContacts'] = this['optionContactsBack'];
  1420. // this.delColumnData(this.getColumnName('269.6'), this['optionContactsBack']);
  1421. // }
  1422. // if (!this.detailData.id) {
  1423. // this.form.businessSource = '内部销售'
  1424. // }
  1425. if (this.detailData.status == 1) {
  1426. this.isExamineBtn = false;
  1427. }
  1428. // if (to.name == '销售订单') {
  1429. // console.log('销售订单');
  1430. // this.isExamineBtn = false;
  1431. // }
  1432. }
  1433. },
  1434. methods: {
  1435. viewInventory() {
  1436. this.inventoryData = []
  1437. inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
  1438. this.inventoryData = res.data.data.records
  1439. ])
  1440. },
  1441. viewInventory2() {
  1442. inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
  1443. this.inventoryData2 = res.data.data.records
  1444. // res.data.data.records.forEach(item => {
  1445. // if (item.storageId == this.form.storageId && item.dot == this.selectionMultilist[0].dot) {
  1446. // if (Number(item.balanceQuantity) == Number(this.selectionMultilist[0].inventory)) {
  1447. // this.$message.success("库存一致,不需要同步");
  1448. // }
  1449. // if (Number(item.balanceQuantity) != Number(this.selectionMultilist[0].inventory)) {
  1450. // this.$confirm('是否更新库存', '提示', {
  1451. // confirmButtonText: '确定',
  1452. // cancelButtonText: '取消',
  1453. // type: 'warning'
  1454. // }).then(() => {
  1455. // this.form.orderItemsList.forEach(e => {
  1456. // if (e.goodsName == this.selectionMultilist[0].goodsName) {
  1457. // e.inventory = item.balanceQuantity
  1458. // }
  1459. // })
  1460. // // this.editCustomer()
  1461. // })
  1462. // }
  1463. // }
  1464. // })
  1465. ])
  1466. },
  1467. synchronous(row) {
  1468. this.form.orderItemsList.forEach(e => {
  1469. if (e.goodsName == this.selectionMultilist[0].goodsName) {
  1470. e.inventory = row.balanceQuantity
  1471. e.dot = row.dot
  1472. }
  1473. })
  1474. },
  1475. uploadAfter(res, done, loading, column) {
  1476. if (Array.isArray(res)) {
  1477. if (res instanceof Array) {
  1478. this.form.orderItemsList = this.form.orderItemsList.concat(res)
  1479. res.forEach(item => {
  1480. dotList({
  1481. storageId: this.form.storageId,
  1482. goodsId: res.goodsId
  1483. }).then(e => {
  1484. this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
  1485. })
  1486. })
  1487. }
  1488. } else {
  1489. this.$message.error(res)
  1490. }
  1491. this.excelBox = false;
  1492. loading = false;
  1493. done(res);
  1494. },
  1495. derivation() {
  1496. window.open(
  1497. `${this.templateUrl}?${this.website.tokenHeader
  1498. }=${getToken()}&stockId=${this.form.storageId}`
  1499. );
  1500. },
  1501. uploadBefore(file, done, loading) {
  1502. done();
  1503. loading = true;
  1504. },
  1505. // 销售明细 导入按钮
  1506. excelDialogfun(name) {
  1507. if (!this.form.customerId) {
  1508. this.$message.error('请选择客户')
  1509. return
  1510. }
  1511. if (name == '名称') {
  1512. this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
  1513. this.templateUrl = '/api/blade-sales-part/order/export-item-name'
  1514. } else if (name == 'code') {
  1515. this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code'
  1516. this.templateUrl = '/api/blade-sales-part/order/export-item-code'
  1517. }
  1518. this.excelBox = true
  1519. },
  1520. //生成退货单
  1521. getReturns() {
  1522. this.$confirm("您确定要退货吗?", {
  1523. confirmButtonText: "确定",
  1524. cancelButtonText: "取消",
  1525. type: "warning"
  1526. }).then(() => {
  1527. this.$router.push({
  1528. path: "/tirePartsMall/salesService/returns/index",
  1529. query: {
  1530. bsType: 'TKXS',
  1531. id: this.form.id,
  1532. }
  1533. });
  1534. })
  1535. },
  1536. // 客户监听
  1537. KHcorpChange(value) {
  1538. for (let item of this.customerData) {
  1539. if (item.cname == value) {
  1540. this.$set(this.form, 'customerId', item.id)
  1541. this.$set(this.form, 'customerName', item.cname)
  1542. if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
  1543. getCustom({ id: item.id }).then(res => {
  1544. if (res.data.data) {
  1545. this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
  1546. this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
  1547. this.form.contacts = res.data.data.corpsAttnList[0].cname
  1548. this.form.phone = res.data.data.corpsAttnList[0].tel
  1549. this.contactsOption = res.data.data.corpsAddrList
  1550. this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
  1551. this.form.salerId = res.data.data.salesmanId ? res.data.data.salesmanId : ''
  1552. }
  1553. })
  1554. }
  1555. }
  1556. }
  1557. },
  1558. KHClear() {
  1559. this.form.customerId = ''
  1560. this.form.customerName = ''
  1561. this.dicUrlWithCustomId = ''
  1562. this.form.storageId = ''
  1563. this.form.contacts = ''
  1564. this.form.phone = ''
  1565. this.contactsOption = ''
  1566. this.form.recAddress = ''
  1567. this.form.salerId = ''
  1568. this.KHgetListfun()
  1569. },
  1570. // 获取客户数据
  1571. KHgetListfun(cname) {
  1572. KHgetList({
  1573. current: 1,
  1574. size: 10,
  1575. corpType: 'KH',
  1576. cname: cname ? cname : null,
  1577. }).then(res => {
  1578. this.customerData = res.data.data.records
  1579. })
  1580. },
  1581. // 获取详细明细信息
  1582. getDetailsfun() {
  1583. getDetails({
  1584. id: this.detailData.id
  1585. }).then(res => {
  1586. this.form = res.data.data
  1587. this.form.orderItemsList = res.data.data.orderItemsList
  1588. console.log(this.isEditButton, 'bianj')
  1589. console.log(this.isDisabledTask, 'chexiao')
  1590. console.log(this.buttonColor, '123')
  1591. // if (this.form.status == '待发货') {
  1592. //
  1593. // }
  1594. })
  1595. },
  1596. // 获取左侧筛选
  1597. getAllWorkDicts() {
  1598. getCorpTypes({ whetherIntegral: '0' }).then(res => {
  1599. this.treeDataGoods = res.data.data;
  1600. });
  1601. },
  1602. //导入页左商品类型查询
  1603. nodeClick(data) {
  1604. this.treeDeptId = data.id;
  1605. this.page.currentPage = 1;
  1606. this.onLoadfun(this.page, { ...this.SelectSearch, goodsTypeId: this.treeDeptId });
  1607. },
  1608. closeGoods() {
  1609. this.treeDataGoods = [];
  1610. this.treeDeptId = "";
  1611. this.activeNameTabs = "searchList";
  1612. this.goodsType = 1
  1613. },
  1614. //刷新触发
  1615. refreshChange() {
  1616. this.page.currentPage = 1;
  1617. this.onLoadfun(this.page);
  1618. },
  1619. //选中触发
  1620. selectionChange(list) {
  1621. this.tableData = list
  1622. },
  1623. // 点击搜索触发
  1624. goodsSearch(params, done) {
  1625. this.page.currentPage = 1;
  1626. params = {
  1627. ...params,
  1628. artsVision: this.form.belongToCorpId,
  1629. }
  1630. // params.specificationAndModel = params.cname
  1631. // delete params.cname
  1632. this.onLoadfun(this.page, params);
  1633. done()
  1634. },
  1635. // 标签页切换
  1636. tabHandle(data) {
  1637. if (data.name == 'searchList') {
  1638. this.goodsListShow = this.data;
  1639. this.page.total = this.pageList.total
  1640. } else if (data.name == 'importStaging') {
  1641. this.goodsListShow = this.goodsListSave;
  1642. this.page.total = 0
  1643. }
  1644. },
  1645. // 商品信息价格计算
  1646. amountChange(value, row) {
  1647. if (value > 0) {
  1648. this.$refs.crud.toggleRowSelection(row, true);
  1649. } else {
  1650. this.$refs.crud.toggleRowSelection(row, false);
  1651. }
  1652. // 价格
  1653. // if (!row.price) {
  1654. // row.price = 0;
  1655. // }
  1656. },
  1657. importStagList(row, index, type) {
  1658. this.goodsListSave.push(row);
  1659. },
  1660. removeStagList(row, index, type) {
  1661. this.goodsListSave.splice(row.$index, 1)
  1662. },
  1663. //确认导入触发
  1664. async importGoods() {
  1665. this.surplusRouteQuantityOption.push({ storageQuantity: '0' });
  1666. if (this.goodsListSave.length > 0) {
  1667. this.goodsListSaveHandle()
  1668. } else {
  1669. if (this.tableData.length > 0) {
  1670. this.tableDataHandle()
  1671. }
  1672. }
  1673. },
  1674. // 导入按钮事件
  1675. tableDataHandle() {
  1676. // 循环获取库存数量
  1677. for (let item of this.tableData) {
  1678. let page = {}
  1679. if (this.form.storageId) {
  1680. page.storageId = this.form.storageId
  1681. }
  1682. page.goodsId = item.goodsId
  1683. let obj = {
  1684. goodsId: item.id,
  1685. price: item.price,
  1686. goodsName: item.cname,
  1687. goodsNum: item.goodsNum,
  1688. brandName: item.brandName,
  1689. brandId: item.brandId,
  1690. goodsNo: item.code,
  1691. propertyName: item.specificationAndModel,
  1692. inventory: item.inventory,
  1693. pattern: item.brandItem,
  1694. goodsDescription: item.goodsDescription,
  1695. dot: item.dot,
  1696. // poNo: item.poNo,
  1697. whether: item.whether,
  1698. units: item.unit,
  1699. // 小计
  1700. subTotalMoney: Number(item.goodsNum * item.price) ? Number(item.goodsNum * item.price).toFixed(2) : 0,
  1701. // 备注
  1702. remarks: item.remarks,
  1703. // 批次号的状态
  1704. dotedittype: false,
  1705. // 价格数量
  1706. goodsNumtype: false,
  1707. // 价格
  1708. pricetype: false,
  1709. }
  1710. if (item.goodsFilesList && item.goodsFilesList.length) {
  1711. for (let ite of item.goodsFilesList) {
  1712. if (ite.version == '0') {
  1713. obj.url = ite.url
  1714. }
  1715. }
  1716. }
  1717. this.form.orderItemsList.push(obj)
  1718. }
  1719. this.dialogVisible = false
  1720. },
  1721. // 导入
  1722. goodsListSaveHandle() {
  1723. this.tableData = this.goodsListSave
  1724. this.tableDataHandle()
  1725. },
  1726. // 获取添加商品弹窗里的数据
  1727. goodsPageXsfun() {
  1728. goodsPageXs({
  1729. customId: this.form.customerId,
  1730. stock: this.form.storageId,
  1731. enableOrNot: 1,
  1732. whetherIntegral: '0'
  1733. }).then(res => {
  1734. const data = res.data.data;
  1735. this.goodsListShow = data.records;
  1736. })
  1737. },
  1738. //导入商品弹窗列表查询
  1739. onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
  1740. this.goodsListShow = []
  1741. this.loading = true;
  1742. if (this.goodsType == 1) {
  1743. goodsPageXs({
  1744. current: page.currentPage,
  1745. size: page.pageSize,
  1746. customId: this.form.customerId,
  1747. stock: this.form.storageId,
  1748. enableOrNot: 1,
  1749. goodsTypeId: this.treeDeptId,
  1750. ...Object.assign(params, this.SelectSearch),
  1751. whetherIntegral: '0'
  1752. }).then(res => {
  1753. const data = res.data.data;
  1754. this.page.total = data.total;
  1755. this.pageList.total = data.total
  1756. this.data = data.records;
  1757. this.goodsListShow = data.records;
  1758. for (let item of this.goodsListShow) {
  1759. item.goodsNum = item.goodsNum ? item.goodsNum : 0
  1760. }
  1761. this.loading = false;
  1762. })
  1763. }
  1764. if (this.goodsType == 2) {
  1765. getGoodAllList({
  1766. current: page.currentPage,
  1767. size: page.pageSize,
  1768. customId: this.form.customerId,
  1769. stock: this.form.storageId,
  1770. enableOrNot: 1,
  1771. goodsTypeId: this.treeDeptId,
  1772. ...Object.assign(params, this.SelectSearch),
  1773. whetherIntegral: '0'
  1774. }).then(res => {
  1775. res.data.data.records.forEach(item => {
  1776. item.goodsNum = item.goodsNum ? item.goodsNum : 0
  1777. item.inventory = item.inventory ? item.inventory : 0
  1778. })
  1779. const data = res.data.data;
  1780. this.page.total = data.total;
  1781. this.pageList.total = data.total
  1782. this.data = data.records;
  1783. this.goodsListShow = data.records;
  1784. this.loading = false;
  1785. })
  1786. }
  1787. },
  1788. // 采购明细行编辑
  1789. hangeditBtn(row, index) {
  1790. // 获取是否管理批次号
  1791. getDetailsGods({ id: row.goodsId }).then(res => {
  1792. row.whether = res.data.data.whether
  1793. this.picihaolistfun(row.id)
  1794. row.dotedittype = true
  1795. // 价格数量
  1796. row.goodsNumtype = true
  1797. row.pricetype = true
  1798. // 编辑和保存状态切换
  1799. this.mingxibaocun = false
  1800. this.goodsPageXsfun()
  1801. })
  1802. },
  1803. // 保存按钮
  1804. hangbaocun(row) {
  1805. row.dotedittype = false
  1806. row.goodsNumtype = false
  1807. row.pricetype = false
  1808. this.mingxibaocun = true
  1809. },
  1810. // 批次号获取数据
  1811. picihaolistfun(goodsId) {
  1812. dotList({
  1813. storageId: this.form.storageId,
  1814. goodsId: goodsId
  1815. }).then(res => {
  1816. this.picihaolist = res.data.data
  1817. })
  1818. },
  1819. // 批次号切换库存
  1820. dotchangefun(value, row) {
  1821. for (let item of this.picihaolist) {
  1822. if (item.dot == value) {
  1823. this.$set(row, 'inventory', item.balanceQuantity)
  1824. this.$set(row, 'rebatePrice', item.rebatePrice)
  1825. }
  1826. }
  1827. },
  1828. // 数量失焦触发
  1829. goodsNumblurfun(row) {
  1830. if (Number(row.goodsNum) > Number(row.inventory)) {
  1831. this.$message.warning("不能大于库存数量");
  1832. return
  1833. }
  1834. },
  1835. editBtn(row, index) {
  1836. this.confirmEditing()
  1837. this.$refs.formContacts.rowEdit(row, index);
  1838. dotList({
  1839. storageId: this.form.storageId,
  1840. goodsId: this.formContacts.goodsId
  1841. }).then(res => {
  1842. this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
  1843. })
  1844. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
  1845. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  1846. })
  1847. },
  1848. //表头编辑
  1849. confirmEditing() {
  1850. this.editButton = false
  1851. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
  1852. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  1853. })
  1854. if (this.form.status == '已发货') {
  1855. this.viewDisabled = false
  1856. return
  1857. }
  1858. /* if (this.form.status == '退款中') {
  1859. this.viewDisabled = false
  1860. this.isRevocationRequest = true
  1861. return
  1862. }*/
  1863. this.isAddBtn = false
  1864. if (this.form.status == '已取消' || this.form.status == '已退款' || this.form.status == '已发货') {
  1865. return
  1866. // this.$message.error('当前状态不允许编辑')
  1867. // this.optionForm.column.forEach(item=>{
  1868. // if(item.prop= 'contacts'){
  1869. // item.disabled = true
  1870. // }
  1871. // })
  1872. }
  1873. if (this.form.status == '退款请核') {
  1874. this.viewDisabled = false
  1875. this.isAddBtn = true
  1876. return
  1877. }
  1878. if (this.form.status == '已取消' || this.form.status == '退款请核') {
  1879. this.isAddBtn = true
  1880. // this.$message.error('当前状态不允许编辑')
  1881. // this.optionForm.column.forEach(item=>{
  1882. // if(item.prop= 'contacts'){
  1883. // item.disabled = true
  1884. // }
  1885. // })
  1886. }
  1887. if (this.form.status == '待发货') {
  1888. this.isAddBtn = true
  1889. }
  1890. this.optionContactsBack.column.forEach(its => {
  1891. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  1892. its.disabled = false
  1893. } else {
  1894. its.disabled = true
  1895. }
  1896. })
  1897. this.$set(this.optionForm, 'disabled', false)
  1898. this.$set(this.optionContactsBack, 'disabled', false)
  1899. if (this.form.generateTask == '已生成') {
  1900. this.optionForm.disabled = true
  1901. }
  1902. this.isDisabled = false
  1903. this.isAdd = false
  1904. if (this.form.businessSource == "外部销售") {
  1905. this.optionForm.column.forEach(its => {
  1906. if (its.prop == 'contacts' || its.prop == 'phone' || its.prop == 'recAddress') {
  1907. this.$set(its, 'disabled', true)
  1908. }
  1909. })
  1910. if (this.form.status == '待发货') {
  1911. this.isSaveBtn = false;
  1912. this.isDisabledTask = false;
  1913. this.viewDisabled = false;
  1914. }
  1915. if (this.form.status == '待确认') {
  1916. const loadings = this.$loading({
  1917. lock: true,
  1918. text: '加载中',
  1919. spinner: 'el-icon-loading',
  1920. background: 'rgba(255,255,255,0.7)'
  1921. });
  1922. console.log('外部销售待确认');
  1923. this.isSaveBtn = false;
  1924. this.isDisabledTask = false;
  1925. this.viewDisabled = false;
  1926. this.optionForm.column.forEach(its => {
  1927. if (its.prop == 'customerName') {
  1928. this.$set(its, 'disabled', true)
  1929. }
  1930. if (its.prop == 'storageId') {
  1931. this.$set(its, 'disabled', false)
  1932. }
  1933. })
  1934. //外部销售都能申请退款
  1935. this.isApplySettlement = false
  1936. //不能录入不能删除
  1937. this.isDisabled = true
  1938. this.isAdd = false
  1939. this.isAddBtn = true
  1940. this.$set(this.form, 'shipType', '物流')
  1941. this.$set(this.form, 'receivableType', '网络支付')
  1942. this.optionContactsBack.column.forEach(item => {
  1943. this.$set(item, 'disabled', true)
  1944. if (item.label == '批次号' || item.label == '备注') {
  1945. item.disabled = false
  1946. }
  1947. })
  1948. loadings.close()
  1949. } else {
  1950. const loadin = this.$loading({
  1951. lock: true,
  1952. text: '加载中',
  1953. spinner: 'el-icon-loading',
  1954. background: 'rgba(255,255,255,0.7)'
  1955. });
  1956. this.isAddBtn = true
  1957. this.isDisabled = true
  1958. this.isSaveBtn = false;
  1959. this.isDisabledTask = false;
  1960. this.viewDisabled = false;
  1961. this.optionForm.column.forEach(its => {
  1962. if (its.prop != 'remarks') {
  1963. its.disabled = true
  1964. } else {
  1965. its.disabled = false
  1966. }
  1967. })
  1968. this.optionContactsBack.column.forEach(its => {
  1969. if (its.prop != 'remarks') {
  1970. its.disabled = true
  1971. } else {
  1972. its.disabled = false
  1973. }
  1974. })
  1975. loadin.close()
  1976. }
  1977. } else {
  1978. const loading = this.$loading({
  1979. lock: true,
  1980. text: '加载中',
  1981. spinner: 'el-icon-loading',
  1982. background: 'rgba(255,255,255,0.7)'
  1983. });
  1984. if (this.form.status == '待发货' || this.form.status == '已发货' || this.form.status == '已取消') {
  1985. const loading = this.$loading({
  1986. lock: true,
  1987. text: '加载中',
  1988. spinner: 'el-icon-loading',
  1989. background: 'rgba(255,255,255,0.7)'
  1990. });
  1991. this.optionForm.column.forEach(its => {
  1992. if (its.prop != 'remarks') {
  1993. its.disabled = true
  1994. } else {
  1995. its.disabled = false
  1996. }
  1997. })
  1998. this.optionContactsBack.column.forEach(its => {
  1999. if (its.prop != 'remarks') {
  2000. its.disabled = true
  2001. } else {
  2002. its.disabled = false
  2003. }
  2004. })
  2005. loading.close()
  2006. } else if (this.form.status == '录入') {
  2007. this.isSaveBtn = false;
  2008. this.isDisabledTask = false;
  2009. this.viewDisabled = false;
  2010. // this.$set(this.optionForm, 'disabled', false)
  2011. // this.$set(this.optionContactsBack, 'disabled', false)
  2012. this.$set(this.optionForm, 'disabled', false)
  2013. this.$set(this.optionContactsBack, 'disabled', false)
  2014. this.isContacts = true
  2015. //删除按钮
  2016. this.isDisabled = false
  2017. // this.optionForm.column.forEach(item => {
  2018. // item.disabled = false
  2019. // })
  2020. loading.close()
  2021. } else if (this.form.status == '待确认') {
  2022. this.isSaveBtn = false;
  2023. this.isDisabledTask = false;
  2024. this.viewDisabled = false;
  2025. // this.isDisabled = true
  2026. console.log('待确认');
  2027. this.optionForm.column.forEach(item => {
  2028. if (item.label === '成本' || item.label === '毛利' || item.label === '销售金额' || item.label === '运费' || item.label === '总金额' || item.label === '已收金额' || item.label === '单据编号' || item.label === '来源编号') {
  2029. this.$set(item, 'disabled', true)
  2030. } else {
  2031. this.$set(item, 'disabled', false)
  2032. }
  2033. })
  2034. this.isContacts = false
  2035. this.optionContactsBack.column.forEach(its => {
  2036. if (its.prop == 'remarks' || its.prop == 'dot') {
  2037. this.$set(its, 'disabled', false)
  2038. } else {
  2039. this.$set(its, 'disabled', true)
  2040. }
  2041. })
  2042. loading.close()
  2043. }
  2044. if (this.form.status == '待发货') {
  2045. this.isSaveBtn = false;
  2046. this.isDisabledTask = false;
  2047. this.viewDisabled = false;
  2048. this.isDisabled = true
  2049. this.isAdd = true
  2050. }
  2051. // this.$set(this.form, 'shipType', '物流')
  2052. // this.$set(this.form, 'receivableType', '现金')
  2053. // this.optionContactsBack.column.forEach(item => {
  2054. // this.$set(item, 'disabled', false)
  2055. // })
  2056. // this.optionContactsBack.column.forEach(item => {
  2057. // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
  2058. // item.disabled = true;
  2059. // }
  2060. // })
  2061. // this['optionContacts'] = this['optionContactsBack'];
  2062. // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
  2063. // this.form.outboundRecordsList.forEach(item=>{
  2064. // if(item.statusName == '待出库'){
  2065. // this.isDisabledTask = true
  2066. // }
  2067. // })
  2068. loading.close()
  2069. }
  2070. // this.$set(this.form.orderItemsList,'goodsNum',66)
  2071. },
  2072. generateOutbound() {
  2073. if (!this.form.id) {
  2074. this.$message.error('请先保存')
  2075. } else {
  2076. if (this.buttonText === '生成任务') {
  2077. //生成任务逻辑
  2078. if (this.form.orderItemsList.length <= 0) {
  2079. this.$message.error('请录入明细');
  2080. } else {
  2081. this.$refs["form"].validate((valid, done) => {
  2082. done();
  2083. if (valid) {
  2084. const loading = this.$loading({
  2085. lock: true,
  2086. text: '加载中',
  2087. spinner: 'el-icon-loading',
  2088. background: 'rgba(255,255,255,0.7)'
  2089. });
  2090. getParamservice(1, 10, { paramKey: 'whether.financing' }).then(res => {
  2091. if (res.data.data.records.length) {
  2092. res.data.data.records.forEach(e => {
  2093. if (e.paramValue == 1) {
  2094. if (!this.form.storageId) return this.$message.error('请选择仓库')
  2095. whetherExistenceFinancing({
  2096. bsType: "XS",
  2097. ...this.form
  2098. }).then(res => {
  2099. if (res.data.data == true) {
  2100. submit({
  2101. bsType: "XS",
  2102. ...this.form
  2103. }).then(res => {
  2104. // this.refresh(res.data.data.id)
  2105. this.isDisabledTask = false
  2106. const loading = this.$loading({
  2107. lock: true,
  2108. text: '加载中',
  2109. spinner: 'el-icon-loading',
  2110. background: 'rgba(255,255,255,0.7)'
  2111. });
  2112. generateShipTask(this.form).then(res => {
  2113. this.$set(this.optionForm, 'disabled', true)
  2114. this.$set(this.optionContactsBack, 'disabled', true)
  2115. this.$message.success("生成出库任务成功");
  2116. // 将按钮文本更改为"撤销任务"
  2117. this.buttonText = '撤销任务';
  2118. // 将按钮颜色更改为对应的颜色
  2119. this.buttonColor = 'warning'; // 比如改为warning
  2120. this.refresh(res.data.data.id)
  2121. this.refreshs(res.data.data.id, true)
  2122. this.isContacts = true
  2123. this.isApplySettlement = false
  2124. this.isAdd = true
  2125. this.isDisabled = true
  2126. this.isAddBtn = true
  2127. this.isDisabledTask = true
  2128. this.editButton = true // 把编辑按钮显示出来
  2129. }).finally(() => {
  2130. loading.close();
  2131. })
  2132. }).catch(() => {
  2133. loading.close();
  2134. })
  2135. } else {
  2136. this.$confirm(res.data.data, '提示', {
  2137. confirmButtonText: '确定',
  2138. cancelButtonText: '取消',
  2139. type: 'warning'
  2140. }).then(() => {
  2141. checkOrderRW({
  2142. bsType: "XS",
  2143. ...this.form,
  2144. url: '/tirePartsMall/salesManagement/saleOrder/index',
  2145. pageStatus: "this.$store.getters.ltxsStatus",
  2146. pageLabel: "销售订单(L)",
  2147. }).then(res => {
  2148. this.$set(this.optionForm, 'disabled', true)
  2149. this.$set(this.optionContactsBack, 'disabled', true)
  2150. this.$message.success("提交成功");
  2151. // 将按钮文本更改为"撤销任务"
  2152. this.buttonText = '撤销任务';
  2153. // 将按钮颜色更改为对应的颜色
  2154. this.buttonColor = 'warning'; // 比如改为warning
  2155. this.refresh(res.data.data.id)
  2156. this.refreshs(res.data.data.id, true)
  2157. this.isContacts = true
  2158. this.isApplySettlement = false
  2159. this.isAdd = true
  2160. this.isDisabled = true
  2161. this.isAddBtn = true
  2162. this.isDisabledTask = true
  2163. this.editButton = true
  2164. }).finally(() => {
  2165. loading.close();
  2166. })
  2167. }).catch(() => {
  2168. loading.close();
  2169. })
  2170. }
  2171. }).catch(() => {
  2172. loading.close();
  2173. })
  2174. } else {
  2175. submit({
  2176. bsType: "XS",
  2177. ...this.form
  2178. }).then(res => {
  2179. // this.refresh(res.data.data.id)
  2180. this.isDisabledTask = false
  2181. const loading = this.$loading({
  2182. lock: true,
  2183. text: '加载中',
  2184. spinner: 'el-icon-loading',
  2185. background: 'rgba(255,255,255,0.7)'
  2186. });
  2187. generateShipTask(this.form).then(res => {
  2188. this.$set(this.optionForm, 'disabled', true)
  2189. this.$set(this.optionContactsBack, 'disabled', true)
  2190. this.$message.success("生成出库任务成功");
  2191. // 将按钮文本更改为"撤销任务"
  2192. this.buttonText = '撤销任务';
  2193. // 将按钮颜色更改为对应的颜色
  2194. this.buttonColor = 'warning'; // 比如改为warning
  2195. this.refresh(res.data.data.id)
  2196. this.refreshs(res.data.data.id, true)
  2197. this.isContacts = true
  2198. this.isApplySettlement = false
  2199. this.isAdd = true
  2200. this.isDisabled = true
  2201. this.isAddBtn = true
  2202. this.isDisabledTask = true
  2203. this.editButton = true // 把编辑按钮显示出来
  2204. }).finally(() => {
  2205. loading.close();
  2206. })
  2207. }).catch(() => {
  2208. loading.close();
  2209. })
  2210. }
  2211. })
  2212. }
  2213. if (res.data.data.records.length == 0) {
  2214. const loading = this.$loading({
  2215. lock: true,
  2216. text: '加载中',
  2217. spinner: 'el-icon-loading',
  2218. background: 'rgba(255,255,255,0.7)'
  2219. });
  2220. submit({
  2221. bsType: "XS",
  2222. ...this.form
  2223. }).then(res => {
  2224. // this.refresh(res.data.data.id)
  2225. this.isDisabledTask = false
  2226. generateShipTask(this.form).then(res => {
  2227. this.$set(this.optionForm, 'disabled', true)
  2228. this.$set(this.optionContactsBack, 'disabled', true)
  2229. this.$message.success("生成出库任务成功");
  2230. // 将按钮文本更改为"撤销任务"
  2231. this.buttonText = '撤销任务';
  2232. // 将按钮颜色更改为对应的颜色
  2233. this.buttonColor = 'warning'; // 比如改为warning
  2234. this.refresh(res.data.data.id)
  2235. this.refreshs(res.data.data.id, true)
  2236. this.isContacts = true
  2237. this.isApplySettlement = false
  2238. this.isAdd = true
  2239. this.isDisabled = true
  2240. this.isAddBtn = true
  2241. this.isDisabledTask = true
  2242. this.editButton = true // 把编辑按钮显示出来
  2243. }).finally(() => {
  2244. loading.close();
  2245. })
  2246. }).catch(() => {
  2247. loading.close();
  2248. })
  2249. }
  2250. })
  2251. done();
  2252. } else {
  2253. this.$message.error('请选择仓库')
  2254. this.$set(this.optionForm, 'disabled', false)
  2255. this.$set(this.optionContactsBack, 'disabled', false)
  2256. }
  2257. })
  2258. }
  2259. } else {
  2260. this.$refs["form"].validate((valid, done) => {
  2261. if (valid) {
  2262. const loading = this.$loading({
  2263. lock: true,
  2264. text: '加载中',
  2265. spinner: 'el-icon-loading',
  2266. background: 'rgba(255,255,255,0.7)'
  2267. });
  2268. // this.form.orderItemsList.forEach((items) => {
  2269. // let brandName = items.brandId
  2270. // items.brandId = items.brandName
  2271. // items.brandName = brandName
  2272. // let goodsName = items.goodsId
  2273. // items.goodsId = items.goodsName
  2274. // items.goodsName = goodsName
  2275. // })
  2276. revokeGenerateShipTask(this.form).then(res => {
  2277. // 将按钮文本更改为"生成任务"
  2278. this.buttonText = '生成任务';
  2279. // 将按钮颜色还原为success
  2280. this.buttonColor = 'success';
  2281. this.$message.success("撤销出库成功");
  2282. this.refresh(res.data.data.id)
  2283. this.isApplySettlement = false
  2284. this.isContacts = true
  2285. this.isDisabled = true
  2286. this.isDisabledTask = false
  2287. this.$set(this.optionForm, 'disabled', false) // form 表单的禁用放开
  2288. this.$set(this.optionContactsBack, 'disabled', false) // table 表格的禁用放开
  2289. this.editButton = true // 把编辑按钮显示出来
  2290. //添加删除按钮禁用
  2291. this.isAdd = true
  2292. if (this.form.businessSource == "外部销售") {
  2293. }
  2294. loading.close();
  2295. }).catch((err) => {
  2296. if (err instanceof TooManyResultsException) {
  2297. // 不显示错误消息
  2298. return;
  2299. }
  2300. // 显示其他错误消息
  2301. this.$message.error('发生错误,请稍后重试');
  2302. }).finally(() => {
  2303. loading.close();
  2304. });
  2305. done();
  2306. }
  2307. })
  2308. }
  2309. }
  2310. },
  2311. revokeTask() {
  2312. this.$confirm('是否撤销出库任务审批?', '提示', {
  2313. confirmButtonText: '确定',
  2314. cancelButtonText: '取消',
  2315. type: 'warning'
  2316. }).then(() => {
  2317. revokeCheckOrderRW(this.form).then(res => {
  2318. this.buttonText = '生成任务';
  2319. // 将按钮颜色还原为success
  2320. this.buttonColor = 'success';
  2321. this.$message.success("撤销出库成功");
  2322. this.refresh(res.data.data.id)
  2323. this.isApplySettlement = false
  2324. this.isContacts = true
  2325. this.isDisabled = true
  2326. this.isDisabledTask = false
  2327. this.$set(this.optionForm, 'disabled', false) // form 表单的禁用放开
  2328. this.$set(this.optionContactsBack, 'disabled', false) // table 表格的禁用放开
  2329. // this.editButton = true // 把编辑按钮显示出来
  2330. //添加删除按钮禁用
  2331. this.isAdd = true
  2332. })
  2333. })
  2334. },
  2335. //联系人change
  2336. contactsChange(e) {
  2337. // 假设this.contactsOption是你的数组对象
  2338. let matchedContact = this.contactsOption.find(item => item.contacts == e);
  2339. // 判断是否找到匹配的对象
  2340. this.$set(this.form, 'phone', matchedContact.tel)
  2341. this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
  2342. },
  2343. //修改提交触发
  2344. editCustomer() {
  2345. this.$refs["form"].validate((valid, done) => {
  2346. done();
  2347. let picihao = false
  2348. if (valid) {
  2349. if (this.form.orderItemsList.length == 0) {
  2350. this.$message.warning("请添加商品");
  2351. return
  2352. }
  2353. for (let i in this.form.orderItemsList) {
  2354. this.form.orderItemsList[i].subTotalMoney = Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price) ? Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price).toFixed(2) : 0
  2355. if (this.form.orderItemsList[i].pid) {
  2356. } else {
  2357. // if (this.form.orderItemsList[i].whether == '1') {
  2358. // if (this.form.orderItemsList[i].dot) { } else {
  2359. // this.$message.warning(`销售明细序号${Number(i) + 1}的批次号不能为空`);
  2360. // picihao = true
  2361. // break;
  2362. // }
  2363. // } else {
  2364. // }
  2365. }
  2366. if (this.form.orderItemsList[i].goodsNum <= 0) {
  2367. return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
  2368. picihao = true
  2369. }
  2370. }
  2371. this.mingxibaocun = true
  2372. if (picihao) {
  2373. return
  2374. }
  2375. const loading = this.$loading({
  2376. lock: true,
  2377. text: '加载中',
  2378. spinner: 'el-icon-loading',
  2379. background: 'rgba(255,255,255,0.7)'
  2380. });
  2381. // this.form.orderItemsList.forEach(its => {
  2382. // console.log(its.goodsId);
  2383. // console.log(its.goodsName);
  2384. // its.brandId = its.brandName
  2385. // let goodsName = its.goodsId
  2386. // its.goodsId = its.goodsName
  2387. // its.goodsName = goodsName
  2388. // })
  2389. for (let courierCompanies of this.courierCompaniesList) {
  2390. if (courierCompanies.dictValue === this.form.logisticsCorpName) {
  2391. this.form.logisticsCorpId = courierCompanies.dictKey
  2392. break
  2393. }
  2394. }
  2395. this.form.salerName = this.form.$salerId ? this.form.$salerId : ''
  2396. this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
  2397. submit({
  2398. bsType: "XS",
  2399. ...this.form
  2400. }).then(res => {
  2401. this.$message.success("保存成功");
  2402. this.refresh(res.data.data.id)
  2403. this.isDisabledTask = false
  2404. // this.editButton = true
  2405. this.$set(this.optionContactsBack, 'disabled', true)
  2406. loading.close();
  2407. }).finally(() => {
  2408. loading.close();
  2409. });
  2410. } else {
  2411. return false;
  2412. }
  2413. });
  2414. },
  2415. //保存
  2416. save() {
  2417. this.$refs["form"].validate((valid, done) => {
  2418. done();
  2419. if (valid) {
  2420. const loading = this.$loading({
  2421. lock: true,
  2422. text: '加载中',
  2423. spinner: 'el-icon-loading',
  2424. background: 'rgba(255,255,255,0.7)'
  2425. });
  2426. submit({
  2427. bsType: "XS",
  2428. ...this.form
  2429. }).then(res => {
  2430. console.log(1);
  2431. this.refresh(res.data.data.id)
  2432. this.isDisabledTask = false
  2433. loading.close();
  2434. }).finally(() => {
  2435. loading.close();
  2436. });
  2437. } else {
  2438. return false;
  2439. }
  2440. });
  2441. },
  2442. //关闭弹窗表单
  2443. beforeClose(done, type) {
  2444. console.log(type);
  2445. // if(row == "add"){
  2446. // this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
  2447. // this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
  2448. // }
  2449. console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
  2450. console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
  2451. done()
  2452. },
  2453. refresh(id, type) {
  2454. const loading = this.$loading({
  2455. lock: true,
  2456. text: '加载中',
  2457. spinner: 'el-icon-loading',
  2458. background: 'rgba(255,255,255,0.7)'
  2459. })
  2460. getDetails({ id: id }).then(res => {
  2461. this.form = res.data.data
  2462. let ordForm = { srcBillNo: this.form.ordNo }
  2463. let _this = this
  2464. this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
  2465. this.$nextTick(() => {
  2466. this.$refs.formContacts.doLayout()
  2467. })
  2468. // getList(1, 50, ordForm).then((res) => {
  2469. // this.dataList = res.data.data.records ? res.data.data.records : [];
  2470. // this.$nextTick(() => {
  2471. // this.$refs.formContacts.doLayout()
  2472. // })
  2473. // })
  2474. // if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
  2475. if (this.form.status !== '录入' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
  2476. console.log(1);
  2477. this.isApplySettlement = false;
  2478. }
  2479. if (
  2480. this.form.status === '已退款' ||
  2481. this.form.status === '已收货' ||
  2482. this.form.status === '已发货' ||
  2483. this.form.status === '已取消'
  2484. ) {
  2485. // 禁用编辑按钮
  2486. console.log('按钮全部禁用');
  2487. this.isEditButton = true;
  2488. this.isSaveBtn = true;
  2489. this.isDisabledTask = true;
  2490. this.viewDisabled = true;
  2491. }
  2492. if (this.form.status === '已发货') {
  2493. this.isDisabledTask = true;
  2494. this.viewDisabled = true;
  2495. this.isEditButton = false;
  2496. }
  2497. // else {
  2498. // this.isSaveBtn = true;
  2499. // this.isDisabledTask = true;
  2500. // this.viewDisabled = true;
  2501. // }
  2502. /*if (this.form.status == '退款中') {
  2503. this.isConfirmRefundBtn = false;
  2504. }*/
  2505. if (this.form.status == '已取消') {
  2506. this.isConfirmRefundBtn = true;
  2507. }
  2508. if (this.form.generateTask == '已生成') {
  2509. this.buttonText = '撤销任务';
  2510. // this.isDisabledTask = false;
  2511. this.buttonColor = 'warning'
  2512. this.optionForm.disabled = true
  2513. this.$set(this.optionForm, 'disabled', true)
  2514. }
  2515. if (this.form.status == '退款请核') {
  2516. this.isRevocationRequest = false;
  2517. }
  2518. if (this.form.status == '待发货') {
  2519. this.isApplySettlement = false
  2520. this.isDisabled = true
  2521. }
  2522. //成本、毛利对业务员隐藏
  2523. this.optionForm.column.forEach(its => {
  2524. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  2525. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  2526. this.$set(its, 'display', false)
  2527. }
  2528. } else {
  2529. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  2530. this.$set(its, 'display', true)
  2531. }
  2532. }
  2533. })
  2534. // 明细信息成本、毛利对业务员隐藏
  2535. this.optionContacts.column.forEach(its => {
  2536. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  2537. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  2538. this.$set(its, 'hide', true)
  2539. }
  2540. } else {
  2541. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  2542. this.$set(its, 'hide', false)
  2543. }
  2544. }
  2545. })
  2546. this.form.orderItemsList.forEach((items) => {
  2547. if (!items.subTotalMoney) {
  2548. items.subTotalMoney = Number(items.goodsNum * items.price) ? Number(items.goodsNum * items.price).toFixed(2) : 0
  2549. items.grossProfit = items.subTotalMoney - items.costprie
  2550. }
  2551. // let brandName = items.brandId
  2552. // items.brandId = items.brandName
  2553. // items.brandName = brandName
  2554. // let goodsName = items.goodsId
  2555. // items.goodsId = items.goodsName
  2556. // items.goodsName = goodsName
  2557. })
  2558. loading.close();
  2559. // if (this.form.businessSource == "外部销售") {
  2560. // console.log('外部销售');
  2561. // this.optionForm.column.forEach(its => {
  2562. // if (its.prop == 'customerId') {
  2563. // this.$set(its, 'disabled', true)
  2564. // }
  2565. // })
  2566. // //不能录入不能删除
  2567. // this.$set(this.optionContactsBack, "addBtn", false)
  2568. // this.isDisabled = true
  2569. // this.$set(this.form, 'shipType', '物流')
  2570. // this.$set(this.form, 'receivableType', '网络支付')
  2571. // this.optionContactsBack.column.forEach(item => {
  2572. // this.$set(item, 'disabled', true)
  2573. // if (item.label == '批次号' || item.label == '备注') {
  2574. // item.disabled = false
  2575. // }
  2576. // })
  2577. // this['optionContacts'] = this['optionContactsBack'];
  2578. // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
  2579. // this.optionContactsBack.column.forEach(item => {
  2580. // if (item.prop == 'dot') {
  2581. // this.$set(item, disabled, false)
  2582. // } else {
  2583. // this.$set(item, disabled, true)
  2584. // }
  2585. // })
  2586. // } else {
  2587. // this.$set(this.form, 'shipType', '物流')
  2588. // this.$set(this.form, 'receivableType', '现金')
  2589. // this.optionContactsBack.column.forEach(item => {
  2590. // this.$set(item, 'disabled', false)
  2591. // })
  2592. // this.optionContactsBack.column.forEach(item => {
  2593. // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
  2594. // item.disabled = true;
  2595. // }
  2596. // })
  2597. // console.log(324324);
  2598. // this['optionContacts'] = this['optionContactsBack'];
  2599. // this.delColumnData(this.getColumnName(269.6), this['optionContactsBack']);
  2600. // }
  2601. // // this.$set(this.form.orderItemsList,'goodsNum',66)
  2602. }).catch(() => {
  2603. loading.close();
  2604. })
  2605. },
  2606. refreshs(id, type) {
  2607. const loading = this.$loading({
  2608. lock: true,
  2609. text: '加载中',
  2610. spinner: 'el-icon-loading',
  2611. background: 'rgba(255,255,255,0.7)'
  2612. });
  2613. getDetails({ id: id }).then(res => {
  2614. this.form = res.data.data
  2615. let ordForm = { srcBillNo: this.form.ordNo }
  2616. let _this = this
  2617. this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
  2618. // if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
  2619. if (this.form.status !== '录入' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款' && this.form.status !== '待确认' && this.form.status !== '待发货') {
  2620. console.log(1);
  2621. this.isApplySettlement = false;
  2622. }
  2623. if (
  2624. this.form.status === '已退款' ||
  2625. this.form.status === '已收货' ||
  2626. this.form.status === '已发货' ||
  2627. this.form.status === '已取消'
  2628. ) {
  2629. // 禁用编辑按钮
  2630. console.log('按钮全部禁用');
  2631. this.isEditButton = true;
  2632. this.isSaveBtn = true;
  2633. this.isDisabledTask = true;
  2634. this.viewDisabled = true;
  2635. }
  2636. if (this.form.status === '已发货') {
  2637. this.isDisabledTask = true;
  2638. this.viewDisabled = true;
  2639. this.isEditButton = false;
  2640. }
  2641. /* if (this.form.status == '退款中') {
  2642. this.isConfirmRefundBtn = false;
  2643. }*/
  2644. if (this.form.status == '已取消') {
  2645. this.isConfirmRefundBtn = true;
  2646. }
  2647. if (this.form.generateTask == '已生成') {
  2648. this.buttonText = '撤销任务';
  2649. // this.isDisabledTask = false;
  2650. this.buttonColor = 'warning'
  2651. this.optionForm.disabled = true
  2652. this.$set(this.optionForm, 'disabled', true)
  2653. }
  2654. if (this.form.status == '退款请核') {
  2655. this.isRevocationRequest = false;
  2656. }
  2657. if (this.form.status == '待发货') {
  2658. this.isApplySettlement = false
  2659. }
  2660. //成本、毛利对业务员隐藏
  2661. this.optionForm.column.forEach(its => {
  2662. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  2663. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  2664. this.$set(its, 'display', false)
  2665. }
  2666. } else {
  2667. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  2668. this.$set(its, 'display', true)
  2669. }
  2670. }
  2671. })
  2672. // 明细信息成本、毛利对业务员隐藏
  2673. this.optionContacts.column.forEach(its => {
  2674. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('业务员')) {
  2675. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  2676. this.$set(its, 'hide', true)
  2677. }
  2678. } else {
  2679. if (its.prop == 'costprie' || its.prop == 'grossProfit') {
  2680. this.$set(its, 'hide', false)
  2681. }
  2682. }
  2683. })
  2684. this.form.orderItemsList.forEach((items) => {
  2685. if (!items.subTotalMoney) {
  2686. items.subTotalMoney = Number(items.goodsNum * items.price) ? Number(items.goodsNum * items.price).toFixed(2) : 0
  2687. items.grossProfit = items.subTotalMoney - items.costprie
  2688. }
  2689. })
  2690. }).finally(() => {
  2691. loading.close();
  2692. });
  2693. },
  2694. //请核关闭
  2695. choceScheduleFun() {
  2696. this.checkScheduleDialog = false
  2697. },
  2698. //关闭审核
  2699. choceCheckFun() {
  2700. this.isExamineBtn = !this.isExamineBtn
  2701. this.checkDialog = false;
  2702. },
  2703. //申请退款
  2704. applySettlement(type) {
  2705. this.$confirm("您确定申请退款吗?", {
  2706. confirmButtonText: "确定",
  2707. cancelButtonText: "取消",
  2708. type: "warning"
  2709. }).then(() => {
  2710. this.$refs["form"].validate((valid, done) => {
  2711. done()
  2712. if (valid) {
  2713. const data = {
  2714. id: this.form.id,
  2715. url: '/tirePartsMall/salesManagement/saleOrder/index',
  2716. pageStatus: "this.$store.getters.ltxsStatus",
  2717. pageLabel: "销售订单",
  2718. }
  2719. const loading = this.$loading({
  2720. lock: true,
  2721. text: '加载中',
  2722. spinner: 'el-icon-loading',
  2723. background: 'rgba(255,255,255,0.7)'
  2724. });
  2725. checkOrder({ ...data }).then((res) => {
  2726. this.refresh(res.data.data.id)
  2727. this.$message.success('申请退款成功');
  2728. this.isApplySettlement = !this.isApplySettlement
  2729. loading.close();
  2730. console.log(res);
  2731. }).catch(() => { loading.close(); })
  2732. }
  2733. })
  2734. })
  2735. },
  2736. //确认退款
  2737. confirmRefundBtn() {
  2738. this.$confirm("您确定退款吗?", {
  2739. confirmButtonText: "确定",
  2740. cancelButtonText: "取消",
  2741. type: "warning"
  2742. }).then(() => {
  2743. const loading = this.$loading({
  2744. lock: true,
  2745. text: '加载中',
  2746. spinner: 'el-icon-loading',
  2747. background: 'rgba(255,255,255,0.7)'
  2748. });
  2749. // this.form.orderItemsList.forEach((items) => {
  2750. // let brandName = items.brandId
  2751. // items.brandId = items.brandName
  2752. // items.brandName = brandName
  2753. // let goodsName = items.goodsId
  2754. // items.goodsId = items.goodsName
  2755. // items.goodsName = goodsName
  2756. // })
  2757. confirmRefund({ ...this.form }).then((res) => {
  2758. loading.close()
  2759. this.$message.success('确定退款成功');
  2760. }).catch(() => { loading.close(); })
  2761. })
  2762. },
  2763. //审批
  2764. examineBtn() {
  2765. this.checkData = this.$route.query.check
  2766. this.checkDialog = true;
  2767. },
  2768. //撤销请核
  2769. revocationRequest() {
  2770. this.$confirm("您确定撤回此次申请吗?", {
  2771. confirmButtonText: "确定",
  2772. cancelButtonText: "取消",
  2773. type: "warning"
  2774. }).then(() => {
  2775. const loading = this.$loading({
  2776. lock: true,
  2777. text: '加载中',
  2778. spinner: 'el-icon-loading',
  2779. background: 'rgba(255,255,255,0.7)'
  2780. });
  2781. // this.form.orderItemsList.forEach((items) => {
  2782. // if (!items.subTotalMoney) {
  2783. // items.subTotalMoney = items.goodsNum * items.price
  2784. // items.grossProfit = items.subTotalMoney - items.costprie
  2785. // }
  2786. // let brandName = items.brandId
  2787. // items.brandId = items.brandName
  2788. // items.brandName = brandName
  2789. // let goodsName = items.goodsId
  2790. // items.goodsId = items.goodsName
  2791. // items.goodsName = goodsName
  2792. // })
  2793. revokeCheckOrder({ ...this.form }).then(res => {
  2794. this.isRevocationRequest = !this.isRevocationRequest
  2795. this.refresh(res.data.data.id)
  2796. this.$message.success('撤回成功')
  2797. loading.close();
  2798. })
  2799. })
  2800. },
  2801. rowDelBox(row, index, type) {
  2802. this.$confirm("确定将选择数据删除?", {
  2803. confirmButtonText: "确定",
  2804. cancelButtonText: "取消",
  2805. type: "warning"
  2806. }).then(() => {
  2807. if (row.id) {
  2808. delOrderItem({ ids: row.id }).then(res => {
  2809. this.form.orderItemsList.splice(index, 1);
  2810. this.$message.success("操作成功!");
  2811. });
  2812. } else {
  2813. this.form[type].splice(index, 1);
  2814. this.$message.success("操作成功!");
  2815. }
  2816. }
  2817. );
  2818. },
  2819. // 明细信息多选
  2820. selectionContacts(list) {
  2821. this.selectionMultilist = list
  2822. },
  2823. // 快捷复制
  2824. quickCopy() {
  2825. let temp = document.createElement("textarea")
  2826. let txt = `${this.form.customerName} ${this.form.businesDate}`
  2827. for (let item of this.form.orderItemsList) {
  2828. txt += `\n${item.goodsName} ${item.goodsNum}`
  2829. }
  2830. document.body.appendChild(temp)
  2831. temp.value = txt
  2832. temp.select()
  2833. document.execCommand("copy")
  2834. document.body.removeChild(temp)
  2835. },
  2836. // 一键删除
  2837. batchDelete() {
  2838. if (this.selectionMultilist.length == 0) {
  2839. return this.$message.warning('请选择要删除的数据')
  2840. }
  2841. this.$confirm("确定将选择数据删除?", {
  2842. confirmButtonText: "确定",
  2843. cancelButtonText: "取消",
  2844. type: "warning"
  2845. }).then(() => {
  2846. let multiList = this.selectionMultilist
  2847. let arr = this.form.orderItemsList
  2848. // 获取有id 的数据
  2849. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  2850. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  2851. // 把选中的删除掉
  2852. multiList.forEach((item) => {
  2853. for (let index in arr) {
  2854. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  2855. arr.splice(Number(index), 1)
  2856. }
  2857. }
  2858. })
  2859. // 有id 的处理
  2860. if (itemsWithId.length != 0) {
  2861. delOrderItem({ ids: arrIds.join(',') }).then(res => {
  2862. this.$message.success("操作成功!");
  2863. });
  2864. }
  2865. })
  2866. },
  2867. rowSave(form, done, loading) {
  2868. if (this.isStatus) {
  2869. done(form)
  2870. } else {
  2871. this.$message.error('请选择相同公司的商品')
  2872. }
  2873. console.log(form);
  2874. // this.form.sharedCompanyId = res.data.data.sharedCompanyId
  2875. // this.form.sharedCompanyName = res.data.data.sharedCompanyName
  2876. },
  2877. rowUpdate(form, index, done, loading) {
  2878. done(form)
  2879. },
  2880. // 新增商品
  2881. rowAdd(row, type) {
  2882. if (!this.form.customerId) {
  2883. this.$message.error('请选择客户')
  2884. return
  2885. }
  2886. this.findObject(this.optionContactsBack.column, 'goodsId').dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`
  2887. this.goodsType = type
  2888. this.optionContactsBack.column.forEach(its => {
  2889. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  2890. its.disabled = false
  2891. } else {
  2892. its.disabled = true
  2893. }
  2894. })
  2895. this.getAllWorkDicts()
  2896. this.goodsListSave = []
  2897. setTimeout(res => {
  2898. this.refreshChange()
  2899. this.dialogVisible = true
  2900. }, 300)
  2901. // this.$refs.formContacts.rowAdd()
  2902. },
  2903. //打印
  2904. handlePrint() {
  2905. this.switchDialog = !this.switchDialog;
  2906. },
  2907. onClose(val) {
  2908. this.switchDialog = val;
  2909. },
  2910. //自定义列保存
  2911. async saveColumnTwo(ref, option, optionBack, code) {
  2912. /**
  2913. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2914. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2915. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2916. */
  2917. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  2918. isProcurement({ "param": "whether.model" }).then(res => {
  2919. if (res.data.data == 1) {
  2920. this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
  2921. }
  2922. })
  2923. if (inSave) {
  2924. this.$message.success("保存成功");
  2925. //关闭窗口
  2926. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2927. }
  2928. },
  2929. //自定义列重置
  2930. async resetColumnTwo(ref, option, optionBack, code) {
  2931. this[option] = this[optionBack];
  2932. isProcurement({ "param": "whether.model" }).then(res => {
  2933. if (res.data.data == 1) {
  2934. this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
  2935. }
  2936. })
  2937. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  2938. if (inSave) {
  2939. this.$message.success("重置成功");
  2940. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2941. }
  2942. },
  2943. backToList(type) {
  2944. this.$emit("backToList", type);
  2945. },
  2946. // 弹框的重置
  2947. resetCrud() {
  2948. this.$message.success("重置成功");
  2949. },
  2950. // 弹窗的保存
  2951. saveCrud() {
  2952. this.$message.success("保存成功");
  2953. }
  2954. }
  2955. }
  2956. </script>
  2957. <style lang="scss" scoped>
  2958. ::v-deep .el-form-item {
  2959. margin-bottom: 8px !important;
  2960. }
  2961. </style>