salesContractEdit.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661
  1. <template>
  2. <div class="container">
  3. <el-row>
  4. <el-col :span="12">
  5. <h2 class="bg-left title">修改合同信息</h2>
  6. </el-col>
  7. <el-col :span="12" class="bg-right">
  8. <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
  9. style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
  10. </el-button>
  11. </el-col>
  12. </el-row>
  13. <div class="center">
  14. <ws-form ref="deptBudgetList" :rules="ruleDeptBudget" :model="deptBudgetList">
  15. <div class="remark">
  16. <h3>基本信息</h3>
  17. <p style="color: #8890b1">
  18. &nbsp;&nbsp;注:“<span style="color:red">*</span>”
  19. 标记的条目提交后不可修改。
  20. </p>
  21. </div>
  22. <!--基本信息-->
  23. <ws-info-table>
  24. <!--合同类型-->
  25. <ws-form-item label="合同类型" span="1">
  26. <div class="unchanged">
  27. {{ deptBudgetList.agreementType}}
  28. </div>
  29. <span class="unchangeable">*</span>
  30. </ws-form-item>
  31. <!--合同编号-->
  32. <ws-form-item label="合同编号" span="1" prop="contractNo"
  33. v-if="deptBudgetList.agreementType == '销售合同'">
  34. <div class="unchanged">
  35. {{ deptBudgetList.contractNo }}
  36. </div>
  37. <span class="unchangeable">*</span>
  38. </ws-form-item>
  39. <ws-form-item label="交易主体" span="1" prop="transactionSubject" class="readonly">
  40. {{deptBudgetList.transactionSubject}}
  41. </ws-form-item>
  42. <ws-form-item v-if="deptBudgetList.transactionSubject == '合营'" class="readonly" label="合营方" span="1" prop="seller">{{ deptBudgetList.jointVentureParties }}
  43. </ws-form-item>
  44. <ws-form-item v-if="deptBudgetList.transactionSubject == '合营'" label="合营方电话" span="1" prop="sellerPhone">
  45. <ws-input v-model="deptBudgetList.jointPhone" maxlength="100" size="small" placeholder="请输入合营方电话" />
  46. </ws-form-item>
  47. <!--关联合同-->
  48. <ws-form-item prop="agreementNo" label="关联合同" span="1" v-if="deptBudgetList.agreementType == '补充协议'">
  49. <div class="unchanged">
  50. {{ deptBudgetList.agreementNo }}
  51. </div>
  52. <span class="unchangeable">*</span>
  53. </ws-form-item>
  54. <!--补充协议编号-->
  55. <ws-form-item label="补充协议编号" span="1" prop="contractNo"
  56. v-if="deptBudgetList.agreementType == '补充协议'">
  57. <div class="unchanged">
  58. {{ deptBudgetList.contractNo }}
  59. </div>
  60. <span class="unchangeable">*</span>
  61. </ws-form-item>
  62. <!--运输方式-->
  63. <ws-form-item label="运输方式" span="1" prop="contractNo">
  64. <ws-input v-model="deptBudgetList.shippingType" placeholder="请输入运输方式" maxlength="100" size="small" />
  65. </ws-form-item>
  66. <!--买方-->
  67. <ws-form-item label="买方" span="1" prop="contractNo">
  68. <div class="unchanged">
  69. {{ deptBudgetList.buyer }}
  70. </div>
  71. <span class="unchangeable">*</span>
  72. </ws-form-item>
  73. <!--结算方式-->
  74. <ws-form-item label="结算方式" span="1" prop="contractNo">
  75. <ws-input v-model="deptBudgetList.settlementMethod" placeholder="请输入结算方式" maxlength="100" size="small" />
  76. </ws-form-item>
  77. <!--卖方-->
  78. <ws-form-item label="卖方" span="1" prop="contractNo">
  79. <div class="unchanged">
  80. {{ deptBudgetList.seller }}
  81. </div>
  82. <span class="unchangeable">*</span>
  83. </ws-form-item>
  84. <!--交货方式-->
  85. <ws-form-item label="交货方式" span="1" prop="contractNo">
  86. <div class="unchanged">
  87. {{ deptBudgetList.deliverType1 }}
  88. </div>
  89. <span class="unchangeable">*</span>
  90. </ws-form-item>
  91. <!--买方电话-->
  92. <ws-form-item label="买方电话" span="1" prop="contractNo">
  93. <ws-input v-model="deptBudgetList.buyerPhone" placeholder="请输入买方电话" maxlength="100" size="small" />
  94. </ws-form-item>
  95. <!-- 收货反馈负责人 -->
  96. <ws-form-item label="收货反馈负责人" span="1" prop="feedbackLeader" v-if="deptBudgetList.deliverType1 == '对方自提'">
  97. <ws-select v-model="deptBudgetList.feedbackLeader" placeholder="请输入收货反馈负责人" class="typeselect" @change="feedbackLeaderChange">
  98. <ws-option v-for="(item,index ) in feedbackLeaders" :key="item.staffId" :label="item.staffName" :value="index" />
  99. </ws-select>
  100. </ws-form-item>
  101. <!--包装方式-->
  102. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  103. <ws-select v-model="deptBudgetList.packingMethod" placeholder="" class="typeselect"
  104. @change="selectpackingMethod">
  105. <ws-option v-for="item in packtypeList" :key="item.constKey" :label="item.constValue"
  106. :value="item.constValue" />
  107. </ws-select>
  108. </ws-form-item>
  109. <ws-form-item label="中转公司" span="1" prop="buyer" class="readonly">
  110. {{deptBudgetList.transitCompany}}
  111. </ws-form-item>
  112. <!--卖方电话-->
  113. <ws-form-item label="卖方电话" span="1" prop="contractNo">
  114. <ws-input v-model="deptBudgetList.sellerPhone" placeholder="请输入卖方电话" maxlength="100" size="small" />
  115. </ws-form-item>
  116. <!--验收方式-->
  117. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  118. <el-select v-model="deptBudgetList.acceptanceMethod" placeholder="请选择验收方式" style="width: 100%" clearable filterable
  119. @change="selectunitList">
  120. <el-option v-for="(item, index) in unitList" :key="item.constValue" :label="item.constValue"
  121. :value="item.constValue">
  122. <span class="unit-left" style="float: left">
  123. <span v-if="item.flag == 'delete'">
  124. {{ item.constValue }}</span>
  125. <!-- 新增文本框 -->
  126. <div style="width: 160px" v-if="item.flag !== 'delete'" @click.stop>
  127. <ws-input v-model="item.constValue" clearable maxlength="10" style="width: 100%"></ws-input>
  128. </div>
  129. </span>
  130. <span style="float: right; color: #8492a6; font-size: 13px">
  131. <!-- 对号 -->
  132. <i class="el-icon-check" style="line-height: 29px; margin-left: 10px" v-if="item.flag !== 'delete'"
  133. @click.stop="saveClick(item, index)"></i>
  134. <!-- 编辑 -->
  135. <i class="el-icon-edit" style="line-height: 29px; margin-left: 10px" v-if="item.flag == 'delete'"
  136. @click.stop="editClick(item, index)"></i>
  137. <!-- 删除 -->
  138. <i class="el-icon-delete" style="line-height: 29px" @click.stop="deleteClick(item, index)"></i>
  139. </span>
  140. </el-option>
  141. <!-- 新增按钮 -->
  142. <el-option value="" label="">
  143. <div style="
  144. text-align: right;
  145. border-top: 1px solid #dcdfe6;
  146. padding: 5px;
  147. ">
  148. <ws-button type="primary" @click.stop="addClick">{{
  149. $t('button.add')
  150. }}</ws-button>
  151. </div>
  152. </el-option>
  153. </el-select>
  154. </ws-form-item>
  155. <!--重量(吨)-->
  156. <ws-form-item label="重量(吨)" span="1" prop="contractNo">
  157. <ws-input v-model="deptBudgetList.weight" @input="weightchange" placeholder="请输入重量(吨)" maxlength="100" size="small" />
  158. </ws-form-item>
  159. <!--交货日期(起)-->
  160. <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
  161. <ws-date-picker v-model="deptBudgetList.deliveryDateStart" type="date" placeholder="请选择交货日期(起)"
  162. value-format="yyyy-MM-dd" />
  163. </ws-form-item>
  164. <!--溢短装(%)-->
  165. <ws-form-item label="溢短装(%)" span="1" prop="contractNo">
  166. <ws-input v-model="deptBudgetList.overShort" placeholder="请输入溢短装(%)" maxlength="100" size="small" />
  167. </ws-form-item>
  168. <!--交货日期(止)-->
  169. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  170. <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
  171. value-format="yyyy-MM-dd" />
  172. </ws-form-item>
  173. <!--价格类型-->
  174. <ws-form-item label="价格类型" span="1" prop="priceType">
  175. <div class="unchanged">
  176. {{ deptBudgetList.priceType }}
  177. </div>
  178. </ws-form-item>
  179. <!--合同单价(元/吨)-->
  180. <ws-form-item label="合同单价(元/吨)" span="1" prop="contractNo" v-if="deptBudgetList.priceType == '定价销售'">
  181. <ws-input @input="pricechange" v-model="deptBudgetList.unitContractPrice" placeholder="请输入合同单价"
  182. maxlength="100" size="small" />
  183. </ws-form-item>
  184. <!--合同总价-->
  185. <ws-form-item label="合同总价" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
  186. <div class="unchanged">
  187. {{ deptBudgetList.totalContractPrice }}
  188. </div>
  189. <span class="unchangeable">*</span>
  190. </ws-form-item>
  191. <!--签订日期-->
  192. <ws-form-item label="签订日期" span="1" prop="signingDate" v-if="deptBudgetList.agreementType=='销售合同'">
  193. <ws-date-picker v-model="deptBudgetList.signingDate" type="date" placeholder="请选择合同签订日期"
  194. value-format="yyyy-MM-dd" />
  195. </ws-form-item>
  196. <!-- 货源所在地区 -->
  197. <ws-form-item label="货源所在地区" span="1" prop="sourceGoods">
  198. <!-- <el-cascader
  199. :options="options_"
  200. v-model="selectedOptions"
  201. clearable
  202. size="large"
  203. placeholder="请选择货源所在地区"
  204. style="width: 200%"
  205. @change="handleChange"
  206. /> -->
  207. <el-button @click="mapInputClick('source')" class="address-btn">
  208. {{ newSelectedOptions }}
  209. </el-button>
  210. </ws-form-item>
  211. <!-- 货源详细地址 -->
  212. <ws-form-item label="货源详细地址" span="1" prop="sourceGoods">
  213. <ws-input v-model="deptBudgetList.sourceGoods" maxlength="100" placeholder="请输入货源详细地址" size="small" />
  214. </ws-form-item>
  215. <!-- 交货地所在地区 -->
  216. <ws-form-item label="交货地所在地区" span="1" prop="placeDelivery">
  217. <!-- <el-cascader
  218. :options="options_"
  219. v-model="selectedOptions1"
  220. clearable
  221. size="large"
  222. placeholder="请选择交货地所在地区"
  223. style="width: 200%"
  224. @change="handleChange1"
  225. /> -->
  226. <el-button @click="mapInputClick('deliveryProv')" class="address-btn">
  227. {{ newSelectedOptions1 }}
  228. </el-button>
  229. </ws-form-item>
  230. <!-- 交货地详细地址 -->
  231. <ws-form-item label="交货地详细地址" span="1" prop="placeDelivery">
  232. <ws-input v-model="deptBudgetList.placeDelivery" maxlength="100" placeholder="请输入交货地详细地址" size="small" />
  233. </ws-form-item>
  234. <!--签订日期-->
  235. <ws-form-item label="签订日期" span="1" prop="signingDate" v-if="deptBudgetList.agreementType=='补充协议'">
  236. <ws-date-picker v-model="deptBudgetList.signingDate" type="date" placeholder="请选择合同签订日期"
  237. value-format="yyyy-MM-dd" />
  238. </ws-form-item>
  239. <!--结算重量方式-->
  240. <ws-form-item label="结算重量方式" span="1" prop="settlementWeightMethod">
  241. <div class="unchanged">
  242. {{ deptBudgetList.settlementWeightMethod==1?'按出库重量结算':'按收货重量结算' }}
  243. </div>
  244. <span class="unchangeable">*</span>
  245. </ws-form-item>
  246. <!-- 最终实际交易量(吨) -->
  247. <ws-form-item label="最终实际交易量(吨)" span="1" prop="finalTradingVolume">
  248. <ws-input v-model="deptBudgetList.finalTradingVolume" maxlength="100" placeholder="请输入最终实际交易量"
  249. size="small" />
  250. </ws-form-item>
  251. <ws-form-item label="收款截止日期" span="1" prop="collectionDeadline">
  252. <ws-date-picker v-model="deptBudgetList.collectionDeadline" type="date" placeholder="请选择收款截止日期"
  253. value-format="yyyy-MM-dd" />
  254. </ws-form-item>
  255. <ws-form-item label="结算单价(元/吨)" span="1" prop="settlementPrice" >
  256. {{ deptBudgetList.settlementPrice?deptBudgetList.settlementPrice:'自动结算,不可编辑'}}
  257. </ws-form-item>
  258. </ws-info-table>
  259. </ws-form>
  260. </div>
  261. <!-- <base-card> -->
  262. <div class="wenzi">
  263. <h3>货物信息</h3>
  264. </div>
  265. <div class="center">
  266. <ws-form ref="deptBudgetList" :rules="ruleDeptBudget" :model="deptBudgetList">
  267. <!--货物信息-->
  268. <ws-info-table>
  269. <!--货名-->
  270. <ws-form-item label="货名" span="1" prop="goodsName">
  271. <div class="unchanged">
  272. {{ deptBudgetList.contractGoodsInfo.goodsName }}
  273. </div>
  274. <span class="unchangeable">*</span>
  275. </ws-form-item>
  276. <!--水分(%)<=-->
  277. <ws-form-item label="水分(%)<=" span="1" prop="contractNo">
  278. <ws-input v-model="deptBudgetList.contractGoodsInfo.waterContent" placeholder="请输入水分(%)" maxlength="100"
  279. size="small" />
  280. </ws-form-item>
  281. <!--品级-->
  282. <ws-form-item label="品级" span="1" prop="grade">
  283. <div class="unchanged">
  284. {{ deptBudgetList.contractGoodsInfo.grade }}
  285. </div>
  286. <span class="unchangeable">*</span>
  287. </ws-form-item>
  288. <!--杂质(%)<=-->
  289. <ws-form-item label="杂质(%)<=" span="1" prop="contractNo">
  290. <ws-input v-model="deptBudgetList.contractGoodsInfo.impurity" placeholder="请输入杂质(%)" maxlength="100"
  291. size="small" />
  292. </ws-form-item>
  293. <!--容重(克/升)>=-->
  294. <ws-form-item label="容重(克/升)>=" span="1" prop="contractNo">
  295. <ws-input v-model="deptBudgetList.contractGoodsInfo.bulkDensity" placeholder="请输入容重(克/升)" maxlength="100"
  296. size="small" />
  297. </ws-form-item>
  298. <!--霉变粒(%)<=-->
  299. <ws-form-item label="霉变粒(%)<=" span="1" prop="contractNo">
  300. <ws-input v-model="deptBudgetList.contractGoodsInfo.mildewGrain" placeholder="请输入霉变粒(%)" maxlength="100"
  301. size="small" />
  302. </ws-form-item>
  303. <!--热损伤(%)<=-->
  304. <ws-form-item label="热损伤(%)<=" span="1" prop="contractNo">
  305. <ws-input v-model="deptBudgetList.contractGoodsInfo.jiaorenli" placeholder="请输入热损伤(%)" maxlength="100"
  306. size="small" />
  307. </ws-form-item>
  308. <!--不完善粒(%)<=-->
  309. <ws-form-item label="不完善粒(%)<=" span="1" prop="contractNo">
  310. <ws-input v-model="deptBudgetList.contractGoodsInfo.imperfectGrain" placeholder="请输入不完善粒(%)" maxlength="100"
  311. size="small" />
  312. </ws-form-item>
  313. </ws-info-table>
  314. </ws-form>
  315. </div>
  316. <div class="wenzi">
  317. <h3>流程信息</h3>
  318. </div>
  319. <div class="center">
  320. <ws-form ref="deptBudgetList" :rules="ruleDeptBudget" :model="deptBudgetList">
  321. <!--流程信息-->
  322. <ws-info-table>
  323. <!--合同收入(元)-->
  324. <ws-form-item label="合同收入(元)" span="1" prop="goodsNameKey">
  325. <ws-input v-model="deptBudgetList.contractProcessInfo.goodsNameKey" placeholder="请输入合同收入(元)" maxlength="100"
  326. size="small" />
  327. </ws-form-item>
  328. <!--已开发票(元)-->
  329. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  330. <ws-input v-model="deptBudgetList.contractProcessInfo.goodsName" placeholder="请输入已开发票(元))" maxlength="100"
  331. size="small" />
  332. </ws-form-item>
  333. <!--费用支出(元)-->
  334. <ws-form-item label="费用支出(元)" span="1" prop="contractNo">
  335. <ws-input v-model="deptBudgetList.contractProcessInfo.waterContent" placeholder="请输入费用支出(元)" maxlength="100"
  336. size="small" />
  337. </ws-form-item>
  338. <!--未开发票(元)-->
  339. <ws-form-item label="未开发票(元)" span="1" prop="contractNo">
  340. <ws-input v-model="deptBudgetList.contractProcessInfo.impurity" placeholder="请输入未开发票(元)" maxlength="100"
  341. size="small" />
  342. </ws-form-item>
  343. <!--未回款(元)-->
  344. <ws-form-item label="未回款(元)" span="1" prop="contractNo">
  345. <ws-input v-model="deptBudgetList.contractProcessInfo.mildewGrain" placeholder="请输入未回款(元)" maxlength="100"
  346. size="small" />
  347. </ws-form-item>
  348. <!--双章原件回收情况-->
  349. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  350. <ws-select v-model="deptBudgetList.contractProcessInfo.grade" placeholder="" class="typeselect"
  351. @change="selectpackingMethod">
  352. <ws-option v-for="item in ChapterTwoList" :key="item.constKey" :label="item.constValue"
  353. :value="item.constValue" />
  354. </ws-select>
  355. </ws-form-item>
  356. </ws-info-table>
  357. </ws-form>
  358. </div>
  359. <div class="wenzi">
  360. <h3>备注信息</h3>
  361. </div>
  362. <div class="center">
  363. <ws-form ref="deptBudgetList" :rules="ruleDeptBudget" :model="deptBudgetList">
  364. <!--备注信息-->
  365. <ws-input v-model="deptBudgetList.remarks" autosize type="textarea" placeholder="请输入备注信息,不超过200字"
  366. maxlength="200" />
  367. <ws-upload ref="upload" @onChange="onChange" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :editable="true" accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar" v-hasPermission="
  368. `contractManagement.salesContract.salesContractInfo.appl`"/>
  369. </ws-form>
  370. </div>
  371. <div v-if="dialogVisible" class="map">
  372. <map-drag @marker="marker" :isShowaddress="true" v-on:addressListen="getAddress" :type="type">
  373. </map-drag>
  374. </div>
  375. <div style="text-align: right; padding: 10px" class="center">
  376. <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交</el-button>
  377. </div>
  378. </div>
  379. </template>
  380. <script>
  381. import {
  382. regionData,
  383. CodeToText,
  384. TextToCode
  385. } from 'element-china-area-data'
  386. import WsUpload from '@/components/WsUpload'
  387. import mapDrag from '@/components/mapdrag/mapdrag'
  388. import {
  389. examineList,
  390. editInfo,
  391. packList,
  392. xiala,
  393. addxiala,
  394. editxiala,
  395. delxiala,
  396. getRelationContractNo,
  397. } from '@/model/contarct/index'
  398. import { getstaff, } from '@/model/warehouse/index'
  399. export default {
  400. name: 'viewSpareMoney',
  401. components: {
  402. WsUpload,
  403. mapDrag
  404. },
  405. watch: {
  406. vesselId(val) {
  407. this.loaddata()
  408. },
  409. isShow(val) {
  410. this.showType = val
  411. },
  412. },
  413. data() {
  414. return {
  415. type: '',
  416. dialogVisible: false,
  417. newSelectedOptions1: '请选择交货所在地区',
  418. newSelectedOptions: '请选择货源所在地',
  419. //弹出框
  420. dialogViewSpareMoney: false,
  421. dialogApproveFormVisible: false,
  422. // 船舶类型
  423. monetaryKey: null,
  424. // 表格显示数据
  425. tableDate: [],
  426. // 是否显示
  427. showType: true,
  428. // 年
  429. year: '',
  430. // 提交类型
  431. submitType: true,
  432. options_: regionData,
  433. selectedOptions: [],
  434. selectedOptions1: [],
  435. tableData: [{
  436. date: 1111,
  437. name: 'qqqq',
  438. address: 'errrtt'
  439. }],
  440. pickerBeginDateBefore: {
  441. disabledDate: (time) => {
  442. return time.getTime() > Date.now()
  443. },
  444. },
  445. selectunitList: {},
  446. uploadSuccess: {},
  447. selectgrade: {},
  448. goodnameList: {},
  449. selectpackingMethod: {},
  450. unitList: {},
  451. packtypeList: [],
  452. compId: localStorage.getItem('ws-pf_compId'),
  453. appendixIdsAdd: '',
  454. size: 10,
  455. deptBudgetList: {
  456. contractGoodsInfo: {
  457. goodsName: '',
  458. },
  459. contractProcessInfo: {},
  460. sourceGoods:'',
  461. placeDelivery:'',
  462. },
  463. ruleDeptBudget: {},
  464. trainingMethods: {},
  465. isEdited: false,
  466. registered: {},
  467. selectCrtDuty: {},
  468. dutyList: {},
  469. sexList: {},
  470. selectDuty: {},
  471. gradeList: {},
  472. ChapterTwoList: {},
  473. selectIntendedShip: {},
  474. interviewTypeList: {},
  475. feedbackLeaders:[],//收货反馈负责人
  476. }
  477. },
  478. activated() {
  479. //cg.viewBudget
  480. //cg.viewSpareMoney
  481. // this.getVesselData();
  482. this.loaddata()
  483. this.editInfo()
  484. this.showType = this.isShow
  485. // console.log(this.$route.params)
  486. this.showType = this.isShow
  487. },
  488. methods: {
  489. feedbackLeaderChange(e){
  490. this.deptBudgetList.feedbackLeader = this.feedbackLeaders[e].staffName
  491. this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[e].staffMobilePhone
  492. console.log( this.deptBudgetList.feedbackLeader,this.deptBudgetList.feedbackLeaderPhone)
  493. },
  494. marker(item) {
  495. this.deptBudgetList.warehousePositioning =
  496. item.lnglat.lat + ',' + item.lnglat.lng
  497. },
  498. getAddress(data) {
  499. console.log('getAddress', data)
  500. if (data[4] == 'source') {
  501. this.newSelectedOptions = data[0] + '/' + data[1] + '/' + data[2]
  502. this.deptBudgetList.sourceProvince = data[0]
  503. this.deptBudgetList.sourceCity = data[1]
  504. this.deptBudgetList.sourceArea = data[2]
  505. this.deptBudgetList.sourceGoods = data[3]
  506. this.deptBudgetList.sourceLocation=data[5].lat+','+data[5].lng
  507. } else {
  508. this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
  509. this.deptBudgetList.deliveryProvince = data[0]
  510. this.deptBudgetList.deliveryCity = data[1]
  511. this.deptBudgetList.deliveryArea = data[2]
  512. this.deptBudgetList.placeDelivery = data[3]
  513. this.deptBudgetList.deliveryLocation=data[5].lat+','+data[5].lng
  514. }
  515. },
  516. mapInputClick(type) {
  517. this.dialogVisible = true
  518. this.type = type
  519. },
  520. blurMap() {
  521. this.dialogVisible = false
  522. },
  523. focusMap() {
  524. this.dialogVisible = true
  525. },
  526. // 关闭 dialog时 处理文件url 初始化upload组件
  527. handleClose() {
  528. this.dialogViewSpareMoney = false
  529. },
  530. returnsales() {
  531. this.deptBudgetList = {}
  532. this.$router.push({
  533. path: 'salesContract'
  534. })
  535. },
  536. handleChange(value) {
  537. this.selectedOptions = value
  538. },
  539. handleChange1(value) {
  540. this.selectedOptions1 = value
  541. },
  542. // 上传附件
  543. onChange() {
  544. this.$refs.upload
  545. .handleSaveBill()
  546. .then(async response => {
  547. this.deptBudgetList.addressUrl = response
  548. })
  549. .catch(res => {
  550. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  551. this.$refs.upload.clearFiles()
  552. })
  553. },
  554. loaddata() {
  555. // 数据
  556. examineList({
  557. id: this.$route.query.id
  558. })
  559. .toPromise()
  560. .then((response) => {
  561. this.deptBudgetList = response
  562. if (this.deptBudgetList.deliverType == 1) {
  563. this.deptBudgetList.deliverType1 = '我方送货'
  564. } else if (this.deptBudgetList.deliverType == 2) {
  565. this.deptBudgetList.deliverType1 = '对方自提'
  566. }
  567. if (this.deptBudgetList.agreementType == 1) {
  568. this.deptBudgetList.agreementType1 = '销售合同'
  569. } else if (this.deptBudgetList.agreementType == 2) {
  570. this.deptBudgetList.agreementType1 = '补充协议'
  571. }
  572. })
  573. // 包装方式
  574. packList({
  575. constId: 'CON1'
  576. })
  577. .toPromise()
  578. .then((response) => {
  579. this.packtypeList = response
  580. })
  581. // 验收方式
  582. this.getUnitList()
  583. // 货名
  584. packList({
  585. constId: 'CON2'
  586. })
  587. .toPromise()
  588. .then((response) => {
  589. this.goodnameList = response
  590. })
  591. // 品级
  592. packList({
  593. constId: 'CON3'
  594. })
  595. .toPromise()
  596. .then((response) => {
  597. this.gradeList = response
  598. })
  599. // 双章
  600. packList({
  601. constId: 'CON4'
  602. })
  603. .toPromise()
  604. .then((response) => {
  605. this.ChapterTwoList = response
  606. })
  607. // 收货反馈负责人
  608. getstaff({
  609. compId: localStorage.getItem('ws-pf_compId')
  610. })
  611. .toPromise()
  612. .then((response) => {
  613. this.feedbackLeaders = response
  614. })
  615. },
  616. getUnitList() {
  617. xiala({
  618. compId: localStorage.getItem('ws-pf_compId'),
  619. constCode: 'TYPEYAN',
  620. })
  621. .toPromise()
  622. .then((response) => {
  623. this.unitList = response
  624. let currItem
  625. this.unitList.forEach((item, index, arr) => {
  626. item.flag = 'delete'
  627. if (this.vModel == item.constKey) {
  628. currItem = item
  629. }
  630. })
  631. if (currItem) {
  632. this.selectContract(currItem.constValue)
  633. }
  634. })
  635. },
  636. // 编辑
  637. editClick(item, index) {
  638. const map = JSON.parse(JSON.stringify(item))
  639. if (Object.is(item.id, 1)) {
  640. return
  641. }
  642. if (Object.is(this.unitList[index].flag, 'delete')) {
  643. map.flag = 'check'
  644. this.$set(this.unitList, index, map)
  645. } else {
  646. map.flag = 'delete'
  647. this.$set(this.unitList, index, map)
  648. }
  649. },
  650. // 删除
  651. deleteClick(item, index) {
  652. if (Object.is(item.constKey, 1)) {
  653. return
  654. }
  655. if (!item.constValue) {
  656. this.unitList.splice(index, 1)
  657. return
  658. }
  659. delxiala({
  660. id: this.unitList[index].id
  661. })
  662. .toPromise()
  663. .then((response) => {
  664. this.getUnitList()
  665. this.pleaseChoose = ''
  666. })
  667. },
  668. weightchange(e) {
  669. if(this.deptBudgetList.unitContractPrice){
  670. this.deptBudgetList.totalContractPrice = e * this.deptBudgetList.unitContractPrice
  671. }
  672. this.deptBudgetList.finalTradingVolume = e
  673. },
  674. pricechange(e) {
  675. if(this.deptBudgetList.weight){
  676. this.deptBudgetList.totalContractPrice = e * this.deptBudgetList.weight
  677. }
  678. },
  679. saveClick(item, index) {
  680. // console.log(item)
  681. if (Object.is(item.id, 1)) {
  682. return
  683. }
  684. if (Object.is(this.unitList[index].flag, 'delete')) {
  685. this.$set(this.unitList, index, {
  686. flag: 'check'
  687. })
  688. } else {
  689. this.$set(this.unitList, index, {
  690. flag: 'delete'
  691. })
  692. }
  693. if (!item.constValue) {
  694. this.unitList.splice(index, 1)
  695. return
  696. }
  697. if (item.flag == 'add') {
  698. item.constKey = Math.random() * 20
  699. this.trainingMethods.compId = localStorage.getItem('ws-pf_compId')
  700. this.trainingMethods.constKey = item.constKey
  701. this.trainingMethods.constCode = 'TYPEYAN'
  702. this.trainingMethods.constValue = item.constValue
  703. this.trainingMethods.id = item.id
  704. addxiala(this.trainingMethods)
  705. .toPromise()
  706. .then((response) => {
  707. this.getUnitList()
  708. })
  709. } else if (item.flag == 'check') {
  710. this.trainingMethods.compId = localStorage.getItem('ws-pf_compId')
  711. this.trainingMethods.constKey = item.constKey
  712. this.trainingMethods.constCode = 'TYPEYAN'
  713. this.trainingMethods.constValue = item.constValue
  714. this.trainingMethods.id = item.id
  715. editxiala(this.trainingMethods)
  716. .toPromise()
  717. .then((response) => {
  718. this.getUnitList()
  719. })
  720. }
  721. },
  722. addClick() {
  723. this.unitList.push({
  724. flag: 'add',
  725. constValue: '',
  726. constKey: '',
  727. })
  728. },
  729. submit() {
  730. if (!this.deptBudgetList.contractNo) {
  731. this.$message({
  732. message: '合同编号不能为空',
  733. type: 'warning',
  734. })
  735. return
  736. }
  737. if (
  738. this.deptBudgetList.contractNo.length < 6 ||
  739. this.deptBudgetList.contractNo.length > 50
  740. ) {
  741. this.$message({
  742. message: '合同编号长度不符合要求,请输入6到50个字符之内!',
  743. type: 'warning',
  744. })
  745. return
  746. }
  747. if (!this.deptBudgetList.shippingType) {
  748. this.$message({
  749. message: '运输方式不能为空',
  750. type: 'warning',
  751. })
  752. return
  753. }
  754. if (
  755. this.deptBudgetList.shippingType.length < 1 ||
  756. this.deptBudgetList.shippingType.length > 20
  757. ) {
  758. this.$message({
  759. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  760. type: 'warning',
  761. })
  762. return
  763. }
  764. if (!this.deptBudgetList.buyer) {
  765. this.$message({
  766. message: '买方名称不能为空',
  767. type: 'warning',
  768. })
  769. return
  770. }
  771. if (this.deptBudgetList.buyer.length > 30) {
  772. this.$message({
  773. message: '买方名称长度不符合要求,请输入30个字符之内!',
  774. type: 'warning',
  775. })
  776. return
  777. }
  778. if (!this.deptBudgetList.settlementMethod) {
  779. this.$message({
  780. message: '结算方式不能为空',
  781. type: 'warning',
  782. })
  783. return
  784. }
  785. if (
  786. this.deptBudgetList.settlementMethod.length < 1 ||
  787. this.deptBudgetList.settlementMethod.length > 20
  788. ) {
  789. this.$message({
  790. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  791. type: 'warning',
  792. })
  793. return
  794. }
  795. if (!this.deptBudgetList.seller) {
  796. this.$message({
  797. message: '请输入卖方名称!',
  798. type: 'warning',
  799. })
  800. return
  801. }
  802. if (this.deptBudgetList.seller.length > 30) {
  803. this.$message({
  804. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  805. type: 'warning',
  806. })
  807. return
  808. }
  809. if (!this.deptBudgetList.buyerPhone) {
  810. this.$message({
  811. message: '请输入买方电话!',
  812. type: 'warning',
  813. })
  814. return
  815. }
  816. if (isNaN(this.deptBudgetList.buyerPhone)) {
  817. this.$message({
  818. message: '输入买方电话有误!',
  819. type: 'warning',
  820. })
  821. return
  822. }
  823. if (!this.deptBudgetList.sellerPhone) {
  824. this.$message({
  825. message: '请输入卖方电话!',
  826. type: 'warning',
  827. })
  828. return
  829. }
  830. if (isNaN(this.deptBudgetList.sellerPhone)) {
  831. this.$message({
  832. message: '输入卖方电话有误!',
  833. type: 'warning',
  834. })
  835. return
  836. }
  837. if(this.deptBudgetList.deliverType == '2'){
  838. if (!this.deptBudgetList.feedbackLeader){
  839. this.$message({
  840. message: '请选择收货反馈负责人',
  841. type: 'warning',
  842. })
  843. return
  844. }
  845. }
  846. if (!this.deptBudgetList.acceptanceMethod) {
  847. this.$message({
  848. message: '请选择验收方式',
  849. type: 'warning',
  850. })
  851. return
  852. }
  853. if (!this.deptBudgetList.weight) {
  854. this.$message({
  855. message: '请输入重量!',
  856. type: 'warning',
  857. })
  858. return
  859. }
  860. if (
  861. isNaN(this.deptBudgetList.weight) ||
  862. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  863. String(this.deptBudgetList.weight).length -
  864. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  865. 3) ||
  866. this.deptBudgetList.weight < 0 ||
  867. this.deptBudgetList.weight > 200000
  868. ) {
  869. this.$message({
  870. message: '输入重量有误!',
  871. type: 'warning',
  872. })
  873. return
  874. }
  875. if (!this.deptBudgetList.deliveryDateStart) {
  876. this.$message({
  877. message: '请选择交货日期(起)',
  878. type: 'warning',
  879. })
  880. return
  881. }
  882. if (!this.deptBudgetList.overShort) {
  883. this.$message({
  884. message: '请输入溢短装!',
  885. type: 'warning',
  886. })
  887. return
  888. }
  889. if (
  890. isNaN(this.deptBudgetList.overShort) ||
  891. (String(this.deptBudgetList.overShort).indexOf('.') != -1 &&
  892. String(this.deptBudgetList.overShort).length -
  893. (String(this.deptBudgetList.overShort).indexOf('.') + 1) >
  894. 2) ||
  895. this.deptBudgetList.overShort < 0 ||
  896. this.deptBudgetList.overShort > 50
  897. ) {
  898. this.$message({
  899. message: '溢短装输入有误!',
  900. type: 'warning',
  901. })
  902. return
  903. }
  904. if (!this.deptBudgetList.deliveryDateEnd) {
  905. this.$message({
  906. message: '请选择交货日期(止)',
  907. type: 'warning',
  908. })
  909. return
  910. }
  911. //时间
  912. if (
  913. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  914. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  915. ) {
  916. this.$message({
  917. message: '交货日期(止)选择错误',
  918. type: 'warning',
  919. })
  920. return
  921. }
  922. if (!this.deptBudgetList.unitContractPrice && this.deptBudgetList.priceType == "定价销售") {
  923. this.$message({
  924. message: '请输入合同单价!',
  925. type: 'warning',
  926. })
  927. return
  928. }
  929. if (
  930. isNaN(this.deptBudgetList.unitContractPrice) ||
  931. (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
  932. String(this.deptBudgetList.unitContractPrice).length -
  933. (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
  934. 2) ||
  935. this.deptBudgetList.unitContractPrice < 0 ||
  936. this.deptBudgetList.unitContractPrice > 10000
  937. ) {
  938. this.$message({
  939. message: '合同单价输入有误!',
  940. type: 'warning',
  941. })
  942. return
  943. }
  944. if (!this.deptBudgetList.totalContractPrice && this.deptBudgetList.priceType == "定价销售") {
  945. this.$message({
  946. message: '请输入合同总价!',
  947. type: 'warning',
  948. })
  949. return
  950. }
  951. if (
  952. isNaN(this.deptBudgetList.totalContractPrice) ||
  953. (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
  954. String(this.deptBudgetList.totalContractPrice).length -
  955. (String(this.deptBudgetList.totalContractPrice).indexOf('.') + 1) >
  956. 2) ||
  957. this.deptBudgetList.totalContractPrice < 0 ||
  958. this.deptBudgetList.totalContractPrice > 1000000000
  959. ) {
  960. this.$message({
  961. message: '合同总价输入有误!',
  962. type: 'warning',
  963. })
  964. return
  965. }
  966. if (!this.newSelectedOptions) {
  967. this.$message({
  968. message: '请选择货源所在地区!',
  969. type: 'warning',
  970. })
  971. return
  972. }
  973. if (!this.deptBudgetList.sourceGoods) {
  974. this.$message({
  975. message: '请输入货源详细地址!',
  976. type: 'warning',
  977. })
  978. return
  979. }
  980. if (!this.newSelectedOptions1) {
  981. this.$message({
  982. message: '请选择交货所在地区!',
  983. type: 'warning',
  984. })
  985. return
  986. }
  987. if (!this.deptBudgetList.placeDelivery) {
  988. this.$message({
  989. message: '请输入交货详细地址!',
  990. type: 'warning',
  991. })
  992. return
  993. }
  994. if (!this.deptBudgetList.signingDate) {
  995. this.$message({
  996. message: '请选择签订日期',
  997. type: 'warning',
  998. })
  999. return
  1000. }
  1001. if (
  1002. isNaN(this.deptBudgetList.finalTradingVolume) ||
  1003. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') != -1 &&
  1004. String(this.deptBudgetList.finalTradingVolume).length -
  1005. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') + 1) >
  1006. 3) ||
  1007. this.deptBudgetList.finalTradingVolume < 0 ||
  1008. this.deptBudgetList.finalTradingVolume > 200000
  1009. ) {
  1010. this.$message({
  1011. message: '最终实际成交量有误!',
  1012. type: 'warning',
  1013. })
  1014. return
  1015. }
  1016. //货物信息
  1017. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1018. this.$message({
  1019. message: '请选择货名',
  1020. type: 'warning',
  1021. })
  1022. return
  1023. }
  1024. // if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1025. // this.$message({
  1026. // message: '请输入水分',
  1027. // type: 'warning',
  1028. // })
  1029. // return
  1030. // }
  1031. if (
  1032. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1033. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1034. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1035. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1036. 2 || this.deptBudgetList.contractGoodsInfo.waterContent > 40 || this.deptBudgetList.contractGoodsInfo
  1037. .waterContent < 0
  1038. ) {
  1039. this.$message({
  1040. message: '水分输入错误',
  1041. type: 'warning',
  1042. })
  1043. return
  1044. }
  1045. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1046. this.$message({
  1047. message: '请选择品级',
  1048. type: 'warning',
  1049. })
  1050. return
  1051. }
  1052. // if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1053. // this.$message({
  1054. // message: '请输入杂质',
  1055. // type: 'warning',
  1056. // })
  1057. // return
  1058. // }
  1059. if (
  1060. this.deptBudgetList.contractGoodsInfo.impurity &&
  1061. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1062. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1063. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1064. 2 || this.deptBudgetList.contractGoodsInfo.impurity > 40 || this.deptBudgetList.contractGoodsInfo.impurity < 0
  1065. ) {
  1066. this.$message({
  1067. message: '杂质输入错误',
  1068. type: 'warning',
  1069. })
  1070. return
  1071. }
  1072. // if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1073. // this.$message({
  1074. // message: '请输入容重',
  1075. // type: 'warning',
  1076. // })
  1077. // return
  1078. // }
  1079. if (
  1080. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1081. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1082. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1083. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1084. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo
  1085. .bulkDensity < 0
  1086. ) {
  1087. this.$message({
  1088. message: '容重输入错误',
  1089. type: 'warning',
  1090. })
  1091. return
  1092. }
  1093. // if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1094. // this.$message({
  1095. // message: '请输入霉变粒',
  1096. // type: 'warning',
  1097. // })
  1098. // return
  1099. // }
  1100. if (
  1101. (this.deptBudgetList.contractGoodsInfo.mildewGrain &&
  1102. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') != -1 &&
  1103. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1104. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf('.') + 1) >
  1105. 2) || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40|| this.deptBudgetList.contractGoodsInfo
  1106. .mildewGrain < 0
  1107. ) {
  1108. this.$message({
  1109. message: '霉变粒输入错误',
  1110. type: 'warning',
  1111. })
  1112. return
  1113. }
  1114. // if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1115. // this.$message({
  1116. // message: '请输入热损伤',
  1117. // type: 'warning',
  1118. // })
  1119. // return
  1120. // }
  1121. if (
  1122. (this.deptBudgetList.contractGoodsInfo.jiaorenli &&
  1123. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') != -1 &&
  1124. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1125. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') + 1) >
  1126. 2) || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40|| this.deptBudgetList.contractGoodsInfo.jiaorenli < 0
  1127. ) {
  1128. this.$message({
  1129. message: '热损伤输入错误',
  1130. type: 'warning',
  1131. })
  1132. return
  1133. }
  1134. // if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1135. // this.$message({
  1136. // message: '请输入不完善粒',
  1137. // type: 'warning',
  1138. // })
  1139. // return
  1140. // }
  1141. if (
  1142. (this.deptBudgetList.contractGoodsInfo.imperfectGrain &&
  1143. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') != -1 &&
  1144. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1145. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf('.') + 1) >
  1146. 2) || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40|| this.deptBudgetList.contractGoodsInfo.imperfectGrain < 0
  1147. ) {
  1148. this.$message({
  1149. message: '不完善粒输入错误',
  1150. type: 'warning',
  1151. })
  1152. return
  1153. }
  1154. if(this.deptBudgetList.contractProcessInfo.goodsNameKey){
  1155. if (
  1156. (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) ||
  1157. (this.deptBudgetList.contractProcessInfo.goodsNameKey < 100) ||
  1158. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1159. '.'
  1160. ) != -1 &&
  1161. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1162. (String(
  1163. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1164. ).indexOf('.') +
  1165. 1) >
  1166. 2)
  1167. ) {
  1168. this.$message({
  1169. message: '合同收入金额输入错误',
  1170. type: 'warning',
  1171. })
  1172. return
  1173. }
  1174. }
  1175. if (
  1176. (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) ||
  1177. (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
  1178. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1179. '.'
  1180. ) != -1 &&
  1181. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1182. (String(
  1183. this.deptBudgetList.contractProcessInfo.waterContent
  1184. ).indexOf('.') +
  1185. 1) >
  1186. 2)
  1187. ) {
  1188. this.$message({
  1189. message: '费用支出输入错误',
  1190. type: 'warning',
  1191. })
  1192. return
  1193. }
  1194. if (
  1195. (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
  1196. (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
  1197. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1198. '.'
  1199. ) != -1 &&
  1200. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1201. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1202. '.'
  1203. ) +
  1204. 1) >
  1205. 2)
  1206. ) {
  1207. this.$message({
  1208. message: '已开发票金额输入错误',
  1209. type: 'warning',
  1210. })
  1211. return
  1212. }
  1213. if (
  1214. (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
  1215. (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
  1216. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1217. '.'
  1218. ) != -1 &&
  1219. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1220. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1221. '.'
  1222. ) +
  1223. 1) >
  1224. 2)
  1225. ) {
  1226. this.$message({
  1227. message: '未开发票金额输入错误',
  1228. type: 'warning',
  1229. })
  1230. return
  1231. }
  1232. if (
  1233. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
  1234. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1235. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1236. '.'
  1237. ) != -1 &&
  1238. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1239. (String(
  1240. this.deptBudgetList.contractProcessInfo.mildewGrain
  1241. ).indexOf('.') +
  1242. 1) >
  1243. 2)
  1244. ) {
  1245. this.$message({
  1246. message: '未回款金额输入错误',
  1247. type: 'warning',
  1248. })
  1249. return
  1250. }
  1251. this.$confirm(`确定提交本次修改?`, {
  1252. cancelButtonText: '取消',
  1253. confirmButtonText: '确定',
  1254. type: 'warning'
  1255. })
  1256. .then(() => {
  1257. this.$refs.deptBudgetList.validate((valid) => {
  1258. if (valid) {
  1259. this.deptBudgetList.compId = this.compId
  1260. this.deptBudgetList.contractType = 1
  1261. editInfo(this.deptBudgetList)
  1262. .toPromise()
  1263. .then((response) => {
  1264. this.$message.success('编辑成功')
  1265. this.deptBudgetList = {}
  1266. this.$router.push({
  1267. path: 'salesContract'
  1268. })
  1269. })
  1270. } else {
  1271. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1272. return false
  1273. }
  1274. })
  1275. })
  1276. },
  1277. editInfo() {
  1278. editInfo({})
  1279. },
  1280. // getList(){}
  1281. },
  1282. }
  1283. </script>
  1284. <style lang="scss" scoped>
  1285. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1286. padding: 0 25px;
  1287. }
  1288. /deep/.ws-info-table .el-form-item {
  1289. border-right: 1px solid #cdd2dc;
  1290. border-bottom: 1px solid #cdd2dc;
  1291. }
  1292. .title {
  1293. position: relative;
  1294. }
  1295. .title::before {
  1296. content: '';
  1297. display: inline-block;
  1298. width: 5px;
  1299. height: 30px;
  1300. background: #5473e8;
  1301. position: absolute;
  1302. left: 0;
  1303. }
  1304. .el-button--primary {
  1305. background-color: #5878e8;
  1306. border-color: #5878e8;
  1307. }
  1308. .el-col {
  1309. background: #f6f7fc;
  1310. }
  1311. .readonly {
  1312. position: relative;
  1313. }
  1314. .readonly:after {
  1315. content: '*';
  1316. color: #ff2727;
  1317. position: absolute;
  1318. right: 8px;
  1319. z-index: 10;
  1320. top: 21%;
  1321. font-size: 20px;
  1322. }
  1323. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1324. padding: 0 25px;
  1325. border-left: 1px solid #cdd2dc;
  1326. background: #fafbfc;
  1327. }
  1328. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1329. width: 140px;
  1330. text-align: center;
  1331. background: #f0f2f6;
  1332. // border: 1px solid #cdd2dc;
  1333. }
  1334. .button-container {
  1335. display: flex;
  1336. flex-wrap: nowrap;
  1337. justify-content: space-between;
  1338. align-items: center;
  1339. background-color: #fff;
  1340. width: 100%;
  1341. height: 50px;
  1342. padding: 0 10px;
  1343. &>div {
  1344. margin-left: 10px;
  1345. display: flex;
  1346. flex-wrap: nowrap;
  1347. flex-direction: row;
  1348. &>span {
  1349. line-height: 50px;
  1350. }
  1351. }
  1352. /deep/.auditFlow-box {
  1353. position: unset;
  1354. margin-left: 10px;
  1355. &/deep/.auditFlow-icon {
  1356. width: auto;
  1357. padding-right: 30px;
  1358. }
  1359. &/deep/.auditFlow-main {
  1360. position: absolute;
  1361. }
  1362. }
  1363. }
  1364. .box-app {
  1365. display: inline-block;
  1366. margin-left: 30px;
  1367. line-height: 50px;
  1368. }
  1369. /deep/.el-dialog {
  1370. .el-form-item {
  1371. margin-bottom: 0 !important;
  1372. .el-input--medium {
  1373. textarea {
  1374. min-height: 100px !important;
  1375. }
  1376. }
  1377. }
  1378. }
  1379. .collapse-bottom {
  1380. margin-bottom: 20px;
  1381. }
  1382. .input-main .textarea .el-textarea__inner {
  1383. width: 100%;
  1384. z-index: 1;
  1385. }
  1386. .bg-left {
  1387. padding-left: 30px;
  1388. }
  1389. .bg-right {
  1390. padding: 10px;
  1391. text-align: right;
  1392. }
  1393. .bg-bottom {
  1394. margin: 6px 0px;
  1395. }
  1396. .wenzi {
  1397. width: 70%;
  1398. margin: 0 auto;
  1399. }
  1400. .wenzi h3 {
  1401. display: inline-block;
  1402. left: 30px;
  1403. }
  1404. .wenzi p {
  1405. display: inline-block;
  1406. }
  1407. .center {
  1408. width: 70%;
  1409. margin: 0 auto;
  1410. }
  1411. .el-form-item {
  1412. width: 50%;
  1413. }
  1414. .el-form-item__label {
  1415. text-align: center;
  1416. }
  1417. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1418. /* height: 82px;*/
  1419. /*}*/
  1420. // 控制select为只读的时候显示样式
  1421. .hide-sel {
  1422. .el-input__inner {
  1423. border: 0px;
  1424. }
  1425. .el-icon-arrow-up {
  1426. display: none;
  1427. }
  1428. .el-textarea__inner {
  1429. background-color: #fff !important;
  1430. border: 0;
  1431. }
  1432. .el-date-editor {
  1433. i {
  1434. display: none;
  1435. }
  1436. }
  1437. .is-disabled {
  1438. .el-input__inner:hover {
  1439. background-color: #fff !important;
  1440. border: 0;
  1441. }
  1442. color: #606266;
  1443. .el-input__inner {
  1444. background-color: #fff !important;
  1445. border: 0;
  1446. color: #606266;
  1447. }
  1448. .el-textarea__inner {
  1449. background-color: #fff !important;
  1450. border: 0;
  1451. color: #606266;
  1452. }
  1453. }
  1454. }
  1455. // 控制select为只读的时候显示样式
  1456. /deep/.ws-class-table-col {
  1457. height: auto;
  1458. padding: 0px 2px;
  1459. /deep/.el-input__inner {
  1460. padding: 0px 2px;
  1461. }
  1462. }
  1463. /deep/.is-disabled {
  1464. .el-input__prefix,
  1465. .el-input__suffix {
  1466. display: none;
  1467. }
  1468. .el-input__inner {
  1469. background-color: #fff;
  1470. border-color: #fff !important;
  1471. color: #000 !important;
  1472. font-size: 14px;
  1473. cursor: text;
  1474. padding: 0 !important;
  1475. }
  1476. }
  1477. .winseaview-view {
  1478. padding: 0 0 20px;
  1479. }
  1480. .container {
  1481. overflow: scroll;
  1482. height: 93vh;
  1483. }
  1484. //*号
  1485. .unchangeable {
  1486. position: absolute;
  1487. width: 9px;
  1488. height: 22px;
  1489. font-size: 16px;
  1490. font-family: PingFangSC-Medium, PingFang SC;
  1491. font-weight: 500;
  1492. color: #ff2727;
  1493. line-height: 22px;
  1494. display: inline-block;
  1495. right: 14px;
  1496. }
  1497. /deep/.el-input,
  1498. /deep/.el-date-editor {
  1499. font-size: 13px;
  1500. }
  1501. /deep/.el-textarea {
  1502. width: 101%;
  1503. margin: 0px;
  1504. }
  1505. /deep/el-date-editor--date {
  1506. width: 200px;
  1507. }
  1508. .unchanged {
  1509. position: absolute;
  1510. left: 37px;
  1511. width: 102px;
  1512. height: 14px;
  1513. font-size: 14px;
  1514. font-weight: 400;
  1515. color: #afb5cb;
  1516. line-height: 14px;
  1517. }
  1518. /deep/.el-input--small .el-input__inner {
  1519. height: 32px;
  1520. line-height: 32px;
  1521. }
  1522. /deep/.el-form-item.is-success .el-input__inner,
  1523. /deep/.el-cascader .el-input .el-input__inner,
  1524. /deep/.el-textarea__inner {
  1525. color: #8890b1;
  1526. }
  1527. .addressUrls {
  1528. width: 100%;
  1529. display: flex;
  1530. margin-top: 10px;
  1531. }
  1532. .addressUrls-item {
  1533. position: relative;
  1534. display: flex;
  1535. }
  1536. .icon-guanbi {
  1537. position: absolute;
  1538. right: 8px;
  1539. }
  1540. .addressUrl {
  1541. margin: 0px 10px;
  1542. border-radius: 3px;
  1543. }
  1544. //上传文件成功标识
  1545. /deep/.el-upload-list__item-status-label {
  1546. position: absolute;
  1547. right: 22px;
  1548. top: -1px;
  1549. line-height: inherit;
  1550. display: none;
  1551. }
  1552. .map {
  1553. position: fixed;
  1554. top: 0;
  1555. bottom: 0;
  1556. left: 0;
  1557. right: 0;
  1558. margin: auto;
  1559. width: 850px;
  1560. height: 400px;
  1561. background: gainsboro;
  1562. border-radius: 20px;
  1563. padding: 10px;
  1564. box-sizing: border-box;
  1565. z-index: 99;
  1566. }
  1567. .amap-container {
  1568. width: 100% !important;
  1569. }
  1570. .address-btn {
  1571. width: 100%;
  1572. text-align: left;
  1573. color:#000;
  1574. border:1px solid #ccc;
  1575. }
  1576. </style>