Contract.vue 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502
  1. <template>
  2. <div style="width: 100%; padding: 0px 15px">
  3. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
  4. <template #btn>
  5. <div>
  6. <el-button type="primary" v-if="
  7. [30].includes(route.query.processType) || !route.query.processType
  8. " @click="clickCopy(1)">复制订单</el-button>
  9. </div>
  10. </template>
  11. <template #ofCompanyId>
  12. <div style="width: 100%">
  13. <el-form-item label="业务公司" class="margin-b-0 wid100" required>
  14. <el-row style="width: 100%">
  15. <el-col :span="12">
  16. <el-form-item prop="ofCompanyId" label="" label-width="0px" class="margin-b-0 wid100">
  17. <el-tree-select v-model="formData.data.ofCompanyId" :data="useUserStore().allDict['tree_company_data']" style="width: 100%"
  18. placeholder="公司" default-expand-all
  19. :props="{ value: 'deptId', label: 'deptName', children: 'children', disabled: 'disabled' }"
  20. @change="handleOfCompanyIdChange" :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" />
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="12">
  24. <el-form-item prop="deptId" label="" label-width="0px" class="margin-b-0 wid100">
  25. <el-tree-select v-model="formData.data.deptId" :data="deptData" style="width: 100%" placeholder="部门" default-expand-all
  26. :props="{ value: 'deptId', label: 'deptName', children: 'children', disabled: 'disabled' }" />
  27. <!-- :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" -->
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. </el-form-item>
  32. </div>
  33. </template>
  34. <template #seller>
  35. <div style="width: 100%">
  36. <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
  37. <el-select v-model="formData.data.sellCorporationId" placeholder="请选择卖方公司" style="width: 100%" @change="sellCorporationIdChange"
  38. filterable>
  39. <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="地址" class="wid100">
  43. <el-row style="width:100%">
  44. <el-col :span="8">
  45. <el-form-item label="" prop="sellCountryName" label-width="0px" class="margin-b-0 wid100">
  46. <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="8">
  50. <el-form-item label="" prop="sellProvinceName" label-width="0px" class="margin-b-0 wid100">
  51. <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="" prop="sellCityName" label-width="0px" class="margin-b-0 wid100">
  56. <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. </el-form-item>
  61. <el-form-item label="详细地址" prop="sellAddress" class="wid100">
  62. <el-input v-model="formData.data.sellAddress" type="textarea">
  63. </el-input>
  64. </el-form-item>
  65. <el-form-item label="联系人" class="wid100">
  66. <el-row style="width:100%">
  67. <el-col :span="8">
  68. <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
  69. <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="16">
  73. <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
  74. <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
  75. </el-form-item>
  76. </el-col>
  77. </el-row>
  78. </el-form-item>
  79. </div>
  80. </template>
  81. <template #buyer>
  82. <div style="width: 100%">
  83. <el-form-item label="买方信息" prop="buyCorporationId" class="wid100">
  84. <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
  85. :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer" v-if="
  86. [30].includes(route.query.processType) ||
  87. !route.query.processType
  88. " :disabled="!isEditList">
  89. <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
  90. </el-select>
  91. <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item label="地址" class="wid100" required>
  95. <el-row style="width: 100%">
  96. <el-col :span="6">
  97. <el-form-item label="" prop="countryId" class="margin-b-0">
  98. <el-select v-model="formData.data.countryId" placeholder="国家" style="width:100%" filterable
  99. @change="(val) => getCityData(val, '20', true)" :disabled="!isEditList">
  100. <el-option v-for="item in countryData" :label="item.name" :value="item.id">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="6">
  106. <el-form-item label="" prop="provinceName" class="margin-b-0">
  107. <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
  108. v-model="formData.data" :data="provinceData" :disabled="!isEditList">
  109. </selectCity>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="6">
  113. <el-form-item label="" prop="cityName" class="margin-b-0">
  114. <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"
  115. :disabled="!isEditList">
  116. </selectCity>
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="6">
  120. <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
  121. <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" :disabled="!isEditList" />
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. </el-form-item>
  126. <el-form-item label="详细地址" prop="buyAddress" class="wid100">
  127. <el-input v-model="formData.data.buyAddress" type="textarea" :disabled="!isEditList">
  128. </el-input>
  129. </el-form-item>
  130. <el-form-item label="联系人" class="wid100" required>
  131. <el-row style="width: 100%">
  132. <el-col :span="8">
  133. <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
  134. <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" style="width:100%" clearable
  135. class="inline-input w-50" placeholder="请输入联系人" @select="handlePerson" :disabled="!isEditList">
  136. </el-autocomplete>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="16">
  140. <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
  141. <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" :disabled="!isEditList" />
  142. </el-form-item>
  143. </el-col>
  144. </el-row>
  145. </el-form-item>
  146. </div>
  147. </template>
  148. <template #advanceRatio>
  149. <el-row style="width: 100%">
  150. <el-col :span="6" style="padding-right:8px">
  151. <el-form-item label="定金比例(%)" prop="advanceRatio" class="margin-b-0 wid100">
  152. <el-input-number v-model="formData.data.advanceRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
  153. :controls="false" @change="(val)=>changeAdvanceRatio(val,true)" />
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="6" style="padding:0px 4px">
  157. <el-form-item label="出货前付款比例" prop="beforeShipmentRatio" class="margin-b-0 wid100">
  158. <el-input-number v-model="formData.data.beforeShipmentRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
  159. :controls="false" @change="(val)=>changeAdvanceRatio(val,false)" />
  160. </el-form-item>
  161. </el-col>
  162. <el-col :span="6" style="padding:0px 4px">
  163. <el-form-item label="出货后付款比例" prop="afterShipmentRatio" class="margin-b-0 wid100">
  164. <el-input-number v-model="formData.data.afterShipmentRatio" placeholder=" " style="width: 100%" :precision="2" :min="0" :max="100"
  165. :controls="false" disabled />
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. </template>
  170. <template #commodity>
  171. <div style="width: 100%">
  172. <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
  173. v-if="!judgeStatus() && isEditList">产品库</el-button>
  174. <!-- :disabled="!formData.data.companyId" -->
  175. <!-- default-expand-all -->
  176. <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
  177. <el-table-column type="expand" width="50" align="center">
  178. <template #default="scope">
  179. <div style="padding-left:50px">
  180. <div style="margin-bottom:10px;">
  181. <TitleInfo content='BOM单:'></TitleInfo>
  182. </div>
  183. <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table" row-key="materialId">
  184. <el-table-column label="图片" width="80">
  185. <template #default="{ row }">
  186. <div v-if="row.fileUrl">
  187. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  188. </div>
  189. <div v-else></div>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="productCode" label="物料编码" width="190" />
  193. <el-table-column prop="productName" label="物料名称" min-width="200" />
  194. <el-table-column label="规格尺寸 (cm)" width="130">
  195. <template #default="{ row, $index }">
  196. <div style="width: 100%">
  197. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  198. </div>
  199. </template>
  200. </el-table-column>
  201. <el-table-column prop="quantity" label="数量" width="130">
  202. <template #default="{ row, $index }">
  203. <div style="width: 100%">
  204. <el-form-item v-if="isEditList"
  205. :prop="'contractProductList.' + scope.$index + '.contractProductBomList.' + $index + '.quantity'"
  206. :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
  207. <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
  208. :controls="false" :min="1" />
  209. </el-form-item>
  210. <span v-else>{{row.quantity}}</span>
  211. </div>
  212. </template>
  213. </el-table-column>
  214. <!-- <el-table-column prop="allQuantity" label="总量" width="80" /> -->
  215. <!-- <el-table-column prop="price" label="单价" width="110">
  216. <template #default="{ row, $index }">
  217. <div style="width: 100%">
  218. ¥ {{row.price}}
  219. </div>
  220. </template>
  221. </el-table-column> -->
  222. <!-- <el-table-column prop="amount" label="小计" width="110">
  223. <template #default="{ row, $index }">
  224. <div style="width: 100%">
  225. ¥ {{row.amount}}
  226. </div>
  227. </template>
  228. </el-table-column> -->
  229. <el-table-column prop="remark" label="备注" width="180">
  230. <template #default="{ row, $index }">
  231. <div style="width: 100%">
  232. <el-form-item v-if="isEditList" :inline-message="true" class="margin-b-0 wid100">
  233. <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
  234. </el-form-item>
  235. <span v-else>{{row.remark}}</span>
  236. </div>
  237. </template>
  238. </el-table-column>
  239. <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
  240. <template #default="{ row,$index }">
  241. <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
  242. </template>
  243. </el-table-column>
  244. </el-table>
  245. </div>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="商品图片" width="80">
  249. <template #default="{ row }">
  250. <div v-if="row.fileUrl">
  251. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  252. </div>
  253. <div v-else></div>
  254. </template>
  255. </el-table-column>
  256. <el-table-column prop="productName" label="商品信息" width="250">
  257. <template #default="{ row, $index }">
  258. <div style="width: 100%;line-height:22px">
  259. <div>
  260. 分类:{{row.productClassifyName}}
  261. </div>
  262. <div>
  263. 编码:{{row.productCode}}
  264. </div>
  265. <div>
  266. 名称:{{row.productName}}
  267. </div>
  268. <div>
  269. 规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  270. </div>
  271. <div>
  272. 颜色:{{row.productColor}}
  273. </div>
  274. <div>
  275. 纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
  276. </div>
  277. <div>
  278. 净重: {{row.productNetWeight}}
  279. </div>
  280. <div>
  281. 单位:{{row.productUnit}}
  282. </div>
  283. <!-- <el-row :gutter="5">
  284. <el-col :span="12">
  285. 分类:{{row.productClassifyName}}
  286. </el-col>
  287. <el-col :span="12">
  288. 编码名称:{{row.productCode}}({{row.productName}})
  289. </el-col>
  290. </el-row>
  291. <el-row :gutter="5">
  292. <el-col :span="12">
  293. 规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  294. </el-col>
  295. <el-col :span="12">
  296. 颜色:{{row.productColor}}
  297. </el-col>
  298. </el-row>
  299. <el-row :gutter="5">
  300. <el-col :span="12">
  301. 纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
  302. </el-col>
  303. <el-col :span="6">
  304. 净重: {{row.productNetWeight}}
  305. </el-col>
  306. <el-col :span="6">
  307. 单位:{{row.productUnit}}
  308. </el-col>
  309. </el-row> -->
  310. </div>
  311. </template>
  312. </el-table-column>
  313. <!-- <el-table-column label="规格尺寸 (cm)" width="130">
  314. <template #default="{ row, $index }">
  315. <div style="width: 100%">
  316. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  317. </div>
  318. </template>
  319. </el-table-column>
  320. <el-table-column prop="productColor" label="颜色" width="140" />
  321. <el-table-column prop="ww" label="纹路" width="140" />
  322. <el-table-column prop="weight" label="净重" width="140" />
  323. <el-table-column prop="unit" label="单位" width="140" /> -->
  324. <el-table-column label="生产plt文件" width="180">
  325. <template #default="{ row, $index }">
  326. <div style="width:100%">
  327. <!-- <div style="display:flex">
  328. <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer"
  329. @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
  330. {{row.isShowProductFile?'上 传 p l t':'取 消 上 传'}}
  331. </div>
  332. <div>
  333. <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
  334. <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
  335. </div>
  336. <div v-else>
  337. <el-upload :file-list="row.prodFileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
  338. :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
  339. :on-remove="(file)=>handleRemoveFile(file,$index)" :on-preview="onPreviewFile"
  340. :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
  341. <el-button text type="primary">上传</el-button>
  342. </el-upload>
  343. </div>
  344. </div>
  345. </div> -->
  346. <div>
  347. <!-- writing-mode: vertical-rl; 文字垂直排 -->
  348. <div style="margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer;width:60px;text-align:center"
  349. @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
  350. {{row.isShowProductFile?'上传plt':'取消上传'}}
  351. </div>
  352. <div>
  353. <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
  354. <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
  355. </div>
  356. <div v-else>
  357. <el-upload :file-list="row.prodFileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
  358. :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
  359. :on-remove="(file)=>handleRemoveFile(file,$index)" :on-preview="onPreviewFile"
  360. :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
  361. <el-button text type="primary">上传</el-button>
  362. </el-upload>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="数量" width="110">
  370. <template #default="{ row, $index }">
  371. <div style="width: 100%">
  372. <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
  373. class="margin-b-0 wid100">
  374. <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
  375. :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
  376. <div v-else> {{row.quantity}}</div>
  377. </el-form-item>
  378. </div>
  379. </template>
  380. </el-table-column>
  381. <el-table-column label="单价" width="160">
  382. <template #default="{ row, $index }">
  383. <div style="width: 100%">
  384. <el-form-item :prop="'contractProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
  385. class="margin-b-0 wid100">
  386. <div style="display:flex;">
  387. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
  388. :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
  389. <div v-else>¥ {{row.price}}</div>
  390. <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
  391. <template #default>
  392. <div>
  393. <div>
  394. <img src="@/assets/images/money1.png" alt="" class="img" /> <span
  395. style="font-size:14px;font-weight:700;color:#000">销售指导价:</span>
  396. <div style="padding:5px 0px 0px 20px">
  397. {{row.currency}} {{moneyFormat(row.salePrice,2)}}
  398. </div>
  399. </div>
  400. <div style="margin-top:15px">
  401. <img src="@/assets/images/money2.png" alt="" class="img" /> <span
  402. style="font-size:14px;font-weight:700;color:#000">客户近期购买价格:</span>
  403. <div style="padding:5px 0px 0px 20px">
  404. <div v-for="item in row.customerContractProductList">
  405. <span>{{item.createTime.slice(0,10)}} </span>
  406. <span style="margin-left:40px">{{item.code}} </span>
  407. <span style="margin-left:40px"> {{item.currency}} {{moneyFormat(item.price,2)}} </span>
  408. </div>
  409. </div>
  410. </div>
  411. <div style="margin-top:15px">
  412. <img src="@/assets/images/money3.png" alt="" class="img" /> <span
  413. style="font-size:14px;font-weight:700;color:#000">产品近期销售价格:</span>
  414. <div style="padding:5px 0px 0px 20px">
  415. <div v-for="item in row.contractProductList">
  416. <span>{{item.createTime.slice(0,10)}} </span>
  417. <span style="margin-left:40px">{{item.code}} </span>
  418. <span style="margin-left:40px">{{item.currency}} {{moneyFormat(item.price,2)}} </span>
  419. </div>
  420. </div>
  421. </div>
  422. <div :ref="row.productId+$index" style="height:180px">
  423. </div>
  424. </div>
  425. </template>
  426. <template #reference>
  427. <!-- <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
  428. <el-icon :size="20" color="#85c1a6">
  429. <WarningFilled />
  430. </el-icon>
  431. </div> -->
  432. </template>
  433. </el-popover>
  434. </div>
  435. </el-form-item>
  436. </div>
  437. </template>
  438. </el-table-column>
  439. <el-table-column label="出厂单价" prop="factoryPrice" width="100">
  440. </el-table-column>
  441. <el-table-column prop="amount" label="小计" width="110">
  442. <template #default="{ row, $index }">
  443. <div style="width: 100%">
  444. ¥ {{row.amount}}
  445. </div>
  446. </template>
  447. </el-table-column>
  448. <el-table-column prop="amountTwo" label="出厂小计金额" width="110">
  449. <template #default="{ row, $index }">
  450. <div style="width: 100%">
  451. ¥ {{row.amountTwo}}
  452. </div>
  453. </template>
  454. </el-table-column>
  455. <el-table-column label="备注" min-width="200">
  456. <template #default="{ row, $index }">
  457. <div style="width: 100%">
  458. <el-form-item :prop="'contractProductList.' + $index + '.remark'" :inline-message="true" class="margin-b-0 wid100">
  459. <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
  460. </el-form-item>
  461. </div>
  462. </template>
  463. </el-table-column>
  464. <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
  465. <template #default="{ $index }">
  466. <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材/配件/辅材</el-button>
  467. <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
  468. </template>
  469. </el-table-column>
  470. </el-table>
  471. </div>
  472. </template>
  473. <template #otherCharge>
  474. <div style="width: 100%">
  475. <el-button type="primary" @click="clickAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加行</el-button>
  476. <el-table :data="formData.data.contractProjectList" style="width: 100%;">
  477. <el-table-column label="收费项目" width="220">
  478. <template #default="{ row, $index }">
  479. <div style="width: 100%">
  480. <el-form-item :prop="'contractProjectList.' + $index + '.payName'" :rules="rules.payName" :inline-message="true"
  481. class="margin-b-0 wid100">
  482. <el-autocomplete v-model="row.payName" :fetch-suggestions="querySearch" clearable class="inline-input w-50"
  483. placeholder="请输入收费项目" />
  484. </el-form-item>
  485. </div>
  486. </template>
  487. </el-table-column>
  488. <el-table-column :label="'金额'" width="130">
  489. <template #default="{ row, $index }">
  490. <div style="width: 100%">
  491. <el-form-item :prop="'contractProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
  492. class="margin-b-0 wid100">
  493. <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
  494. :controls="false" :min="0" @change="totalAmount()" />
  495. </el-form-item>
  496. </div>
  497. </template>
  498. </el-table-column>
  499. <el-table-column label="备注">
  500. <template #default="{ row, $index }">
  501. <div style="width: 100%">
  502. <el-form-item :prop="'contractProjectList.' + $index + '.remark'" class="margin-b-0 wid100">
  503. <el-input v-model="row.remark" placeholder="请输入备注" />
  504. </el-form-item>
  505. </div>
  506. </template>
  507. </el-table-column>
  508. <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
  509. <template #default="{ $index }">
  510. <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
  511. </template>
  512. </el-table-column>
  513. </el-table>
  514. </div>
  515. </template>
  516. <template #templateContent>
  517. <div style="width: 100%">
  518. <Editor :value="formData.data.templateContent" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
  519. </div>
  520. </template>
  521. <template #contractFileList>
  522. <div style="width: 100%">
  523. <div v-for="(file, index) in formData.data.contractFileList" :key="index">
  524. <span class="el-click" @click="openImg(file.fileUrl)">{{ file.fileName }}</span>
  525. </div>
  526. </div>
  527. </template>
  528. </byForm>
  529. <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
  530. <SelectProduct @selectProduct="selectProduct" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
  531. <!-- :companyId="formData.data.companyId" -->
  532. <template #footer>
  533. <el-button @click="openProductCompany = false" size="defualt" v-debounce>关 闭</el-button>
  534. </template>
  535. </el-dialog>
  536. <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
  537. <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
  538. <template #footer>
  539. <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
  540. </template>
  541. </el-dialog>
  542. <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '订单选择' : '样品单选择'" width="90%" append-to-body>
  543. <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
  544. <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
  545. </el-dialog> -->
  546. </div>
  547. </template>
  548. <script setup>
  549. import byForm from "@/components/byForm/index";
  550. import SelectProduct from "@/components/product/SelectProduct.vue";
  551. import SelectMaterial from "@/components/product/SelectMaterial.vue";
  552. import Editor from "@/components/Editor/index.vue";
  553. import selectCity from "@/components/selectCity/index.vue";
  554. import { useRoute } from "vue-router";
  555. import SelectContract from "@/components/contractCom/selectContract.vue";
  556. import SelectSample from "@/components/contractCom/selectSample.vue";
  557. import * as echarts from "echarts";
  558. import $bus from "@/bus/index.js";
  559. import { v4 as uuidv4 } from "uuid";
  560. import { async } from "@antv/x6/lib/registry/marker/main";
  561. const route = useRoute();
  562. const { proxy } = getCurrentInstance();
  563. // 接收父组件的传值
  564. const props = defineProps({
  565. queryData: Object,
  566. });
  567. const currencyData = computed(
  568. () => proxy.useUserStore().allDict["account_currency"]
  569. );
  570. const fundsPaymentMethod = computed(
  571. () => proxy.useUserStore().allDict["funds_payment_method"]
  572. );
  573. const shippingMethod = computed(
  574. () => proxy.useUserStore().allDict["shipping_method"]
  575. );
  576. const contractChannel = computed(
  577. () => proxy.useUserStore().allDict["contract_channel"]
  578. );
  579. const taxTransportationWay = computed(
  580. () => proxy.useUserStore().allDict["tax_transportation_way"]
  581. );
  582. const shopName = computed(() => proxy.useUserStore().allDict["shop_name"]);
  583. const taxPoints = computed(() => proxy.useUserStore().allDict["tax_points"]);
  584. const settlementWay = computed(
  585. () => proxy.useUserStore().allDict["settlement_way"]
  586. );
  587. const frontLinesData = computed(
  588. () => proxy.useUserStore().allDict["front_lines"]
  589. );
  590. const accountList = ref([]);
  591. const customerList = ref([]);
  592. const templateList = ref([]);
  593. const userList = ref([]);
  594. const corporationList = ref([]);
  595. const customerUserList = ref([]);
  596. const countryData = ref([]);
  597. const provinceData = ref([]);
  598. const cityData = ref([]);
  599. const treeData = ref([]);
  600. const deptData = ref([]);
  601. const openProductCompany = ref(false);
  602. const copyType = ref(1);
  603. const copyContract = ref(false);
  604. const indexValue = ref(-1);
  605. const openSelectMaterial = ref(false);
  606. const formData = reactive({
  607. data: {
  608. contractType: "2",
  609. rate: 1,
  610. contractProductList: [],
  611. companyId: "",
  612. templateContent: "",
  613. contractChannel: "",
  614. paymentMethod: "",
  615. },
  616. });
  617. const uploadData = ref({});
  618. const formDom = ref(null);
  619. const remarkEditor = ref(null);
  620. const judgeStatus = () => {
  621. if (
  622. route.query.processType == 20 ||
  623. route.query.processType == 10 ||
  624. props.queryData.processType == 20 ||
  625. props.queryData.processType == 10
  626. ) {
  627. return true;
  628. }
  629. if (props.queryData.recordList && props.queryData.recordList.length > 0) {
  630. let data = props.queryData.recordList.filter(
  631. (item) => item.status === 2 && item.nodeType !== 1
  632. );
  633. if (data && data.length > 0) {
  634. return true;
  635. }
  636. }
  637. return false;
  638. };
  639. const formOption = reactive({
  640. inline: true,
  641. labelWidth: 120,
  642. itemWidth: 100,
  643. disabled: false,
  644. });
  645. const formConfig = computed(() => {
  646. return [
  647. // {
  648. // type: "slot",
  649. // slotName: "btn",
  650. // label: "",
  651. // itemWidth: 50,
  652. // },
  653. {
  654. type: "title",
  655. title: "基本信息",
  656. },
  657. {
  658. type: "input",
  659. prop: "code",
  660. label: "订单号",
  661. disabled: true,
  662. isShow: formData.data.code ? true : false,
  663. },
  664. // {
  665. // type: "treeSelect",
  666. // prop: "ofCompanyId",
  667. // label: "业务公司",
  668. // data: proxy.useUserStore().allDict["tree_company_data"],
  669. // propsTreeLabel: "deptName",
  670. // propsTreeValue: "deptId",
  671. // itemWidth: 50,
  672. // },
  673. {
  674. type: "slot",
  675. slotName: "ofCompanyId",
  676. label: "",
  677. itemWidth: 50,
  678. },
  679. {
  680. type: "select",
  681. prop: "contractType",
  682. label: "订单类型",
  683. data: [
  684. {
  685. dictKey: "3",
  686. dictValue: "打样订单",
  687. },
  688. {
  689. dictKey: "2",
  690. dictValue: "内销订单",
  691. },
  692. {
  693. dictKey: "1",
  694. dictValue: "外贸订单(退税)",
  695. },
  696. {
  697. dictKey: "4",
  698. dictValue: "外贸订单(不退税)",
  699. },
  700. ],
  701. itemWidth: 50,
  702. fn: (val) => {
  703. if (val == "2") {
  704. formData.data.currency = currencyData.value[0].dictKey;
  705. formData.data.rate = 1;
  706. }
  707. if (formData.data.sellCorporationId) {
  708. sellCorporationIdChange(formData.data.sellCorporationId);
  709. }
  710. if (formData.data.shroffAccountId) {
  711. changeShroffAccount(formData.data.shroffAccountId);
  712. }
  713. },
  714. },
  715. {
  716. type: "select",
  717. prop: "processingMethod",
  718. label: "订单处理方式",
  719. data: [
  720. {
  721. dictKey: 10,
  722. dictValue: "业务自采",
  723. },
  724. {
  725. dictKey: 20,
  726. dictValue: "生产处理",
  727. },
  728. ],
  729. itemWidth: 50,
  730. },
  731. // {
  732. // type: "treeSelect",
  733. // prop: "companyId",
  734. // label: "工厂",
  735. // data: treeData.value,
  736. // propsTreeLabel: "deptName",
  737. // propsTreeValue: "deptId",
  738. // itemWidth: 50,
  739. // disabled: !isEditList.value,
  740. // fn: () => {
  741. // formData.data.contractProductList = [];
  742. // },
  743. // },
  744. {
  745. type: "select",
  746. prop: "belongType",
  747. label: "订单归属",
  748. data: [
  749. {
  750. dictKey: "1",
  751. dictValue: "归属工厂",
  752. },
  753. {
  754. dictKey: "2",
  755. dictValue: "归属业务",
  756. },
  757. ],
  758. itemWidth: 50,
  759. },
  760. {
  761. type: "select",
  762. prop: "contractChannel",
  763. label: "订单渠道",
  764. data: contractChannel.value,
  765. itemWidth: 50,
  766. },
  767. {
  768. type: "input",
  769. prop: "channelCode",
  770. label: "渠道订单编号",
  771. itemWidth: 50,
  772. isShow:
  773. formData.data.contractChannel &&
  774. formData.data.contractChannel.includes("阿里巴巴")
  775. ? true
  776. : false,
  777. },
  778. {
  779. type: "select",
  780. prop: "salesmanId",
  781. label: "业务员",
  782. data: userList.value,
  783. itemWidth: 50,
  784. },
  785. {
  786. type: "select",
  787. prop: "merchUserId",
  788. label: "跟单员",
  789. data: userList.value,
  790. itemWidth: 50,
  791. },
  792. {
  793. type: "title",
  794. title: "贸易信息",
  795. haveLine: true,
  796. },
  797. {
  798. type: "slot",
  799. slotName: "seller",
  800. label: "",
  801. itemWidth: 50,
  802. },
  803. {
  804. type: "slot",
  805. slotName: "buyer",
  806. label: "",
  807. itemWidth: 50,
  808. },
  809. {
  810. type: "title",
  811. title: "收款信息",
  812. haveLine: true,
  813. },
  814. // {
  815. // type: "select",
  816. // prop: "currency",
  817. // label: "币种",
  818. // data: currencyData.value,
  819. // itemWidth: 25,
  820. // disabled: formData.data.contractType == "2",
  821. // },
  822. // {
  823. // type: "number",
  824. // prop: "rate",
  825. // label: "汇率",
  826. // precision: 2,
  827. // min: 0,
  828. // controls: false,
  829. // itemWidth: 25,
  830. // disabled: formData.data.contractType == "2",
  831. // },
  832. {
  833. type: "select",
  834. prop: "isTax",
  835. label: "是否含税",
  836. data: [
  837. {
  838. dictKey: "1",
  839. dictValue: "含税",
  840. },
  841. {
  842. dictKey: "0",
  843. dictValue: "不含税",
  844. },
  845. ],
  846. itemWidth: 25,
  847. },
  848. {
  849. type: "select",
  850. prop: "taxPoints",
  851. label: "税点",
  852. data: taxPoints.value,
  853. itemWidth: 25,
  854. isShow: formData.data.isTax && formData.data.isTax == "1" ? true : false,
  855. },
  856. {
  857. type: "select",
  858. prop: "isFreight",
  859. label: "是否含运费",
  860. data: [
  861. {
  862. dictKey: "1",
  863. dictValue: "含运费",
  864. },
  865. {
  866. dictKey: "0",
  867. dictValue: "不含运费",
  868. },
  869. ],
  870. itemWidth: 25,
  871. },
  872. {
  873. type: "select",
  874. prop: "settlementMethod",
  875. label: "客户结算方式",
  876. data: settlementWay.value,
  877. itemWidth: 25,
  878. },
  879. {
  880. type: "select",
  881. prop: "paymentMethod",
  882. label: "客户付款方式",
  883. data: fundsPaymentMethod.value,
  884. itemWidth: 25,
  885. },
  886. // {
  887. // type: "select",
  888. // prop: "paymentMethod",
  889. // label: "付款方式",
  890. // data: fundsPaymentMethod.value,
  891. // itemWidth: 25,
  892. // },
  893. {
  894. type: "input",
  895. prop: "alibabaCode",
  896. label: "阿里巴巴订单编号",
  897. itemType: "text",
  898. itemWidth: 25,
  899. isShow:
  900. formData.data.paymentMethod &&
  901. formData.data.paymentMethod.includes("阿里巴巴")
  902. ? true
  903. : false,
  904. },
  905. {
  906. type: "select",
  907. prop: "alibabaShopName",
  908. label: "1688店铺名称",
  909. data: shopName.value,
  910. itemWidth: 25,
  911. isShow:
  912. formData.data.paymentMethod &&
  913. formData.data.paymentMethod.includes("阿里巴巴")
  914. ? true
  915. : false,
  916. },
  917. {
  918. type: "select",
  919. prop: "shroffAccountId",
  920. label: "收款账号",
  921. data: accountList.value,
  922. itemWidth: 50,
  923. fn: (val) => {
  924. changeShroffAccount(val);
  925. },
  926. isShow: formData.data.paymentMethod == "bank1",
  927. },
  928. {
  929. type: "input",
  930. prop: "accountName",
  931. label: "户名",
  932. placeholder: "请输入户名",
  933. itemWidth: 50,
  934. isShow:
  935. formData.data.paymentMethod &&
  936. formData.data.paymentMethod.includes("bank")
  937. ? true
  938. : false,
  939. },
  940. {
  941. type: "input",
  942. prop: "openingBank",
  943. label: "开户行",
  944. placeholder: "请输入开户行",
  945. itemWidth: 50,
  946. isShow:
  947. formData.data.paymentMethod &&
  948. formData.data.paymentMethod.includes("bank")
  949. ? true
  950. : false,
  951. },
  952. {
  953. type: "input",
  954. prop: "accountOpening",
  955. label: "账号",
  956. placeholder: "请输入账号",
  957. itemWidth: 50,
  958. isShow:
  959. formData.data.paymentMethod &&
  960. (formData.data.paymentMethod.includes("bank") ||
  961. ["wxPay", "aliPay"].includes(formData.data.paymentMethod))
  962. ? true
  963. : false,
  964. },
  965. {
  966. type: "input",
  967. prop: "remark",
  968. label: "其他收款方式备注说明",
  969. itemType: "textarea",
  970. itemWidth: 100,
  971. isShow:
  972. formData.data.paymentMethod &&
  973. !["bank", "bank1", "阿里巴巴", "wxPay", "aliPay"].includes(
  974. formData.data.paymentMethod
  975. )
  976. ? true
  977. : false,
  978. },
  979. {
  980. type: "slot",
  981. slotName: "advanceRatio",
  982. prop: "",
  983. label: "",
  984. },
  985. // {
  986. // type: "number",
  987. // prop: "advanceRatio",
  988. // label: "定金比例",
  989. // precision: 2,
  990. // min: 0,
  991. // max: 100,
  992. // controls: false,
  993. // itemWidth: 25,
  994. // fn: (val) => {
  995. // if (val && formData.data.beforeShipmentRatio) {
  996. // let total = val + formData.data.beforeShipmentRatio;
  997. // if (total > 100) {
  998. // formData.data.advanceRatio = null;
  999. // formData.data.beforeShipmentRatio = null;
  1000. // }
  1001. // formData.data.afterShipmentRatio = 100 - total;
  1002. // }
  1003. // },
  1004. // },
  1005. // {
  1006. // type: "number",
  1007. // prop: "beforeShipmentRatio",
  1008. // label: "出货前付款⽐例",
  1009. // precision: 2,
  1010. // min: 0,
  1011. // max: 100,
  1012. // controls: false,
  1013. // itemWidth: 25,
  1014. // fn: (val) => {
  1015. // if (val && formData.data.advanceRatio) {
  1016. // let total = val + formData.data.advanceRatio;
  1017. // if (total > 100) {
  1018. // formData.data.advanceRatio = null;
  1019. // formData.data.beforeShipmentRatio = null;
  1020. // }
  1021. // formData.data.afterShipmentRatio = 100 - total;
  1022. // }
  1023. // },
  1024. // },
  1025. // {
  1026. // type: "number",
  1027. // prop: "afterShipmentRatio",
  1028. // label: "出货后尾款⽐例",
  1029. // precision: 2,
  1030. // min: 0,
  1031. // max: 100,
  1032. // controls: false,
  1033. // itemWidth: 25,
  1034. // disabled: true,
  1035. // },
  1036. // {
  1037. // type: "input",
  1038. // prop: "remark",
  1039. // label: "付款条件",
  1040. // itemType: "textarea",
  1041. // itemWidth: 100,
  1042. // },
  1043. // {
  1044. // type: "input",
  1045. // prop: "beneficiaryName",
  1046. // label: " ",
  1047. // placeholder: "请输入Beneficiary Name",
  1048. // itemWidth: 50,
  1049. // isShow: formData.data.contractType == "1",
  1050. // },
  1051. // {
  1052. // type: "input",
  1053. // prop: "beneficiaryAccountNumber",
  1054. // label: " ",
  1055. // placeholder: "请输入Beneficiary Account Number",
  1056. // itemWidth: 50,
  1057. // isShow: formData.data.contractType == "1",
  1058. // },
  1059. // {
  1060. // type: "input",
  1061. // prop: "beneficiaryBank",
  1062. // label: " ",
  1063. // placeholder: "请输入Beneficiary Bank",
  1064. // itemWidth: 50,
  1065. // isShow: formData.data.contractType == "1",
  1066. // },
  1067. // {
  1068. // type: "input",
  1069. // prop: "swiftCode",
  1070. // label: " ",
  1071. // placeholder: "请输入Swift Code",
  1072. // itemWidth: 50,
  1073. // isShow: formData.data.contractType == "1",
  1074. // },
  1075. // {
  1076. // type: "input",
  1077. // prop: "beneficiaryBankAddress",
  1078. // label: " ",
  1079. // placeholder: "请输入Beneficiary Bank Address",
  1080. // itemWidth: 50,
  1081. // isShow: formData.data.contractType == "1",
  1082. // },
  1083. // {
  1084. // type: "input",
  1085. // prop: "beneficiaryAddress",
  1086. // label: " ",
  1087. // placeholder: "请输入Beneficiary Address",
  1088. // itemWidth: 50,
  1089. // isShow: formData.data.contractType == "1",
  1090. // },
  1091. // {
  1092. // type: "slot",
  1093. // slotName: "payment",
  1094. // label: "",
  1095. // },
  1096. {
  1097. type: "title",
  1098. title: "交付信息",
  1099. haveLine: true,
  1100. },
  1101. {
  1102. type: "date",
  1103. itemType: "date",
  1104. prop: "saleDate",
  1105. label: "销售日期",
  1106. itemWidth: 50,
  1107. },
  1108. {
  1109. type: "date",
  1110. itemType: "date",
  1111. prop: "deliveryTime",
  1112. label: "交货期限",
  1113. itemWidth: 50,
  1114. },
  1115. {
  1116. type: "select",
  1117. prop: "transportMethod",
  1118. label: "运输方式",
  1119. data: shippingMethod.value,
  1120. itemWidth: 50,
  1121. },
  1122. // {
  1123. // type: "select",
  1124. // prop: "taxTransportationWay",
  1125. // label: "税运方式",
  1126. // data: taxTransportationWay.value,
  1127. // itemWidth: 50,
  1128. // },
  1129. // {
  1130. // type: "input",
  1131. // prop: "transportRemark",
  1132. // label: "运输说明",
  1133. // itemWidth: 50,
  1134. // },
  1135. // {
  1136. // type: "slot",
  1137. // slotName: "delivery",
  1138. // label: "",
  1139. // },
  1140. {
  1141. type: "title",
  1142. title: "商品信息",
  1143. haveLine: true,
  1144. },
  1145. {
  1146. type: "slot",
  1147. slotName: "commodity",
  1148. label: "",
  1149. },
  1150. // {
  1151. // type: "title",
  1152. // title: "其他收费项目",
  1153. // haveLine: true,
  1154. // },
  1155. // {
  1156. // type: "slot",
  1157. // slotName: "otherCharge",
  1158. // label: "",
  1159. // },
  1160. {
  1161. type: "title",
  1162. title: "订单总金额",
  1163. haveLine: true,
  1164. },
  1165. {
  1166. type: "input",
  1167. prop: "amount",
  1168. label: "订单总⾦额",
  1169. itemWidth: 25,
  1170. disabled: true,
  1171. },
  1172. {
  1173. type: "input",
  1174. prop: "factoryAmount",
  1175. label: "出⼚总⾦额",
  1176. itemWidth: 25,
  1177. disabled: true,
  1178. },
  1179. {
  1180. type: "input",
  1181. prop: "grossProfit",
  1182. label: "合计⽑利",
  1183. itemWidth: 25,
  1184. disabled: true,
  1185. },
  1186. {
  1187. type: "title",
  1188. title: "订单模板",
  1189. haveLine: true,
  1190. },
  1191. {
  1192. type: "select",
  1193. prop: "contractTemplateId",
  1194. label: "订单模板",
  1195. data: templateList.value,
  1196. itemWidth: 50,
  1197. fn: (val) => {
  1198. proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
  1199. formData.data.templateContent = res.templateContent;
  1200. remarkEditor.value.changeHtml(formData.data.templateContent);
  1201. });
  1202. },
  1203. },
  1204. {
  1205. type: "slot",
  1206. slotName: "templateContent",
  1207. prop: "templateContent",
  1208. label: "模板内容",
  1209. itemWidth: 100,
  1210. disabled: false,
  1211. },
  1212. {
  1213. type: "title",
  1214. title: "合同上传",
  1215. haveLine: true,
  1216. isShow:
  1217. route.query.processType == 20 || props.queryData.processType == 20,
  1218. },
  1219. {
  1220. type: "slot",
  1221. slotName: "contractFileList",
  1222. prop: "contractFileList",
  1223. label: "合同上传",
  1224. isShow:
  1225. route.query.processType == 20 || props.queryData.processType == 20,
  1226. },
  1227. ];
  1228. });
  1229. const rules = ref({
  1230. ofCompanyId: [
  1231. { required: true, message: "请选择业务公司", trigger: "change" },
  1232. ],
  1233. deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
  1234. companyId: [{ required: true, message: "请选择生产公司", trigger: "change" }],
  1235. contractType: [
  1236. { required: true, message: "请选择订单类型", trigger: "change" },
  1237. ],
  1238. processingMethod: [
  1239. { required: true, message: "请选择订单处理方式", trigger: "change" },
  1240. ],
  1241. deliveryTime: [
  1242. { required: true, message: "请选择交货日期", trigger: "change" },
  1243. ],
  1244. belongType: [
  1245. { required: true, message: "请选择订单归属", trigger: "change" },
  1246. ],
  1247. merchUserId: [{ required: true, message: "请选择跟单员", trigger: "change" }],
  1248. salesmanId: [{ required: true, message: "请选择业务员", trigger: "change" }],
  1249. isTax: [{ required: true, message: "请选择是否含税", trigger: "change" }],
  1250. isFreight: [
  1251. { required: true, message: "请选择是否含运费", trigger: "change" },
  1252. ],
  1253. sellCorporationId: [
  1254. { required: true, message: "请选择卖方公司", trigger: "change" },
  1255. ],
  1256. buyCorporationId: [
  1257. { required: true, message: "请选择买方公司", trigger: "change" },
  1258. ],
  1259. countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
  1260. sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
  1261. buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
  1262. buyContactName: [
  1263. { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
  1264. ],
  1265. buyContactNumber: [
  1266. { required: true, message: "请输入联系电话", trigger: "blur" },
  1267. ],
  1268. quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
  1269. price: [{ required: true, message: "请输入单价", trigger: "blur" }],
  1270. payName: [
  1271. { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
  1272. ],
  1273. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  1274. settlementMethod: [
  1275. { required: true, message: "请选择客户结算方式", trigger: "change" },
  1276. ],
  1277. paymentMethod: [
  1278. { required: true, message: "请选择付款方式", trigger: "change" },
  1279. ],
  1280. advanceRatio: [
  1281. { required: true, message: "请输入预付比例", trigger: "blur" },
  1282. ],
  1283. transportMethod: [
  1284. { required: true, message: "请选择运输方式", trigger: "change" },
  1285. ],
  1286. remark: [
  1287. { required: true, message: "请输入其他收款方式备注说明", trigger: "blur" },
  1288. ],
  1289. rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
  1290. shroffAccountId: [
  1291. { required: true, message: "请选择收款账号", trigger: "change" },
  1292. ],
  1293. // contractTemplateId: [
  1294. // { required: true, message: "请选择模板", trigger: "change" },
  1295. // ],
  1296. templateContent: [
  1297. { required: true, message: "请输入模板内容", trigger: "blur" },
  1298. ],
  1299. contractChannel: [
  1300. { required: true, message: "请选择订单渠道", trigger: "change" },
  1301. ],
  1302. channelCode: [
  1303. { required: true, message: "请输入订单渠道编号", trigger: "blur" },
  1304. ],
  1305. saleDate: [{ required: true, message: "请选择销售日期", trigger: "change" }],
  1306. taxTransportationWay: [
  1307. { required: true, message: "请选择税运方式", trigger: "change" },
  1308. ],
  1309. beforeShipmentRatio: [
  1310. { required: true, message: "请输入出货前付款比例", trigger: "blur" },
  1311. ],
  1312. afterShipmentRatio: [
  1313. { required: true, message: "请输入出货后付款比例", trigger: "blur" },
  1314. ],
  1315. taxPoints: [{ required: true, message: "请选择税点", trigger: "change" }],
  1316. alibabaCode: [
  1317. { required: true, message: "请输入阿里巴巴编号", trigger: "blur" },
  1318. ],
  1319. alibabaShopName: [
  1320. { required: true, message: "请选择1688店铺名称", trigger: "change" },
  1321. ],
  1322. });
  1323. const getDict = () => {
  1324. proxy
  1325. .post("/contractTemplate/page", {
  1326. pageNum: 1,
  1327. pageSize: 999,
  1328. templateType: "1",
  1329. })
  1330. .then((res) => {
  1331. templateList.value = res.rows.map((x) => ({
  1332. label: x.templateName,
  1333. value: x.id,
  1334. }));
  1335. });
  1336. proxy
  1337. .post("/customer/selPage", {
  1338. pageNum: 1,
  1339. pageSize: 50,
  1340. })
  1341. .then((res) => {
  1342. customerList.value = res.rows.map((x) => ({
  1343. ...x,
  1344. label: x.name,
  1345. value: x.id,
  1346. }));
  1347. });
  1348. proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  1349. corporationList.value = res.rows.map((item) => {
  1350. return {
  1351. ...item,
  1352. label: item.name,
  1353. value: item.id,
  1354. };
  1355. });
  1356. });
  1357. proxy
  1358. .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
  1359. .then((res) => {
  1360. accountList.value = res.rows.map((item) => {
  1361. return {
  1362. ...item,
  1363. label: item.alias,
  1364. value: item.id,
  1365. };
  1366. });
  1367. });
  1368. proxy
  1369. .get("/tenantDept/list", {
  1370. pageNum: 1,
  1371. pageSize: 9999,
  1372. keyword: "",
  1373. tenantId: proxy.useUserStore().user.tenantId,
  1374. type: 0,
  1375. })
  1376. .then((res) => {
  1377. treeData.value = proxy.handleTree(res.data, "deptId");
  1378. });
  1379. proxy
  1380. .get("/tenantUser/list", {
  1381. pageNum: 1,
  1382. pageSize: 10000,
  1383. tenantId: proxy.useUserStore().user.tenantId,
  1384. })
  1385. .then((res) => {
  1386. userList.value = res.rows.map((item) => {
  1387. return {
  1388. label: item.nickName,
  1389. value: item.userId,
  1390. };
  1391. });
  1392. });
  1393. };
  1394. const getCityData = (id, type, isChange) => {
  1395. proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
  1396. if (type === "20") {
  1397. provinceData.value = res;
  1398. if (isChange) {
  1399. formData.data.provinceId = "";
  1400. formData.data.provinceName = "";
  1401. formData.data.cityId = "";
  1402. formData.data.cityName = "";
  1403. }
  1404. } else if (type === "30") {
  1405. cityData.value = res;
  1406. if (isChange) {
  1407. formData.data.cityId = "";
  1408. formData.data.cityName = "";
  1409. }
  1410. } else {
  1411. countryData.value = res;
  1412. }
  1413. });
  1414. };
  1415. getDict();
  1416. getCityData("0");
  1417. const handleOfCompanyIdChange = (val) => {
  1418. if (val) {
  1419. proxy
  1420. .get("/tenantDept/list", {
  1421. pageNum: 1,
  1422. pageSize: 9999,
  1423. keyword: "",
  1424. ancestors: val,
  1425. tenantId: proxy.useUserStore().user.tenantId,
  1426. // type: 2,
  1427. })
  1428. .then((res) => {
  1429. deptData.value = proxy.handleTree(res.data, "deptId");
  1430. });
  1431. }
  1432. };
  1433. const sellCorporationIdChange = (val) => {
  1434. if (val) {
  1435. proxy.post("/corporation/detail", { id: val }).then((res) => {
  1436. formData.data.sellCountryName = res.countryName;
  1437. formData.data.sellProvinceName = res.provinceName;
  1438. formData.data.sellCityName = res.cityName;
  1439. formData.data.sellAddress = res.address;
  1440. formData.data.sellContactName = res.contactName;
  1441. formData.data.sellContactNumber = res.contactPhone;
  1442. // if (formData.data.contractType == "2") {
  1443. // formData.data.sellCountryName = res.countryName;
  1444. // formData.data.sellProvinceName = res.provinceName;
  1445. // formData.data.sellCityName = res.cityName;
  1446. // formData.data.sellAddress = res.address;
  1447. // formData.data.sellContactName = res.contactName;
  1448. // formData.data.sellContactNumber = res.contactPhone;
  1449. // } else {
  1450. // formData.data.sellCountryName = res.countryEnStr;
  1451. // formData.data.sellProvinceName = res.provinceEnStr;
  1452. // formData.data.sellCityName = res.cityEnStr;
  1453. // formData.data.sellAddress = res.addressEn;
  1454. // formData.data.sellContactName = res.contactName;
  1455. // formData.data.sellContactNumber = res.contactPhone;
  1456. // }
  1457. });
  1458. }
  1459. };
  1460. const changeCustomer = (val) => {
  1461. formData.data.contractProductList = [];
  1462. if (val) {
  1463. proxy.post("/customer/detail", { id: val }).then(
  1464. (res) => {
  1465. formData.data.buyCorporationName = res.name;
  1466. formData.data.settlementMethod = res.settlementMode;
  1467. if (res.customerUserList && res.customerUserList.length > 0) {
  1468. formData.data.buyContactName = res.customerUserList[0].name;
  1469. formData.data.buyContactNumber = res.customerUserList[0].phone;
  1470. // if (res.customerUserList[0].contactJson) {
  1471. // let contactJson = JSON.parse(res.customerUserList[0].contactJson);
  1472. // if (contactJson && contactJson.length > 0) {
  1473. // formData.data.buyContactNumber = contactJson[0].contactNo;
  1474. // }
  1475. // }
  1476. customerUserList.value = res.customerUserList.map((item) => {
  1477. return {
  1478. ...item,
  1479. value: item.name,
  1480. };
  1481. });
  1482. }
  1483. // 回填客户的账户信息
  1484. // formData.data.beneficiaryName = res.beneficiaryName;
  1485. // formData.data.beneficiaryBank = res.beneficiaryBank;
  1486. // formData.data.beneficiaryBankAddress = res.beneficiaryBankAddress;
  1487. // formData.data.beneficiaryAccountNumber = res.beneficiaryAccountNumber;
  1488. // formData.data.swiftCode = res.swiftCode;
  1489. // formData.data.beneficiaryAddress = res.beneficiaryAddress;
  1490. formData.data.countryId = res.countryId;
  1491. formData.data.provinceId = res.provinceId;
  1492. formData.data.cityId = res.cityId;
  1493. formData.data.buyPostalCode = res.zipCode;
  1494. formData.data.buyAddress = res.address;
  1495. getCityData(formData.data.countryId, "20");
  1496. if (formData.data.provinceId) {
  1497. getCityData(formData.data.provinceId, "30");
  1498. }
  1499. },
  1500. (err) => {
  1501. formData.data.countryId = "";
  1502. formData.data.provinceId = "";
  1503. formData.data.cityId = "";
  1504. formData.data.buyPostalCode = "";
  1505. formData.data.buyAddress = "";
  1506. }
  1507. );
  1508. } else {
  1509. formData.data.countryId = "";
  1510. formData.data.provinceId = "";
  1511. formData.data.cityId = "";
  1512. formData.data.buyPostalCode = "";
  1513. formData.data.buyAddress = "";
  1514. }
  1515. };
  1516. const changeAdvanceRatio = (val, flag) => {
  1517. if (flag) {
  1518. let total = Number(
  1519. parseFloat(val + Number(formData.data.beforeShipmentRatio)).toFixed(2)
  1520. );
  1521. if (total > 100) {
  1522. formData.data.advanceRatio = null;
  1523. formData.data.beforeShipmentRatio = null;
  1524. formData.data.afterShipmentRatio = null;
  1525. } else {
  1526. formData.data.afterShipmentRatio = Number(
  1527. parseFloat(100 - total).toFixed(2)
  1528. );
  1529. }
  1530. } else {
  1531. let total = Number(
  1532. parseFloat(val + Number(formData.data.advanceRatio)).toFixed(2)
  1533. );
  1534. if (total > 100) {
  1535. formData.data.advanceRatio = null;
  1536. formData.data.beforeShipmentRatio = null;
  1537. formData.data.afterShipmentRatio = null;
  1538. } else {
  1539. formData.data.afterShipmentRatio = Number(
  1540. parseFloat(100 - total).toFixed(2)
  1541. );
  1542. }
  1543. }
  1544. };
  1545. const createFilter = (queryString) => {
  1546. return (restaurant) => {
  1547. return (
  1548. restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
  1549. );
  1550. };
  1551. };
  1552. const querySearchPerson = (queryString, callback) => {
  1553. const results = queryString
  1554. ? customerUserList.value.filter(createFilter(queryString))
  1555. : customerUserList.value;
  1556. callback(results);
  1557. };
  1558. const handlePerson = (item) => {
  1559. if (item.contactJson) {
  1560. let data = JSON.parse(item.contactJson);
  1561. formData.data.buyContactNumber = data[0].contactNo;
  1562. }
  1563. };
  1564. const handleClickSelectMaterial = (index) => {
  1565. indexValue.value = index;
  1566. openSelectMaterial.value = true;
  1567. };
  1568. const contractProductBomList = ref([]);
  1569. const selectProduct = async (goods) => {
  1570. if (goods && goods.id) {
  1571. let rowId = uuidv4();
  1572. let allFile = [];
  1573. let fileUrl = "";
  1574. if (goods.fileList && goods.fileList.length > 0) {
  1575. fileUrl = goods.fileList[0].fileUrl;
  1576. }
  1577. const fileData = await proxy.post("/fileInfo/getList", {
  1578. businessIdList: [goods.id],
  1579. });
  1580. if (fileData[goods.id] && fileData[goods.id].length > 0) {
  1581. allFile = fileData[goods.id];
  1582. } else {
  1583. allFile = [];
  1584. }
  1585. proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
  1586. if (res.productBomDetailList && res.productBomDetailList.length > 0) {
  1587. contractProductBomList.value = res.productBomDetailList.map((x) => ({
  1588. fileUrl: "",
  1589. materialId: x.materialId,
  1590. productName: x.materialName,
  1591. productCode: x.materialCode,
  1592. productLength: x.materialLength,
  1593. productWidth: x.materialWidth,
  1594. productHeight: x.materialHeight,
  1595. quantity: x.quantity || null,
  1596. allQuantity: "",
  1597. price: x.materialPrice || null,
  1598. amount: "",
  1599. fileList: [],
  1600. type: x.type,
  1601. }));
  1602. let fileListOne = [];
  1603. if (allFile && allFile.length > 0) {
  1604. fileListOne = allFile.filter((x) => x.businessType == "2");
  1605. }
  1606. formData.data.contractProductList.push({
  1607. fileUrl: fileUrl,
  1608. productId: goods.id,
  1609. productClassifyName: goods.classifyName,
  1610. productName: goods.name,
  1611. productCode: goods.customCode,
  1612. productLength: goods["length"],
  1613. productWidth: goods.width,
  1614. productHeight: goods.height,
  1615. productColor: goods.color,
  1616. productNetWeight: goods.netWeight,
  1617. productUnit: goods.unit,
  1618. productFrontalTexture: goods.frontalTexture,
  1619. prodFilePath: goods.prodFilePath,
  1620. quantity: null,
  1621. price: goods.price || null,
  1622. factoryPrice: goods.factoryPrice || null,
  1623. amount: "",
  1624. remark: "",
  1625. fileList: [],
  1626. isShowProductFile: true,
  1627. fileListOne: fileListOne,
  1628. prodFileList: [],
  1629. contractProductBomList: contractProductBomList.value,
  1630. rowId: rowId,
  1631. });
  1632. proxy.msgTip("添加成功", 1);
  1633. changeProductPrice();
  1634. let ids = contractProductBomList.value.map((x) => x.materialId);
  1635. proxy.getFile(
  1636. ids,
  1637. contractProductBomList.value,
  1638. "materialId",
  1639. "fileList",
  1640. "fileUrl"
  1641. );
  1642. } else {
  1643. return proxy.msgTip("该产品未配置BOM", 2);
  1644. }
  1645. });
  1646. } else {
  1647. return proxy.msgTip("选择错误", 2);
  1648. }
  1649. };
  1650. const selectMaterial = (goods) => {
  1651. let flag = formData.data.contractProductList[
  1652. indexValue.value
  1653. ].contractProductBomList.some((x) => x.materialId == goods.id);
  1654. if (!flag) {
  1655. let fileUrl = "";
  1656. if (goods.fileList && goods.fileList.length > 0) {
  1657. fileUrl = goods.fileList[0].fileUrl;
  1658. }
  1659. formData.data.contractProductList[
  1660. indexValue.value
  1661. ].contractProductBomList.push({
  1662. fileUrl: fileUrl,
  1663. materialId: goods.id,
  1664. productName: goods.name,
  1665. productCode: goods.customCode,
  1666. productLength: goods["length"],
  1667. productWidth: goods.width,
  1668. productHeight: goods.height,
  1669. quantity: null,
  1670. price: goods.price || null,
  1671. amount: "",
  1672. fileList: [],
  1673. type: 2,
  1674. });
  1675. proxy.msgTip("选择成功");
  1676. } else {
  1677. proxy.msgTip("该物料已选择", 2);
  1678. }
  1679. };
  1680. const changeProductPrice = () => {
  1681. return;
  1682. let productIds = formData.data.contractProductList.map((x) => x.productId);
  1683. if (productIds && productIds.length > 0) {
  1684. proxy
  1685. .post("/contract/getProductPriceInfo", {
  1686. productIds: productIds,
  1687. customerId: formData.data.buyCorporationId
  1688. ? formData.data.buyCorporationId
  1689. : "",
  1690. })
  1691. .then((res) => {
  1692. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1693. const iele = formData.data.contractProductList[i];
  1694. for (const key in res) {
  1695. if (key == iele.productId) {
  1696. iele.salePrice = res[key].price;
  1697. iele.currency = res[key].currency;
  1698. iele.saleCostPrice = res[key].costPrice;
  1699. iele.contractProductList = res[key].contractProductList
  1700. .map((x) => ({
  1701. createTime: x.createTime || "",
  1702. price: x.price,
  1703. currency: x.currency,
  1704. }))
  1705. .filter((y, index) => index < 3);
  1706. iele.contractProductListOne = res[key].contractProductList.map(
  1707. (x) => ({
  1708. createTime: x.createTime || "",
  1709. price: x.price,
  1710. currency: x.currency,
  1711. })
  1712. );
  1713. iele.customerContractProductList = res[
  1714. key
  1715. ].customerContractProductList.map((x) => ({
  1716. createTime: x.createTime || "",
  1717. price: x.price,
  1718. currency: x.currency,
  1719. }));
  1720. }
  1721. }
  1722. }
  1723. });
  1724. }
  1725. };
  1726. const updateContent = (val) => {
  1727. formData.data.templateContent = val;
  1728. };
  1729. const onPicture = (path) => {
  1730. window.open(path, "_blank");
  1731. };
  1732. const handleRemove = (index) => {
  1733. formData.data.contractProductList.splice(index, 1);
  1734. totalAmount();
  1735. };
  1736. const handleDeleteMaterial = (index, sonIndex) => {
  1737. formData.data.contractProductList[index].contractProductBomList.splice(
  1738. sonIndex,
  1739. 1
  1740. );
  1741. };
  1742. const calculationAmount = () => {
  1743. if (
  1744. formData.data.contractProductList &&
  1745. formData.data.contractProductList.length > 0
  1746. ) {
  1747. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1748. formData.data.contractProductList[i].amount = parseFloat(
  1749. Number(formData.data.contractProductList[i].quantity) *
  1750. Number(formData.data.contractProductList[i].price)
  1751. ).toFixed(2);
  1752. formData.data.contractProductList[i].amountTwo = parseFloat(
  1753. Number(formData.data.contractProductList[i].quantity) *
  1754. Number(formData.data.contractProductList[i].factoryPrice)
  1755. ).toFixed(2);
  1756. }
  1757. }
  1758. totalAmount();
  1759. };
  1760. const totalAmount = () => {
  1761. let money = 0;
  1762. let moneyTwo = 0;
  1763. if (
  1764. formData.data.contractProductList &&
  1765. formData.data.contractProductList.length > 0
  1766. ) {
  1767. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1768. if (formData.data.contractProductList[i].amount) {
  1769. money = parseFloat(
  1770. Number(money) + Number(formData.data.contractProductList[i].amount)
  1771. ).toFixed(2);
  1772. }
  1773. if (formData.data.contractProductList[i].amountTwo) {
  1774. moneyTwo = parseFloat(
  1775. Number(moneyTwo) +
  1776. Number(formData.data.contractProductList[i].amountTwo)
  1777. ).toFixed(2);
  1778. }
  1779. }
  1780. }
  1781. if (
  1782. formData.data.contractProjectList &&
  1783. formData.data.contractProjectList.length > 0
  1784. ) {
  1785. for (let i = 0; i < formData.data.contractProjectList.length; i++) {
  1786. if (formData.data.contractProjectList[i].amount) {
  1787. money = parseFloat(
  1788. Number(money) + Number(formData.data.contractProjectList[i].amount)
  1789. ).toFixed(2);
  1790. }
  1791. }
  1792. }
  1793. formData.data.amount = money;
  1794. formData.data.factoryAmount = moneyTwo;
  1795. formData.data.grossProfit = parseFloat(
  1796. Number(formData.data.amount) - Number(formData.data.factoryAmount)
  1797. ).toFixed(2);
  1798. };
  1799. const clickAdd = () => {
  1800. if (
  1801. formData.data.contractProjectList &&
  1802. formData.data.contractProjectList.length > 0
  1803. ) {
  1804. formData.data.contractProjectList.push({
  1805. payName: "",
  1806. amount: null,
  1807. remark: "",
  1808. });
  1809. } else {
  1810. formData.data.contractProjectList = [
  1811. { payName: "", amount: null, remark: "" },
  1812. ];
  1813. }
  1814. };
  1815. const handleDelete = (index) => {
  1816. formData.data.contractProjectList.splice(index, 1);
  1817. totalAmount();
  1818. };
  1819. const querySearch = (queryString, callback) => {
  1820. proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
  1821. if (res.rows && res.rows.length > 0) {
  1822. res.rows = res.rows.map((item) => {
  1823. return {
  1824. ...item,
  1825. value: item.payName,
  1826. };
  1827. });
  1828. callback(res.rows);
  1829. } else {
  1830. callback([]);
  1831. }
  1832. });
  1833. };
  1834. const handleBeforeUpload = async (file, index) => {
  1835. formData.data.contractProductList[index].imgLoading = true;
  1836. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  1837. uploadData.value = res.uploadBody;
  1838. formData.data.contractProductList[index].fileList = [
  1839. {
  1840. id: res.id,
  1841. fileName: res.fileName,
  1842. fileUrl: res.fileUrl,
  1843. uploadState: false,
  1844. },
  1845. ];
  1846. formData.data.contractProductList[index].fileData = res;
  1847. return true;
  1848. };
  1849. const handleBeforeUploadOne = async (file, index) => {
  1850. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  1851. file.id = res.id;
  1852. file.fileUrl = res.fileUrl;
  1853. uploadData.value = res.uploadBody;
  1854. formData.data.contractProductList[index].fileData = res;
  1855. return true;
  1856. };
  1857. const handleSuccess = (index) => {
  1858. if (
  1859. formData.data.contractProductList[index].fileData &&
  1860. formData.data.contractProductList[index].fileData.fileUrl
  1861. ) {
  1862. formData.data.contractProductList[index].uploadState = true;
  1863. formData.data.contractProductList[index].imageUrl =
  1864. formData.data.contractProductList[index].fileData.fileUrl;
  1865. }
  1866. setTimeout(() => {
  1867. formData.data.contractProductList[index].imgLoading = false;
  1868. }, 400);
  1869. };
  1870. const handleSuccessOne = (index) => {
  1871. if (
  1872. formData.data.contractProductList[index].fileData &&
  1873. formData.data.contractProductList[index].fileData.fileUrl
  1874. ) {
  1875. let file = formData.data.contractProductList[index].fileData;
  1876. formData.data.contractProductList[index].prodFileList.push({
  1877. id: file.id,
  1878. fileName: file.fileName,
  1879. name: file.fileName,
  1880. url: file.fileUrl,
  1881. fileUrl: file.fileUrl,
  1882. });
  1883. formData.data.contractProductList[index].fileData = {};
  1884. }
  1885. };
  1886. const handleRemoveFile = (file, index) => {
  1887. let sonIndex = formData.data.contractProductList[
  1888. index
  1889. ].prodFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
  1890. if (sonIndex > -1) {
  1891. formData.data.contractProductList[index].prodFileList.splice(sonIndex, 1);
  1892. }
  1893. };
  1894. const onPreviewFile = (file) => {
  1895. if (file && file.fileUrl) {
  1896. window.open(file.fileUrl, "_blank");
  1897. } else {
  1898. window.open(file.raw.fileUrl, "_blank");
  1899. }
  1900. };
  1901. const loadingSearch = ref(false);
  1902. const remoteMethod = (keyword) => {
  1903. if (keyword && typeof keyword === "string") {
  1904. loadingSearch.value = true;
  1905. proxy.post("/customer/selPage", { keyword }).then((res) => {
  1906. customerList.value = res.rows.map((x) => ({
  1907. ...x,
  1908. label: x.name,
  1909. value: x.id,
  1910. }));
  1911. loadingSearch.value = false;
  1912. });
  1913. }
  1914. return;
  1915. };
  1916. const handleSubmit = async (isStag = false) => {
  1917. if (isStag) {
  1918. return true;
  1919. }
  1920. let flag = await formDom.value.handleSubmit(() => {});
  1921. if (flag) {
  1922. if (
  1923. formData.data.contractProductList &&
  1924. formData.data.contractProductList.length > 0
  1925. ) {
  1926. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1927. const ele = formData.data.contractProductList[i];
  1928. if (ele.isShowProductFile && ele.fileListOne.length > 0) {
  1929. ele.prodFileList = ele.fileListOne;
  1930. }
  1931. }
  1932. formData.data.currency = currencyData.value[0].dictKey;
  1933. return true;
  1934. } else {
  1935. proxy.msgTip("请添加至少一件商品", 2);
  1936. return false;
  1937. }
  1938. } else {
  1939. // setTimeout(() => {
  1940. // const errorDiv = document.getElementsByClassName("is-error");
  1941. // errorDiv[0].scrollIntoView();
  1942. // }, 0);
  1943. }
  1944. return flag;
  1945. };
  1946. const getFormData = () => {
  1947. // 赋值类型
  1948. formData.data.type = route.query.flowKey == "sample_flow" ? "1" : "0";
  1949. return proxy.deepClone(formData.data);
  1950. };
  1951. // 向父组件暴露
  1952. defineExpose({
  1953. getFormData,
  1954. handleSubmit,
  1955. });
  1956. const changeShroffAccount = (val) => {
  1957. if (val) {
  1958. let data = accountList.value.find((item) => item.value == val);
  1959. if (data) {
  1960. formData.data.beneficiaryName = "";
  1961. formData.data.beneficiaryBank = "";
  1962. formData.data.beneficiaryBankAddress = "";
  1963. formData.data.beneficiaryAccountNumber = "";
  1964. formData.data.swiftCode = "";
  1965. formData.data.beneficiaryAddress = "";
  1966. formData.data.accountName = data.name;
  1967. formData.data.openingBank = data.openingBank;
  1968. formData.data.accountOpening = data.accountOpening;
  1969. }
  1970. // if (formData.data.contractType == "2") {
  1971. // if (data) {
  1972. // formData.data.beneficiaryName = "";
  1973. // formData.data.beneficiaryBank = "";
  1974. // formData.data.beneficiaryBankAddress = "";
  1975. // formData.data.beneficiaryAccountNumber = "";
  1976. // formData.data.swiftCode = "";
  1977. // formData.data.beneficiaryAddress = "";
  1978. // formData.data.accountName = data.name;
  1979. // formData.data.openingBank = data.openingBank;
  1980. // formData.data.accountOpening = data.accountOpening;
  1981. // }
  1982. // } else {
  1983. // if (data) {
  1984. // formData.data.accountName = "";
  1985. // formData.data.openingBank = "";
  1986. // formData.data.accountOpening = "";
  1987. // formData.data.beneficiaryName = data.beneficiaryName;
  1988. // formData.data.beneficiaryBank = data.beneficiaryBank;
  1989. // formData.data.beneficiaryBankAddress = data.beneficiaryBankAddress;
  1990. // formData.data.beneficiaryAccountNumber = data.beneficiaryAccountNumber;
  1991. // formData.data.swiftCode = data.swiftCode;
  1992. // formData.data.beneficiaryAddress = data.beneficiaryAddress;
  1993. // }
  1994. // }
  1995. }
  1996. };
  1997. const handleClickUpload = async (att, flag, index) => {
  1998. let res = null;
  1999. let path = "";
  2000. if (flag) {
  2001. proxy.msgTip("请稍后", 2);
  2002. res = await proxy.post("/fileService/createTempFolder");
  2003. if (res && res.path) {
  2004. formData.data.contractProductList[index][att] = res.path;
  2005. path = res.path;
  2006. }
  2007. } else {
  2008. path = formData.data.contractProductList[index][att];
  2009. }
  2010. let a = document.createElement("a");
  2011. a.href = "printer://" + `ftp://${import.meta.env.VITE_APP_IP}/` + path + "/";
  2012. a.style.display = "none";
  2013. document.body.appendChild(a);
  2014. a.click();
  2015. document.body.removeChild(a);
  2016. };
  2017. const handleClickUploadOne = (index) => {
  2018. formData.data.contractProductList[index].isShowProductFile =
  2019. !formData.data.contractProductList[index].isShowProductFile;
  2020. if (formData.data.contractProductList[index].isShowProductFile) {
  2021. formData.data.contractProductList[index].prodFileList = [];
  2022. formData.data.contractProductList[index].fileData = {};
  2023. }
  2024. };
  2025. const getAllData = (businessId) => {
  2026. proxy.post("/contract/detail", { id: businessId }).then(async (res) => {
  2027. res.countryId = res.buyCountryId;
  2028. res.provinceId = res.buyProvinceId;
  2029. res.cityId = res.buyCityId;
  2030. if (res.grossProfitInfoList && res.grossProfitInfoList.length > 0) {
  2031. $bus.emit("getGrossData", res.grossProfitInfoList);
  2032. }
  2033. for (const key in res) {
  2034. formData.data[key] = res[key];
  2035. }
  2036. formData.data.belongType = formData.data.belongType + "";
  2037. formData.data.isFreight = formData.data.isFreight + "";
  2038. formData.data.isTax = formData.data.isTax + "";
  2039. remarkEditor.value.changeHtml(formData.data.templateContent);
  2040. // 外层附件回显
  2041. proxy
  2042. .post("/fileInfo/getList", { businessIdList: [businessId] })
  2043. .then((fileObj) => {
  2044. if (fileObj[businessId] && fileObj[businessId].length > 0) {
  2045. formData.data.contractFileList = fileObj[businessId]
  2046. .filter((x) => x.businessType == "10")
  2047. .map((item) => {
  2048. return {
  2049. ...item,
  2050. name: item.fileName,
  2051. url: item.fileUrl,
  2052. };
  2053. });
  2054. } else {
  2055. formData.data.contractFileList = [];
  2056. }
  2057. });
  2058. if (
  2059. formData.data.contractProductList &&
  2060. formData.data.contractProductList.length > 0
  2061. ) {
  2062. formData.data.contractProductList.forEach((x) => {
  2063. x.rowId = uuidv4();
  2064. });
  2065. getFileData();
  2066. let productIds = formData.data.contractProductList.map(
  2067. (x) => x.productId
  2068. );
  2069. // proxy.getFileData({
  2070. // businessIdList: productIds,
  2071. // data: formData.data.contractProductList,
  2072. // att: "productId",
  2073. // businessType: "0",
  2074. // fileAtt: "productFile",
  2075. // filePathAtt: "fileUrl",
  2076. // });
  2077. const productAllFile = await proxy.getFileData({
  2078. businessIdList: productIds,
  2079. getAll: true,
  2080. });
  2081. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  2082. const ele = formData.data.contractProductList[i];
  2083. for (const key in productAllFile) {
  2084. if (
  2085. ele.productId == key &&
  2086. productAllFile[ele.productId] &&
  2087. productAllFile[ele.productId].length > 0
  2088. ) {
  2089. ele.productFile = productAllFile[ele.productId].filter(
  2090. (x) => x.businessType == "0"
  2091. );
  2092. if (ele.productFile && ele.productFile.length > 0) {
  2093. ele.fileUrl = ele.productFile[0].fileUrl;
  2094. }
  2095. break;
  2096. }
  2097. }
  2098. }
  2099. let ids = formData.data.contractProductList.map((x) => x.id);
  2100. proxy
  2101. .getFileData({
  2102. businessIdList: ids,
  2103. getAll: true,
  2104. })
  2105. .then((fileObj) => {
  2106. if (fileObj && Object.keys(fileObj).length > 0) {
  2107. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  2108. const ele = formData.data.contractProductList[i];
  2109. for (const key in fileObj) {
  2110. if (
  2111. ele.id == key &&
  2112. fileObj[ele.id] &&
  2113. fileObj[ele.id].length > 0
  2114. ) {
  2115. let imageUrlList = fileObj[ele.id].filter(
  2116. (x) => x.businessType == "0"
  2117. );
  2118. if (imageUrlList && imageUrlList.length > 0) {
  2119. ele.imageUrl = imageUrlList[0].fileUrl;
  2120. }
  2121. ele.prodFileList = fileObj[ele.id]
  2122. .filter((x) => x.businessType == "1")
  2123. .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
  2124. if (ele.prodFileList && ele.prodFileList.length > 0) {
  2125. ele.isShowProductFile = false;
  2126. } else {
  2127. ele.isShowProductFile = true;
  2128. if (productAllFile[ele.productId]) {
  2129. ele.fileListOne = productAllFile[ele.productId].filter(
  2130. (x) => x.businessType == "2"
  2131. );
  2132. }
  2133. }
  2134. }
  2135. }
  2136. }
  2137. } else {
  2138. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  2139. const ele = formData.data.contractProductList[i];
  2140. ele.isShowProductFile = true;
  2141. for (const key in productAllFile) {
  2142. if (
  2143. ele.productId == key &&
  2144. productAllFile[ele.productId] &&
  2145. productAllFile[ele.productId].length > 0
  2146. ) {
  2147. ele.fileListOne = productAllFile[ele.productId].filter(
  2148. (x) => x.businessType == "2"
  2149. );
  2150. break;
  2151. }
  2152. }
  2153. }
  2154. }
  2155. });
  2156. changeProductPrice();
  2157. }
  2158. calculationAmount();
  2159. if (formData.data.countryId) {
  2160. getCityData(formData.data.countryId, "20");
  2161. }
  2162. if (formData.data.provinceId) {
  2163. getCityData(formData.data.provinceId, "30");
  2164. }
  2165. });
  2166. };
  2167. const getFileData = () => {
  2168. let ids = [];
  2169. formData.data.contractProductList.map((x) => {
  2170. // ids.push(x.productId);
  2171. x.contractProductBomList.map((y) => {
  2172. ids.push(y.materialId);
  2173. });
  2174. });
  2175. ids = Array.from(new Set(ids));
  2176. proxy
  2177. .post("/fileInfo/getList", {
  2178. businessIdList: ids,
  2179. })
  2180. .then((fileObj) => {
  2181. formData.data.contractProductList.map((x) => {
  2182. // if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
  2183. // x.fileUrl = fileObj[x.productId][0].fileUrl;
  2184. // }
  2185. x.contractProductBomList.map((y) => {
  2186. y.fileList = fileObj[y.materialId] || [];
  2187. if (y.fileList && y.fileList.length > 0) {
  2188. y.fileUrl = y.fileList[0].fileUrl;
  2189. }
  2190. });
  2191. });
  2192. });
  2193. };
  2194. const getPriceSheetData = (id) => {
  2195. proxy.post("/extQuotation/detail", { id }).then(async (res) => {
  2196. if (formData.data.deptId) {
  2197. res.deptId = formData.data.deptId;
  2198. }
  2199. formData.data = res;
  2200. formData.data = {
  2201. contractType: route.query.contractType,
  2202. templateContent: "",
  2203. quotationId: res.id,
  2204. // companyId: res.companyId,
  2205. ofCompanyId: res.ofCompanyId,
  2206. deptId: res.deptId,
  2207. buyCorporationId: res.buyCorporationId,
  2208. buyAddress: res.buyAddress,
  2209. buyPostalCode: res.buyPostalCode,
  2210. buyContactName: res.buyContactName,
  2211. buyContactNumber: res.buyContactNumber,
  2212. amount: res.amount,
  2213. };
  2214. // if (res.type == 1) {
  2215. // formData.data.contractType = "2";
  2216. // if (currencyData.value && currencyData.value.length > 0) {
  2217. // formData.data.currency = currencyData.value[0].dictKey;
  2218. // }
  2219. // formData.data.rate = 1;
  2220. // } else {
  2221. // formData.data.contractType = "1";
  2222. // }
  2223. formData.data.contractProductList = res.quotationProductList.map((x) => ({
  2224. quotationProductId: x.id,
  2225. fileUrl: "",
  2226. productId: x.productId,
  2227. productName: x.productName,
  2228. productCode: x.productCode,
  2229. productLength: x.productLength,
  2230. productWidth: x.productWidth,
  2231. productHeight: x.productHeight,
  2232. prodFilePath: x.productProdImgPath,
  2233. quantity: x.quantity,
  2234. price: x.price,
  2235. amount: x.amount,
  2236. fileList: [],
  2237. contractProductBomList: x.quotationProductBomList.map((y) => {
  2238. y.quotationProductBomId = y.id;
  2239. delete y.id;
  2240. return y;
  2241. }),
  2242. rowId: uuidv4(),
  2243. }));
  2244. changeProductPrice();
  2245. totalAmount();
  2246. getFileData();
  2247. let productIds = formData.data.contractProductList.map((x) => x.productId);
  2248. const productAllFile = await proxy.getFileData({
  2249. businessIdList: productIds,
  2250. getAll: true,
  2251. });
  2252. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  2253. const ele = formData.data.contractProductList[i];
  2254. for (const key in productAllFile) {
  2255. if (
  2256. ele.productId == key &&
  2257. productAllFile[ele.productId] &&
  2258. productAllFile[ele.productId].length > 0
  2259. ) {
  2260. ele.productFile = productAllFile[ele.productId].filter(
  2261. (x) => x.businessType == "0"
  2262. );
  2263. if (ele.productFile && ele.productFile.length > 0) {
  2264. ele.fileUrl = ele.productFile[0].fileUrl;
  2265. }
  2266. ele.fileListOne = productAllFile[ele.productId].filter(
  2267. (x) => x.businessType == "2"
  2268. );
  2269. if (ele.fileListOne && ele.fileListOne.length > 0) {
  2270. ele.isShowProductFile = true;
  2271. } else {
  2272. ele.isShowProductFile = false;
  2273. }
  2274. break;
  2275. }
  2276. }
  2277. }
  2278. formData.data.countryId = res.buyCountryId;
  2279. formData.data.provinceId = res.buyProvinceId;
  2280. formData.data.cityId = res.buyCityId;
  2281. if (formData.data.countryId) {
  2282. getCityData(formData.data.countryId, "20");
  2283. }
  2284. if (formData.data.provinceId) {
  2285. getCityData(formData.data.provinceId, "30");
  2286. }
  2287. });
  2288. };
  2289. // 是否能编辑修改产品列表
  2290. const isEditList = ref(true);
  2291. onMounted(() => {
  2292. formData.data.ofCompanyId = proxy.useUserStore().user.companyId;
  2293. formData.data.salesmanId = proxy.useUserStore().user.userId;
  2294. handleOfCompanyIdChange(formData.data.ofCompanyId);
  2295. if (
  2296. proxy.useUserStore().currentCompany == proxy.useUserStore().user.ofCompanyId
  2297. ) {
  2298. formData.data.deptId = proxy.useUserStore().user.deptId;
  2299. }
  2300. if (currencyData.value && currencyData.value.length > 0) {
  2301. formData.data.currency = currencyData.value[0].dictKey;
  2302. }
  2303. formOption.disabled = judgeStatus();
  2304. // 报价转销售订单
  2305. if (route.query && route.query.priceSheetId) {
  2306. getPriceSheetData(route.query.priceSheetId);
  2307. isEditList.value = false;
  2308. } else if (route.query && route.query.businessId && route.query.processType) {
  2309. let businessId = route.query.businessId;
  2310. getAllData(businessId);
  2311. } else if (
  2312. route.query &&
  2313. route.query.businessId &&
  2314. !route.query.processType
  2315. ) {
  2316. let businessId = route.query.businessId;
  2317. getAllData(businessId);
  2318. }
  2319. });
  2320. watch(
  2321. () => props.queryData,
  2322. (val) => {
  2323. nextTick(() => {
  2324. formOption.disabled = judgeStatus();
  2325. });
  2326. if (val.businessId && val.processType) {
  2327. getAllData(val.businessId);
  2328. }
  2329. },
  2330. {
  2331. deep: true,
  2332. immediate: true,
  2333. }
  2334. );
  2335. const showPriceInfo = () => {
  2336. if (props.queryData.processType) {
  2337. return false;
  2338. }
  2339. if (route.query.processType) {
  2340. return false;
  2341. } else {
  2342. return true;
  2343. }
  2344. };
  2345. const optionTwo = reactive({
  2346. data: {
  2347. tooltip: {
  2348. trigger: "axis",
  2349. },
  2350. // legend: {
  2351. // data: ["价格"],
  2352. // },
  2353. grid: {
  2354. left: "3%",
  2355. right: "4%",
  2356. top: "10%",
  2357. bottom: "3%",
  2358. containLabel: true,
  2359. },
  2360. // toolbox: {
  2361. // feature: {
  2362. // saveAsImage: {},
  2363. // },
  2364. // },
  2365. xAxis: {
  2366. type: "category",
  2367. boundaryGap: false,
  2368. data: [],
  2369. },
  2370. yAxis: {
  2371. type: "value",
  2372. },
  2373. series: [
  2374. {
  2375. name: "价格",
  2376. type: "line",
  2377. data: [],
  2378. },
  2379. ],
  2380. },
  2381. });
  2382. const showEcharts = (row, index) => {
  2383. let myChart = null;
  2384. myChart = echarts.init(proxy.$refs[row.productId + index]);
  2385. window.addEventListener("resize", () => {
  2386. myChart.resize();
  2387. });
  2388. if (row.contractProductListOne && row.contractProductListOne.length > 0) {
  2389. optionTwo.data.xAxis.data = row.contractProductListOne.map((item) => {
  2390. return item.createTime.slice(0, 10);
  2391. });
  2392. optionTwo.data.series[0].data = row.contractProductListOne.map((item) => {
  2393. return item.price;
  2394. });
  2395. } else {
  2396. optionTwo.data.xAxis.data = [];
  2397. optionTwo.data.series[0].data = [];
  2398. }
  2399. myChart.setOption(optionTwo.data);
  2400. myChart.resize();
  2401. };
  2402. const clickCopy = (type) => {
  2403. copyType.value = type;
  2404. copyContract.value = true;
  2405. };
  2406. </script>
  2407. <style lang="scss" scoped>
  2408. .img {
  2409. object-fit: contain;
  2410. width: 16px;
  2411. height: 16px;
  2412. vertical-align: middle;
  2413. }
  2414. .pic {
  2415. object-fit: contain;
  2416. width: 50px;
  2417. height: 50px;
  2418. cursor: pointer;
  2419. vertical-align: middle;
  2420. }
  2421. .el-icon.avatar-uploader-icon {
  2422. font-size: 20px;
  2423. color: #8c939d;
  2424. width: 50px;
  2425. height: 50px;
  2426. text-align: center;
  2427. border: 1px dashed var(--el-border-color);
  2428. }
  2429. .ql-editor {
  2430. padding: 0px;
  2431. }
  2432. :deep(.el-upload-list) {
  2433. margin: 0px !important;
  2434. position: relative;
  2435. top: -8px;
  2436. left: -8px;
  2437. }
  2438. :deep(.el-upload-list--text .el-upload-list__item) {
  2439. min-width: 150px !important;
  2440. }
  2441. :deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
  2442. background: #f4f4f5 !important;
  2443. }
  2444. </style>