detailsPageEdit.vue 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  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">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button--small-yh" type="primary" :loading="saveLoading" size="small" @click="calculateInterest()">利息计算
  11. </el-button>
  12. </div>
  13. </div>
  14. <div class="customer-main">
  15. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  16. <containerTitle title="基础资料"></containerTitle>
  17. <basic-container :showBtn="true">
  18. <el-row>
  19. <el-col v-for="(item, index) in basicData.column" :key="index" :span="item.span ? item.span : 8"
  20. :class="{ isShow: item.display }">
  21. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  22. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  23. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"
  24. :disabled="detailData.seeDisabled || browse" />
  25. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  26. size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"
  27. :disabled="detailData.seeDisabled || browse" />
  28. <crop-select v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" @getCorpData="getCorpRow"
  29. corpType="KH" :disabled="detailData.seeDisabled || browse || !form.belongToCorpId" style="width: 100%"
  30. ref="KHSelect" :belongtocompany="form.belongToCorpId"></crop-select>
  31. <crop-select v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]"
  32. @getCorpData="returnBack" corpType="GS" :disabled="detailData.seeDisabled || browse"></crop-select>
  33. <crop-select v-else-if="item.prop === 'productionPlant'" v-model="form[item.prop]"
  34. @getCorpData="getPlantRow" corpType="GYS" :disabled="detailData.seeDisabled || browse"
  35. style="width: 100%"></crop-select>
  36. <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable
  37. filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse">
  38. <el-option v-for="(item, index) in paymentOption" :key="index" :label="item.dictValue"
  39. :value="item.dictValue"></el-option>
  40. </el-select>
  41. <el-select v-else-if="item.prop === 'packageRemarks'" v-model="form[item.prop]" placeholder="请选择"
  42. clearable filterable allow-create default-first-option style="width: 100%" size="small"
  43. :disabled="detailData.seeDisabled || browse">
  44. <el-option v-for="(item, index) in packageOptions" :key="index" :label="item.dictValue"
  45. :value="item.dictValue"></el-option>
  46. </el-select>
  47. <el-select v-else-if="item.prop === 'arrivalAddress'" v-model="form[item.prop]" placeholder="请选择"
  48. clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse"
  49. allow-create default-first-option>
  50. <el-option v-for="(item, index) in arrivalOptions" :key="index" :label="item.label"
  51. :value="item.label"></el-option>
  52. </el-select>
  53. <el-select v-else-if="item.prop === 'shippingAddress'" v-model="form[item.prop]" placeholder="请选择"
  54. clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse"
  55. allow-create default-first-option>
  56. <el-option v-for="(item, index) in shippingOptions" :key="index" :label="item.label"
  57. :value="item.label"></el-option>
  58. </el-select>
  59. <el-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]" placeholder="请选择仓库" clearable
  60. filterable style="width: 100%" size="small" default-first-option
  61. :disabled="detailData.seeDisabled || item.disabled || browse">
  62. <el-option v-for="(item, index) in storageIdOption" :key="index" :label="item.cname"
  63. :value="item.id"></el-option>
  64. </el-select>
  65. <el-select v-else-if="item.prop === 'banks'" v-model="form[item.prop]" placeholder="请选择" clearable
  66. filterable allow-create default-first-option size="small" style="width: 100%;"
  67. :disabled="detailData.seeDisabled || browse">
  68. <el-option v-for="(item, index) in bankList" :key="index" :label="item.accountNo"
  69. :value="item.accountNo"></el-option>
  70. </el-select>
  71. <el-select v-else-if="item.prop === 'corpAttn'" v-model="form[item.prop]" placeholder="请选择" clearable
  72. filterable allow-create default-first-option size="small" style="width: 100%;" :disabled="detailData.seeDisabled || browse">
  73. <el-option v-for="(item, index) in khInfoList" :key="index" :label="item.cname"
  74. :value="item.id"></el-option>
  75. </el-select>
  76. <el-input v-else-if="item.type == 'number'" placeholder="请输入" v-input-limit="2" size="small"
  77. :disabled="item.disabled || detailData.seeDisabled || browse" v-model.trim="form[item.prop]" />
  78. <span v-else-if="item.type == 'radio'">
  79. <el-radio size="small" :disabled="item.disabled || detailData.seeDisabled || browse"
  80. v-model.trim="form[item.prop]" :label="1">是</el-radio>
  81. <el-radio size="small" :disabled="item.disabled || detailData.seeDisabled || browse"
  82. v-model.trim="form[item.prop]" :label="0">否</el-radio>
  83. </span>
  84. <el-select v-else-if="item.prop === 'chargeMember'" v-model="form[item.prop]" placeholder="请选择"
  85. filterable size="small" style="width: 100%;" :disabled="detailData.seeDisabled || browse">
  86. <el-option v-for="(item, index) in userList" :key="index" :label="item.cname"
  87. :value="item.cname"></el-option>
  88. </el-select>
  89. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]"
  90. size="small" autocomplete="off"
  91. :disabled="item.disabled || detailData.seeDisabled || browse"></el-input>
  92. <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off"
  93. :disabled="item.disabled || detailData.seeDisabled || browse" clearable></el-input>
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. </basic-container>
  98. <containerTitle title="利息信息"/>
  99. <basic-container>
  100. <el-row>
  101. <el-col span="8">
  102. <el-form-item label="资方" prop="investor">
  103. <crop-select v-model="form.investor" @getCorpData="getInvestor" corpType="GYS" style="width: 100%"></crop-select>
  104. </el-form-item>
  105. </el-col>
  106. <el-col span="6">
  107. <el-form-item label="利率" prop="interestRate">
  108. <el-input type="age" v-model.trim="form.interestRate" size="small" autocomplete="off" placeholder="请输入年利率" v-input-limit="2">
  109. <template slot="append">%</template>
  110. </el-input>
  111. </el-form-item>
  112. </el-col>
  113. <el-col span="4">
  114. <el-form-item label="天数" prop="days">
  115. <el-input type="number" v-model.trim="form.days" size="small" autocomplete="off" placeholder="请输入天数" v-input-limit="2">
  116. </el-input>
  117. </el-form-item>
  118. </el-col>
  119. <el-col span="6">
  120. <el-form-item label="配资比例" prop="fundingRatio">
  121. <el-input type="age" v-model.trim="form.fundingRatio" size="small" autocomplete="off" placeholder="请输入多多配资比例" v-input-limit="2">
  122. <template slot="append">%</template>
  123. </el-input>
  124. </el-form-item>
  125. </el-col>
  126. <el-col span="4">
  127. <el-form-item label="税率" prop="fundingRatio">
  128. <el-input type="age" v-model.trim="form.taxRate" size="small" autocomplete="off" placeholder="请输入税率" v-input-limit="2">
  129. </el-input>
  130. </el-form-item>
  131. </el-col>
  132. <el-col span="6">
  133. <el-form-item label="利息金额" prop="fundingRatio">
  134. <el-input type="age" v-model.trim="form.interestAmount" size="small" autocomplete="off" disabled placeholder="请输入多多配资比例" v-input-limit="2">
  135. </el-input>
  136. </el-form-item>
  137. </el-col>
  138. </el-row>
  139. </basic-container>
  140. <containerTitle title="发货信息"></containerTitle>
  141. <basic-container :showBtn="true" :block="true" ref="shipmentRef">
  142. <el-row>
  143. <el-col v-for="(item, index) in contactInformation.column" :key="index" :span="item.span ? item.span : 8"
  144. :class="{ isShow: item.display == false }">
  145. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  146. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  147. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"
  148. :disabled="item.disabled || detailData.seeDisabled || browse" />
  149. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  150. size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"
  151. :disabled="detailData.seeDisabled || browse" />
  152. <el-input v-else-if="(item.prop === 'advancePayment') || (item.prop === 'orderAmount') ||
  153. (item.prop === 'settlmentAmount') || (item.prop === 'caseOverPayment') || (item.prop === 'thisUsedProfit') ||
  154. (item.prop === 'createProfit')" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="detailData.seeDisabled || item.disabled || browse"
  155. v-input-limit="2"></el-input>
  156. <el-select v-else-if="item.prop === 'orderStatus'" v-model="form[item.prop]" placeholder="请选择" clearable
  157. filterable style="width: 100%" size="small"
  158. :disabled="detailData.seeDisabled || item.disabled || browse">
  159. <el-option v-for="(item, index) in statusOption" :key="index" :label="item.dictValue"
  160. :value="item.dictValue"></el-option>
  161. </el-select>
  162. <el-input type="age" v-else-if="item.prop === 'grossProfitRate'" v-model.trim="form[item.prop]"
  163. size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse"
  164. v-input-limit="2">
  165. <template slot="append">%</template>
  166. </el-input>
  167. <el-input type="age" v-else-if="item.prop === 'specialOfferOf'" v-model.trim="form[item.prop]"
  168. size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse"
  169. v-input-limit="2">
  170. <template slot="append">%</template>
  171. </el-input>
  172. <el-input type="age" v-else-if="item.prop === 'largeScale'" v-model.trim="form[item.prop]" size="small"
  173. autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
  174. <template slot="append">%</template>
  175. </el-input>
  176. <el-input v-else-if="item.type == 'number'" placeholder="请输入" v-input-limit="2" size="small"
  177. :disabled="item.disabled || detailData.seeDisabled || browse" v-model.trim="form[item.prop]" />
  178. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]"
  179. size="small" autocomplete="off"
  180. :disabled="item.disabled || detailData.seeDisabled || browse"></el-input>
  181. <el-input v-else type="age" v-model.trim="form[item.prop]" size="small" autocomplete="off"
  182. :disabled="item.disabled || detailData.seeDisabled || browse"></el-input>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. </basic-container>
  187. <containerTitle title="商品信息"></containerTitle>
  188. <basic-container style="margin-bottom: 10px">
  189. <avue-crud :option="customerContact" v-model="contactsForm" :data="goodsShowData" ref="crudContact"
  190. @saveColumn="saveColumn('goods')" @resetColumn="resetColumn" :summary-method="summaryMethod"
  191. :cell-style="goodsRowClassName" :table-loading="goodsLoading" :key="index">
  192. <template slot="headerSerial">
  193. <span class="order_number">序号</span>
  194. <el-button class="number_button" type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
  195. @click="$refs.crudContact.rowCellAdd()"></el-button>
  196. </template>
  197. <template slot="cntrVolumn" slot-scope="{row}">
  198. <span>{{ row.cntrVolumn ? parseFloat(row.cntrVolumn) : row.cntrVolumn }}</span>
  199. </template>
  200. <template slot="storageId" slot-scope="{ row }">
  201. <!--v-input-limit="2" 代表可以输入2位小数的数字 -->
  202. <el-select v-if="row.$cellEdit" v-model="row.storageId" allow-create filterable default-first-option>
  203. <el-option v-for="(item, index) in row.storageQuantityList" :key="index"
  204. :label="item.storageName + '-' + item.corpName" :value="item.storageId"></el-option>
  205. </el-select>
  206. <span v-else>{{ row.storageName }}</span>
  207. </template>
  208. <template slot="storageQuantity" slot-scope="{ row }">
  209. <span>{{ row.storageQuantity | decimalFormat }}</span>
  210. </template>
  211. <template slot="purchaseRebatePrice" slot-scope="{ row }">
  212. <el-input v-if="false" v-model="row.purchaseRebatePrice" allow-create
  213. filterable v-input-limit="2" default-first-option>
  214. <el-option v-for="(item, index) in purchasePriceOption" :key="index" :label="item.purchaseRebatePrice"
  215. :value="item.purchaseRebatePrice"></el-option>
  216. </el-input>
  217. <span v-else>{{ row.purchaseRebatePrice }}</span>
  218. </template>
  219. <template slot="purchaseAmount" slot-scope="{ row }">
  220. <el-input v-if="row.$cellEdit" v-model="row.purchaseAmount" allow-create
  221. filterable v-input-limit="2" default-first-option>
  222. <el-option v-for="(item, index) in purchasePriceOption" :key="index" :label="item.purchasePrice"
  223. :value="item.purchasePrice"></el-option>
  224. </el-input>
  225. <span v-else>{{ row.purchaseAmount }}</span>
  226. </template>
  227. <template slot="price" slot-scope="{ row }">
  228. <el-select v-if="false" v-model="row.price" @focus="getMarketPrice(row)"
  229. allow-create filterable v-input-limit="2" default-first-option>
  230. <el-option v-for="(item, index) in salesPriceOtion" :key="index" :label="item.salePrice"
  231. :value="item.salePrice"></el-option>
  232. </el-select>
  233. <span v-else>{{ row.price }}</span>
  234. </template>
  235. <template slot="amount" slot-scope="{ row }">
  236. <span>{{ row.amount | decimalFormat }}</span>
  237. </template>
  238. <template slot="actualQuantity" slot-scope="{ row }">
  239. <span>{{ row.actualQuantity | IntegerFormat }}</span>
  240. </template>
  241. <template slot="orderQuantity" slot-scope="{ row }">
  242. <span>{{ row.orderQuantity | IntegerFormat }}</span>
  243. </template>
  244. <template slot="shopQuality" slot-scope="{ row }">
  245. <el-switch v-model="row.shopQuality" :disabled="!row.$cellEdit || shopQualityDisable" :active-value="1"
  246. :inactive-value="0"></el-switch>
  247. </template>
  248. <template slot="menuLeft" slot-scope="{size}">
  249. <el-tabs v-model="goodsActives" @tab-click="handleClick" :before-leave="beforeLeave">
  250. <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
  251. </el-tab-pane>
  252. <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
  253. </el-tab-pane>
  254. </el-tabs>
  255. <el-button type="info" :size="size" icon="el-icon-printer" @click.stop="openReport()" v-show="goodsActives == 'goods'">报表打印</el-button>
  256. </template>
  257. </avue-crud>
  258. </basic-container>
  259. <fee-info ref="feeInfo" :orderFeesList="advantageProjectData"
  260. :disabled="true" feeUrl="/blade-purchase-sales/orderfees/update"
  261. optionType="GN" itemType="销售" @beforeFinance="beforeFinance" :corpId="form.corpId" :financeDisabled="false"
  262. :tabShow="2" />
  263. <containerTitle title="上传附件"></containerTitle>
  264. <c-upload :data="bankOfDepositData" deleteUrl="/api/blade-client/corpsbank/update" :disabled="true" :enumerationValue="77" display />
  265. </el-form>
  266. </div>
  267. <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="配资" @onClose="onClose()" />
  268. </div>
  269. </template>
  270. <script>
  271. import {
  272. detail,
  273. getlistBankBy,
  274. getProfit,
  275. calculateInterestAmount
  276. } from "@/api/basicData/configuration"
  277. import { getCorpDetail } from "@/api/maintenance/overpayment"
  278. import { integralDetail } from "@/api/maintenance/integral"
  279. import customerContact from "./configuration/customerContact.json"
  280. import optionPolicy from "./configuration/optionPolicy.json"
  281. import BuyFree from "./configuration/BuyFree.json"
  282. import {
  283. customerList as feeList,
  284. getDeptLazyTree,
  285. getDeptLazyTreeTwo,
  286. policyColumn
  287. } from "@/api/basicData/basicFeesDesc";
  288. import _ from "lodash";
  289. import reportDialog from "@/components/report-dialog/main";
  290. import { getToken } from "@/util/auth";
  291. import feeInfo from "@/components/fee-info/main";
  292. import { customerList as getKHList, detail as khDetail } from "@/api/basicData/customerInformation";
  293. import { IntegerFormat } from "@/util/validate";
  294. import { getCharge } from "@/api/basicData/customerInquiry";
  295. import { mapGetters } from "vuex";
  296. import { customerList as storageType } from "@/api/basicData/basicStorageType"
  297. export default {
  298. name: "detailsPage",
  299. props: {
  300. isProcurements: {
  301. type: Boolean
  302. },
  303. detailData: {
  304. type: Object
  305. }
  306. },
  307. components: {
  308. reportDialog,
  309. feeInfo
  310. },
  311. data() {
  312. return {
  313. policyList: [],
  314. selectionDList: [],
  315. searchDL: {},
  316. policyType: null,
  317. dataDL: [],
  318. optionThree: {
  319. header: false,
  320. menu: true,
  321. editBtn: false,
  322. delBtn: false,
  323. menuWidth: '80',
  324. searchSpan: 12,
  325. column: [
  326. {
  327. label: '商品名称',
  328. prop: 'cname',
  329. search: true,
  330. overHidden: true
  331. }, {
  332. label: '编码',
  333. prop: 'code',
  334. search: true,
  335. overHidden: true
  336. }, {
  337. label: '规格型号',
  338. prop: 'typeno',
  339. overHidden: true
  340. }, {
  341. label: '花纹',
  342. prop: 'brandItem',
  343. overHidden: true
  344. }, {
  345. label: '订货数量',
  346. prop: 'orderQuantity',
  347. overHidden: true
  348. }, {
  349. label: '供应商',
  350. prop: 'corpName',
  351. overHidden: true
  352. }
  353. ]
  354. },
  355. optionFour: {
  356. header: false,
  357. menu: false,
  358. editBtn: false,
  359. delBtn: false,
  360. menuWidth: '80',
  361. column: [
  362. {
  363. label: '商品名称',
  364. prop: 'cname',
  365. overHidden: true
  366. }, {
  367. label: '编码',
  368. prop: 'code',
  369. overHidden: true
  370. }, {
  371. label: '规格型号',
  372. prop: 'typeno',
  373. overHidden: true
  374. }, {
  375. label: '花纹',
  376. prop: 'brandItem',
  377. overHidden: true
  378. }, {
  379. label: '订货数量',
  380. prop: 'orderQuantity',
  381. overHidden: true
  382. }, {
  383. label: '供应商',
  384. prop: 'corpName',
  385. overHidden: true
  386. }
  387. ]
  388. },
  389. optionDL: {
  390. header: false,
  391. menu: false,
  392. selection: true,
  393. tip: false,
  394. column: [
  395. {
  396. label: '订单号',
  397. prop: 'orgOrderNo',
  398. overHidden: true
  399. }, {
  400. label: '订单日期',
  401. prop: 'businesDate',
  402. overHidden: true
  403. }, {
  404. label: '收货地址',
  405. prop: 'arrivalAddress',
  406. overHidden: true
  407. }, {
  408. label: '品牌',
  409. prop: 'brand',
  410. overHidden: true
  411. }
  412. ]
  413. },
  414. storageNameList: [],
  415. surplusRouteQuantityOption: [],
  416. saveLoading: false,
  417. userInfo: null,
  418. disabled: false,
  419. form: {
  420. corpId: null,
  421. },
  422. billType: "收费", //账单类型
  423. billData: {}, //账单需要数据
  424. applySettlementDialog: false,//生成账单组件
  425. financialAccountDialog: false,
  426. configuration: {
  427. multipleChoices: false,
  428. multiple: false,
  429. collapseTags: false,
  430. placeholder: '请点击右边按钮选择',
  431. dicData: []
  432. },
  433. goodsConfiguration: {
  434. multipleChoices: false,
  435. multiple: false,
  436. collapseTags: false,
  437. placeholder: '请点击右边按钮选择',
  438. dicData: []
  439. },
  440. plantConfiguration: {
  441. multipleChoices: false,
  442. multiple: false,
  443. collapseTags: false,
  444. placeholder: '请点击右边按钮选择',
  445. dicData: []
  446. },
  447. companyConfiguration: {
  448. multipleChoices: false,
  449. multiple: false,
  450. collapseTags: false,
  451. placeholder: '请点击右边按钮选择',
  452. dicData: []
  453. },
  454. data: [],
  455. policyForm: {},
  456. dataPolicy: [],
  457. contactsDataBuyFree: [],
  458. loadingCost: false,
  459. customerDivide: '',
  460. choiceData: false,
  461. commodityData: false,
  462. dataCost: [],
  463. treeDataDL: [],
  464. treeDataPolicy: [],
  465. treeDataGoods: [],
  466. choiceIndex: '',
  467. dialogCost: false,
  468. treeDeptId: '',
  469. treeDeptIdCost: '',
  470. treePolicyId: '',
  471. pageCost: {
  472. pageSize: 10,
  473. currentPage: 1,
  474. total: 0
  475. },
  476. page: {
  477. pageSize: 10,
  478. currentPage: 1,
  479. total: 0,
  480. pageSizes: [10, 50, 100, 300, 500]
  481. },
  482. pageList: {
  483. pageSize: 10,
  484. currentPage: 1,
  485. total: 0
  486. },
  487. pagePolicy: {
  488. pageSize: 10,
  489. currentPage: 1,
  490. total: 0
  491. },
  492. loading: false,
  493. loadingPolicy: false,
  494. contactsForm: {},
  495. optionPolicy: optionPolicy,
  496. customerBuyFree: BuyFree,
  497. nowDate: new Date().toLocaleString('chinese', { hour12: false }).replaceAll('/', '-'),
  498. policyOption: {
  499. nodeKey: 'id',
  500. lazy: true,
  501. treeLoad: (node, resolve) => {
  502. const parentId = (node.level === 0) ? 0 : node.data.id;
  503. const newTime = new Date().toLocaleString('chinese', { hour12: false }).replaceAll('/', '-')
  504. policyColumn({ newTime: newTime, parentId: parentId, corps: this.form.corpId }).then(res => {
  505. resolve(res.data.data.map(item => {
  506. return {
  507. ...item,
  508. leaf: !item.hasChildren
  509. }
  510. }))
  511. });
  512. },
  513. addBtn: false,
  514. menu: false,
  515. size: 'small',
  516. props: {
  517. labelText: '标题',
  518. label: 'title',
  519. value: 'value',
  520. children: 'children'
  521. }
  522. },
  523. treeOptionCost: {
  524. nodeKey: 'id',
  525. lazy: true,
  526. treeLoad: function (node, resolve) {
  527. const parentId = (node.level === 0) ? 0 : node.data.id;
  528. getDeptLazyTree(parentId).then(res => {
  529. resolve(res.data.data.map(item => {
  530. return {
  531. ...item,
  532. leaf: !item.hasChildren
  533. }
  534. }))
  535. });
  536. },
  537. addBtn: false,
  538. menu: false,
  539. size: 'small',
  540. props: {
  541. labelText: '标题',
  542. label: 'title',
  543. value: 'value',
  544. children: 'children'
  545. }
  546. },
  547. treeOption: {
  548. nodeKey: 'id',
  549. lazy: true,
  550. treeLoad: function (node, resolve) {
  551. const parentId = (node.level === 0) ? 0 : node.data.id;
  552. getDeptLazyTreeTwo(parentId).then(res => {
  553. resolve(res.data.data.map(item => {
  554. return {
  555. ...item,
  556. leaf: !item.hasChildren
  557. }
  558. }))
  559. });
  560. },
  561. addBtn: false,
  562. menu: false,
  563. size: 'small',
  564. props: {
  565. labelText: '标题',
  566. label: 'title',
  567. value: 'value',
  568. children: 'children'
  569. }
  570. },
  571. dialogVisible: false,
  572. policyDialog: false,
  573. advantageProjectForm: {},
  574. selection: [],
  575. bankOfDepositForm: {},
  576. contactsData: [],
  577. advantageProjectData: [],
  578. bankOfDepositData: [],
  579. tableDataCost: [],
  580. dic: [],
  581. storageId: [],
  582. tableData: [],
  583. policyData: [],
  584. policyDataTwo: [],
  585. customerContact: {},
  586. advantageProject: {},
  587. contactInformation: {
  588. column: [
  589. {
  590. label: '销售金额',
  591. prop: 'orderAmount',
  592. type: 'number',
  593. rules: [
  594. {
  595. required: false,
  596. message: ' ',
  597. trigger: 'blur'
  598. }
  599. ]
  600. }, {
  601. label: '其他费用',
  602. prop: 'otherAmount',
  603. type: 'number',
  604. rules: [
  605. {
  606. required: false,
  607. message: ' ',
  608. trigger: 'blur'
  609. }
  610. ]
  611. }, {
  612. label: '总溢付款',
  613. prop: 'overPayment',
  614. disabled: true,
  615. rules: [
  616. {
  617. required: false,
  618. message: ' ',
  619. trigger: 'blur'
  620. }
  621. ]
  622. }, {
  623. label: '返利余额',
  624. prop: 'profit',
  625. disabled: true,
  626. rules: [
  627. {
  628. required: false,
  629. message: ' ',
  630. trigger: 'blur'
  631. }
  632. ]
  633. }, {
  634. label: '产生返利',
  635. prop: 'createProfit',
  636. disabled: false,
  637. rules: [
  638. {
  639. required: false,
  640. message: ' ',
  641. trigger: 'blur'
  642. }
  643. ]
  644. }, {
  645. label: '本次使用返利',
  646. prop: 'thisUsedProfit',
  647. disabled: false,
  648. rules: [
  649. {
  650. required: false,
  651. message: ' ',
  652. trigger: 'blur'
  653. }
  654. ]
  655. }, {
  656. label: '应收账款',
  657. prop: 'debitAmount',
  658. type: 'number',
  659. disabled: true,
  660. rules: [
  661. {
  662. required: false,
  663. message: ' ',
  664. trigger: 'blur'
  665. }
  666. ]
  667. }, {
  668. label: '已收款',
  669. prop: 'settlmentAmount',
  670. disabled: true,
  671. rules: [
  672. {
  673. required: false,
  674. message: ' ',
  675. trigger: 'blur'
  676. }
  677. ]
  678. }, {
  679. label: '应收未收款',
  680. prop: 'balanceAmount',//无
  681. disabled: true,
  682. rules: [
  683. {
  684. required: false,
  685. message: ' ',
  686. trigger: 'blur'
  687. }
  688. ]
  689. },
  690. {
  691. label: '保证金',
  692. prop: 'deposit',
  693. type: 'number',
  694. rules: [
  695. {
  696. required: false,
  697. message: ' ',
  698. trigger: 'blur'
  699. }
  700. ]
  701. }, {
  702. label: '逾期账款',
  703. prop: 'overDueAccounts',
  704. type: 'number',
  705. rules: [
  706. {
  707. required: false,
  708. message: ' ',
  709. trigger: 'blur'
  710. }
  711. ]
  712. }, {
  713. label: '实际发货日期',
  714. prop: 'actualDeliveryDate',
  715. type: 'datetime',
  716. rules: [
  717. {
  718. required: false,
  719. message: ' ',
  720. trigger: 'blur'
  721. }
  722. ]
  723. }, {
  724. label: '合同日期',
  725. prop: 'businesDate',
  726. type: 'date',
  727. rules: [
  728. {
  729. required: false,
  730. message: ' ',
  731. trigger: 'blur'
  732. }
  733. ]
  734. }, {
  735. label: '到货日期',
  736. prop: 'arrivalDate',
  737. type: 'datetime',
  738. rules: [
  739. {
  740. required: false,
  741. message: ' ',
  742. trigger: 'blur'
  743. }
  744. ]
  745. }, {
  746. label: '毛利率',
  747. prop: 'grossProfitRate',
  748. display: true,
  749. rules: [
  750. {
  751. required: false,
  752. message: ' ',
  753. trigger: 'blur'
  754. }
  755. ]
  756. }, {
  757. label: '毛利额',
  758. prop: 'grossProfit',
  759. type: 'number',
  760. display: true,
  761. rules: [
  762. {
  763. required: false,
  764. message: ' ',
  765. trigger: 'blur'
  766. }
  767. ]
  768. }, {
  769. label: '历史运费(元/条)',
  770. prop: 'freightAmountHistory',
  771. type: 'number',
  772. rules: [
  773. {
  774. required: false,
  775. message: ' ',
  776. trigger: 'blur'
  777. }
  778. ]
  779. }, {
  780. label: '预收款日期',
  781. type: 'datetime',
  782. prop: 'advanceCollectionDate',
  783. rules: [
  784. {
  785. required: false,
  786. message: ' ',
  787. trigger: 'blur'
  788. }
  789. ]
  790. }, {
  791. label: '特价占比',
  792. prop: 'specialOfferOf',
  793. disabled: false,
  794. rules: [
  795. {
  796. required: false,
  797. message: ' ',
  798. trigger: 'blur'
  799. }
  800. ]
  801. }, {
  802. label: '大尺寸占比',
  803. prop: 'largeScale',
  804. disabled: false,
  805. }, {
  806. label: '单据状态',
  807. prop: 'orderStatus',
  808. disabled: true,
  809. rules: [
  810. {
  811. required: false,
  812. message: ' ',
  813. trigger: 'blur'
  814. }
  815. ]
  816. }, {
  817. label: '积分余额',
  818. prop: 'pointMutiple',
  819. disabled: true,
  820. rules: [
  821. {
  822. required: false,
  823. message: ' ',
  824. trigger: 'blur'
  825. }
  826. ]
  827. }, {
  828. label: '赠送积分',
  829. prop: 'presenterIntegral',
  830. disabled: true,
  831. rules: [
  832. {
  833. required: false,
  834. message: ' ',
  835. trigger: 'blur'
  836. }
  837. ]
  838. }, {
  839. label: '兑换积分',
  840. prop: 'convertIntegral',
  841. disabled: true,
  842. rules: [
  843. {
  844. required: false,
  845. message: ' ',
  846. trigger: 'blur'
  847. }
  848. ]
  849. }, {
  850. label: '重量合计',
  851. prop: 'cartonWeight',
  852. disabled: true,
  853. rules: [
  854. {
  855. required: false,
  856. message: ' ',
  857. trigger: 'blur'
  858. }
  859. ]
  860. }, {
  861. label: '体积合计',
  862. prop: 'cntrVolumn',
  863. disabled: true,
  864. rules: [
  865. {
  866. required: false,
  867. message: ' ',
  868. trigger: 'blur'
  869. }
  870. ]
  871. }, {
  872. label: '制单人',
  873. prop: 'createUserName',
  874. disabled: true,
  875. rules: [
  876. {
  877. required: false,
  878. message: ' ',
  879. trigger: 'blur'
  880. }
  881. ]
  882. }, {
  883. label: '制单日期',
  884. prop: 'createTime',
  885. type: 'datetime',
  886. disabled: true,
  887. rules: [
  888. {
  889. required: false,
  890. message: ' ',
  891. trigger: 'blur'
  892. }
  893. ]
  894. }, {
  895. label: '特别提醒',
  896. prop: 'specialRemarks',
  897. type: 'textarea',
  898. span: 24,
  899. rules: [
  900. {
  901. required: false,
  902. message: ' ',
  903. trigger: 'blur'
  904. }
  905. ]
  906. }
  907. ]
  908. },
  909. basicData: {
  910. column: [
  911. {
  912. label: '所属公司',
  913. prop: 'belongToCorpId',
  914. span: 8,
  915. rules: [
  916. {
  917. required: true,
  918. message: ' ',
  919. trigger: 'change'
  920. }
  921. ]
  922. }, {
  923. label: '付款方式',
  924. prop: 'paymentType',
  925. rules: [
  926. {
  927. required: true,
  928. message: ' ',
  929. trigger: 'change'
  930. }
  931. ]
  932. }, {
  933. label: '包装要求',
  934. prop: 'packageRemarks',
  935. rules: [
  936. {
  937. required: true,
  938. message: ' ',
  939. trigger: 'change'
  940. }
  941. ]
  942. },
  943. {
  944. label: '银行帐号',
  945. prop: 'banks',
  946. type: 'select',
  947. rules: [
  948. {
  949. required: true,
  950. message: ' ',
  951. trigger: 'change'
  952. }
  953. ]
  954. }, {
  955. label: '公司户头',
  956. prop: 'banksAccountName',
  957. rules: [
  958. {
  959. required: false,
  960. message: ' ',
  961. trigger: 'blur'
  962. }
  963. ]
  964. }, {
  965. label: '开户银行',
  966. prop: 'accountBank',
  967. rules: [
  968. {
  969. required: false,
  970. message: ' ',
  971. trigger: 'blur'
  972. }
  973. ]
  974. },
  975. {
  976. label: '客户全称',
  977. prop: 'corpId',
  978. span: 8,
  979. rules: [
  980. {
  981. required: true,
  982. message: ' ',
  983. trigger: 'change'
  984. }
  985. ]
  986. }, {
  987. label: '到货地址',
  988. prop: 'arrivalAddress',
  989. span: 16,
  990. rules: [
  991. {
  992. required: true,
  993. message: ' ',
  994. trigger: 'change'
  995. }
  996. ]
  997. }, {
  998. label: '生产工厂',
  999. prop: 'productionPlant',
  1000. span: 8,
  1001. rules: [
  1002. {
  1003. required: true,
  1004. message: ' ',
  1005. trigger: 'change'
  1006. }
  1007. ]
  1008. },
  1009. {
  1010. label: '发货地址',
  1011. prop: 'shippingAddress',
  1012. disabled: false,
  1013. span: 16,
  1014. rules: [
  1015. {
  1016. required: true,
  1017. message: ' ',
  1018. trigger: 'change'
  1019. }
  1020. ]
  1021. },
  1022. {
  1023. label: '销售订单号',
  1024. prop: 'orderNo',
  1025. disabled: true,
  1026. rules: [
  1027. {
  1028. required: false,
  1029. message: ' ',
  1030. trigger: 'blur'
  1031. }
  1032. ]
  1033. }, {
  1034. label: '主订单号',
  1035. prop: 'morderNo',
  1036. rules: [
  1037. {
  1038. required: false,
  1039. message: ' ',
  1040. trigger: 'blur'
  1041. }
  1042. ]
  1043. },
  1044. {
  1045. label: '是否收取标签费',
  1046. prop: 'isLabel',
  1047. type: 'radio',
  1048. },
  1049. {
  1050. label: '是否包运费',
  1051. prop: 'isFreight',
  1052. type: 'radio',
  1053. },
  1054. {
  1055. label: '预估运费',
  1056. prop: 'predictOceanFreight',
  1057. type: 'number',
  1058. rules: [
  1059. {
  1060. required: true,
  1061. message: ' ',
  1062. trigger: 'blur'
  1063. }
  1064. ]
  1065. },
  1066. {
  1067. label: '要求发货日期',
  1068. prop: 'requiredDeliveryDate',
  1069. type: 'date',
  1070. rules: [
  1071. {
  1072. required: false,
  1073. message: ' ',
  1074. trigger: 'blur'
  1075. }
  1076. ]
  1077. }, {
  1078. label: '要求到货日期',
  1079. prop: 'requiredArrivalDate',
  1080. type: 'date',
  1081. rules: [
  1082. {
  1083. required: false,
  1084. message: ' ',
  1085. trigger: 'blur'
  1086. }
  1087. ]
  1088. }, {
  1089. label: '业务员',
  1090. prop: 'chargeMember',
  1091. rules: [
  1092. {
  1093. required: true,
  1094. message: ' ',
  1095. trigger: 'change'
  1096. }
  1097. ]
  1098. }, {
  1099. label: '联系人',
  1100. prop: 'corpAttn',
  1101. rules: [
  1102. {
  1103. required: false,
  1104. message: ' ',
  1105. trigger: 'change'
  1106. }
  1107. ]
  1108. }, {
  1109. label: '联系电话',
  1110. prop: 'corpTel',
  1111. rules: [
  1112. {
  1113. required: false,
  1114. message: ' ',
  1115. trigger: 'change'
  1116. }
  1117. ]
  1118. }, {
  1119. label: '仓库',
  1120. prop: 'storageId',
  1121. dicData: [],
  1122. overHidden: true,
  1123. rules: [
  1124. {
  1125. required: false,
  1126. message: ' ',
  1127. trigger: 'blur'
  1128. }
  1129. ]
  1130. }, {
  1131. label: "订单备注",
  1132. type: 'textarea',
  1133. span: 24,
  1134. prop: "orderRemark",
  1135. mock: {
  1136. type: 'county'
  1137. }
  1138. }
  1139. ]
  1140. },
  1141. // 银行账号下拉
  1142. bankList: [],
  1143. paymentOption: [],
  1144. statusOption: [],
  1145. // 费用信息排序的最大值
  1146. maxFeeNum: 0,
  1147. maxGoodsNum: 0,
  1148. oldForm: {
  1149. orderStatus: "录入"
  1150. },
  1151. oldGoodsList: [],
  1152. oldGiftList: [],
  1153. oldFeesList: [],
  1154. oldUploadList: [],
  1155. // 采购价格
  1156. purchasePriceOption: [],
  1157. // 销售价格
  1158. salesPriceOtion: [],
  1159. // 弹窗高度
  1160. rowHeight: '',
  1161. // 查询时loading页面
  1162. pageLoading: false,
  1163. switchDialog: false,
  1164. // 商品信息表格loading
  1165. goodsLoading: false,
  1166. dialogVisibleDL: false,
  1167. // 上传时带的参数
  1168. uploadPolicy: {
  1169. policyName: '',
  1170. salesType: 1
  1171. },
  1172. baseURL: '/api/blade-purchase-sales/orderitems/importPrice', // 商品明细上传路径
  1173. headers: { "Blade-Auth": 'Bearer ' + getToken() },
  1174. activeName: 'searchList',
  1175. // 商品列表数据合计
  1176. goodsListShow: [],
  1177. DLListShow: [],
  1178. dataTwo: [],
  1179. dataThree: [],
  1180. // 商品列表暂存
  1181. goodsListSave: [],
  1182. DLListSave: [],
  1183. goodsListPolicy: [],
  1184. buyAndGiveList: [],
  1185. goodsListTotal: 0,
  1186. goodsListSaveTotal: 0,
  1187. goodsActives: 'goods',
  1188. saveActives: '',
  1189. goodsDisabled: false,
  1190. // 赠品信息数据
  1191. giftData: [],
  1192. // 商品信息展示数据
  1193. goodsShowData: [],
  1194. arrivalOptions: [],
  1195. shippingOptions: [],
  1196. storageOptions: [],
  1197. applicationDialog: false,
  1198. itemType: '销售',
  1199. packageOptions: [],
  1200. // 请核状态禁用
  1201. browse: false,
  1202. roleName: '',
  1203. userList: [],
  1204. storageIdOption: [],
  1205. feesOption: [],
  1206. checkDisabled: false,
  1207. checkData: {},
  1208. checkDialog: false,
  1209. checkScheduleDialog: false,
  1210. checkId: '',
  1211. batchNo: '',
  1212. applyPaymentList: [],
  1213. khInfoList: [],
  1214. messageVisble: false, //消息弹窗开关
  1215. changeApproveVis: false, // 更换审批人弹窗
  1216. arrearsCheck: false, // 是否欠款发货审批
  1217. shopQualityDisable: false, //质量胎切换禁用
  1218. index: 0,
  1219. policyIndex: 0,
  1220. routerTag: '',
  1221. handId: null,
  1222. mockData: []
  1223. }
  1224. },
  1225. mounted() {
  1226. this.$nextTick(() => {
  1227. // 监听浏览器高度变化,改变表格高度
  1228. window.onresize = () => {
  1229. this.rowHeight = (window.innerHeight - 130) + 'px'
  1230. }
  1231. this.routerTag = window.location.hash.slice(1);
  1232. })
  1233. this.userInfo = localStorage.getItem('saber-userInfo') && JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('admin');
  1234. },
  1235. filters: {
  1236. IntegerFormat(num) {
  1237. return IntegerFormat(num);
  1238. },
  1239. decimalFormat(num) {
  1240. return num ? Number(num).toFixed(2) : "0.00";
  1241. }
  1242. },
  1243. //初始化查询
  1244. async created() {
  1245. this.rowHeight = (window.innerHeight - 130) + 'px'
  1246. this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
  1247. this.getWorkDicts("payment_term").then(res => {
  1248. this.paymentOption = res.data.data
  1249. })
  1250. storageType().then(res => {
  1251. this.storageIdOption = res.data.data.records
  1252. this.form.storageId = res.data.data.records[0].id
  1253. this.form.storageName = res.data.data.records[0].cname
  1254. })
  1255. this.getWorkDicts("order_status").then(res => {
  1256. this.statusOption = res.data.data
  1257. })
  1258. this.getWorkDicts("packageRemarks").then(res => {
  1259. this.packageOptions = res.data.data;
  1260. });
  1261. // this.getDefault()
  1262. if (this.detailData.id) {
  1263. // 详情进入
  1264. this.queryData(this.detailData.id)
  1265. }
  1266. feeList().then(res => {
  1267. this.feesOption = res.data.data.records
  1268. })
  1269. this.oldForm = Object.assign({}, this.form);
  1270. this.customerBuyFree.height = (window.innerHeight - 330) / 2;
  1271. this.optionPolicy.height = (window.innerHeight - 330) / 2;
  1272. this.customerContact.height = window.innerHeight - 240;
  1273. this.index++;
  1274. this.$refs.shipmentRef.show = false
  1275. },
  1276. updated() {
  1277. this.$nextTick(() => {
  1278. this.$refs.crudContact.doLayout();
  1279. })
  1280. },
  1281. methods: {
  1282. getInvestor(data){
  1283. console.info('data-------', data);
  1284. if (!data) {
  1285. this.form.investor = ''
  1286. this.form.investorName = ''
  1287. return false
  1288. }
  1289. this.form.investor = data.id
  1290. this.form.investorName = data.cname
  1291. },
  1292. calculateInterest(){
  1293. if (!this.form.investor) {
  1294. this.$message.error('请选择资方')
  1295. return false
  1296. }
  1297. if (!this.form.interestRate) {
  1298. this.$message.error('请输入利率')
  1299. return false
  1300. }
  1301. if (!this.form.days) {
  1302. this.$message.error('请输入天数')
  1303. return false
  1304. }
  1305. calculateInterestAmount(this.form).then(res => {
  1306. this.$message.success(res.data.msg)
  1307. this.queryData(this.form.id)
  1308. })
  1309. },
  1310. queryData(id) {
  1311. this.pageLoading = true
  1312. this.saveLoading = true
  1313. detail(id).then(async res => {
  1314. this.form = res.data.data;
  1315. this.browse = this.form.status > 0 ? true : false;
  1316. this.arrearsCheck = this.form.specialCheckStatus == 3 ? true : false;
  1317. await getProfit({ Id: this.form.corpId }).then(res => {
  1318. this.$set(this.form, 'profit', res.data.data.surplusProfit ? res.data.data.surplusProfit : '0.00')
  1319. })
  1320. this.contactsData = this.form.orderItemsList.filter(item => {
  1321. return item.goodType == 0
  1322. })
  1323. for (let item of this.contactsData) {
  1324. item.storageId = item.storageId + '-' + item.corpId
  1325. }
  1326. console.log(this.contactsData, 1598)
  1327. this.giftData = this.form.orderItemsList.filter(item => {
  1328. return item.goodType == 1
  1329. })
  1330. for (let item of this.giftData) {
  1331. item.storageId = item.storageId + '-' + item.corpId
  1332. }
  1333. this.goodsShowData = this.giftData;
  1334. this.saveActives = 'gift'
  1335. this.goodsActives = 'goods';
  1336. this.handleClick({ name: this.goodsActives })
  1337. this.advantageProjectData = this.form.orderFeesList
  1338. this.bankOfDepositData = this.form.orderFilesList
  1339. this.configuration.dicData = this.form.corpName
  1340. let feesData = []
  1341. this.form.orderFeesList.forEach(item => {
  1342. let a = {
  1343. cname: item.corpName,
  1344. id: item.corpId
  1345. }
  1346. feesData.push(a)
  1347. })
  1348. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  1349. // 去重
  1350. this.removeRepeat()
  1351. let goodsData = []
  1352. this.form.orderItemsList.forEach(item => {
  1353. let a = {
  1354. cname: item.cname,
  1355. }
  1356. goodsData.push(a)
  1357. })
  1358. this.goodsConfiguration.dicData = [].concat(goodsData)
  1359. this.removeGoodsRepeat()
  1360. delete this.form.orderItemsList
  1361. delete this.form.orderFeesList
  1362. delete this.form.orderFilesList
  1363. // 获取最大值
  1364. let numList = this.advantageProjectData.map(item => item.sort)
  1365. this.maxFeeNum = numList.length === 0 ? 0 : Math.max.apply(null, numList);
  1366. let goodsNum = []
  1367. let purchaseAmount = 0
  1368. this.contactsData.forEach(item => {
  1369. goodsNum.push(item.sort)
  1370. purchaseAmount += Number(item.purchaseAmount)
  1371. })
  1372. if (goodsNum.length == 0) {
  1373. this.maxGoodsNum = 0;
  1374. } else {
  1375. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  1376. return b > a ? b : a;
  1377. })
  1378. }
  1379. this.oldForm = Object.assign({}, this.form)
  1380. this.oldGoodsList = []
  1381. this.oldGiftList = []
  1382. this.oldFeesList = []
  1383. this.oldUploadList = []
  1384. this.storageNameList = []
  1385. this.oldGoodsList = this.deepClone(this.contactsData)
  1386. this.oldGiftList = this.deepClone(this.giftData)
  1387. this.oldFeesList = this.deepClone(this.advantageProjectData)
  1388. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  1389. }).finally(() => {
  1390. this.saveLoading = false
  1391. this.pageLoading = false
  1392. });
  1393. },
  1394. getDefault() {
  1395. let date = new Date();
  1396. let year = date.getFullYear();
  1397. let month = date.getMonth() + 1;
  1398. let day = date.getDate();
  1399. if (month < 10) {
  1400. month = "0" + month;
  1401. }
  1402. if (day < 10) {
  1403. day = "0" + day;
  1404. }
  1405. let nowDate = year + "-" + month + "-" + day + ' 00:00:00';
  1406. this.$set(this.form, 'businesDate', nowDate)
  1407. this.$set(this.form, 'orderStatus', '录入')
  1408. this.$set(this.form, 'caseOverPayment', 0)
  1409. this.$set(this.form, 'overPayment', 0)
  1410. this.$set(this.form, 'orderAmount', 0)
  1411. this.$set(this.form, 'predictOceanFreight', 0)
  1412. this.$set(this.form, 'presenterIntegral', 0)
  1413. this.$set(this.form, 'convertIntegral', 0)
  1414. this.$set(this.form, 'profit', 0)
  1415. this.$set(this.form, 'paymentType', '预付')
  1416. this.$set(this.form, 'thisUsedProfit', 0)
  1417. this.$set(this.form, 'createProfit', 0)
  1418. this.$set(this.form, 'isFreight', 0)
  1419. this.$set(this.form, 'isLabel', 0)
  1420. },
  1421. // 报表
  1422. openReport() {
  1423. this.switchDialog = !this.switchDialog;
  1424. },
  1425. // 导出
  1426. exportHandle() {
  1427. this.$confirm('是否导出产品信息?', '提示', {
  1428. confirmButtonText: '确定',
  1429. cancelButtonText: '取消',
  1430. type: 'warning'
  1431. }).then(() => {
  1432. window.open(
  1433. `/api/blade-client/goodsdesc/export-out-info?${this.website.tokenHeader
  1434. }=${getToken()}`
  1435. );
  1436. }).catch(() => {
  1437. this.$message({
  1438. type: 'info',
  1439. message: '已取消'
  1440. });
  1441. })
  1442. },
  1443. onClose(val) {
  1444. this.switchDialog = val;
  1445. },
  1446. // 去重
  1447. removeRepeat() {
  1448. let obj = []
  1449. this.configuration.dicData = this.configuration.dicData.reduce((current, next) => {
  1450. obj[next.id] ? '' : obj[next.id] = true && current.push(next)
  1451. return current
  1452. }, [])
  1453. },
  1454. removeGoodsRepeat() {
  1455. let obj = []
  1456. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current, next) => {
  1457. obj[next.cname] ? '' : obj[next.cname] = true && current.push(next)
  1458. return current
  1459. }, [])
  1460. },
  1461. async getCorpRow(data) {
  1462. getCharge('KH', data.id).then(res => {
  1463. this.userList = res.data.data;
  1464. })
  1465. khDetail(data.id).then(res => {
  1466. this.$set(this.form, 'packageRemarks', res.data.data.packageRemarks ? res.data.data.packageRemarks : '透明包装')
  1467. if (res.data.data.adminProfiles) {
  1468. res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
  1469. let arr = [];
  1470. res.data.data.adminProfiles.forEach(e => {
  1471. arr.push(this.userList.find(item => item.id == e).cname)
  1472. })
  1473. this.$set(this.form, 'chargeMember', arr[0])
  1474. }
  1475. if (res.data.data.corpsAttnList.length > 0) {
  1476. this.khInfoList = res.data.data.corpsAttnList;
  1477. this.$set(this.form, 'corpAttn', res.data.data.corpsAttnList[0].cname);
  1478. this.$set(this.form, 'corpTel', res.data.data.corpsAttnList[0].tel);
  1479. } else {
  1480. this.khInfoList = [];
  1481. this.$set(this.form, 'corpAttn', null);
  1482. this.$set(this.form, 'corpTel', null);
  1483. }
  1484. })
  1485. getCorpDetail({ corpId: data.id }).then(res => {
  1486. this.form.overPayment = res.data.data ? res.data.data.balanceOverpaymen : 0
  1487. })
  1488. integralDetail({ corpId: data.id }).then(res => {
  1489. this.form.pointMutiple = res.data.data ? res.data.data.balancePoints : 0
  1490. })
  1491. getProfit({ Id: data.id }).then(res => {
  1492. this.form.profit = res.data.data.surplusProfit ? res.data.data.surplusProfit : '0.00'
  1493. })
  1494. this.arrivalOptions = [];
  1495. this.arrivalOptions = await this.corpAddr(data.id)
  1496. this.$set(this.form, 'paymentType', data.paymentType ? data.paymentType : '预付')
  1497. if (this.arrivalOptions.length > 0) {
  1498. this.$set(this.form, 'arrivalAddress', this.arrivalOptions[0].label)
  1499. } else {
  1500. this.$set(this.form, 'arrivalAddress', null)
  1501. }
  1502. },
  1503. async getPlantRow(data) {
  1504. this.shippingOptions = [];
  1505. this.shippingOptions = await this.corpAddr(data.id)
  1506. if (this.shippingOptions.length > 0) {
  1507. this.$set(this.form, 'shippingAddress', this.shippingOptions[0].label)
  1508. } else {
  1509. this.$set(this.form, 'shippingAddress', null)
  1510. }
  1511. },
  1512. //返回列表
  1513. backToList() {
  1514. this.$emit("goBack");
  1515. this.leaveDetailsKey(this.$route.name)
  1516. },
  1517. // 保存列设置
  1518. async saveColumn(name) {
  1519. if (name == 'goods') {
  1520. const inSave = await this.saveColumnData(
  1521. this.getColumnName(15),
  1522. this.customerContact
  1523. );
  1524. if (inSave) {
  1525. this.$message.success("保存成功");
  1526. //关闭窗口
  1527. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1528. this.$nextTick(() => {
  1529. this.$refs.crudContact.doLayout()
  1530. })
  1531. }
  1532. } else if (name === 'fees') {
  1533. const inSave = await this.saveColumnData(
  1534. this.getColumnName(16),
  1535. this.advantageProject
  1536. );
  1537. if (inSave) {
  1538. this.$message.success("保存成功");
  1539. //关闭窗口
  1540. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  1541. }
  1542. }
  1543. },
  1544. async resetColumn() {
  1545. this.customerContact = customerContact
  1546. const inSave = await this.delColumnData(
  1547. this.getColumnName(15),
  1548. customerContact
  1549. );
  1550. if (inSave) {
  1551. this.$nextTick(() => {
  1552. this.$refs.crudContact.doLayout()
  1553. })
  1554. this.$message.success("重置成功");
  1555. //关闭窗口
  1556. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1557. }
  1558. },
  1559. returnBack(row) {
  1560. console.log(row)
  1561. this.$refs.KHSelect[0].updateData(row.id)
  1562. getKHList({ corpType: 'KH', belongtocompany: row.id }).then(res => {
  1563. })
  1564. getKHList({ corpType: 'GYS', belongtocompany: row.id }).then(res => {
  1565. this.form.productionPlant = res.data.data.records.length > 0 ? res.data.data.records[0].id : null;
  1566. if (this.form.productionPlant) {
  1567. this.getPlantRow({ id: this.form.productionPlant })
  1568. }
  1569. })
  1570. this.form.belongCompany = row.cname
  1571. getlistBankBy(row.id).then(res => {
  1572. this.$set(this.form, 'banks', null)
  1573. this.$set(this.form, 'banksAccountName', null)
  1574. this.$set(this.form, 'accountBank', null)
  1575. this.bankList = res.data
  1576. if (this.bankList.length > 0) {
  1577. this.form.banks = this.bankList[0].accountNo
  1578. this.form.banksAccountName = this.bankList[0].accountName
  1579. this.form.accountBank = this.bankList[0].accountBank
  1580. }
  1581. })
  1582. },
  1583. // 商品表格加色
  1584. goodsRowClassName({ row, column, rowIndex, columnIndex }) {
  1585. if (Number(row.orderQuantity) > Number(row.storageQuantity) && column.property == 'storageQuantity') {
  1586. return "color: #fff;background:#a4cf57"
  1587. }
  1588. return '';
  1589. },
  1590. // 合计计算
  1591. summaryMethod({ columns, data }) {
  1592. const sums = [];
  1593. if (columns.length > 0) {
  1594. columns.forEach((item, index) => {
  1595. sums[0] = '合计'
  1596. if (
  1597. item.property == "amount" ||
  1598. item.property == "orderQuantity" ||
  1599. item.property == "actualQuantity" ||
  1600. item.property == "integral" ||
  1601. item.property == "cartonWeight" ||
  1602. item.property == "cntrVolumn"
  1603. ) {
  1604. let amountSum = 0;
  1605. let orderQuantitySum = 0;
  1606. let actualQuantitySum = 0;
  1607. let integralSum = 0;
  1608. let cartonWeight = 0;
  1609. let cntrVolumn = 0;
  1610. if (this.selection.length > 0) {
  1611. this.selection.forEach(e => {
  1612. amountSum = _.add(amountSum, Number(e.amount));
  1613. orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
  1614. actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
  1615. integralSum = _.add(integralSum, Number(e.integral));
  1616. cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
  1617. cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
  1618. })
  1619. } else {
  1620. {
  1621. this.goodsShowData.forEach(e => {
  1622. amountSum = _.add(amountSum, Number(e.amount));
  1623. orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
  1624. actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
  1625. integralSum = _.add(integralSum, Number(e.integral));
  1626. cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
  1627. cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
  1628. })
  1629. }
  1630. }
  1631. // 订货数量合计
  1632. if (item.property == "orderQuantity") {
  1633. sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(0) : "0";
  1634. }
  1635. // 发货数量合计
  1636. if (item.property == "actualQuantity") {
  1637. sums[index] = actualQuantitySum ? actualQuantitySum.toFixed(0) : "0";
  1638. }
  1639. // 金额合计
  1640. if (item.property == "amount") {
  1641. sums[index] = amountSum ? amountSum.toFixed(2) : "0.00";
  1642. }
  1643. // 积分合计
  1644. if (item.property == "integral") {
  1645. sums[index] = integralSum ? integralSum.toFixed(2) : "0.00";
  1646. }
  1647. // 重量合计
  1648. if (item.property == "cartonWeight") {
  1649. sums[index] = cartonWeight ? cartonWeight.toFixed(2) : "0.00";
  1650. }
  1651. // 体积合计
  1652. if (item.property == "cntrVolumn") {
  1653. sums[index] = cntrVolumn ? cntrVolumn.toFixed(5) : "0.00000";
  1654. }
  1655. }
  1656. })
  1657. }
  1658. return sums;
  1659. },
  1660. // 标签页切换
  1661. tabHandle(data) {
  1662. if (data.name == 'searchList') {
  1663. this.goodsListShow = this.data;
  1664. this.page.total = this.pageList.total
  1665. } else if (data.name == 'importStaging') {
  1666. this.goodsListShow = this.goodsListSave;
  1667. this.page.total = 0
  1668. }
  1669. },
  1670. // 商品信息标签页切换
  1671. handleClick(data) {
  1672. console.info('datata---', data);
  1673. console.info('this.saveActives---', this.saveActives);
  1674. if (this.saveActives == data.name) return
  1675. this.saveActives = data.name
  1676. this.goodsDisabled = true
  1677. if (data.name == 'goods') {
  1678. this.giftData = this.goodsShowData.filter(item => item.goodType == 1)
  1679. // 显示
  1680. this.customerContact.column.forEach(item => {
  1681. if (item.prop == 'integralMultiples') item.label = '积分倍数'
  1682. if (item.prop == 'integral') item.label = '赠送积分'
  1683. if (item.prop == 'orderQuantity') item.label = '订货数量'
  1684. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1685. || item.prop == 'actualQuantity' || item.prop == 'storageQuantity'
  1686. || item.prop == 'purchaseAmount' || item.prop == 'price' || item.prop == 'amount'
  1687. || item.prop == 'shopQuality'
  1688. ) {
  1689. item.hide = false;
  1690. item.showColumn = true;
  1691. if (!this.permission.show_purPrice) {
  1692. if (item.prop == 'purchaseAmount') {
  1693. item.hide = true;
  1694. item.showColumn = false;
  1695. }
  1696. }
  1697. }
  1698. })
  1699. // contactsData它是商品的数组 giftData它是赠品的数组 goodsShowData它是展示页面的数组一共三个
  1700. this.goodsShowData = this.deepClone(this.contactsData);
  1701. setTimeout(() => {
  1702. this.goodsDisabled = false
  1703. }, 500)
  1704. } else {
  1705. // 隐藏字段
  1706. this.contactsData = this.goodsShowData.filter(item => item.goodType == 0)
  1707. this.customerContact.column.forEach(item => {
  1708. if (item.prop == 'deliveryAmount') item.label = '积分'
  1709. if (item.prop == 'actualQuantity') item.label = '数量'
  1710. if (item.prop == 'integralMultiples') item.label = '积分'
  1711. if (item.prop == 'integral') item.label = '兑换积分'
  1712. if (item.prop == 'orderQuantity') item.label = '数量'
  1713. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1714. || item.prop == 'actualQuantity' || item.prop == 'storageQuantity'
  1715. || item.prop == 'purchaseAmount' || item.prop == 'price' || item.prop == 'amount'
  1716. || item.prop == 'shopQuality'
  1717. ) {
  1718. item.hide = true;
  1719. item.showColumn = false;
  1720. }
  1721. })
  1722. // this.giftData=this.goodsShowData.filter(e=>e.typegood==1)
  1723. this.goodsShowData = this.deepClone(this.giftData);
  1724. setTimeout(() => {
  1725. this.goodsDisabled = false
  1726. }, 500)
  1727. }
  1728. },
  1729. // 切换之前
  1730. beforeLeave(activeName, oldActiveName) {
  1731. },
  1732. //费用明细回调
  1733. beforeFinance(feesData, callback) {
  1734. this.advantageProjectData = feesData;
  1735. let params = {}
  1736. //暂时默认通过 之后优化
  1737. params.valid = true
  1738. params.parentId = this.form.id
  1739. params.srcOrderno = this.form.orderNo
  1740. callback(params)
  1741. }
  1742. },
  1743. computed: {
  1744. ...mapGetters(["userInfo", "permission"])
  1745. },
  1746. watch: {
  1747. customerContact(oldVal, newVal) {
  1748. if (!this.permission.show_purPrice) {
  1749. oldVal.column.forEach(item => {
  1750. if (item.prop == 'purchaseAmount') {
  1751. item.hide = true;
  1752. item.showColumn = false;
  1753. }
  1754. })
  1755. }
  1756. if (this.roleName.includes('业务员')) {
  1757. oldVal.column.forEach(item => {
  1758. if (item.prop == 'purchaseAmount') {
  1759. item.hide = true;
  1760. item.showColumn = false;
  1761. }
  1762. })
  1763. } else {
  1764. oldVal.column.forEach(item => {
  1765. if (item.prop == 'purchaseAmount') {
  1766. item.hide = false;
  1767. item.showColumn = true;
  1768. }
  1769. })
  1770. }
  1771. }
  1772. }
  1773. }
  1774. </script>
  1775. <style lang="scss" scoped>
  1776. .back-icon {
  1777. line-height: 64px;
  1778. font-size: 20px;
  1779. margin-right: 8px;
  1780. }
  1781. ::v-deep .el-form-item {
  1782. margin-bottom: 0;
  1783. }
  1784. .el-dialogDeep {
  1785. ::v-deep .el-dialog {
  1786. margin: 1vh auto 0 !important;
  1787. padding-bottom: 10px !important;
  1788. .el-dialog__body,
  1789. .el-dialog__footer {
  1790. padding-bottom: 0 !important;
  1791. padding-top: 0 !important;
  1792. }
  1793. }
  1794. }
  1795. .print-div {
  1796. color: #000;
  1797. }
  1798. .print_table {
  1799. table {
  1800. border-right: 1px solid #000;
  1801. border-bottom: 1px solid #000;
  1802. font-size: 12px;
  1803. margin-bottom: 5px;
  1804. }
  1805. table td {
  1806. border-left: 1px solid #000;
  1807. border-top: 1px solid #000;
  1808. vertical-align: middle;
  1809. padding: 2px;
  1810. text-align: center;
  1811. }
  1812. }
  1813. .table {
  1814. border-collapse: collapse;
  1815. border-spacing: 0;
  1816. background-color: transparent;
  1817. display: table;
  1818. width: 99%;
  1819. max-width: 100%;
  1820. margin: 0 auto;
  1821. }
  1822. .table td {
  1823. text-align: left;
  1824. vertical-align: middle;
  1825. font-size: 14px;
  1826. color: #000000;
  1827. padding: 10.5px 0 10.5px 30px;
  1828. //border: 1px solid #000;
  1829. }
  1830. ::v-deep .el-form-item {
  1831. margin-bottom: 0;
  1832. }
  1833. ::v-deep .el-form-item__content {
  1834. line-height: 32px;
  1835. }
  1836. .isShow {
  1837. display: none;
  1838. }
  1839. .order_number:hover {
  1840. display: none;
  1841. }
  1842. .number_button {
  1843. display: none;
  1844. }
  1845. .order_number:hover+.number_button {
  1846. display: block;
  1847. }
  1848. </style>