index.vue 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964
  1. <template>
  2. <div class="pageIndexClass">
  3. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
  4. highlight-current-row :action-list="[
  5. ]" @get-list="getList">
  6. <template #code="{ item }">
  7. <div style="width: 100%">
  8. <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="getDtlOne(item,true,0)">{{ item.code }}</span>
  9. </div>
  10. </template>
  11. <template #status="{ item }">
  12. <div style="width: 100%">
  13. <span :style="{color: item.status ==88? 'red' :''}">{{dictValueLabel(item.status, statusData)}}</span>
  14. </div>
  15. </template>
  16. <template #quotationStatus="{item}">
  17. <div style="width: 100%">
  18. <span
  19. :class="{ 'tag-active-1': item.quotationStatus==1, 'tag-active': item.quotationStatus==2 }">{{dictValueLabel(item.quotationStatus, quotationStatusData)}}</span>
  20. </div>
  21. </template>
  22. <template #amount="{ item }">
  23. <div>
  24. <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
  25. <span>{{ moneyFormat(item.prodAmount, 2) }}</span>
  26. </div>
  27. </template>
  28. <template #product="{ item }">
  29. <div style="width:100%;">
  30. <el-popover placement="bottom-start" title="" :width="300" trigger="hover">
  31. <div default>
  32. <div v-for="(product,index) in item.quotationProductList">
  33. {{index+1}}、{{product.productName}}
  34. <!-- <span v-if="index<item.quotationProductList.length-1">,</span> -->
  35. </div>
  36. </div>
  37. <template #reference>
  38. <div style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer">
  39. <span v-for="(product,index) in item.quotationProductList">
  40. {{product.productName}}
  41. <span v-if="index<item.quotationProductList.length-1"> , </span>
  42. </span>
  43. </div>
  44. </template>
  45. </el-popover>
  46. </div>
  47. </template>
  48. </byTable>
  49. <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="98%" append-to-body>
  50. <div style="height:calc(100vh - 215px)" class="box">
  51. <div class="left">
  52. <!-- <el-card style="width:100%;margin-bottom:15px" v-for="(item,index) in quotationProductList" :key="index">
  53. <div style="text-align:right">
  54. <el-button plain type="primary" @click="handleLookDetail(item,index)">查看</el-button>
  55. <el-button plain type="primary" @click="handleReportPrice(item,index)">报价</el-button>
  56. </div>
  57. <el-table :data="[item]" style="width: 100%;">
  58. <el-table-column label="图片" width="80">
  59. <template #default="{ row }">
  60. <div v-if="row.fileUrl">
  61. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  62. </div>
  63. <div v-else></div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column prop="productCode" label="商品编码" width="190" />
  67. <el-table-column prop="productName" label="商品名称" min-width="200" />
  68. <el-table-column label="规格尺寸 (cm)" width="150">
  69. <template #default="{ row, $index }">
  70. <div style="width: 100%">
  71. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  72. </div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="productColor" label="颜色" width="100" />
  76. <el-table-column label="数量" width="120" prop="quantity">
  77. </el-table-column>
  78. <el-table-column label="单价" width="120" prop="prodPrice" fixed="right">
  79. <template #default="{ row, $index }">
  80. <div style="width: 100%;">
  81. <span :style="{
  82. color:row.prodPrice?'red':''
  83. }">¥{{row.prodPrice}}</span>
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="amount" label="小计" width="120" fixed="right">
  88. <template #default="{ row, $index }">
  89. <div style="width: 100%">
  90. <span :style="{
  91. color:row.prodPrice?'red':''
  92. }">¥{{row.amount}}</span>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </el-card> -->
  98. <el-form disabled label-width="80px">
  99. <el-collapse v-model="activeNames">
  100. <el-card style="margin-bottom:15px" v-for="(product,index) in quotationProductList" :key="index">
  101. <el-collapse-item :name="index">
  102. <template #title>
  103. <el-row style="width:100%">
  104. <el-col :span="8">
  105. <div style="font-size:14px;font-weight:700;padding-left:10px">
  106. 产品编码:{{product.productCode || '定制产品'}}
  107. </div>
  108. </el-col>
  109. <el-col :span="4">
  110. <!-- <el-form-item label="数量" class="margin-b-0" :prop="'quotationProductList.' +index + '.quantity'" :rules="rules.quantity"
  111. :inline-message="true" @click.stop>
  112. <el-input-number v-model="product.quantity" placeholder="请输入" style="width: 100%" :precision="0" :controls="false" :min="1"
  113. onmousewheel="return false;" />
  114. </el-form-item> -->
  115. <span>数量:{{product.quantity}}</span>
  116. </el-col>
  117. <el-col :span="4">
  118. <!-- <el-form-item label="单价" class="margin-b-0" @click.stop>
  119. <el-input-number v-model="product.price" placeholder="" style="width: 100%" :precision="2" :controls="false" :min="1"
  120. onmousewheel="return false;" disabled />
  121. </el-form-item> -->
  122. 单价:<span :style="{color:product.prodPrice?'red':''}">{{product.prodPrice}}</span>
  123. </el-col>
  124. <el-col :span="4">
  125. <!-- <el-form-item label="总价" class="margin-b-0" @click.stop>
  126. <el-input-number v-model="product.amount" placeholder="" style="width: 100%" :precision="2" :controls="false" :min="1"
  127. onmousewheel="return false;" disabled />
  128. </el-form-item> -->
  129. 总价:<span :style="{color:product.prodPrice?'red':''}">{{product.amount}}</span>
  130. </el-col>
  131. <el-col :span="4" style="padding-left:10px">
  132. <!-- <el-button plain type="primary" @click="handleReportPrice(product,index)">报价</el-button> -->
  133. <span class="el-click" @click.stop="handleReportPrice(product,index)">报价</span>
  134. </el-col>
  135. </el-row>
  136. </template>
  137. <div style="width:100%">
  138. <div style="margin:10px 0">
  139. <TitleInfo :content="'基本信息'"></TitleInfo>
  140. </div>
  141. <div style="width: 100%;padding-left:15px">
  142. <el-row>
  143. <!-- <el-col :span="12">
  144. <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
  145. label="原材料" class="wid100">
  146. <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
  147. <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
  148. </el-select>
  149. </el-form-item>
  150. </el-col> -->
  151. <el-col :span="12">
  152. <el-form-item label="颜色" class="margin-b-0 wid100">
  153. <el-row style="width: 100%">
  154. <el-col :span="12">
  155. <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
  156. <el-input v-model="product.productColor" placeholder="颜色" />
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="12">
  160. <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
  161. <el-input v-model="product.colorCardCode" placeholder="色卡号" />
  162. </el-form-item>
  163. </el-col>
  164. </el-row>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="12">
  168. <el-form-item label="尺寸" required>
  169. <el-row style="width:100%">
  170. <el-col :span="8">
  171. <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
  172. :inline-message="true" label-width="0px" class="margin-b-0 wid100">
  173. <el-input-number v-model="product.productLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
  174. :controls="false" :min="0" onmousewheel="return false;" />
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="8">
  178. <el-form-item :prop="'quotationProductList.' +index + '.productWidth'" :rules="rules.productWidth"
  179. :inline-message="true" label-width="0px" class="margin-b-0 wid100">
  180. <el-input-number v-model="product.productWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2"
  181. :controls="false" :min="0" onmousewheel="return false;" />
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="8">
  185. <el-form-item :prop="'quotationProductList.' +index + '.productHeight'" :rules="rules.productHeight"
  186. :inline-message="true" label-width="0px" class="margin-b-0 wid100">
  187. <el-input-number v-model="product.productHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
  188. :controls="false" :min="0" onmousewheel="return false;" />
  189. </el-form-item>
  190. </el-col>
  191. </el-row>
  192. </el-form-item>
  193. </el-col>
  194. </el-row>
  195. <el-row>
  196. <el-col :span="12">
  197. <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
  198. <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
  199. :min="0" onmousewheel="return false;" />
  200. </el-form-item>
  201. </el-col>
  202. </el-row>
  203. </div>
  204. <div style="margin:10px 0">
  205. <TitleInfo :content="'BOM'"></TitleInfo>
  206. </div>
  207. <div style="width: 100%;padding-left:15px">
  208. <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
  209. <el-table-column prop="productName" label="物料名称" width="170" />
  210. <el-table-column prop="productCode" label="物料编码" width="180" />
  211. <el-table-column label="规格尺寸(cm)" width="130">
  212. <template #default="{ row, $index }">
  213. <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
  214. {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
  215. </div>
  216. </template>
  217. </el-table-column>
  218. <el-table-column prop="productColor" label="颜色" width="170" />
  219. <el-table-column prop="quantity" label="数量" width="100" />
  220. <el-table-column prop="standardDosage" label="标准用量" width="100" />
  221. <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
  222. <el-table-column prop="remark" label="备注" min-width="150" />
  223. </el-table>
  224. </div>
  225. <div style="margin:10px 0">
  226. <TitleInfo :content="'附加工艺要求'"></TitleInfo>
  227. </div>
  228. <div style="width:100%;padding-left:15px">
  229. <!-- <div class="small-title">
  230. ① 工艺线路
  231. </div>
  232. <el-row style="width:100%">
  233. <el-col :span="12">
  234. <el-form-item label="生产工艺" class="wid100" :prop="'quotationProductList.' + index + '.technologyId'"
  235. :rules="rules.technologyId" :inline-message="true">
  236. <el-select v-model="product.technologyId" placeholder="请选择" style="width:100%">
  237. <el-option v-for="item in technologyData" :key="item.id" :label="item.name" :value="item.id" />
  238. </el-select>
  239. </el-form-item>
  240. </el-col>
  241. </el-row> -->
  242. <div class="small-title">
  243. ① LOGO
  244. </div>
  245. <el-row style="width:100%">
  246. <el-col :span="12">
  247. <el-form-item label="LOGO尺寸" class="wid100">
  248. <el-row style="width:100%">
  249. <el-col :span="12">
  250. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoLength'"
  251. :rules="rules.logoLength" :inline-message="true">
  252. <el-input-number v-model="product.logoLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
  253. :controls="false" :min="0" onmousewheel="return false;" />
  254. </el-form-item>
  255. </el-col>
  256. <el-col :span="12">
  257. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoWidth'"
  258. :rules="rules.logoWidth" :inline-message="true">
  259. <el-input-number v-model="product.logoWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2"
  260. :controls="false" :min="0" onmousewheel="return false;" />
  261. </el-form-item>
  262. </el-col>
  263. <!-- <el-col :span="8">
  264. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoHeight'"
  265. :rules="rules.logoHeight" :inline-message="true">
  266. <el-input-number v-model="product.logoHeight" placeholder="高 (cm)" style="width: 100%" :precision="2" :controls="false"
  267. :min="0" onmousewheel="return false;" />
  268. </el-form-item>
  269. </el-col> -->
  270. </el-row>
  271. </el-form-item>
  272. </el-col>
  273. <el-col :span="12">
  274. <el-form-item label="几色印刷" class="wid100">
  275. <el-input-number v-model="product.colorCount" style="width: 100%" :precision="0" :controls="false" :min="1"
  276. onmousewheel="return false;" />
  277. </el-form-item>
  278. </el-col>
  279. </el-row>
  280. <div class="small-title">
  281. ② 折叠
  282. </div>
  283. <el-row style="width:100%">
  284. <el-col :span="12">
  285. <el-form-item label="是否折叠" class="wid100">
  286. <el-select v-model="product.isFold" style="width:100%">
  287. <el-option :label="'否'" :value="0" />
  288. <el-option :label="'是'" :value="1" />
  289. </el-select>
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="12">
  293. <el-form-item label="折叠数" class="wid100" :prop="'quotationProductList.' +index + '.foldWay'" v-if="product.isFold==1"
  294. :rules="product.isFold==1?rules.foldWay:''">
  295. <el-select v-model="product.foldWay" style="width:100%">
  296. <el-option v-for="item in foldWayData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  297. </el-select>
  298. </el-form-item>
  299. </el-col>
  300. </el-row>
  301. <div class="small-title">
  302. ③ 包装要求
  303. </div>
  304. <el-row style="width:100%">
  305. <el-col :span="12">
  306. <el-form-item label="包装要求" class="wid100">
  307. <el-select v-model="product.packAsk" style="width:100%" multiple placeholder=" ">
  308. <el-option v-for="item in packAskData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  309. </el-select>
  310. </el-form-item>
  311. </el-col>
  312. </el-row>
  313. <div class="small-title">
  314. ④ 是否定制
  315. </div>
  316. <el-row style="width:100%">
  317. <el-col :span="12">
  318. <el-form-item prop="isCustomized" label="是否定制" class="wid100">
  319. <el-select v-model="product.isCustomized" style="width:100%">
  320. <el-option :label="'否'" :value="0" />
  321. <el-option :label="'是'" :value="1" />
  322. </el-select>
  323. </el-form-item>
  324. </el-col>
  325. </el-row>
  326. <el-row style="width:100%">
  327. <el-form-item label="定制内容" class="wid100" v-if="product.isCustomized==1">
  328. <table style="width:100%" border class="table">
  329. <tr>
  330. <td style="width:20%">
  331. </td>
  332. <td style="width:40%">附件</td>
  333. <td style="width:40%">备注</td>
  334. </tr>
  335. <tr v-for="(row,sonIndex) in product.quotationProductCustomInfoList" :key="sonIndex">
  336. <td>
  337. <el-checkbox v-model="row.isCheckBox" label="" /> <span style="position:relative;top:-2px">
  338. {{getLabelOne(row.type)}}</span>
  339. </td>
  340. <td>
  341. <div v-for="file in row.fileList" :key="file.id" class="el-click" @click="openImg(file.fileUrl)">
  342. {{file.fileName}}
  343. </div>
  344. </td>
  345. <td>
  346. <el-form-item :prop="'quotationProductList.' + index + '.quotationProductCustomInfoList.' + sonIndex + '.remark'"
  347. :rules="row.isCheckBox?rules.remark:''" :inline-message="true" class="margin-b-0 wid100">
  348. <el-input v-model="row.remark" />
  349. </el-form-item>
  350. </td>
  351. </tr>
  352. </table>
  353. </el-form-item>
  354. </el-row>
  355. </div>
  356. </div>
  357. </el-collapse-item>
  358. </el-card>
  359. </el-collapse>
  360. </el-form>
  361. </div>
  362. <div class="right">
  363. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom"
  364. v-if="formData.data.quotationProductId" v-loading="submitLoading">
  365. <template #quotationDetail>
  366. <div style="width:100%">
  367. <div style="text-align:center">
  368. 正在对 <span style="color:red">{{formData.data.productCode}},{{formData.data.productName}}({{formData.data.quantity}})</span> 进行报价
  369. </div>
  370. <table class="table" border>
  371. <thead>
  372. <tr>
  373. <th style="width:10%">
  374. 类型
  375. </th>
  376. <th style="width:15%">
  377. 编码
  378. </th>
  379. <th style="width:15%">
  380. 名称
  381. </th>
  382. <th style="width:8%" class="align-right">
  383. 一出几
  384. </th>
  385. <th style="width:16%" class="align-right">
  386. 模具
  387. </th>
  388. <th style="width:9%" class="align-right">
  389. 数量/件
  390. </th>
  391. <th style="width:9%" class="align-right">
  392. 单价
  393. </th>
  394. <th style="width:8%" class="align-right">
  395. 总量
  396. </th>
  397. <th style="width:10%" class="align-right">
  398. 总价
  399. </th>
  400. </tr>
  401. </thead>
  402. <tbody>
  403. <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
  404. <tr v-if="row.type==1">
  405. <td>原材料</td>
  406. <td>{{row.code}}</td>
  407. <td>{{row.name}}</td>
  408. <td class="align-right">
  409. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.cavityNum'"
  410. :rules="rules.cavityNum" :inline-message="true">
  411. <el-input-number onmousewheel="return false;" v-model="row.cavityNum" placeholder="一出几" style="width: 100%" :precision="0"
  412. :controls="false" :min="1" @change="(val)=>changeCavityNum(val,index)" />
  413. </el-form-item>
  414. </td>
  415. <td class="align-right">
  416. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.moldId'"
  417. :rules="rules.moldId" :inline-message="true">
  418. <el-select v-model="row.moldId" filterable placeholder="请选择模具" style="width: 100%"
  419. @change="(val)=>changeMoldId(val,index)">
  420. <el-option v-for="item in moldData" :key="item.id" :label="item.moldName" :value="item.id" />
  421. </el-select>
  422. </el-form-item>
  423. </td>
  424. <td class="align-right">-</td>
  425. <td class="align-right">
  426. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
  427. :inline-message="true">
  428. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
  429. :controls="false" :min="0" @change="changeTotalAmount()" />
  430. </el-form-item>
  431. </td>
  432. <td class="align-right">
  433. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.totalQuantity'"
  434. :rules="rules.totalQuantity" :inline-message="true">
  435. <el-input-number onmousewheel="return false;" v-model="row.totalQuantity" placeholder="总量" style="width: 100%"
  436. :precision="0" :controls="false" :min="1" @change="changeTotalAmount()" />
  437. </el-form-item>
  438. </td>
  439. <td class="align-right">{{row.amount}}</td>
  440. </tr>
  441. </template>
  442. <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
  443. <tr v-if="row.type == 2">
  444. <td :rowspan="getRowSpan(2)" v-if="row.show">
  445. <el-button text type="primary" @click="openSelectMaterial=true">选择</el-button>
  446. <div>包材/配件/辅材</div>
  447. </td>
  448. <td>
  449. {{row.code}}
  450. </td>
  451. <td>
  452. {{row.name}}
  453. </td>
  454. <td class="align-right">
  455. -
  456. </td>
  457. <td class="align-right">
  458. -
  459. </td>
  460. <td class="align-right">
  461. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.quantity'"
  462. :rules="rules.quantity" :inline-message="true">
  463. <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="数量" style="width: 100%" :precision="0"
  464. :controls="false" :min="1" @change="changeTotalAmount()" />
  465. </el-form-item>
  466. </td>
  467. <td class="align-right">
  468. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
  469. :inline-message="true">
  470. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
  471. :controls="false" :min="0" @change="changeTotalAmount()" />
  472. </el-form-item>
  473. </td>
  474. <td class="align-right">
  475. {{row.totalQuantity}}
  476. </td>
  477. <td class="align-right">
  478. {{row.amount}}
  479. </td>
  480. </tr>
  481. </template>
  482. <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
  483. <tr v-if="row.type == 3">
  484. <td :rowspan="getRowSpan(3)" v-if="row.show">
  485. 工序
  486. </td>
  487. <td>
  488. {{row.code}}
  489. </td>
  490. <td>
  491. {{row.name}}
  492. </td>
  493. <td class="align-right">
  494. -
  495. </td>
  496. <td class="align-right">
  497. -
  498. </td>
  499. <td class="align-right">
  500. {{row.quantity}}
  501. </td>
  502. <td class="align-right">
  503. <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
  504. :inline-message="true">
  505. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="4"
  506. :controls="false" :min="0" @change="changeTotalAmount()" />
  507. </el-form-item>
  508. </td>
  509. <td class="align-right">
  510. {{row.totalQuantity}}
  511. </td>
  512. <td class="align-right">
  513. {{row.amount}}
  514. </td>
  515. </tr>
  516. </template>
  517. <tr>
  518. <td colspan="8">
  519. 合计
  520. </td>
  521. <td class="align-right">
  522. {{formData.data.totalAmount}}
  523. </td>
  524. </tr>
  525. </tbody>
  526. </table>
  527. </div>
  528. </template>
  529. <!-- <template #chart>
  530. <div style="width:100%;padding-left:25px">
  531. <div ref="chartDom" style="height:300px"></div>
  532. </div>
  533. </template>
  534. <template #commodity>
  535. <div style="width: 100%;padding-left:25px">
  536. <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
  537. <el-table-column type="expand" width="50" align="center">
  538. <template #default="scope">
  539. <div style="padding-left:50px">
  540. <div style="margin-bottom:10px;margin-left:-20px">
  541. <TitleInfo content='BOM单:'></TitleInfo>
  542. </div>
  543. <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
  544. <el-table-column label="图片" width="80">
  545. <template #default="{ row }">
  546. <div v-if="row.fileUrl">
  547. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  548. </div>
  549. <div v-else></div>
  550. </template>
  551. </el-table-column>
  552. <el-table-column prop="productCode" label="物料编码" width="190" />
  553. <el-table-column prop="productName" label="物料名称" min-width="200" />
  554. <el-table-column label="规格尺寸 (cm)" width="150">
  555. <template #default="{ row, $index }">
  556. <div style="width: 100%">
  557. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  558. </div>
  559. </template>
  560. </el-table-column>
  561. <el-table-column prop="quantity" label="数量" width="80">
  562. </el-table-column>
  563. <el-table-column prop="allQuantity" label="总量" width="80" />
  564. <el-table-column label="单价" width="110">
  565. <template #default="{ row, $index }">
  566. <div style="width: 100%">
  567. <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.price'"
  568. :rules="rules.price" :inline-message="true" class="margin-b-0 wid100">
  569. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
  570. :controls="false" :min="0" @change="totalAmount()" />
  571. </el-form-item>
  572. </div>
  573. </template>
  574. </el-table-column>
  575. <el-table-column prop="amount" label="小计" width="110">
  576. <template #default="{ row, $index }">
  577. <div style="width: 100%">
  578. ¥ {{row.amount}}
  579. </div>
  580. </template>
  581. </el-table-column>
  582. <el-table-column label="备注" width="180" prop="remark">
  583. </el-table-column>
  584. </el-table>
  585. </div>
  586. </template>
  587. </el-table-column>
  588. <el-table-column label="图片" width="80">
  589. <template #default="{ row }">
  590. <div v-if="row.fileUrl">
  591. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  592. </div>
  593. <div v-else></div>
  594. </template>
  595. </el-table-column>
  596. <el-table-column prop="productCode" label="商品编码" width="190" />
  597. <el-table-column prop="productName" label="商品名称" min-width="200" />
  598. <el-table-column label="规格尺寸 (cm)" width="150">
  599. <template #default="{ row, $index }">
  600. <div style="width: 100%">
  601. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  602. </div>
  603. </template>
  604. </el-table-column>
  605. <el-table-column prop="productColor" label="颜色" width="100" />
  606. <el-table-column label="数量" width="120" prop="quantity">
  607. </el-table-column>
  608. <el-table-column label="单价" width="120" prop="price">
  609. <template #default="{ row, $index }">
  610. <div style="width: 100%">
  611. ¥ {{row.price}}
  612. </div>
  613. </template>
  614. </el-table-column>
  615. <el-table-column prop="amount" label="小计" width="120">
  616. <template #default="{ row, $index }">
  617. <div style="width: 100%">
  618. ¥ {{row.amount}}
  619. </div>
  620. </template>
  621. </el-table-column>
  622. </el-table>
  623. </div>
  624. </template> -->
  625. </byForm>
  626. <div style="text-align:center" class="btn" v-if="!isDetail && formData.data.quotationProductId">
  627. <el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
  628. <!-- <el-button type="primary" @click="handleSubmit(1)" size="default" v-debounce>暂 存</el-button> -->
  629. <el-button type="primary" @click="handleSubmit(2)" size="default" v-debounce>保 存</el-button>
  630. </div>
  631. </div>
  632. </div>
  633. <div style="text-align:center" v-if="!isDetail">
  634. <el-button type="primary" @click="handleSubmitOne()" size="default" v-debounce>提交</el-button>
  635. </div>
  636. <!-- <template #footer v-if="!isDetail">
  637. <el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
  638. <el-button type="primary" @click="handleSubmit(1)" size="default" v-debounce>暂 存</el-button>
  639. <el-button type="primary" @click="handleSubmit(2)" size="default" v-debounce>提 交</el-button>
  640. </template> -->
  641. </el-dialog>
  642. <el-dialog v-if="detailDialog" v-model="detailDialog" :title="formData.detailsData.productCode+`(${formData.detailsData.productName})产品详情`"
  643. width="60%" append-to-body>
  644. <byForm :formConfig="detailsFormConfig" :formOption="detailsFormOption" v-model="formData.detailsData">
  645. <template #detail>
  646. <div style="width:100%">
  647. <div style="margin:10px 0">
  648. <TitleInfo :content="'基本信息'"></TitleInfo>
  649. </div>
  650. <div style="width: 100%;padding-left:15px">
  651. <el-row>
  652. <!-- <el-col :span="12">
  653. <el-form-item label="原材料" class="wid100">
  654. <el-select v-model="formData.detailsData.rawMaterialId" placeholder=" " style="width:100%">
  655. <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
  656. </el-select>
  657. </el-form-item>
  658. </el-col> -->
  659. <el-col :span="12">
  660. <el-form-item label="颜色" class="margin-b-0 wid100">
  661. <el-row style="width: 100%">
  662. <el-col :span="12">
  663. <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
  664. <el-input v-model="formData.detailsData.productColor" placeholder="" />
  665. </el-form-item>
  666. </el-col>
  667. <el-col :span="12">
  668. <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
  669. <el-input v-model="formData.detailsData.colorCardCode" placeholder="" />
  670. </el-form-item>
  671. </el-col>
  672. </el-row>
  673. </el-form-item>
  674. </el-col>
  675. <el-col :span="12">
  676. <el-form-item label="尺寸" required>
  677. <el-row style="width:100%">
  678. <el-col :span="8">
  679. <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength" :inline-message="true"
  680. label-width="0px" class="margin-b-0 wid100">
  681. <el-input-number v-model="formData.detailsData.productLength" placeholder="" style="width: 100%" :precision="2"
  682. :controls="false" :min="0" onmousewheel="return false;" />
  683. </el-form-item>
  684. </el-col>
  685. <el-col :span="8">
  686. <el-form-item :prop="'quotationProductList.' +index + '.productWidth'" :rules="rules.productWidth" :inline-message="true"
  687. label-width="0px" class="margin-b-0 wid100">
  688. <el-input-number v-model="formData.detailsData.productWidth" placeholder="" style="width: 100%" :precision="2"
  689. :controls="false" :min="0" onmousewheel="return false;" />
  690. </el-form-item>
  691. </el-col>
  692. <el-col :span="8">
  693. <el-form-item :prop="'quotationProductList.' +index + '.productHeight'" :rules="rules.productHeight" :inline-message="true"
  694. label-width="0px" class="margin-b-0 wid100">
  695. <el-input-number v-model="formData.detailsData.productHeight" placeholder="" style="width: 100%" :precision="2"
  696. :controls="false" :min="0" onmousewheel="return false;" />
  697. </el-form-item>
  698. </el-col>
  699. </el-row>
  700. </el-form-item>
  701. </el-col>
  702. </el-row>
  703. <el-row>
  704. <el-col :span="12">
  705. <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
  706. <el-input-number v-model="formData.detailsData.netWeight" placeholder="" style="width: 100%" :precision="2" :controls="false"
  707. :min="0" onmousewheel="return false;" />
  708. </el-form-item>
  709. </el-col>
  710. </el-row>
  711. </div>
  712. <div style="margin:10px 0">
  713. <TitleInfo :content="'BOM'"></TitleInfo>
  714. </div>
  715. <div style="width: 100%;padding-left:15px">
  716. <el-table :data="formData.detailsData.quotationProductBomList" style="width: 100%;">
  717. <el-table-column prop="productName" label="物料名称" width="170" />
  718. <el-table-column prop="productCode" label="物料编码" width="180" />
  719. <el-table-column label="规格尺寸(cm)" width="130">
  720. <template #default="{ row, $index }">
  721. <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
  722. {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
  723. </div>
  724. </template>
  725. </el-table-column>
  726. <el-table-column prop="productColor" label="颜色" width="170" />
  727. <el-table-column prop="quantity" label="数量" width="100" />
  728. <el-table-column prop="standardDosage" label="标准用量" width="100" />
  729. <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
  730. <el-table-column prop="remark" label="备注" min-width="150" />
  731. </el-table>
  732. </div>
  733. <div style="margin:10px 0">
  734. <TitleInfo :content="'附加工艺要求'"></TitleInfo>
  735. </div>
  736. <div style="width:100%;padding-left:15px">
  737. <!-- <div class="small-title">
  738. ① 工艺线路
  739. </div>
  740. <el-row style="width:100%">
  741. <el-col :span="12">
  742. <el-form-item label="生产工艺" class="wid100" :prop="'quotationProductList.' +index + '.technologyId'" :rules="rules.technologyId"
  743. :inline-message="true">
  744. <el-select v-model="formData.detailsData.technologyId" placeholder="请选择" style="width:100%">
  745. <el-option v-for="item in technologyData" :key="item.id" :label="item.name" :value="item.id" />
  746. </el-select>
  747. </el-form-item>
  748. </el-col>
  749. </el-row> -->
  750. <div class="small-title">
  751. ① LOGO
  752. </div>
  753. <el-row style="width:100%">
  754. <el-col :span="12">
  755. <el-form-item label="LOGO尺寸" class="wid100">
  756. <el-row style="width:100%">
  757. <el-col :span="12">
  758. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoLength'"
  759. :rules="rules.logoLength" :inline-message="true">
  760. <el-input-number v-model="formData.detailsData.logoLength" placeholder="" style="width: 100%" :precision="2"
  761. :controls="false" :min="0" onmousewheel="return false;" />
  762. </el-form-item>
  763. </el-col>
  764. <el-col :span="12">
  765. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoWidth'"
  766. :rules="rules.logoWidth" :inline-message="true">
  767. <el-input-number v-model="formData.detailsData.logoWidth" placeholder="" style="width: 100%" :precision="2"
  768. :controls="false" :min="0" onmousewheel="return false;" />
  769. </el-form-item>
  770. </el-col>
  771. <!-- <el-col :span="8">
  772. <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoHeight'"
  773. :rules="rules.logoHeight" :inline-message="true">
  774. <el-input-number v-model="formData.detailsData.logoHeight" placeholder="" style="width: 100%" :precision="2"
  775. :controls="false" :min="0" onmousewheel="return false;" />
  776. </el-form-item>
  777. </el-col> -->
  778. </el-row>
  779. </el-form-item>
  780. </el-col>
  781. <el-col :span="12">
  782. <el-form-item label="几色印刷" class="wid100">
  783. <el-input-number v-model="formData.detailsData.colorCount" placeholder="" style="width: 100%" :precision="0" :controls="false"
  784. :min="1" onmousewheel="return false;" />
  785. </el-form-item>
  786. </el-col>
  787. </el-row>
  788. <div class="small-title">
  789. ② 折叠
  790. </div>
  791. <el-row style="width:100%">
  792. <el-col :span="12">
  793. <el-form-item label="是否折叠" class="wid100">
  794. <el-select v-model="formData.detailsData.isFold" placeholder="" style="width:100%">
  795. <el-option :label="'否'" :value="0" />
  796. <el-option :label="'是'" :value="1" />
  797. </el-select>
  798. </el-form-item>
  799. </el-col>
  800. <el-col :span="12">
  801. <el-form-item label="折叠数" class="wid100" v-if="formData.detailsData.isFold==1">
  802. <el-select v-model="formData.detailsData.foldWay" placeholder="" style="width:100%">
  803. <el-option v-for="item in foldWayData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  804. </el-select>
  805. </el-form-item>
  806. </el-col>
  807. </el-row>
  808. <div class="small-title">
  809. ③ 包装要求
  810. </div>
  811. <el-row style="width:100%">
  812. <el-col :span="12">
  813. <el-form-item label="包装要求" class="wid100">
  814. <el-select v-model="formData.detailsData.packAsk" placeholder="" style="width:100%" multiple>
  815. <el-option v-for="item in packAskData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  816. </el-select>
  817. </el-form-item>
  818. </el-col>
  819. </el-row>
  820. <div class="small-title">
  821. ④ 是否定制
  822. </div>
  823. <el-row style="width:100%">
  824. <el-col :span="12">
  825. <el-form-item prop="isCustomized" label="是否定制" class="wid100">
  826. <el-select v-model="formData.detailsData.isCustomized" placeholder="" style="width:100%">
  827. <el-option :label="'否'" :value="0" />
  828. <el-option :label="'是'" :value="1" />
  829. </el-select>
  830. </el-form-item>
  831. </el-col>
  832. </el-row>
  833. <el-row style="width:100%">
  834. <el-form-item prop="technologyId" label="定制内容" class="wid100" v-if="formData.detailsData.isCustomized==1">
  835. <table style="width:100%" border class="table">
  836. <tr>
  837. <td style="width:20%">
  838. </td>
  839. <td style="width:40%">附件</td>
  840. <td style="width:40%">备注</td>
  841. </tr>
  842. <tr v-for="(row,sonIndex) in formData.detailsData.quotationProductCustomInfoList" :key="sonIndex">
  843. <td>
  844. <el-checkbox v-model="row.isCheckBox" label="" /> <span style="position:relative;top:-2px">
  845. {{getLabelOne(row.type)}}</span>
  846. </td>
  847. <td>
  848. <div v-for="file in row.fileList" :key="file.id" class="el-click" @click="openImg(file.fileUrl)">
  849. {{file.fileName}}
  850. </div>
  851. </td>
  852. <td>
  853. <el-form-item :prop="'quotationProductList.' + index + '.quotationProductCustomInfoList.' + sonIndex + '.remark'"
  854. :rules="row.isCheckBox?rules.remark:''" :inline-message="true" class="margin-b-0 wid100">
  855. <el-input v-model="row.remark" placeholder="" />
  856. </el-form-item>
  857. </td>
  858. </tr>
  859. </table>
  860. </el-form-item>
  861. </el-row>
  862. </div>
  863. </div>
  864. </template>
  865. </byForm>
  866. <template #footer>
  867. <el-button @click="detailDialog = false" size="default" v-debounce>关 闭</el-button>
  868. </template>
  869. </el-dialog>
  870. <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
  871. <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
  872. <template #footer>
  873. <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
  874. </template>
  875. </el-dialog>
  876. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840">
  877. <QuotationPDF :rowData="rowData"></QuotationPDF>
  878. </el-dialog>
  879. </div>
  880. </template>
  881. <script setup>
  882. import byTable from "@/components/byTable/index";
  883. import byForm from "@/components/byForm/index";
  884. import { ref } from "vue";
  885. import * as echarts from "echarts";
  886. import SelectMaterial from "@/components/product/SelectMaterial.vue";
  887. import QuotationPDF from "@/components/PDF/quotationPDF.vue";
  888. const { proxy } = getCurrentInstance();
  889. const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
  890. const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
  891. const sourceList = ref({
  892. data: [],
  893. pagination: {
  894. total: 0,
  895. pageNum: 1,
  896. pageSize: 10,
  897. keyword: "",
  898. status: "",
  899. type: "",
  900. quotationStatus: "",
  901. companyId: "",
  902. quotationTimeSta: "",
  903. quotationTimeEnd: "",
  904. beginTime: "",
  905. endTime: "",
  906. isEstimate: "1",
  907. },
  908. });
  909. const loading = ref(false);
  910. const openAddDialog = ref(false);
  911. const statusData = ref([
  912. {
  913. label: "草稿",
  914. value: 0,
  915. },
  916. {
  917. label: "正常",
  918. value: 30,
  919. },
  920. {
  921. label: "作废",
  922. value: 88,
  923. },
  924. ]);
  925. const quotationStatusData = ref([
  926. {
  927. label: "未报价",
  928. value: 0,
  929. },
  930. {
  931. label: "报价中",
  932. value: 1,
  933. },
  934. {
  935. label: "已报价",
  936. value: 2,
  937. },
  938. ]);
  939. const selectConfig = computed(() => {
  940. return [
  941. {
  942. label: "业务公司",
  943. prop: "ofCompanyId",
  944. data: proxy.useUserStore().allDict["list_company_data"],
  945. },
  946. {
  947. label: "报价单状态",
  948. prop: "status",
  949. data: statusData.value,
  950. },
  951. {
  952. label: "工厂报价状态",
  953. prop: "quotationStatus",
  954. data: quotationStatusData.value,
  955. },
  956. {
  957. type: "time",
  958. label: "报价时间",
  959. placeholder: "开始日期",
  960. prop: "quotationTimeSta",
  961. placeholderOne: "结束日期",
  962. propOne: "quotationTimeEnd",
  963. },
  964. ];
  965. });
  966. const config = computed(() => {
  967. return [
  968. {
  969. attrs: {
  970. label: "业务公司",
  971. prop: "ofCompanyName",
  972. width: 110,
  973. },
  974. },
  975. {
  976. attrs: {
  977. label: "报价单号",
  978. slot: "code",
  979. width: 180,
  980. },
  981. },
  982. {
  983. attrs: {
  984. label: "报价单状态",
  985. slot: "status",
  986. width: 100,
  987. },
  988. },
  989. {
  990. attrs: {
  991. label: "工厂报价状态",
  992. slot: "quotationStatus",
  993. width: 130,
  994. },
  995. },
  996. {
  997. attrs: {
  998. label: "报价金额",
  999. slot: "amount",
  1000. width: 120,
  1001. },
  1002. },
  1003. {
  1004. attrs: {
  1005. label: "报价时间",
  1006. prop: "quotationTime",
  1007. width: 160,
  1008. },
  1009. },
  1010. {
  1011. attrs: {
  1012. label: "创建时间",
  1013. prop: "createTime",
  1014. width: 160,
  1015. },
  1016. },
  1017. {
  1018. attrs: {
  1019. label: "报价单产品",
  1020. slot: "product",
  1021. "min-width": 180,
  1022. },
  1023. },
  1024. {
  1025. attrs: {
  1026. label: "操作",
  1027. width: 120,
  1028. align: "center",
  1029. fixed: "right",
  1030. },
  1031. renderHTML(row) {
  1032. return [
  1033. row.quotationStatus < 2 && row.status == 30
  1034. ? {
  1035. attrs: {
  1036. label: "报价",
  1037. type: "primary",
  1038. text: true,
  1039. },
  1040. el: "button",
  1041. click() {
  1042. getDtlOne(row, false, 0);
  1043. },
  1044. }
  1045. : {},
  1046. row.quotationStatus == 2 && row.status == 30
  1047. ? {
  1048. attrs: {
  1049. label: "打印",
  1050. type: "primary",
  1051. text: true,
  1052. },
  1053. el: "button",
  1054. click() {
  1055. handlePrint(row);
  1056. },
  1057. }
  1058. : {},
  1059. ];
  1060. },
  1061. },
  1062. ];
  1063. });
  1064. const getList = async (req) => {
  1065. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  1066. loading.value = true;
  1067. proxy.post("/saleQuotation/page", sourceList.value.pagination).then((res) => {
  1068. res.rows.forEach((x) => {
  1069. x.addTagShow = false;
  1070. if (x.tag) {
  1071. x.tags = x.tag.split(",");
  1072. } else {
  1073. x.tags = [];
  1074. }
  1075. });
  1076. sourceList.value.data = res.rows;
  1077. sourceList.value.pagination.total = res.total;
  1078. setTimeout(() => {
  1079. loading.value = false;
  1080. }, 200);
  1081. });
  1082. };
  1083. getList();
  1084. const rawMaterialData = ref([]);
  1085. const technologyData = ref([]);
  1086. const getRawMaterialData = () => {
  1087. proxy.post("/productInfo/page", { productClassifyId: 110 }).then((res) => {
  1088. rawMaterialData.value = res.rows.map((x) => ({
  1089. label: x.name + "," + x.customCode,
  1090. value: x.id,
  1091. }));
  1092. });
  1093. proxy.post("/technology/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  1094. technologyData.value = res.rows;
  1095. });
  1096. };
  1097. getRawMaterialData();
  1098. const formDom = ref(null);
  1099. const submitLoading = ref(false);
  1100. const formData = reactive({
  1101. data: {},
  1102. detailsData: {},
  1103. });
  1104. const formOption = reactive({
  1105. inline: true,
  1106. labelWidth: 100,
  1107. itemWidth: 100,
  1108. disabled: false,
  1109. });
  1110. const isShowBackRemark = ref(false);
  1111. let myChart = null;
  1112. const chartDom = ref(null);
  1113. const chartData = ref([]);
  1114. const isShowChart = ref(false);
  1115. const formConfig = computed(() => {
  1116. return [
  1117. // {
  1118. // type: "title1",
  1119. // title: "报价趋势",
  1120. // isShow: isShowChart.value,
  1121. // },
  1122. // {
  1123. // type: "slot",
  1124. // slotName: "chart",
  1125. // isShow: isShowChart.value,
  1126. // },
  1127. // {
  1128. // type: "title1",
  1129. // title: "退回原因",
  1130. // isShow: isShowBackRemark.value,
  1131. // },
  1132. // {
  1133. // type: "input",
  1134. // itemType: "textarea",
  1135. // rows: 10,
  1136. // prop: "backRemark",
  1137. // label: "退回原因",
  1138. // itemWidth: 100,
  1139. // disabled: true,
  1140. // isShow: isShowBackRemark.value,
  1141. // },
  1142. // {
  1143. // type: "title1",
  1144. // title: "商品信息",
  1145. // },
  1146. // {
  1147. // type: "slot",
  1148. // slotName: "commodity",
  1149. // label: "",
  1150. // },
  1151. // {
  1152. // type: "title1",
  1153. // title: "报价总金额",
  1154. // },
  1155. // {
  1156. // type: "input",
  1157. // prop: "amount",
  1158. // label: "报价总金额",
  1159. // itemWidth: 25,
  1160. // disabled: true,
  1161. // },
  1162. {
  1163. type: "slot",
  1164. slotName: "quotationDetail",
  1165. label: "",
  1166. },
  1167. ];
  1168. });
  1169. const rules = ref({
  1170. price: [{ required: true, message: "单价", trigger: "blur" }],
  1171. moldId: [{ required: true, message: "请选择模具", trigger: "change" }],
  1172. quantity: [{ required: true, message: "数量", trigger: "blur" }],
  1173. totalQuantity: [{ required: true, message: "总量", trigger: "blur" }],
  1174. });
  1175. const isDetail = ref(false);
  1176. const chartOption = reactive({
  1177. data: {
  1178. tooltip: {
  1179. trigger: "axis",
  1180. },
  1181. // legend: {
  1182. // data: ["价格"],
  1183. // },
  1184. grid: {
  1185. left: "3%",
  1186. right: "6%",
  1187. top: "10%",
  1188. bottom: "3%",
  1189. containLabel: true,
  1190. },
  1191. tooltip: {
  1192. show: true,
  1193. trigger: "axis",
  1194. // 格式化函数
  1195. // valueFormatter: (val) => {
  1196. // return val + "aaa";
  1197. // },
  1198. formatter: (params, ticket, callback) => {
  1199. return `
  1200. ${params[0].seriesName}:${params[0].value}
  1201. <br/>
  1202. 报价单号:${chartData.value[params[0].dataIndex].code}
  1203. `;
  1204. },
  1205. textStyle: {
  1206. fontSize: 12,
  1207. },
  1208. },
  1209. // toolbox: {
  1210. // feature: {
  1211. // saveAsImage: {},
  1212. // },
  1213. // },
  1214. xAxis: {
  1215. type: "category",
  1216. boundaryGap: false,
  1217. data: [],
  1218. },
  1219. yAxis: {
  1220. type: "value",
  1221. },
  1222. series: [
  1223. {
  1224. name: "报价金额",
  1225. type: "line",
  1226. symbolSize: 10,
  1227. data: [],
  1228. },
  1229. ],
  1230. },
  1231. });
  1232. const getFileData = () => {
  1233. let ids = [];
  1234. formData.data.quotationProductList.map((x) => {
  1235. // ids.push(x.productId);
  1236. x.quotationProductBomList.map((y) => {
  1237. ids.push(y.materialId);
  1238. });
  1239. });
  1240. ids = Array.from(new Set(ids));
  1241. proxy
  1242. .post("/fileInfo/getList", {
  1243. businessIdList: ids,
  1244. })
  1245. .then((fileObj) => {
  1246. formData.data.quotationProductList.map((x) => {
  1247. // x.fileList = fileObj[x.productId] || [];
  1248. // if (x.fileList && x.fileList.length > 0) {
  1249. // x.fileUrl = x.fileList[0].fileUrl;
  1250. // }
  1251. x.quotationProductBomList.map((y) => {
  1252. y.fileList = fileObj[y.materialId] || [];
  1253. if (y.fileList && y.fileList.length > 0) {
  1254. y.fileUrl = y.fileList[0].fileUrl;
  1255. }
  1256. });
  1257. });
  1258. });
  1259. };
  1260. const getDtl = (row, flag = false) => {
  1261. formOption.disabled = flag;
  1262. isDetail.value = flag;
  1263. openAddDialog.value = true;
  1264. proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
  1265. formData.data = res;
  1266. // 是否显示退回原因
  1267. if (res.backRemark) {
  1268. isShowBackRemark.value = true;
  1269. } else {
  1270. isShowBackRemark.value = false;
  1271. }
  1272. // 城市数据回显
  1273. // if (formData.data.buyCountryId) {
  1274. // getCityData(formData.data.buyCountryId, "20");
  1275. // }
  1276. // if (formData.data.buyProvinceId) {
  1277. // getCityData(formData.data.buyProvinceId, "30");
  1278. // }
  1279. // 价格计算
  1280. changeQuantity();
  1281. // 文件数据回显
  1282. getFileData();
  1283. let productIds = formData.data.quotationProductList.map((x) => x.productId);
  1284. proxy.getFileData({
  1285. businessIdList: productIds,
  1286. data: formData.data.quotationProductList,
  1287. att: "productId",
  1288. businessType: "0",
  1289. fileAtt: "productFile",
  1290. filePathAtt: "fileUrl",
  1291. });
  1292. //折线图
  1293. if (res.quotationTrendList && res.quotationTrendList.length >= 2) {
  1294. isShowChart.value = true;
  1295. nextTick(() => {
  1296. myChart = echarts.init(chartDom.value);
  1297. window.addEventListener("resize", () => {
  1298. myChart.resize();
  1299. });
  1300. chartData.value = res.quotationTrendList;
  1301. chartOption.data.xAxis.data = chartData.value.map((item) => {
  1302. return item.createTime.slice(0, 10);
  1303. });
  1304. chartOption.data.series[0].data = chartData.value.map((item, index) => {
  1305. if (item.code == row.code) {
  1306. return {
  1307. value: item.amount || 0,
  1308. itemStyle: { color: "red" },
  1309. };
  1310. } else {
  1311. return item.amount || 0;
  1312. }
  1313. });
  1314. myChart.setOption(chartOption.data);
  1315. myChart.resize();
  1316. });
  1317. } else {
  1318. isShowChart.value = false;
  1319. }
  1320. });
  1321. };
  1322. const getFileDataOne = () => {
  1323. let ids = [];
  1324. quotationProductList.value.map((x) => {
  1325. // ids.push(x.productId);
  1326. x.quotationProductBomList.map((y) => {
  1327. ids.push(y.materialId);
  1328. });
  1329. });
  1330. ids = Array.from(new Set(ids));
  1331. proxy
  1332. .post("/fileInfo/getList", {
  1333. businessIdList: ids,
  1334. })
  1335. .then((fileObj) => {
  1336. quotationProductList.value.map((x) => {
  1337. // x.fileList = fileObj[x.productId] || [];
  1338. // if (x.fileList && x.fileList.length > 0) {
  1339. // x.fileUrl = x.fileList[0].fileUrl;
  1340. // }
  1341. x.quotationProductBomList.map((y) => {
  1342. y.fileList = fileObj[y.materialId] || [];
  1343. if (y.fileList && y.fileList.length > 0) {
  1344. y.fileUrl = y.fileList[0].fileUrl;
  1345. }
  1346. });
  1347. });
  1348. });
  1349. };
  1350. const quotationProductList = ref([]);
  1351. const allData = ref({});
  1352. const getDtlOne = (row, flag = false, index = 0) => {
  1353. formOption.disabled = flag;
  1354. isDetail.value = flag;
  1355. openAddDialog.value = true;
  1356. proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
  1357. allData.value = res;
  1358. formData.data = {
  1359. quotationProductId: "",
  1360. };
  1361. if (res.quotationProductList && res.quotationProductList.length > 0) {
  1362. for (let i = 0; i < res.quotationProductList.length; i++) {
  1363. const iele = res.quotationProductList[i];
  1364. if (iele.packAsk) {
  1365. iele.packAsk = iele.packAsk.split(",");
  1366. } else {
  1367. iele.packAsk = [];
  1368. }
  1369. // if (
  1370. // iele.quotationProductBomList &&
  1371. // iele.quotationProductBomList.length > 0
  1372. // ) {
  1373. // iele.quotationProductBomList = iele.quotationProductBomList.filter(
  1374. // (x) => x.type == 2
  1375. // );
  1376. // }
  1377. if (
  1378. iele.quotationProductCustomInfoList &&
  1379. iele.quotationProductCustomInfoList.length > 0
  1380. ) {
  1381. for (let j = 0; j < iele.quotationProductCustomInfoList.length; j++) {
  1382. const jele = iele.quotationProductCustomInfoList[j];
  1383. if (jele.fileList) {
  1384. jele.fileList = jele.fileList.map((x) => ({
  1385. ...x,
  1386. url: x.fileUrl,
  1387. name: x.fileName,
  1388. }));
  1389. } else {
  1390. jele.fileList = [];
  1391. }
  1392. jele.isCheckBox = jele.isCheck == 1;
  1393. }
  1394. }
  1395. }
  1396. }
  1397. quotationProductList.value = res.quotationProductList.map((x) => ({
  1398. ...x,
  1399. amount: parseFloat(x.quantity * x.prodPrice).toFixed(2),
  1400. }));
  1401. if (quotationProductList.value && quotationProductList.value.length > 0) {
  1402. handleReportPrice(quotationProductList.value[index], index);
  1403. }
  1404. // getFileDataOne();
  1405. // let productIds = quotationProductList.value.map((x) => x.productId);
  1406. // proxy.getFileData({
  1407. // businessIdList: productIds,
  1408. // data: quotationProductList.value,
  1409. // att: "productId",
  1410. // businessType: "0",
  1411. // fileAtt: "productFile",
  1412. // filePathAtt: "fileUrl",
  1413. // });
  1414. });
  1415. };
  1416. const changeQuantity = () => {
  1417. if (
  1418. formData.data.quotationProductList &&
  1419. formData.data.quotationProductList.length > 0
  1420. ) {
  1421. for (let i = 0; i < formData.data.quotationProductList.length; i++) {
  1422. let iele = formData.data.quotationProductList[i];
  1423. if (iele.quantity) {
  1424. for (let j = 0; j < iele.quotationProductBomList.length; j++) {
  1425. const jele = iele.quotationProductBomList[j];
  1426. if (!jele.price) {
  1427. jele.price = jele.costPrice;
  1428. }
  1429. jele.allQuantity = iele.quantity * jele.quantity;
  1430. }
  1431. }
  1432. }
  1433. totalAmount();
  1434. }
  1435. };
  1436. const totalAmount = () => {
  1437. let money = 0;
  1438. if (
  1439. formData.data.quotationProductList &&
  1440. formData.data.quotationProductList.length > 0
  1441. ) {
  1442. // 先算单个产品的价格
  1443. for (let i = 0; i < formData.data.quotationProductList.length; i++) {
  1444. let iele = formData.data.quotationProductList[i];
  1445. let productPrice = 0;
  1446. for (let j = 0; j < iele.quotationProductBomList.length; j++) {
  1447. const jele = iele.quotationProductBomList[j];
  1448. productPrice += Number(
  1449. parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
  1450. );
  1451. }
  1452. iele.price = parseFloat(productPrice).toFixed(2);
  1453. }
  1454. for (let i = 0; i < formData.data.quotationProductList.length; i++) {
  1455. let iele = formData.data.quotationProductList[i];
  1456. iele.amount = parseFloat(
  1457. Number(iele.quantity) * Number(iele.price)
  1458. ).toFixed(2);
  1459. money += Number(iele.amount);
  1460. for (let j = 0; j < iele.quotationProductBomList.length; j++) {
  1461. const jele = iele.quotationProductBomList[j];
  1462. jele.amount = parseFloat(
  1463. Number(jele.allQuantity) * Number(jele.price)
  1464. ).toFixed(2);
  1465. }
  1466. }
  1467. }
  1468. formData.data.amount = parseFloat(money).toFixed(2);
  1469. };
  1470. // const handleSubmit = (type) => {
  1471. // formDom.value.handleSubmit(() => {
  1472. // if (
  1473. // formData.data.quotationProductList &&
  1474. // formData.data.quotationProductList.length > 0
  1475. // ) {
  1476. // submitLoading.value = true;
  1477. // formData.data.quotationStatus = type;
  1478. // proxy.post("/saleQuotation/edit", formData.data).then(
  1479. // (res) => {
  1480. // proxy.msgTip("操作成功", 1);
  1481. // openAddDialog.value = false;
  1482. // submitLoading.value = false;
  1483. // getList();
  1484. // },
  1485. // (err) => {
  1486. // submitLoading.value = false;
  1487. // }
  1488. // );
  1489. // } else {
  1490. // return proxy.msgTip("请添加至少一件商品", 2);
  1491. // }
  1492. // });
  1493. // };
  1494. const handleSubmit = (type) => {
  1495. formDom.value.handleSubmit(() => {
  1496. if (
  1497. formData.data.quotationEstimateList &&
  1498. formData.data.quotationEstimateList.length > 0
  1499. ) {
  1500. submitLoading.value = true;
  1501. proxy.post("/quotationEstimate/addOrEdit", formData.data).then(
  1502. (res) => {
  1503. proxy.msgTip("操作成功", 1);
  1504. // openAddDialog.value = false;
  1505. submitLoading.value = false;
  1506. // getList();
  1507. getDtlOne(allData.value, false, currentIndex.value);
  1508. },
  1509. (err) => {
  1510. submitLoading.value = false;
  1511. }
  1512. );
  1513. } else {
  1514. return proxy.msgTip("无报价明细", 2);
  1515. }
  1516. });
  1517. };
  1518. const handleSubmitOne = () => {
  1519. let listLength = 0;
  1520. for (let i = 0; i < quotationProductList.value.length; i++) {
  1521. const ele = quotationProductList.value[i];
  1522. if (ele.prodPrice && Number(ele.prodPrice) > 0) {
  1523. listLength += 1;
  1524. }
  1525. }
  1526. if (listLength == quotationProductList.value.length) {
  1527. proxy
  1528. .msgConfirm()
  1529. .then((res) => {
  1530. proxy
  1531. .post("/quotationEstimate/submitQuotation", {
  1532. quotationId: allData.value.id,
  1533. })
  1534. .then((res) => {
  1535. proxy.msgTip("操作成功", 1);
  1536. openAddDialog.value = false;
  1537. getList();
  1538. });
  1539. })
  1540. .catch((err) => {});
  1541. } else {
  1542. return proxy.msgTip("还有未报价的商品", 2);
  1543. }
  1544. };
  1545. const moldData = ref([]);
  1546. const getDict = () => {
  1547. proxy
  1548. .post("/moldInfo/page", {
  1549. pageNum: 1,
  1550. pageSize: 9999,
  1551. })
  1552. .then((res) => {
  1553. moldData.value = res.rows.map((x) => ({
  1554. ...x,
  1555. area: Number(parseFloat(x.moldLength * x.moldWidth).toFixed(2)),
  1556. moldName:
  1557. x.moldName + `(${x.moldLength}*${x.moldWidth}*${x.moldHeight})`,
  1558. }));
  1559. });
  1560. };
  1561. getDict();
  1562. let currentIndex = ref(-1);
  1563. const currentProduct = ref({});
  1564. const handleReportPrice = (item, index) => {
  1565. currentProduct.value = item;
  1566. currentIndex.value = index;
  1567. submitLoading.value = true;
  1568. formData.data = {
  1569. quotationProductId: item.id,
  1570. productCode: item.productCode,
  1571. productName: item.productName,
  1572. quantity: item.quantity,
  1573. };
  1574. proxy
  1575. .post("/quotationEstimate/detail", {
  1576. quotationProductId: formData.data.quotationProductId,
  1577. })
  1578. .then((res) => {
  1579. let type1Status = true;
  1580. let type2Status = true;
  1581. let type3Status = true;
  1582. if (res && res.length > 0) {
  1583. for (let i = 0; i < res.length; i++) {
  1584. const ele = res[i];
  1585. if (ele.type == 1 && type1Status) {
  1586. ele.show = true;
  1587. type1Status = false;
  1588. } else if (ele.type == 2 && type2Status) {
  1589. ele.show = true;
  1590. type2Status = false;
  1591. } else if (ele.type == 3 && type3Status) {
  1592. ele.show = true;
  1593. type3Status = false;
  1594. } else {
  1595. ele.show = false;
  1596. }
  1597. }
  1598. formData.data.quotationEstimateList = res;
  1599. }
  1600. submitLoading.value = false;
  1601. changeTotalAmount();
  1602. });
  1603. };
  1604. const openSelectMaterial = ref(false);
  1605. const selectMaterial = (goods) => {
  1606. let flag = formData.data.quotationEstimateList.some(
  1607. (x) => x.materialId == goods.id
  1608. );
  1609. if (!flag) {
  1610. formData.data.quotationEstimateList.push({
  1611. materialId: goods.id,
  1612. name: goods.name,
  1613. code: goods.customCode,
  1614. quantity: 1,
  1615. price: null,
  1616. totalQuantity: null,
  1617. amount: "",
  1618. type: 2,
  1619. });
  1620. proxy.msgTip("选择成功");
  1621. } else {
  1622. proxy.msgTip("该物料已选择", 2);
  1623. }
  1624. };
  1625. const getRowSpan = (type) => {
  1626. if (
  1627. formData.data.quotationEstimateList &&
  1628. formData.data.quotationEstimateList.length > 0
  1629. ) {
  1630. return formData.data.quotationEstimateList.filter((x) => x.type == type)
  1631. .length;
  1632. }
  1633. };
  1634. const changeTotalAmount = () => {
  1635. let money = 0;
  1636. for (let i = 0; i < formData.data.quotationEstimateList.length; i++) {
  1637. const ele = formData.data.quotationEstimateList[i];
  1638. let amount = 0;
  1639. if (ele.type == 1 && ele.moldId) {
  1640. let mold = moldData.value.find((x) => x.id == ele.moldId);
  1641. if (mold) {
  1642. amount = parseFloat(
  1643. mold.moldLength *
  1644. mold.moldWidth *
  1645. Number(ele.price) *
  1646. Number(ele.totalQuantity)
  1647. ).toFixed(2);
  1648. }
  1649. } else if (ele.type == 2) {
  1650. ele.totalQuantity = ele.quantity * formData.data.quantity;
  1651. amount = parseFloat(
  1652. Number(ele.price) * Number(ele.totalQuantity)
  1653. ).toFixed(2);
  1654. } else if (ele.type == 3) {
  1655. ele.totalQuantity = formData.data.quantity;
  1656. amount = parseFloat(
  1657. Number(ele.price) * Number(ele.totalQuantity)
  1658. ).toFixed(2);
  1659. }
  1660. ele.amount = amount;
  1661. money += Number(parseFloat(amount).toFixed(2));
  1662. }
  1663. formData.data.totalAmount = parseFloat(money).toFixed(2);
  1664. };
  1665. const openPrint = ref(false);
  1666. const rowData = ref({});
  1667. const handlePrint = (row) => {
  1668. openPrint.value = true;
  1669. rowData.value = row;
  1670. };
  1671. const changeTotalQuantity = (index) => {
  1672. formData.data.quotationEstimateList[index].totalQuantity = Math.ceil(
  1673. currentProduct.value.quantity /
  1674. formData.data.quotationEstimateList[index].cavityNum
  1675. );
  1676. changeTotalAmount();
  1677. };
  1678. const changeCavityNum = (val, index) => {
  1679. let { productLength, productWidth } = currentProduct.value;
  1680. if (val) {
  1681. // 单个产品所需的长
  1682. let realityProductLength = productLength + 2;
  1683. // 单个产品所需的宽
  1684. let realityProductWidth = productWidth + 2;
  1685. // 计算商品所需的理论面积
  1686. let theoryArea = realityProductLength * realityProductWidth * val;
  1687. // 计算模具的理论面积
  1688. for (let i = 0; i < moldData.value.length; i++) {
  1689. const ele = moldData.value[i];
  1690. // 计算模具可做产品数量的理论面积
  1691. // 第一种面积
  1692. let theoryLength =
  1693. Math.floor(ele.moldLength / realityProductLength) *
  1694. realityProductLength;
  1695. let theoryWidth =
  1696. Math.floor(ele.moldWidth / realityProductWidth) * realityProductWidth;
  1697. let theoryArea = Number(
  1698. parseFloat(theoryLength * theoryWidth).toFixed(2)
  1699. );
  1700. // 第二种面积
  1701. let theoryLengthOne =
  1702. Math.floor(ele.moldLength / realityProductWidth) * realityProductWidth;
  1703. let theoryWidthOne =
  1704. Math.floor(ele.moldWidth / realityProductLength) * realityProductLength;
  1705. let theoryAreaOne = Number(
  1706. parseFloat(theoryLengthOne * theoryWidthOne).toFixed(2)
  1707. );
  1708. ele.theoryArea = theoryArea >= theoryAreaOne ? theoryArea : theoryAreaOne;
  1709. }
  1710. // 过滤出模具理论面积 >= 商品的理论面积
  1711. let filterData = moldData.value.filter((x) => x.theoryArea >= theoryArea);
  1712. // 取出面积最小的模具
  1713. if (filterData && filterData.length > 0) {
  1714. let sortList = filterData.sort((a, b) => a.area - b.area);
  1715. formData.data.quotationEstimateList[index].moldId = sortList[0].id;
  1716. } else {
  1717. formData.data.quotationEstimateList[index].moldId = "";
  1718. return proxy.msgTip("未找到合适的模具", 2);
  1719. }
  1720. changeTotalQuantity(index);
  1721. }
  1722. };
  1723. const changeMoldId = (val, index) => {
  1724. let { productLength, productWidth } = currentProduct.value;
  1725. // 一出几
  1726. let cavityNum = formData.data.quotationEstimateList[index].cavityNum || 1;
  1727. // 单个产品所需的长
  1728. let realityProductLength = productLength + 2;
  1729. // 单个产品所需的宽
  1730. let realityProductWidth = productWidth + 2;
  1731. // 计算商品所需的理论面积
  1732. let productTheoryArea =
  1733. realityProductLength * realityProductWidth * cavityNum;
  1734. // 计算商品的总面积
  1735. if (val && cavityNum) {
  1736. for (let i = 0; i < moldData.value.length; i++) {
  1737. const ele = moldData.value[i];
  1738. if (ele.id == val) {
  1739. // 计算模具可做产品数量的理论面积
  1740. // 第一种面积
  1741. let theoryLength =
  1742. Math.floor(ele.moldLength / realityProductLength) *
  1743. realityProductLength;
  1744. let theoryWidth =
  1745. Math.floor(ele.moldWidth / realityProductWidth) * realityProductWidth;
  1746. let theoryArea = Number(
  1747. parseFloat(theoryLength * theoryWidth).toFixed(2)
  1748. );
  1749. // 第二种面积
  1750. let theoryLengthOne =
  1751. Math.floor(ele.moldLength / realityProductWidth) *
  1752. realityProductWidth;
  1753. let theoryWidthOne =
  1754. Math.floor(ele.moldWidth / realityProductLength) *
  1755. realityProductLength;
  1756. let theoryAreaOne = Number(
  1757. parseFloat(theoryLengthOne * theoryWidthOne).toFixed(2)
  1758. );
  1759. ele.theoryArea =
  1760. theoryArea >= theoryAreaOne ? theoryArea : theoryAreaOne;
  1761. if (ele.theoryArea) {
  1762. formData.data.quotationEstimateList[index].cavityNum = Math.floor(
  1763. ele.theoryArea / (realityProductLength * realityProductWidth)
  1764. );
  1765. } else {
  1766. proxy.msgTip(`该模具不能一出${cavityNum}`, 2);
  1767. formData.data.quotationEstimateList[index].moldId = "";
  1768. }
  1769. }
  1770. }
  1771. changeTotalQuantity(index);
  1772. }
  1773. };
  1774. const detailDialog = ref(false);
  1775. const detailsFormOption = reactive({
  1776. inline: true,
  1777. labelWidth: 100,
  1778. itemWidth: 100,
  1779. disabled: true,
  1780. });
  1781. const detailsFormConfig = computed(() => {
  1782. return [
  1783. {
  1784. type: "slot",
  1785. slotName: "detail",
  1786. label: "",
  1787. },
  1788. ];
  1789. });
  1790. const handleLookDetail = (item) => {
  1791. let obj = proxy.deepClone(item);
  1792. if (obj.packAsk) {
  1793. obj.packAsk = obj.packAsk.split(",");
  1794. }
  1795. obj.quotationProductCustomInfoList.forEach((x) => {
  1796. if (x.fileList) {
  1797. x.fileList = x.fileList.map((y) => ({
  1798. ...y,
  1799. url: y.fileUrl,
  1800. name: y.fileName,
  1801. }));
  1802. } else {
  1803. x.fileList = [];
  1804. }
  1805. x.isCheckBox = x.isCheck == 1;
  1806. });
  1807. obj.quotationProductBomList = obj.quotationProductBomList.filter(
  1808. (x) => x.type == 2
  1809. );
  1810. formData.detailsData = obj;
  1811. detailDialog.value = true;
  1812. };
  1813. let obj = {
  1814. 1: "定制刀模",
  1815. 2: "定制纹路",
  1816. 3: "定制模具",
  1817. };
  1818. const getLabelOne = (type) => {
  1819. return obj[type];
  1820. };
  1821. </script>
  1822. <style lang="scss" scoped>
  1823. .pic {
  1824. object-fit: contain;
  1825. width: 50px;
  1826. height: 50px;
  1827. cursor: pointer;
  1828. vertical-align: middle;
  1829. }
  1830. :deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
  1831. background: #f4f4f5 !important;
  1832. }
  1833. .box {
  1834. width: 100%;
  1835. display: flex;
  1836. .left {
  1837. width: 45%;
  1838. height: 100%;
  1839. overflow: auto;
  1840. border-right: 1px solid #eee;
  1841. padding: 4px 15px 4px 4px;
  1842. }
  1843. .right {
  1844. width: 55%;
  1845. height: 100%;
  1846. overflow: auto;
  1847. position: relative;
  1848. padding: 4px 0 4px 15px;
  1849. .btn {
  1850. // position: absolute;
  1851. // bottom: 20px;
  1852. // height: 32px;
  1853. // left: 50%;
  1854. // transform: translateX(-50%);
  1855. height: 32px;
  1856. text-align: center;
  1857. }
  1858. .table {
  1859. border-collapse: collapse;
  1860. border-spacing: 0;
  1861. width: 100%;
  1862. td,
  1863. th {
  1864. text-align: left;
  1865. padding: 5px;
  1866. font-size: 12px;
  1867. // padding: 5px 10px;
  1868. }
  1869. .align-right {
  1870. text-align: right;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. ::v-deep(.box .el-input-number .el-input__inner) {
  1876. text-align: right !important;
  1877. }
  1878. ::v-deep(.box .el-input-number.is-without-controls .el-input__wrapper) {
  1879. padding-left: 10px;
  1880. padding-right: 10px;
  1881. }
  1882. .table {
  1883. border-collapse: collapse;
  1884. border-spacing: 0;
  1885. td {
  1886. text-align: center;
  1887. padding: 2px 4px;
  1888. // padding: 5px 10px;
  1889. }
  1890. }
  1891. .small-title {
  1892. padding-left: 15px;
  1893. margin-bottom: 10px;
  1894. color: #3366ff;
  1895. font-size: 14px;
  1896. }
  1897. :deep(.el-checkbox) {
  1898. margin-right: 0px;
  1899. }
  1900. // :deep(.el-collapse-item) {
  1901. // margin-bottom: 10px;
  1902. // }
  1903. :deep(.el-collapse-item__header) {
  1904. background-color: #eee;
  1905. }
  1906. </style>