salesContractAdd.vue 60 KB

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