purchaseContractAdd.vue 54 KB

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