Contract.vue 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  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 #seller>
  12. <div style="width: 100%">
  13. <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
  14. <el-select v-model="formData.data.sellCorporationId" placeholder="请选择卖方公司" style="width: 100%" filterable>
  15. <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="地址" class="wid100">
  19. <el-row style="width:100%">
  20. <el-col :span="8">
  21. <el-form-item label="" prop="sellCountryName" label-width="0px" class="margin-b-0 wid100">
  22. <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="8">
  26. <el-form-item label="" prop="sellProvinceName" label-width="0px" class="margin-b-0 wid100">
  27. <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="8">
  31. <el-form-item label="" prop="sellCityName" label-width="0px" class="margin-b-0 wid100">
  32. <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
  33. </el-form-item>
  34. </el-col>
  35. </el-row>
  36. </el-form-item>
  37. <el-form-item label="详细地址" prop="sellAddress" class="wid100">
  38. <el-input v-model="formData.data.sellAddress" type="textarea">
  39. </el-input>
  40. </el-form-item>
  41. <el-form-item label="联系人" class="wid100" required>
  42. <el-row style="width:100%">
  43. <el-col :span="8">
  44. <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
  45. <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="16">
  49. <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
  50. <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
  51. </el-form-item>
  52. </el-col>
  53. </el-row>
  54. </el-form-item>
  55. </div>
  56. </template>
  57. <template #buyer>
  58. <div style="width: 100%">
  59. <el-form-item label="买方信息" prop="buyCorporationId" class="wid100">
  60. <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
  61. :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer" v-if="
  62. [30].includes(route.query.processType) ||
  63. !route.query.processType
  64. ">
  65. <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
  66. </el-select>
  67. <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="地址" class="wid100" required>
  71. <el-row style="width: 100%">
  72. <el-col :span="6">
  73. <el-form-item label="" prop="countryId" class="margin-b-0">
  74. <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
  75. <el-option v-for="item in countryData" :label="item.name" :value="item.id">
  76. </el-option>
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6">
  81. <el-form-item label="" prop="provinceName" class="margin-b-0">
  82. <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
  83. v-model="formData.data" :data="provinceData">
  84. </selectCity>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="6">
  88. <el-form-item label="" prop="cityName" class="margin-b-0">
  89. <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
  90. </selectCity>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="6">
  94. <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
  95. <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
  96. </el-form-item>
  97. </el-col>
  98. </el-row>
  99. </el-form-item>
  100. <el-form-item label="详细地址" prop="buyAddress" class="wid100">
  101. <el-input v-model="formData.data.buyAddress" type="textarea">
  102. </el-input>
  103. </el-form-item>
  104. <el-form-item label="联系人" class="wid100" required>
  105. <el-row style="width: 100%">
  106. <el-col :span="8">
  107. <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
  108. <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" style="width:100%" clearable
  109. class="inline-input w-50" placeholder="请输入联系人" @select="handlePerson">
  110. </el-autocomplete>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="16">
  114. <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
  115. <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. </el-form-item>
  120. </div>
  121. </template>
  122. <template #commodity>
  123. <div style="width: 100%">
  124. <el-button type="primary" @click="openProductCompany = true" plain>标准产品库</el-button>
  125. <el-table :data="formData.data.contractProductList" style="width: 100%; margin-top: 16px">
  126. <el-table-column label="商品图片" width="80">
  127. <template #default="{ row }">
  128. <div v-if="row.fileUrl">
  129. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  130. </div>
  131. <div v-else></div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="productName" label="商品名称" min-width="130" />
  135. <el-table-column prop="productCode" label="商品编码" width="130" />
  136. <el-table-column label="尺寸 cm*cm*cm" width="140">
  137. <template #default="{ row, $index }">
  138. <div style="width: 100%">
  139. {{row['length']}}*{{row.width}}*{{row.height}}
  140. </div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="设计图稿" width="80">
  144. <template #default="{ row, $index }">
  145. <div style="width: 100%">
  146. <el-upload :action="uploadUrl" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false" :data="uploadData"
  147. :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
  148. <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
  149. <el-icon v-else class="avatar-uploader-icon">
  150. <Plus />
  151. </el-icon>
  152. </el-upload>
  153. </div>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="生产源文件" width="100">
  157. <template #default="{ row, $index }">
  158. <span class="el-click">点击上传</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="数量" width="150">
  162. <template #default="{ row, $index }">
  163. <div style="width: 100%">
  164. <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
  165. class="margin-b-0 wid100">
  166. <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
  167. :controls="false" :min="0" @change="calculationAmount('quantity')" />
  168. </el-form-item>
  169. </div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="单价" width="150">
  173. <template #default="{ row, $index }">
  174. <div style="width: 100%">
  175. <el-form-item :prop="'contractProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
  176. class="margin-b-0 wid100">
  177. <div style="display:flex;">
  178. <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
  179. :controls="false" :min="0" @change="calculationAmount()" />
  180. <!-- <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
  181. <template #default>
  182. <div>
  183. <div>
  184. <img src="@/assets/images/money1.png" alt="" class="img" /> <span
  185. style="font-size:14px;font-weight:700;color:#000">销售指导价:</span>
  186. <div style="padding:5px 0px 0px 20px">
  187. {{row.currency}} {{moneyFormat(row.salePrice,2)}}
  188. </div>
  189. </div>
  190. <div style="margin-top:15px">
  191. <img src="@/assets/images/money2.png" alt="" class="img" /> <span
  192. style="font-size:14px;font-weight:700;color:#000">客户近期购买价格:</span>
  193. <div style="padding:5px 0px 0px 20px">
  194. <div v-for="item in row.customerContractProductList">
  195. <span>{{item.createTime.slice(0,10)}} </span>
  196. <span style="margin-left:40px">{{item.code}} </span>
  197. <span style="margin-left:40px"> {{item.currency}} {{moneyFormat(item.price,2)}} </span>
  198. </div>
  199. </div>
  200. </div>
  201. <div style="margin-top:15px">
  202. <img src="@/assets/images/money3.png" alt="" class="img" /> <span
  203. style="font-size:14px;font-weight:700;color:#000">产品近期销售价格:</span>
  204. <div style="padding:5px 0px 0px 20px">
  205. <div v-for="item in row.contractProductList">
  206. <span>{{item.createTime.slice(0,10)}} </span>
  207. <span style="margin-left:40px">{{item.code}} </span>
  208. <span style="margin-left:40px">{{item.currency}} {{moneyFormat(item.price,2)}} </span>
  209. </div>
  210. </div>
  211. </div>
  212. <div :ref="row.productId+$index" style="height:180px">
  213. </div>
  214. </div>
  215. </template>
  216. <template #reference>
  217. <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
  218. <el-icon :size="20" color="#85c1a6">
  219. <WarningFilled />
  220. </el-icon>
  221. </div>
  222. </template>
  223. </el-popover> -->
  224. </div>
  225. </el-form-item>
  226. </div>
  227. </template>
  228. </el-table-column>
  229. <el-table-column prop="amount" label="小计" width="100" />
  230. <el-table-column label="操作" width="60" align="center" fixed="right">
  231. <template #default="{ $index }">
  232. <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
  233. </template>
  234. </el-table-column>
  235. </el-table>
  236. </div>
  237. </template>
  238. <template #otherCharge>
  239. <div style="width: 100%">
  240. <el-button type="primary" @click="clickAdd()" plain>添加行</el-button>
  241. <el-table :data="formData.data.contractProjectList" style="width: 100%; margin-top: 16px">
  242. <el-table-column label="收费项目" width="220">
  243. <template #default="{ row, $index }">
  244. <div style="width: 100%">
  245. <el-form-item :prop="'contractProjectList.' + $index + '.payName'" :rules="rules.payName" :inline-message="true"
  246. class="margin-b-0 wid100">
  247. <el-autocomplete v-model="row.payName" :fetch-suggestions="querySearch" clearable class="inline-input w-50"
  248. placeholder="请输入收费项目" />
  249. </el-form-item>
  250. </div>
  251. </template>
  252. </el-table-column>
  253. <el-table-column label="备注">
  254. <template #default="{ row, $index }">
  255. <div style="width: 100%">
  256. <el-form-item :prop="'contractProjectList.' + $index + '.remark'" class="margin-b-0 wid100">
  257. <el-input v-model="row.remark" placeholder="请输入备注" />
  258. </el-form-item>
  259. </div>
  260. </template>
  261. </el-table-column>
  262. <el-table-column :label="'金额'" width="130">
  263. <template #default="{ row, $index }">
  264. <div style="width: 100%">
  265. <el-form-item :prop="'contractProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
  266. class="margin-b-0 wid100">
  267. <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
  268. :controls="false" :min="0" @change="totalAmount()" />
  269. </el-form-item>
  270. </div>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="操作" width="60" align="center" fixed="right">
  274. <template #default="{ $index }">
  275. <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
  276. </template>
  277. </el-table-column>
  278. </el-table>
  279. </div>
  280. </template>
  281. </byForm>
  282. <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="公司产品库" width="90%" append-to-body>
  283. <SelectCompanyProduct @selectProduct="selectProduct" :alreadySelectData="formData.data.contractProductList"></SelectCompanyProduct>
  284. </el-dialog>
  285. <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
  286. <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
  287. <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
  288. </el-dialog> -->
  289. </div>
  290. </template>
  291. <script setup>
  292. import byForm from "@/components/byForm/index";
  293. import SelectCompanyProduct from "@/components/product/SelectCompanyProduct.vue";
  294. // import SelectCustomerProduct from "@/components/product/SelectCustomerProduct.vue";
  295. import selectCity from "@/components/selectCity/index.vue";
  296. import { useRoute } from "vue-router";
  297. import SelectContract from "@/components/contractCom/selectContract.vue";
  298. import SelectSample from "@/components/contractCom/selectSample.vue";
  299. // import * as echarts from "echarts";
  300. // import $bus from "@/bus/index.js";
  301. const route = useRoute();
  302. const { proxy } = getCurrentInstance();
  303. // 接收父组件的传值
  304. const props = defineProps({
  305. queryData: Object,
  306. });
  307. const currencyData = computed(
  308. () => proxy.useUserStore().allDict["account_currency"]
  309. );
  310. const fundsPaymentMethod = computed(
  311. () => proxy.useUserStore().allDict["funds_payment_method"]
  312. );
  313. const shippingMethod = computed(
  314. () => proxy.useUserStore().allDict["shipping_method"]
  315. );
  316. const accountList = ref([]);
  317. const customerList = ref([]);
  318. const corporationList = ref([]);
  319. const countryData = ref([]);
  320. const provinceData = ref([]);
  321. const cityData = ref([]);
  322. const openProductCompany = ref(false);
  323. const copyType = ref(1);
  324. const copyContract = ref(false);
  325. const formData = reactive({
  326. data: {
  327. contractType: "0",
  328. contractProductList: [],
  329. },
  330. });
  331. const uploadData = ref({});
  332. const formDom = ref(null);
  333. const judgeStatus = () => {
  334. if (route.query.processType == 20 || route.query.processType == 10) {
  335. return true;
  336. }
  337. if (props.queryData.recordList && props.queryData.recordList.length > 0) {
  338. let data = props.queryData.recordList.filter(
  339. (item) => item.status === 2 && item.nodeType !== 1
  340. );
  341. if (data && data.length > 0) {
  342. return true;
  343. }
  344. }
  345. return false;
  346. };
  347. const formOption = reactive({
  348. inline: true,
  349. labelWidth: 100,
  350. itemWidth: 100,
  351. disabled: false,
  352. });
  353. const formConfig = computed(() => {
  354. return [
  355. // {
  356. // type: "slot",
  357. // slotName: "btn",
  358. // label: "",
  359. // itemWidth: 50,
  360. // },
  361. {
  362. type: "title",
  363. title: "合同类型",
  364. },
  365. {
  366. type: "select",
  367. prop: "contractType",
  368. label: "合同类型",
  369. data: [
  370. {
  371. dictKey: "0",
  372. dictValue: "内销",
  373. },
  374. {
  375. dictKey: "1",
  376. dictValue: "外销",
  377. },
  378. ],
  379. fn: (val) => {
  380. if (val == "0") {
  381. formData.data.aa = currencyData.value[0].dictKey;
  382. formData.data.netWeight = 1;
  383. }
  384. },
  385. },
  386. {
  387. type: "title",
  388. title: "贸易信息",
  389. haveLine: true,
  390. },
  391. {
  392. type: "slot",
  393. slotName: "seller",
  394. label: "",
  395. itemWidth: 50,
  396. },
  397. {
  398. type: "slot",
  399. slotName: "buyer",
  400. label: "",
  401. itemWidth: 50,
  402. },
  403. {
  404. type: "title",
  405. title: "付款信息",
  406. haveLine: true,
  407. },
  408. {
  409. type: "select",
  410. prop: "currency",
  411. label: "币种",
  412. data: currencyData.value,
  413. itemWidth: 25,
  414. disabled: formData.data.contractType == "0",
  415. },
  416. {
  417. type: "number",
  418. prop: "rate",
  419. label: "汇率",
  420. precision: 2,
  421. min: 0,
  422. controls: false,
  423. itemWidth: 25,
  424. disabled: formData.data.contractType == "0",
  425. },
  426. {
  427. type: "select",
  428. prop: "paymentMethod",
  429. label: "付款方式",
  430. data: fundsPaymentMethod.value,
  431. itemWidth: 25,
  432. },
  433. {
  434. type: "number",
  435. prop: "advanceRatio",
  436. label: "预付款比列(%)",
  437. precision: 2,
  438. min: 0,
  439. controls: false,
  440. itemWidth: 25,
  441. },
  442. {
  443. type: "input",
  444. prop: "remark",
  445. label: "付款条件",
  446. itemType: "textarea",
  447. itemWidth: 50,
  448. },
  449. {
  450. type: "select",
  451. prop: "shroffAccountId",
  452. label: "收款账号",
  453. data: accountList.value,
  454. itemWidth: 100,
  455. fn: (val) => {
  456. changeShroffAccount(val);
  457. },
  458. },
  459. {
  460. type: "input",
  461. prop: "beneficiaryName",
  462. label: " ",
  463. placeholder: "请输入Beneficiary Name",
  464. itemWidth: 50,
  465. isShow: formData.data.contractType == "1",
  466. },
  467. {
  468. type: "input",
  469. prop: "beneficiaryAccountNumber",
  470. label: " ",
  471. placeholder: "请输入Beneficiary Account Number",
  472. itemWidth: 50,
  473. isShow: formData.data.contractType == "1",
  474. },
  475. {
  476. type: "input",
  477. prop: "beneficiaryBank",
  478. label: " ",
  479. placeholder: "请输入Beneficiary Bank",
  480. itemWidth: 50,
  481. isShow: formData.data.contractType == "1",
  482. },
  483. {
  484. type: "input",
  485. prop: "swiftCode",
  486. label: " ",
  487. placeholder: "请输入Swift Code",
  488. itemWidth: 50,
  489. isShow: formData.data.contractType == "1",
  490. },
  491. {
  492. type: "input",
  493. prop: "beneficiaryBankAddress",
  494. label: " ",
  495. placeholder: "请输入Beneficiary Bank Address",
  496. itemWidth: 50,
  497. isShow: formData.data.contractType == "1",
  498. },
  499. {
  500. type: "input",
  501. prop: "beneficiaryAddress",
  502. label: " ",
  503. placeholder: "请输入Beneficiary Address",
  504. itemWidth: 50,
  505. isShow: formData.data.contractType == "1",
  506. },
  507. {
  508. type: "input",
  509. prop: "accountName",
  510. label: "户名",
  511. placeholder: "请输入户名",
  512. itemWidth: 50,
  513. isShow: formData.data.contractType == "0",
  514. },
  515. {
  516. type: "input",
  517. prop: "openingBank",
  518. label: "开户行",
  519. placeholder: "请输入开户行",
  520. itemWidth: 50,
  521. isShow: formData.data.contractType == "0",
  522. },
  523. {
  524. type: "input",
  525. prop: "accountOpening",
  526. label: "账号",
  527. placeholder: "请输入账号",
  528. itemWidth: 50,
  529. isShow: formData.data.contractType == "0",
  530. },
  531. // {
  532. // type: "slot",
  533. // slotName: "payment",
  534. // label: "",
  535. // },
  536. {
  537. type: "title",
  538. title: "交付信息",
  539. haveLine: true,
  540. },
  541. {
  542. type: "date",
  543. prop: "deliveryTime",
  544. label: "交货期限",
  545. itemWidth: 50,
  546. },
  547. {
  548. type: "select",
  549. prop: "transportMethod",
  550. label: "运输方式",
  551. data: shippingMethod.value,
  552. itemWidth: 50,
  553. },
  554. {
  555. type: "input",
  556. prop: "transportRemark",
  557. label: "运输说明",
  558. itemWidth: 50,
  559. },
  560. // {
  561. // type: "slot",
  562. // slotName: "delivery",
  563. // label: "",
  564. // },
  565. {
  566. type: "title",
  567. title: "商品信息",
  568. haveLine: true,
  569. },
  570. {
  571. type: "slot",
  572. slotName: "commodity",
  573. label: "",
  574. },
  575. {
  576. type: "title",
  577. title: "其他收费项目",
  578. haveLine: true,
  579. },
  580. {
  581. type: "slot",
  582. slotName: "otherCharge",
  583. label: "",
  584. },
  585. {
  586. type: "title",
  587. title: "合同总金额",
  588. haveLine: true,
  589. },
  590. {
  591. type: "input",
  592. prop: "amount",
  593. label: "合同总金额",
  594. itemWidth: 25,
  595. disabled: true,
  596. },
  597. ];
  598. });
  599. const rules = ref({
  600. contractType: [
  601. { required: true, message: "请选择合同类型", trigger: "change" },
  602. ],
  603. sellCorporationId: [
  604. { required: true, message: "请选择卖方公司", trigger: "change" },
  605. ],
  606. buyCorporationId: [
  607. { required: true, message: "请选择买方公司", trigger: "change" },
  608. ],
  609. countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
  610. sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
  611. buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
  612. buyContactName: [
  613. { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
  614. ],
  615. buyContactNumber: [
  616. { required: true, message: "请输入联系电话", trigger: "blur" },
  617. ],
  618. quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
  619. price: [{ required: true, message: "请输入单价", trigger: "blur" }],
  620. payName: [
  621. { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
  622. ],
  623. currency: [{ required: true, message: "请选择币种", trigger: "change" }],
  624. paymentMethod: [
  625. { required: true, message: "请选择付款方式", trigger: "change" },
  626. ],
  627. advanceRatio: [
  628. { required: true, message: "请输入预付比例", trigger: "blur" },
  629. ],
  630. transportMethod: [
  631. { required: true, message: "请选择运输方式", trigger: "change" },
  632. ],
  633. remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
  634. rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
  635. shroffAccountId: [
  636. { required: true, message: "请选择收款账号", trigger: "change" },
  637. ],
  638. });
  639. const getDict = () => {
  640. proxy
  641. .post("/customer/selPage", {
  642. pageNum: 1,
  643. pageSize: 50,
  644. })
  645. .then((res) => {
  646. console.log(res, "sad");
  647. customerList.value = res.rows.map((x) => ({
  648. ...x,
  649. label: x.name,
  650. value: x.id,
  651. }));
  652. });
  653. proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  654. corporationList.value = res.rows.map((item) => {
  655. return {
  656. ...item,
  657. label: item.name,
  658. value: item.id,
  659. };
  660. });
  661. });
  662. proxy
  663. .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
  664. .then((res) => {
  665. accountList.value = res.rows.map((item) => {
  666. return {
  667. ...item,
  668. label: item.alias,
  669. value: item.id,
  670. };
  671. });
  672. });
  673. };
  674. const getCityData = (id, type, isChange) => {
  675. proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
  676. if (type === "20") {
  677. provinceData.value = res;
  678. if (isChange) {
  679. formData.data.provinceId = "";
  680. formData.data.provinceName = "";
  681. formData.data.cityId = "";
  682. formData.data.cityName = "";
  683. }
  684. } else if (type === "30") {
  685. cityData.value = res;
  686. if (isChange) {
  687. formData.data.cityId = "";
  688. formData.data.cityName = "";
  689. }
  690. } else {
  691. countryData.value = res;
  692. }
  693. });
  694. };
  695. getDict();
  696. getCityData("0");
  697. const changeCustomer = (val) => {
  698. formData.data.contractProductList = [];
  699. formData.data.customerName = "";
  700. formData.data.customerTel = "";
  701. if (val) {
  702. proxy.post("/customer/detail", { id: val }).then(
  703. (res) => {
  704. formData.data.buyCorporationName = res.name;
  705. if (res.customerUserList && res.customerUserList.length > 0) {
  706. formData.data.buyContactName = res.customerUserList[0].name;
  707. if (res.customerUserList[0].contactJson) {
  708. let contactJson = JSON.parse(res.customerUserList[0].contactJson);
  709. if (contactJson && contactJson.length > 0) {
  710. formData.data.buyContactNumber = contactJson[0].contactNo;
  711. }
  712. }
  713. customerUserList.value = res.customerUserList.map((item) => {
  714. return {
  715. ...item,
  716. value: item.name,
  717. };
  718. });
  719. }
  720. // 回填客户的账户信息
  721. formData.data.beneficiaryName = res.beneficiaryName;
  722. formData.data.beneficiaryBank = res.beneficiaryBank;
  723. formData.data.beneficiaryBankAddress = res.beneficiaryBankAddress;
  724. formData.data.beneficiaryAccountNumber = res.beneficiaryAccountNumber;
  725. formData.data.swiftCode = res.swiftCode;
  726. formData.data.beneficiaryAddress = res.beneficiaryAddress;
  727. formData.data.countryId = res.countryId;
  728. formData.data.provinceId = res.provinceId;
  729. formData.data.cityId = res.cityId;
  730. formData.data.buyPostalCode = res.zipCode;
  731. formData.data.buyAddress = res.address;
  732. getCityData(formData.data.countryId, "20");
  733. if (formData.data.provinceId) {
  734. getCityData(formData.data.provinceId, "30");
  735. }
  736. },
  737. (err) => {
  738. console.log(err);
  739. formData.data.countryId = "";
  740. formData.data.provinceId = "";
  741. formData.data.cityId = "";
  742. formData.data.buyPostalCode = "";
  743. formData.data.buyAddress = "";
  744. }
  745. );
  746. } else {
  747. formData.data.countryId = "";
  748. formData.data.provinceId = "";
  749. formData.data.cityId = "";
  750. formData.data.buyPostalCode = "";
  751. formData.data.buyAddress = "";
  752. }
  753. };
  754. const createFilter = (queryString) => {
  755. return (restaurant) => {
  756. return (
  757. restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
  758. );
  759. };
  760. };
  761. const querySearchPerson = (queryString, callback) => {
  762. const results = queryString
  763. ? customerUserList.value.filter(createFilter(queryString))
  764. : customerUserList.value;
  765. callback(results);
  766. };
  767. const handlePerson = (item) => {
  768. formData.data.customerTel = item.phone;
  769. };
  770. const selectProduct = (goods) => {
  771. if (goods && goods.id) {
  772. let rowId = uuidv4();
  773. let fileUrl = "";
  774. if (goods.fileList && goods.fileList.length > 0) {
  775. fileUrl = goods.fileList[0].fileUrl;
  776. }
  777. if (
  778. formData.data.contractProductList &&
  779. formData.data.contractProductList.length > 0
  780. ) {
  781. formData.data.contractProductList.push({
  782. fileUrl: fileUrl,
  783. rowId,
  784. productId: goods.id,
  785. productCnName: goods.name,
  786. productName: goods.nameEnglish,
  787. productModel:
  788. goods.productLong + "*" + goods.productWide + "*" + goods.productHigh,
  789. quantity: null,
  790. price: null,
  791. amount: "",
  792. tradeMethods: "",
  793. selectType: goods.selectType,
  794. fileList: [],
  795. });
  796. } else {
  797. formData.data.contractProductList = [
  798. {
  799. fileUrl: fileUrl,
  800. rowId,
  801. productId: goods.id,
  802. productCnName: goods.name,
  803. productName: goods.nameEnglish,
  804. productModel:
  805. goods.productLong +
  806. "*" +
  807. goods.productWide +
  808. "*" +
  809. goods.productHigh,
  810. quantity: null,
  811. price: null,
  812. amount: "",
  813. tradeMethods: "",
  814. selectType: goods.selectType,
  815. fileList: [],
  816. },
  817. ];
  818. }
  819. // changeProductPrice();
  820. proxy.msgTip("添加成功", 1);
  821. } else {
  822. return proxy.msgTip("选择错误", 2);
  823. }
  824. };
  825. const changeProductPrice = () => {
  826. let productIds = formData.data.contractProductList.map((x) => x.productId);
  827. if (productIds && productIds.length > 0) {
  828. proxy
  829. .post("/contract/getProductPriceInfo", {
  830. productIds: productIds,
  831. customerId: formData.data.buyCorporationId
  832. ? formData.data.buyCorporationId
  833. : "",
  834. })
  835. .then((res) => {
  836. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  837. const iele = formData.data.contractProductList[i];
  838. for (const key in res) {
  839. if (key == iele.productId) {
  840. iele.salePrice = res[key].price;
  841. iele.currency = res[key].currency;
  842. iele.saleCostPrice = res[key].costPrice;
  843. iele.contractProductList = res[key].contractProductList
  844. .map((x) => ({
  845. createTime: x.createTime,
  846. price: x.price,
  847. currency: x.currency,
  848. }))
  849. .filter((y, index) => index < 3);
  850. iele.contractProductListOne = res[key].contractProductList.map(
  851. (x) => ({
  852. createTime: x.createTime,
  853. price: x.price,
  854. currency: x.currency,
  855. })
  856. );
  857. iele.customerContractProductList = res[
  858. key
  859. ].customerContractProductList.map((x) => ({
  860. createTime: x.createTime,
  861. price: x.price,
  862. currency: x.currency,
  863. }));
  864. }
  865. }
  866. }
  867. });
  868. }
  869. };
  870. const onPicture = (path) => {
  871. window.open(path, "_blank");
  872. };
  873. const handleRemove = (index) => {
  874. formData.data.contractProductList.splice(index, 1);
  875. totalAmount();
  876. };
  877. const calculationAmount = (att = "") => {
  878. nextTick(() => {
  879. if (
  880. formData.data.contractProductList &&
  881. formData.data.contractProductList.length > 0
  882. ) {
  883. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  884. let money = 0;
  885. money = parseFloat(
  886. Number(formData.data.contractProductList[i].quantity) *
  887. Number(formData.data.contractProductList[i].price)
  888. ).toFixed(2);
  889. formData.data.contractProductList[i].amount = money;
  890. }
  891. }
  892. nextTick(() => {
  893. totalAmount();
  894. });
  895. });
  896. };
  897. const totalAmount = () => {
  898. let money = 0;
  899. if (
  900. formData.data.contractProductList &&
  901. formData.data.contractProductList.length > 0
  902. ) {
  903. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  904. if (formData.data.contractProductList[i].amount) {
  905. money = parseFloat(
  906. Number(money) + Number(formData.data.contractProductList[i].amount)
  907. ).toFixed(2);
  908. }
  909. }
  910. }
  911. if (
  912. formData.data.contractProjectList &&
  913. formData.data.contractProjectList.length > 0
  914. ) {
  915. for (let i = 0; i < formData.data.contractProjectList.length; i++) {
  916. if (formData.data.contractProjectList[i].amount) {
  917. money = parseFloat(
  918. Number(money) + Number(formData.data.contractProjectList[i].amount)
  919. ).toFixed(2);
  920. }
  921. }
  922. }
  923. formData.data.amount = money;
  924. };
  925. const clickAdd = () => {
  926. if (
  927. formData.data.contractProjectList &&
  928. formData.data.contractProjectList.length > 0
  929. ) {
  930. formData.data.contractProjectList.push({
  931. payName: "",
  932. amount: null,
  933. remark: "",
  934. });
  935. } else {
  936. formData.data.contractProjectList = [
  937. { payName: "", amount: null, remark: "" },
  938. ];
  939. }
  940. };
  941. const handleDelete = (index) => {
  942. formData.data.contractProjectList.splice(index, 1);
  943. totalAmount();
  944. };
  945. const querySearch = (queryString, callback) => {
  946. proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
  947. if (res.rows && res.rows.length > 0) {
  948. res.rows = res.rows.map((item) => {
  949. return {
  950. ...item,
  951. value: item.payName,
  952. };
  953. });
  954. callback(res.rows);
  955. } else {
  956. callback([]);
  957. }
  958. });
  959. };
  960. const handleBeforeUpload = async (file, index) => {
  961. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  962. uploadData.value = res.uploadBody;
  963. formData.data.contractProductList[index].fileList = [
  964. {
  965. id: res.id,
  966. fileName: res.fileName,
  967. fileUrl: res.fileUrl,
  968. uploadState: false,
  969. },
  970. ];
  971. formData.data.contractProductList[index].imageUrl = res.fileUrl;
  972. return true;
  973. };
  974. const handleSuccess = (index) => {
  975. formData.data.contractProductList[index].uploadState = true;
  976. };
  977. const loadingSearch = ref(false);
  978. const remoteMethod = (keyword) => {
  979. if (keyword && typeof keyword === "string") {
  980. loadingSearch.value = true;
  981. proxy.post("/customer/selPage", { keyword }).then((res) => {
  982. customerList.value = res.rows.map((x) => ({
  983. ...x,
  984. label: x.name,
  985. value: x.id,
  986. }));
  987. loadingSearch.value = false;
  988. });
  989. }
  990. return;
  991. };
  992. const handleSubmit = async () => {
  993. let flag = await formDom.value.handleSubmit(() => {});
  994. if (flag) {
  995. if (
  996. formData.data.contractProductList &&
  997. formData.data.contractProductList.length > 0
  998. ) {
  999. return true;
  1000. } else {
  1001. proxy.msgTip("请添加至少一件商品", 2);
  1002. return false;
  1003. }
  1004. } else {
  1005. setTimeout(() => {
  1006. const errorDiv = document.getElementsByClassName("is-error");
  1007. errorDiv[0].scrollIntoView();
  1008. }, 0);
  1009. }
  1010. return flag;
  1011. };
  1012. const getFormData = () => {
  1013. return proxy.deepClone(formData.data);
  1014. };
  1015. // 向父组件暴露
  1016. defineExpose({
  1017. getFormData,
  1018. handleSubmit,
  1019. });
  1020. const changeShroffAccount = (val) => {
  1021. if (val) {
  1022. let data = accountList.value.find((item) => item.value == val);
  1023. if (formData.data.contractType == "0") {
  1024. } else {
  1025. if (data) {
  1026. formData.data.beneficiaryName = data.beneficiaryName;
  1027. formData.data.beneficiaryBank = data.beneficiaryBank;
  1028. formData.data.beneficiaryBankAddress = data.beneficiaryBankAddress;
  1029. formData.data.beneficiaryAccountNumber = data.beneficiaryAccountNumber;
  1030. formData.data.swiftCode = data.swiftCode;
  1031. formData.data.beneficiaryAddress = data.beneficiaryAddress;
  1032. }
  1033. }
  1034. }
  1035. };
  1036. onMounted(() => {
  1037. formOption.disabled = judgeStatus();
  1038. if (route.query && route.query.businessId && route.query.processType) {
  1039. let businessId = route.query.businessId;
  1040. proxy.post("/contract/detail", { id: businessId }).then((res) => {
  1041. if (res && res.dataJson) {
  1042. // res = { ...res, ...JSON.parse(res.dataJson) };
  1043. // res=proxy.deepClone()
  1044. // res.contractProductList = JSON.parse(res.dataJson).contractProductList;
  1045. }
  1046. if (res.grossProfitInfoList && res.grossProfitInfoList.length > 0) {
  1047. $bus.emit("getGrossData", res.grossProfitInfoList);
  1048. }
  1049. if (!res.fileList) {
  1050. res.fileList = [];
  1051. }
  1052. if (!res.packageFileList) {
  1053. res.packageFileList = [];
  1054. }
  1055. res.countryId = res.buyCountryId;
  1056. res.provinceId = res.buyProvinceId;
  1057. res.cityId = res.buyCityId;
  1058. for (const key in res) {
  1059. formData.data[key] = res[key];
  1060. }
  1061. proxy
  1062. .post("/fileInfo/getList", {
  1063. businessIdList: [businessId],
  1064. })
  1065. .then((fileObj) => {
  1066. if (fileObj[businessId] && fileObj[businessId].length > 0) {
  1067. formData.data.fileList = fileObj[businessId]
  1068. .filter((x) => x.businessType === "1")
  1069. .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
  1070. formData.data.packageFileList = fileObj[businessId]
  1071. .filter((x) => x.businessType === "2")
  1072. .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
  1073. }
  1074. });
  1075. if (
  1076. formData.data.contractProductList &&
  1077. formData.data.contractProductList.length > 0
  1078. ) {
  1079. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1080. const e = formData.data.contractProductList[i];
  1081. e.rowId = uuidv4();
  1082. if (e.ehsdJson) {
  1083. let obj = JSON.parse(e.ehsdJson);
  1084. e.packMethod = obj.packMethod;
  1085. e.tradeMethods = obj.tradeMethods;
  1086. }
  1087. }
  1088. let ids = formData.data.contractProductList.map((x) => x.productId);
  1089. proxy
  1090. .post("/fileInfo/getList", {
  1091. businessIdList: ids,
  1092. })
  1093. .then((fileObj) => {
  1094. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1095. const e = formData.data.contractProductList[i];
  1096. for (const key in fileObj) {
  1097. if (e.productId === key) {
  1098. e.fileList = fileObj[key] || [];
  1099. if (e.fileList && e.fileList.length > 0) {
  1100. e.fileUrl = e.fileList[0].fileUrl;
  1101. }
  1102. }
  1103. }
  1104. }
  1105. });
  1106. changeProductPrice();
  1107. }
  1108. if (route.query.processType == 30) {
  1109. formData.data.contractWaitShipmentList =
  1110. formData.data.contractProductList.map((x) => ({
  1111. productCode: x.productCode,
  1112. rowId: x.rowId,
  1113. productId: x.productId,
  1114. productName: x.productName,
  1115. quantity: 0,
  1116. waitQuantity: "",
  1117. }));
  1118. changeWaitQuantity();
  1119. formData.data.contractShipmentList = [];
  1120. }
  1121. if (formData.data.countryId) {
  1122. getCityData(formData.data.countryId, "20");
  1123. }
  1124. if (formData.data.provinceId) {
  1125. getCityData(formData.data.provinceId, "30");
  1126. }
  1127. getDecisionAids();
  1128. });
  1129. }
  1130. });
  1131. const showPriceInfo = () => {
  1132. if (props.queryData.processType) {
  1133. return false;
  1134. }
  1135. if (route.query.processType) {
  1136. return false;
  1137. } else {
  1138. return true;
  1139. }
  1140. };
  1141. const optionTwo = reactive({
  1142. data: {
  1143. tooltip: {
  1144. trigger: "axis",
  1145. },
  1146. // legend: {
  1147. // data: ["价格"],
  1148. // },
  1149. grid: {
  1150. left: "3%",
  1151. right: "4%",
  1152. top: "10%",
  1153. bottom: "3%",
  1154. containLabel: true,
  1155. },
  1156. // toolbox: {
  1157. // feature: {
  1158. // saveAsImage: {},
  1159. // },
  1160. // },
  1161. xAxis: {
  1162. type: "category",
  1163. boundaryGap: false,
  1164. data: [],
  1165. },
  1166. yAxis: {
  1167. type: "value",
  1168. },
  1169. series: [
  1170. {
  1171. name: "价格",
  1172. type: "line",
  1173. data: [],
  1174. },
  1175. ],
  1176. },
  1177. });
  1178. const showEcharts = (row, index) => {
  1179. let myChart = null;
  1180. myChart = echarts.init(proxy.$refs[row.productId + index]);
  1181. window.addEventListener("resize", () => {
  1182. myChart.resize();
  1183. });
  1184. if (row.contractProductListOne && row.contractProductListOne.length > 0) {
  1185. optionTwo.data.xAxis.data = row.contractProductListOne.map((item) => {
  1186. return item.createTime.slice(0, 10);
  1187. });
  1188. optionTwo.data.series[0].data = row.contractProductListOne.map((item) => {
  1189. return item.price;
  1190. });
  1191. } else {
  1192. optionTwo.data.xAxis.data = [];
  1193. optionTwo.data.series[0].data = [];
  1194. }
  1195. myChart.setOption(optionTwo.data);
  1196. myChart.resize();
  1197. };
  1198. const judgeStatusOne = () => {
  1199. if (props.queryData.processType == 20 || props.queryData.processType == 10) {
  1200. return true;
  1201. }
  1202. if (props.queryData.recordList && props.queryData.recordList.length > 0) {
  1203. let data = props.queryData.recordList.filter(
  1204. (item) => item.status === 2 && item.nodeType !== 1
  1205. );
  1206. if (data && data.length > 0) {
  1207. return true;
  1208. }
  1209. }
  1210. return false;
  1211. };
  1212. watch(
  1213. () => props.queryData,
  1214. (val) => {
  1215. nextTick(() => {
  1216. formOption.disabled = judgeStatusOne();
  1217. });
  1218. if (val.businessId && val.processType) {
  1219. let businessId = val.businessId;
  1220. proxy.post("/contract/detail", { id: businessId }).then((res) => {
  1221. if (res && res.dataJson) {
  1222. // res = { ...res, ...JSON.parse(res.dataJson) };
  1223. // res=proxy.deepClone()
  1224. // res.contractProductList = JSON.parse(res.dataJson).contractProductList;
  1225. }
  1226. if (res.grossProfitInfoList && res.grossProfitInfoList.length > 0) {
  1227. $bus.emit("getGrossData", res.grossProfitInfoList);
  1228. }
  1229. if (!res.fileList) {
  1230. res.fileList = [];
  1231. }
  1232. if (!res.packageFileList) {
  1233. res.packageFileList = [];
  1234. }
  1235. res.countryId = res.buyCountryId;
  1236. res.provinceId = res.buyProvinceId;
  1237. res.cityId = res.buyCityId;
  1238. if (res && res.buyCorporationName) {
  1239. proxy
  1240. .post("/customer/selPage", {
  1241. keyword: res.buyCorporationName,
  1242. })
  1243. .then((res) => {
  1244. customerList.value = res.rows.map((x) => ({
  1245. ...x,
  1246. label: x.name,
  1247. value: x.id,
  1248. }));
  1249. });
  1250. }
  1251. for (const key in res) {
  1252. formData.data[key] = res[key];
  1253. }
  1254. proxy
  1255. .post("/fileInfo/getList", {
  1256. businessIdList: [businessId],
  1257. })
  1258. .then((fileObj) => {
  1259. if (fileObj[businessId] && fileObj[businessId].length > 0) {
  1260. formData.data.fileList = fileObj[businessId]
  1261. .filter((x) => x.businessType === "1")
  1262. .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
  1263. formData.data.packageFileList = fileObj[businessId]
  1264. .filter((x) => x.businessType === "2")
  1265. .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
  1266. }
  1267. });
  1268. if (
  1269. formData.data.contractProductList &&
  1270. formData.data.contractProductList.length > 0
  1271. ) {
  1272. for (let i = 0; i < formData.data.contractProductList.length; i++) {
  1273. const e = formData.data.contractProductList[i];
  1274. if (e.ehsdJson) {
  1275. let obj = JSON.parse(e.ehsdJson);
  1276. e.packMethod = obj.packMethod;
  1277. e.tradeMethods = obj.tradeMethods;
  1278. }
  1279. }
  1280. let ids = formData.data.contractProductList.map((x) => x.productId);
  1281. proxy
  1282. .post("/fileInfo/getList", {
  1283. businessIdList: ids,
  1284. })
  1285. .then((fileObj) => {
  1286. for (
  1287. let i = 0;
  1288. i < formData.data.contractProductList.length;
  1289. i++
  1290. ) {
  1291. const e = formData.data.contractProductList[i];
  1292. for (const key in fileObj) {
  1293. if (e.productId === key) {
  1294. e.fileList = fileObj[key] || [];
  1295. if (e.fileList && e.fileList.length > 0) {
  1296. e.fileUrl = e.fileList[0].fileUrl;
  1297. }
  1298. }
  1299. }
  1300. }
  1301. });
  1302. changeProductPrice();
  1303. }
  1304. if (formData.data.countryId) {
  1305. getCityData(formData.data.countryId, "20");
  1306. }
  1307. if (formData.data.provinceId) {
  1308. getCityData(formData.data.provinceId, "30");
  1309. }
  1310. getDecisionAids();
  1311. });
  1312. }
  1313. },
  1314. {
  1315. deep: true,
  1316. immediate: true,
  1317. }
  1318. );
  1319. const clickCopy = (type) => {
  1320. copyType.value = type;
  1321. copyContract.value = true;
  1322. };
  1323. </script>
  1324. <style lang="scss" scoped>
  1325. .img {
  1326. object-fit: contain;
  1327. width: 16px;
  1328. height: 16px;
  1329. vertical-align: middle;
  1330. }
  1331. .pic {
  1332. object-fit: contain;
  1333. width: 50px;
  1334. height: 50px;
  1335. cursor: pointer;
  1336. vertical-align: middle;
  1337. }
  1338. .el-icon.avatar-uploader-icon {
  1339. font-size: 20px;
  1340. color: #8c939d;
  1341. width: 50px;
  1342. height: 50px;
  1343. text-align: center;
  1344. border: 1px dashed var(--el-border-color);
  1345. }
  1346. </style>