purchaseContractAdd.vue 73 KB

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