collectionContractAdd.vue 58 KB

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