purchaseContractAdd.vue 76 KB

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