salesContractAdd.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725
  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="vertion-align: bottom; margin-right: 3px"
  17. src="../../../public/img/lujing.png"
  18. alt=""
  19. />返回</el-button
  20. >
  21. </el-col>
  22. </el-row>
  23. <div class="wenzi">
  24. <h3>基本信息</h3>
  25. <p>
  26. &nbsp;&nbsp;注:基本信息和货物信息均为必填项,“*”
  27. 标记的条目提交后不可修改。
  28. </p>
  29. </div>
  30. <div class="center">
  31. <ws-form ref="deptBudgetList" :model="deptBudgetList">
  32. <!--基本信息-->
  33. <ws-info-table>
  34. <!--合同编号-->
  35. <ws-form-item
  36. label="合同编号"
  37. span="1"
  38. prop="contractNo"
  39. class="readonly"
  40. >
  41. <ws-input
  42. v-model="deptBudgetList.contractNo"
  43. placeholder="请输入合同编号"
  44. maxlength="20"
  45. size="small"
  46. :rules="ruleDeptBudget"
  47. />
  48. </ws-form-item>
  49. <!--运输方式-->
  50. <ws-form-item label="运输方式" span="1" prop="shippingType">
  51. <ws-input
  52. v-model="deptBudgetList.shippingType"
  53. placeholder="请输入运输方式"
  54. maxlength="20"
  55. size="small"
  56. />
  57. </ws-form-item>
  58. <!--买方-->
  59. <ws-form-item label="买方" span="1" prop="buyer" class="readonly">
  60. <ws-input
  61. v-model="deptBudgetList.buyer"
  62. placeholder="请输入买方名称"
  63. maxlength="100"
  64. size="small"
  65. />
  66. </ws-form-item>
  67. <!--结算方式-->
  68. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  69. <ws-input
  70. v-model="deptBudgetList.settlementMethod"
  71. placeholder="请输入结算方式"
  72. maxlength="120"
  73. size="small"
  74. />
  75. </ws-form-item>
  76. <!--卖方-->
  77. <ws-form-item label="卖方" span="1" prop="seller" class="readonly">
  78. <ws-input
  79. v-model="deptBudgetList.seller"
  80. placeholder="请输入卖方名称"
  81. maxlength="100"
  82. size="small"
  83. />
  84. </ws-form-item>
  85. <ws-form-item
  86. label="交货方式"
  87. span="1"
  88. prop="seller"
  89. class="readonly"
  90. >
  91. <el-radio v-model="deptBudgetList.deliverType" label="1"
  92. >我方送货</el-radio
  93. >
  94. <el-radio v-model="deptBudgetList.deliverType" label="2"
  95. >对方自提</el-radio
  96. >
  97. </ws-form-item>
  98. <!--买方电话-->
  99. <ws-form-item label="买方电话" span="1" prop="contractNo">
  100. <ws-input
  101. v-model.number="deptBudgetList.buyerPhone"
  102. placeholder="请输入买方电话"
  103. maxlength="100"
  104. size="small"
  105. />
  106. </ws-form-item>
  107. <!--包装方式-->
  108. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  109. <ws-select
  110. v-model="deptBudgetList.packingMethod"
  111. placeholder=""
  112. class="typeselect"
  113. @change="selectpackingMethod"
  114. >
  115. <ws-option
  116. v-for="item in packtypeList"
  117. :key="item.constKey"
  118. :label="item.constValue"
  119. :value="item.constValue"
  120. />
  121. </ws-select>
  122. </ws-form-item>
  123. <!--卖方电话-->
  124. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  125. <ws-input
  126. v-model="deptBudgetList.sellerPhone"
  127. placeholder="请输入卖方电话"
  128. maxlength="100"
  129. size="small"
  130. />
  131. </ws-form-item>
  132. <!--验收方式-->
  133. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  134. <el-select
  135. v-model="deptBudgetList.acceptanceMethod"
  136. placeholder="请选择验收方式"
  137. style="width: 100%"
  138. filterable
  139. @change="selectunitList"
  140. >
  141. <el-option
  142. v-for="(item, index) in unitList"
  143. :key="item.constValue"
  144. :label="item.constValue"
  145. :value="item.constValue"
  146. >
  147. <span class="unit-left" style="float: left">
  148. <span v-if="item.flag == 'delete'">
  149. {{ item.constValue }}</span
  150. >
  151. <!-- 新增文本框 -->
  152. <div
  153. style="width: 160px"
  154. v-if="item.flag !== 'delete'"
  155. @click.stop
  156. >
  157. <ws-input
  158. v-model="item.constValue"
  159. clearable
  160. maxlength="10"
  161. style="width: 100%"
  162. ></ws-input>
  163. </div>
  164. </span>
  165. <span style="float: right; color: #8492a6; font-size: 13px">
  166. <!-- 对号 -->
  167. <i
  168. class="el-icon-check"
  169. style="line-height: 29px; margin-left: 10px"
  170. v-if="item.flag !== 'delete'"
  171. @click.stop="saveClick(item, index)"
  172. ></i>
  173. <!-- 编辑 -->
  174. <i
  175. class="el-icon-edit"
  176. style="line-height: 29px; margin-left: 10px"
  177. v-if="item.flag == 'delete'"
  178. @click.stop="editClick(item, index)"
  179. ></i>
  180. <!-- 删除 -->
  181. <i
  182. class="el-icon-delete"
  183. style="line-height: 29px"
  184. @click.stop="deleteClick(item, index)"
  185. ></i>
  186. </span>
  187. </el-option>
  188. <!-- 新增按钮 -->
  189. <el-option value="" label="">
  190. <div
  191. style="
  192. text-align: right;
  193. border-top: 1px solid #dcdfe6;
  194. padding: 5px;
  195. "
  196. >
  197. <ws-button type="primary" @click.stop="addClick">{{
  198. $t('button.add')
  199. }}</ws-button>
  200. </div>
  201. </el-option>
  202. </el-select>
  203. </ws-form-item>
  204. <!--重量(吨)-->
  205. <ws-form-item label="重量(吨)" span="1" prop="weight">
  206. <ws-input
  207. v-model="deptBudgetList.weight"
  208. placeholder="请输入重量(吨)"
  209. maxlength="100"
  210. size="small"
  211. />
  212. </ws-form-item>
  213. <!--交货日期(起)-->
  214. <ws-form-item
  215. label="交货日期(起)"
  216. span="1"
  217. prop="deliveryDateStart"
  218. >
  219. <ws-date-picker
  220. v-model="deptBudgetList.deliveryDateStart"
  221. type="date"
  222. placeholder="请选择交货日期(起)"
  223. value-format="yyyy-MM-dd"
  224. />
  225. </ws-form-item>
  226. <!--溢短装(%)-->
  227. <ws-form-item label="溢短装(%)" span="1" prop="overShort">
  228. <ws-input
  229. v-model="deptBudgetList.overShort"
  230. placeholder="请输入溢短装比例(%)"
  231. maxlength="100"
  232. size="small"
  233. />
  234. </ws-form-item>
  235. <!--交货日期(止)-->
  236. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  237. <ws-date-picker
  238. v-model="deptBudgetList.deliveryDateEnd"
  239. type="date"
  240. placeholder="请选择交货日期(止)"
  241. value-format="yyyy-MM-dd"
  242. />
  243. </ws-form-item>
  244. <!--合同单价(元/吨)-->
  245. <ws-form-item
  246. class="readonly"
  247. label="合同单价(元/吨)"
  248. span="1"
  249. prop="unitContractPrice"
  250. >
  251. <ws-input
  252. v-model="deptBudgetList.unitContractPrice"
  253. placeholder="请输入合同单价"
  254. maxlength="100"
  255. size="small"
  256. />
  257. </ws-form-item>
  258. <!--合同总价-->
  259. <ws-form-item label="合同总价" span="1" prop="totalContractPrice">
  260. <ws-input
  261. v-model="deptBudgetList.totalContractPrice"
  262. placeholder="请输入合同总价"
  263. maxlength="100"
  264. size="small"
  265. />
  266. </ws-form-item>
  267. <ws-form-item label="货源所在地区" span="1" prop="sourceGoods">
  268. <el-cascader
  269. :options="options_"
  270. v-model="selectedOptions"
  271. clearable
  272. size="large"
  273. placeholder="请选择货源所在地区"
  274. style="width: 200%"
  275. @change="handleChange"
  276. />
  277. </ws-form-item>
  278. <ws-form-item label="货源详细地址" span="1" prop="sourceGoods">
  279. <ws-input
  280. v-model="deptBudgetList.sourceGoods"
  281. placeholder="请输入货源详细地址"
  282. maxlength="20"
  283. size="small"
  284. />
  285. </ws-form-item>
  286. <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
  287. <el-cascader
  288. :options="options_"
  289. v-model="selectedOptions1"
  290. clearable
  291. size="large"
  292. placeholder="请选择交货所在地区"
  293. style="width: 200%"
  294. @change="handleChange1"
  295. />
  296. </ws-form-item>
  297. <ws-form-item label="交货详细地址" span="1" prop="placeDelivery">
  298. <ws-input
  299. v-model="deptBudgetList.placeDelivery"
  300. placeholder="请输入交货详细地址"
  301. maxlength="20"
  302. size="small"
  303. />
  304. </ws-form-item>
  305. <!--签订日期-->
  306. <ws-form-item label="签订日期" span="1" prop="signingDate">
  307. <ws-date-picker
  308. v-model="deptBudgetList.signingDate"
  309. type="date"
  310. placeholder="请选择合同签订日期"
  311. value-format="yyyy-MM-dd"
  312. />
  313. </ws-form-item>
  314. <ws-form-item
  315. label="最终实际成交量(吨)"
  316. span="1"
  317. prop="finalTradingVolume"
  318. >
  319. <ws-input
  320. v-model="deptBudgetList.finalTradingVolume"
  321. placeholder="请输入最终实际成交量"
  322. maxlength="100"
  323. size="small"
  324. />
  325. </ws-form-item>
  326. </ws-info-table>
  327. </ws-form>
  328. </div>
  329. <div class="wenzi">
  330. <h3>货物信息</h3>
  331. </div>
  332. <div class="center">
  333. <ws-form
  334. ref="deptBudgetList"
  335. :rules="ruleDeptBudget"
  336. :model="deptBudgetList"
  337. >
  338. <!--货物信息-->
  339. <ws-info-table>
  340. <!--货名-->
  341. <ws-form-item label="货名" span="1" prop="goodsName" class="readonly">
  342. <ws-select
  343. v-model="deptBudgetList.contractGoodsInfo.goodsName"
  344. placeholder=""
  345. class="typeselect"
  346. @change="selectpackingMethod"
  347. >
  348. <ws-option
  349. v-for="item in goodnameList"
  350. :key="item.constKey"
  351. :label="item.constValue"
  352. :value="item.constValue"
  353. />
  354. </ws-select>
  355. </ws-form-item>
  356. <!--水分(%)<=-->
  357. <ws-form-item label="水分(%)" span="1" prop="waterContent">
  358. <ws-input
  359. v-model="deptBudgetList.contractGoodsInfo.waterContent"
  360. placeholder="请输入水分占比"
  361. maxlength="100"
  362. size="small"
  363. />
  364. </ws-form-item>
  365. <!--品级-->
  366. <ws-form-item label="品级" span="1" prop="grade" class="readonly">
  367. <ws-select
  368. v-model="deptBudgetList.contractGoodsInfo.grade"
  369. placeholder=""
  370. class="typeselect"
  371. @change="selectgrade"
  372. >
  373. <ws-option
  374. v-for="item in gradeList"
  375. :key="item.constKey"
  376. :label="item.constValue"
  377. :value="item.constValue"
  378. />
  379. </ws-select>
  380. </ws-form-item>
  381. <!--杂质(%)<=-->
  382. <ws-form-item label="杂质(%)" span="1" prop="impurity">
  383. <ws-input
  384. v-model="deptBudgetList.contractGoodsInfo.impurity"
  385. placeholder="请输入杂质占比(%)"
  386. maxlength="40"
  387. size="small"
  388. />
  389. </ws-form-item>
  390. <!--容量(克/升)>=-->
  391. <ws-form-item label="容量(克/升)" span="1" prop="bulkDensity">
  392. <ws-input
  393. v-model="deptBudgetList.contractGoodsInfo.bulkDensity"
  394. placeholder="请输入容重"
  395. maxlength="40"
  396. size="small"
  397. />
  398. </ws-form-item>
  399. <!--霉变粒(%)<=-->
  400. <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
  401. <ws-input
  402. v-model="deptBudgetList.contractGoodsInfo.mildewGrain"
  403. placeholder="请输入霉变粒占比(%)"
  404. maxlength="40"
  405. size="small"
  406. />
  407. </ws-form-item>
  408. <!--热损伤(%)<=-->
  409. <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
  410. <ws-input
  411. v-model="deptBudgetList.contractGoodsInfo.jiaorenli"
  412. placeholder="请输入输入热损伤占比(%)"
  413. maxlength="40"
  414. size="small"
  415. />
  416. </ws-form-item>
  417. <!--不完整粒(%)<=-->
  418. <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
  419. <ws-input
  420. v-model="deptBudgetList.contractGoodsInfo.imperfectGrain"
  421. placeholder="请输入不完整粒占比(%)"
  422. maxlength="40"
  423. size="small"
  424. />
  425. </ws-form-item>
  426. </ws-info-table>
  427. </ws-form>
  428. </div>
  429. <div class="wenzi">
  430. <h3>流程信息</h3>
  431. </div>
  432. <div class="center">
  433. <ws-form
  434. ref="deptBudgetList"
  435. :rules="ruleDeptBudget"
  436. :model="deptBudgetList"
  437. >
  438. <!--流程信息-->
  439. <ws-info-table>
  440. <!--合同收入(元)-->
  441. <ws-form-item label="合同收入(元)" span="1" prop="goodsNameKey">
  442. <ws-input
  443. v-model="deptBudgetList.contractProcessInfo.goodsNameKey"
  444. placeholder="请输入合同收入(元)"
  445. maxlength="100"
  446. size="small"
  447. />
  448. </ws-form-item>
  449. <!--已开发票(元)-->
  450. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  451. <ws-input
  452. v-model="deptBudgetList.contractProcessInfo.goodsName"
  453. placeholder="请输入已开发票(元)"
  454. maxlength="100"
  455. size="small"
  456. />
  457. </ws-form-item>
  458. <!--费用支出(元)-->
  459. <ws-form-item label="费用支出(元)" span="1" prop="waterContent">
  460. <ws-input
  461. v-model="deptBudgetList.contractProcessInfo.waterContent"
  462. placeholder="请输入费用支出(元)"
  463. maxlength="100"
  464. size="small"
  465. />
  466. </ws-form-item>
  467. <!--未开发票(元)-->
  468. <ws-form-item label="未开发票(元)" span="1" prop="impurity">
  469. <ws-input
  470. v-model="deptBudgetList.contractProcessInfo.impurity"
  471. placeholder="请输入未开发票(元)"
  472. maxlength="100"
  473. size="small"
  474. />
  475. </ws-form-item>
  476. <!--未回款(元)-->
  477. <ws-form-item label="未回款(元)" span="1" prop="mildewGrain">
  478. <ws-input
  479. v-model="deptBudgetList.contractProcessInfo.mildewGrain"
  480. placeholder="请输入未回款(元)"
  481. maxlength="100"
  482. size="small"
  483. />
  484. </ws-form-item>
  485. <!--已完成发货量(吨)-->
  486. <!-- <ws-form-item
  487. label="已完成发运量(吨)"
  488. span="1"
  489. prop="imperfectGrain"
  490. >
  491. <ws-input
  492. v-model="deptBudgetList.contractProcessInfo.imperfectGrain"
  493. placeholder="请输入已完成发运量(吨)"
  494. maxlength="100"
  495. size="small"
  496. />
  497. </ws-form-item> -->
  498. <!--双章原件回收情况-->
  499. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  500. <ws-select
  501. v-model="deptBudgetList.contractProcessInfo.grade"
  502. placeholder=""
  503. class="typeselect"
  504. @change="selectpackingMethod"
  505. >
  506. <ws-option
  507. v-for="item in ChapterTwoList"
  508. :key="item.constKey"
  509. :label="item.constValue"
  510. :value="item.constValue"
  511. />
  512. </ws-select>
  513. </ws-form-item>
  514. </ws-info-table>
  515. </ws-form>
  516. </div>
  517. <div class="wenzi">
  518. <h3>备注信息</h3>
  519. </div>
  520. <div class="ce">
  521. <ws-form
  522. ref="deptBudgetList"
  523. :rules="ruleDeptBudget"
  524. :model="deptBudgetList"
  525. >
  526. <!--备注信息-->
  527. <ws-input
  528. v-model="deptBudgetList.remarks"
  529. type="textarea"
  530. row="3"
  531. placeholder="请输入备注信息,不超过200字"
  532. maxlength="200"
  533. />
  534. <!-- <el-upload
  535. action="https://www.zthymaoyi.com/upload/admin"
  536. :show-file-list="false"
  537. :on-success="
  538. (res, file) => {
  539. uploadSuccessHandle(res)
  540. }
  541. "
  542. class="avatar-uploader"
  543. accept=".jpg, .jpeg, .png,.gif, .pdf, .doc, .zip, .rar"
  544. >
  545. <el-button style="margin-top: 10px">上传附件</el-button>
  546. </el-upload>
  547. <div class="addressUrls" v-if="addressUrls != null">
  548. <div class="addressUrls-item">
  549. <div
  550. v-for="(item, index) in addressUrls"
  551. class="addressUrl"
  552. :key="index"
  553. >
  554. <div @click="close(index)" class="iconfont icon-guanbi"></div>
  555. <img
  556. v-if="addressUrls != null"
  557. width="100"
  558. height="100"
  559. :src="item"
  560. alt=""
  561. />
  562. </div>
  563. </div>
  564. </div> -->
  565. <el-upload
  566. class="upload-demo"
  567. action="https://www.zthymaoyi.com/upload/admin"
  568. :on-success="
  569. (res, file) => {
  570. uploadSuccessHandle(res)
  571. }
  572. "
  573. multiple
  574. :limit="3"
  575. :file-list="fileList"
  576. >
  577. <el-button size="small" type="primary">上传附件</el-button>
  578. <div slot="tip" class="el-upload__tip">
  579. 推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
  580. </div>
  581. </el-upload>
  582. </ws-form>
  583. </div>
  584. <div style="text-align: right; padding: 10px" class="center">
  585. <el-button
  586. class="bg-bottom"
  587. type="primary"
  588. size="small"
  589. @click="submit(deptBudgetList)"
  590. >提交</el-button
  591. >
  592. </div>
  593. </div>
  594. </template>
  595. <script>
  596. // import { getVesselOne } from '@/model/procurement/basic'
  597. // import { dayjs } from 'base-core-lib'
  598. import {
  599. packList,
  600. addList,
  601. xiala,
  602. addxiala,
  603. editxiala,
  604. delxiala,
  605. } from '@/model/contarct/index'
  606. import WsUpload from '@/components/WsUpload'
  607. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  608. import thirdPartyInspectionReportAddVue from '../system/shipInspection/thirdPartyInspectionReportAdd.vue'
  609. export default {
  610. name: 'viewSpareMoney',
  611. components: {
  612. WsUpload,
  613. },
  614. watch: {
  615. vesselId(val) {
  616. this.getVesselData()
  617. },
  618. isShow(val) {
  619. this.showType = val
  620. },
  621. },
  622. data() {
  623. return {
  624. //弹出框
  625. dialogViewSpareMoney: false,
  626. dialogApproveFormVisible: false,
  627. // 船舶类型
  628. monetaryKey: null,
  629. // 表格显示数据
  630. tableDate: [],
  631. // 是否显示
  632. showType: true,
  633. // 年
  634. year: '',
  635. options_: regionData,
  636. selectedOptions: [],
  637. selectedOptions1: [],
  638. // 提交类型
  639. submitType: true,
  640. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  641. trainingMethods: {},
  642. packtypeList: [],
  643. compId: sessionStorage.getItem('ws-pf_compId'),
  644. mainReportAdd: {},
  645. appendixIdsAdd: '',
  646. size: 10,
  647. // uploadSuccess: {},
  648. // onChange:{},
  649. unitList: [],
  650. goodnameList: [],
  651. gradeList: [],
  652. ChapterTwoList: [],
  653. addressUrls: [],
  654. deptBudgetList: {
  655. deliverType: '1',
  656. finalTradingVolume: 0,
  657. contractGoodsInfo: {
  658. goodsName: '',
  659. },
  660. contractProcessInfo: {},
  661. addressUrl: '',
  662. },
  663. pickerBeginDateBefore: {
  664. disabledDate: (time) => {
  665. return time.getTime() > Date.now()
  666. },
  667. },
  668. ruleDeptBudget: {
  669. contractNo: [
  670. { required: true, message: '请输入活动名称', trigger: 'blur' },
  671. {
  672. min: 6,
  673. max: 20,
  674. message: '长度在 6 到 20 个字符',
  675. trigger: 'blur',
  676. },
  677. ],
  678. },
  679. selectIntendedShip: {},
  680. interviewTypeList: {},
  681. fileList:[],
  682. }
  683. },
  684. activated() {
  685. //cg.viewBudget
  686. //cg.viewSpareMoney
  687. // this.getVesselData();
  688. this.deptBudgetList.packingMethod = '散装'
  689. this.deptBudgetList.packingMethodKey = 1
  690. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  691. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  692. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  693. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  694. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  695. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  696. this.loaddata()
  697. this.showType = this.isShow
  698. },
  699. methods: {
  700. close(index) {
  701. this.addressUrls.splice(index, 1)
  702. },
  703. // 关闭 dialog时 处理文件url 初始化upload组件
  704. handleClose() {
  705. this.dialogViewSpareMoney = false
  706. },
  707. handleChange(value) {
  708. this.selectedOptions = value
  709. },
  710. handleChange1(value) {
  711. this.selectedOptions1 = value
  712. },
  713. returnsales() {
  714. this.$router.push({ path: 'salesContract' })
  715. },
  716. loaddata() {
  717. // 包装方式
  718. packList({ constId: 'CON1' })
  719. .toPromise()
  720. .then((response) => {
  721. this.packtypeList = response
  722. })
  723. // 验收方式
  724. this.getUnitList()
  725. // 货名
  726. packList({ constId: 'CON2' })
  727. .toPromise()
  728. .then((response) => {
  729. this.goodnameList = response
  730. })
  731. // 品级
  732. packList({ constId: 'CON3' })
  733. .toPromise()
  734. .then((response) => {
  735. this.gradeList = response
  736. })
  737. // 双章
  738. packList({ constId: 'CON4' })
  739. .toPromise()
  740. .then((response) => {
  741. this.ChapterTwoList = response
  742. })
  743. },
  744. // 上传附件
  745. uploadSuccessHandle(e) {
  746. this.addressUrls.push(e.url)
  747. this.deptBudgetList.addressUrl = this.addressUrls.toString
  748. },
  749. onChange(files) {
  750. this.fileNum = files
  751. this.$refs.upload.handleSaveBill().then((res) => {
  752. console.log(files)
  753. })
  754. },
  755. getUnitList() {
  756. xiala({
  757. compId: sessionStorage.getItem('ws-pf_compId'),
  758. constCode: 'TYPEYAN',
  759. })
  760. .toPromise()
  761. .then((response) => {
  762. this.unitList = response
  763. let currItem
  764. this.unitList.forEach((item, index, arr) => {
  765. item.flag = 'delete'
  766. if (this.vModel == item.constKey) {
  767. currItem = item
  768. }
  769. })
  770. //
  771. if (currItem) {
  772. this.selectContract(currItem.constValue)
  773. }
  774. })
  775. },
  776. submit() {
  777. if (!this.deptBudgetList.contractNo) {
  778. this.$message({
  779. message: '请输入合同编号',
  780. type: 'warning',
  781. })
  782. return
  783. }
  784. if (
  785. this.deptBudgetList.contractNo.length < 6 ||
  786. this.deptBudgetList.contractNo.length > 20
  787. ) {
  788. this.$message({
  789. message: '合同编号长度不符合要求,请输入6到20个字符之内!',
  790. type: 'warning',
  791. })
  792. return
  793. }
  794. if (!this.deptBudgetList.shippingType) {
  795. this.$message({
  796. message: '请输入运输方式!',
  797. type: 'warning',
  798. })
  799. return
  800. }
  801. if (
  802. this.deptBudgetList.shippingType.length < 1 ||
  803. this.deptBudgetList.shippingType.length > 20
  804. ) {
  805. this.$message({
  806. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  807. type: 'warning',
  808. })
  809. return
  810. }
  811. if (!this.deptBudgetList.buyer) {
  812. this.$message({
  813. message: '请输入买方名称!',
  814. type: 'warning',
  815. })
  816. return
  817. }
  818. if (this.deptBudgetList.buyer.length > 30) {
  819. this.$message({
  820. message: '买方名称长度不符合要求,请输入30个字符之内!',
  821. type: 'warning',
  822. })
  823. return
  824. }
  825. if (!this.deptBudgetList.seller) {
  826. this.$message({
  827. message: '请输入卖方名称!',
  828. type: 'warning',
  829. })
  830. return
  831. }
  832. if (this.deptBudgetList.seller.length > 30) {
  833. this.$message({
  834. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  835. type: 'warning',
  836. })
  837. return
  838. }
  839. if (!this.deptBudgetList.buyerPhone) {
  840. this.$message({
  841. message: '请输入买方电话!',
  842. type: 'warning',
  843. })
  844. return
  845. }
  846. if (isNaN(this.deptBudgetList.buyerPhone)) {
  847. this.$message({
  848. message: '输入买方电话有误!',
  849. type: 'warning',
  850. })
  851. return
  852. }
  853. if (
  854. this.deptBudgetList.buyerPhone.length < 7 ||
  855. this.deptBudgetList.buyerPhone.length > 20
  856. ) {
  857. this.$message({
  858. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  859. type: 'warning',
  860. })
  861. return
  862. }
  863. if (!this.deptBudgetList.sellerPhone) {
  864. this.$message({
  865. message: '请输入卖方电话!',
  866. type: 'warning',
  867. })
  868. return
  869. }
  870. if (isNaN(this.deptBudgetList.sellerPhone)) {
  871. this.$message({
  872. message: '输入卖方电话有误!',
  873. type: 'warning',
  874. })
  875. return
  876. }
  877. if (
  878. this.deptBudgetList.buyerPhone.length < 7 ||
  879. this.deptBudgetList.buyerPhone.length > 20
  880. ) {
  881. this.$message({
  882. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  883. type: 'warning',
  884. })
  885. return
  886. }
  887. if (!this.deptBudgetList.settlementMethod) {
  888. this.$message({
  889. message: '请输入结算方式!',
  890. type: 'warning',
  891. })
  892. return
  893. }
  894. if (!this.deptBudgetList.sourceGoods) {
  895. this.$message({
  896. message: '请输入货源详细地址!',
  897. type: 'warning',
  898. })
  899. return
  900. }
  901. if (!this.deptBudgetList.placeDelivery) {
  902. this.$message({
  903. message: '请输入交货详细地址!',
  904. type: 'warning',
  905. })
  906. return
  907. }
  908. if (this.selectedOptions.length == 0) {
  909. this.$message({
  910. message: '请选择货源所在地区!',
  911. type: 'warning',
  912. })
  913. return
  914. }
  915. if (this.selectedOptions1.length == 0) {
  916. this.$message({
  917. message: '请选择交货所在地区!',
  918. type: 'warning',
  919. })
  920. return
  921. }
  922. if (!this.deptBudgetList.weight) {
  923. this.$message({
  924. message: '请输入重量!',
  925. type: 'warning',
  926. })
  927. return
  928. }
  929. if (
  930. isNaN(this.deptBudgetList.weight) ||
  931. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  932. String(this.deptBudgetList.weight).length -
  933. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  934. 3) ||
  935. this.deptBudgetList.weight < 0 ||
  936. this.deptBudgetList.weight > 200000
  937. ) {
  938. this.$message({
  939. message: '输入重量有误!',
  940. type: 'warning',
  941. })
  942. return
  943. }
  944. if (
  945. !this.deptBudgetList.overShort &&
  946. isNaN(this.deptBudgetList.overShort)
  947. ) {
  948. this.$message({
  949. message: '溢短装输入有误!',
  950. type: 'warning',
  951. })
  952. return
  953. }
  954. if (
  955. !this.deptBudgetList.unitContractPrice &&
  956. isNaN(this.deptBudgetList.unitContractPrice)
  957. ) {
  958. this.$message({
  959. message: '合同单价输入有误!',
  960. type: 'warning',
  961. })
  962. return
  963. }
  964. if (
  965. !this.deptBudgetList.totalContractPrice &&
  966. isNaN(this.deptBudgetList.totalContractPrice)
  967. ) {
  968. this.$message({
  969. message: '合同总价输入有误!',
  970. type: 'warning',
  971. })
  972. return
  973. }
  974. if (!this.deptBudgetList.deliveryDateStart) {
  975. this.$message({
  976. message: '请选择交货日期(起)',
  977. type: 'warning',
  978. })
  979. return
  980. }
  981. if (!this.deptBudgetList.deliveryDateEnd) {
  982. this.$message({
  983. message: '请选择交货日期(止)',
  984. type: 'warning',
  985. })
  986. return
  987. }
  988. //时间
  989. if (
  990. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  991. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  992. ) {
  993. this.$message({
  994. message: '交货日期(止)选择错误',
  995. type: 'warning',
  996. })
  997. return
  998. }
  999. if (!this.deptBudgetList.signingDate) {
  1000. this.$message({
  1001. message: '请选择签订日期',
  1002. type: 'warning',
  1003. })
  1004. return
  1005. }
  1006. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1007. this.$message({
  1008. message: '请选择货名',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1014. this.$message({
  1015. message: '请输入水分',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1021. this.$message({
  1022. message: '请选择品级',
  1023. type: 'warning',
  1024. })
  1025. return
  1026. }
  1027. if (
  1028. !this.deptBudgetList.contractGoodsInfo.impurity ||
  1029. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
  1030. -1 &&
  1031. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1032. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
  1033. '.'
  1034. ) +
  1035. 1) >
  1036. 2)
  1037. ) {
  1038. this.$message({
  1039. message: '杂质输入错误',
  1040. type: 'warning',
  1041. })
  1042. return
  1043. }
  1044. if (
  1045. !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
  1046. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1047. '.'
  1048. ) != -1 &&
  1049. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1050. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1051. '.'
  1052. ) +
  1053. 1) >
  1054. 2)
  1055. ) {
  1056. this.$message({
  1057. message: '容重输入错误',
  1058. type: 'warning',
  1059. })
  1060. return
  1061. }
  1062. if (
  1063. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1064. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1065. '.'
  1066. ) != -1 &&
  1067. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1068. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1069. '.'
  1070. ) +
  1071. 1) >
  1072. 2)
  1073. ) {
  1074. this.$message({
  1075. message: '霉变粒输入错误',
  1076. type: 'warning',
  1077. })
  1078. return
  1079. }
  1080. if (
  1081. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1082. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1083. -1 &&
  1084. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1085. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1086. '.'
  1087. ) +
  1088. 1) >
  1089. 2)
  1090. ) {
  1091. this.$message({
  1092. message: '热损伤输入错误',
  1093. type: 'warning',
  1094. })
  1095. return
  1096. }
  1097. if (
  1098. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1099. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1100. '.'
  1101. ) != -1 &&
  1102. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1103. (String(
  1104. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1105. ).indexOf('.') +
  1106. 1) >
  1107. 2)
  1108. ) {
  1109. this.$message({
  1110. message: '不完整粒输入错误',
  1111. type: 'warning',
  1112. })
  1113. return
  1114. }
  1115. if (
  1116. (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
  1117. (this.deptBudgetList.contractProcessInfo.goodsNameKey < 0) ||
  1118. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1119. '.'
  1120. ) != -1 &&
  1121. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1122. (String(
  1123. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1124. ).indexOf('.') +
  1125. 1) >
  1126. 2)
  1127. ) {
  1128. this.$message({
  1129. message: '合同收入金额输入错误',
  1130. type: 'warning',
  1131. })
  1132. return
  1133. }
  1134. if (
  1135. (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
  1136. (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
  1137. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1138. '.'
  1139. ) != -1 &&
  1140. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1141. (String(
  1142. this.deptBudgetList.contractProcessInfo.waterContent
  1143. ).indexOf('.') +
  1144. 1) >
  1145. 2)
  1146. ) {
  1147. this.$message({
  1148. message: '费用金额输入错误',
  1149. type: 'warning',
  1150. })
  1151. return
  1152. }
  1153. if (
  1154. (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
  1155. (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
  1156. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1157. '.'
  1158. ) != -1 &&
  1159. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1160. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1161. '.'
  1162. ) +
  1163. 1) >
  1164. 2)
  1165. ) {
  1166. this.$message({
  1167. message: '已开发票金额输入错误',
  1168. type: 'warning',
  1169. })
  1170. return
  1171. }
  1172. if (
  1173. (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
  1174. (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
  1175. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1176. '.'
  1177. ) != -1 &&
  1178. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1179. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1180. '.'
  1181. ) +
  1182. 1) >
  1183. 2)
  1184. ) {
  1185. this.$message({
  1186. message: '未开发票金额输入错误',
  1187. type: 'warning',
  1188. })
  1189. return
  1190. }
  1191. // if (
  1192. // (this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
  1193. // (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
  1194. // (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
  1195. // '.'
  1196. // ) != -1 &&
  1197. // String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
  1198. // .length -
  1199. // (String(
  1200. // this.deptBudgetList.contractProcessInfo.imperfectGrain
  1201. // ).indexOf('.') +
  1202. // 1) >
  1203. // 2)
  1204. // ) {
  1205. // this.$message({
  1206. // message: '已完成发运量输入错误',
  1207. // type: 'warning',
  1208. // })
  1209. // return
  1210. // }
  1211. if (
  1212. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
  1213. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1214. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1215. '.'
  1216. ) != -1 &&
  1217. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1218. (String(
  1219. this.deptBudgetList.contractProcessInfo.mildewGrain
  1220. ).indexOf('.') +
  1221. 1) >
  1222. 2)
  1223. ) {
  1224. this.$message({
  1225. message: '未回款金额输入错误',
  1226. type: 'warning',
  1227. })
  1228. return
  1229. }
  1230. this.$refs.deptBudgetList.validate((valid) => {
  1231. if (valid) {
  1232. this.deptBudgetList.sourceProvince =
  1233. CodeToText[this.selectedOptions[0]]
  1234. this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
  1235. this.deptBudgetList.deliveryProvince =
  1236. CodeToText[this.selectedOptions1[0]]
  1237. this.deptBudgetList.deliveryCity =
  1238. CodeToText[this.selectedOptions1[1]]
  1239. this.deptBudgetList.compId = this.compId
  1240. this.deptBudgetList.contractType = 1
  1241. this.deptBudgetList.goodsType = 1
  1242. if (
  1243. this.deptBudgetList.deliveryProvince == '澳门特别行政区' ||
  1244. this.deptBudgetList.deliveryProvince == '澳门特别行政区'
  1245. ) {
  1246. this.deptBudgetList.deliveryArea = '特别行政区'
  1247. } else {
  1248. this.deptBudgetList.deliveryArea =
  1249. CodeToText[this.selectedOptions1[2]]
  1250. }
  1251. if (
  1252. this.deptBudgetList.sourceProvince == '澳门特别行政区' ||
  1253. this.deptBudgetList.sourceProvince == '澳门特别行政区'
  1254. ) {
  1255. this.deptBudgetList.sourceArea = '特别行政区'
  1256. } else {
  1257. this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
  1258. }
  1259. this.deptBudgetList.addressUrl = this.addressUrls.toString()
  1260. addList(this.deptBudgetList)
  1261. .toPromise()
  1262. .then((response) => {
  1263. this.$message.success('添加成功')
  1264. this.deptBudgetList = {
  1265. deliverType: '1',
  1266. finalTradingVolume: 0,
  1267. contractGoodsInfo: {
  1268. goodsName: '',
  1269. },
  1270. contractProcessInfo: {},
  1271. }
  1272. this.$router.push({ path: 'salesContract' })
  1273. })
  1274. } else {
  1275. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1276. return false
  1277. }
  1278. })
  1279. },
  1280. resetForm(deptBudgetList) {
  1281. this.$refs[deptBudgetList].resetFields()
  1282. },
  1283. saveClick(item, index) {
  1284. console.log(item)
  1285. if (Object.is(item.id, 1)) {
  1286. return
  1287. }
  1288. if (Object.is(this.unitList[index].flag, 'delete')) {
  1289. this.$set(this.unitList, index, { flag: 'check' })
  1290. } else {
  1291. this.$set(this.unitList, index, { flag: 'delete' })
  1292. }
  1293. if (!item.constValue) {
  1294. this.unitList.splice(index, 1)
  1295. return
  1296. }
  1297. if (item.flag == 'add') {
  1298. item.constKey = Math.random() * 20
  1299. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  1300. this.trainingMethods.constKey = item.constKey
  1301. this.trainingMethods.constCode = 'TYPEYAN'
  1302. this.trainingMethods.constValue = item.constValue
  1303. this.trainingMethods.id = item.id
  1304. addxiala(this.trainingMethods)
  1305. .toPromise()
  1306. .then((response) => {
  1307. this.getUnitList()
  1308. })
  1309. } else if (item.flag == 'check') {
  1310. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  1311. this.trainingMethods.constKey = item.constKey
  1312. this.trainingMethods.constCode = 'TYPEYAN'
  1313. this.trainingMethods.constValue = item.constValue
  1314. this.trainingMethods.id = item.id
  1315. editxiala(this.trainingMethods)
  1316. .toPromise()
  1317. .then((response) => {
  1318. this.getUnitList()
  1319. })
  1320. }
  1321. },
  1322. // selectContract(val) {
  1323. // let key = this.unitList.find((item) => item.constValue === val).constKey
  1324. // this.pleaseChoose = val
  1325. // },
  1326. handleExamine() {},
  1327. approve() {},
  1328. // returnsales() {
  1329. // this.$router.push({ path: 'purchaseContract' })
  1330. // },
  1331. addClick() {
  1332. // let [flag, constValue, constKey] = ['check', '', '']
  1333. // let obj = { flag, constValue, constKey }
  1334. // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
  1335. // let result = this.unitList.filter((item, val, arr) => {
  1336. // return item.id != '1'
  1337. // })
  1338. // result.push(obj)
  1339. // result.push(objAdd)
  1340. // this.unitList = result
  1341. this.unitList.push({
  1342. flag: 'add',
  1343. constValue: '',
  1344. constKey: '',
  1345. })
  1346. },
  1347. selectChapterTwo(e) {
  1348. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1349. if (this.ChapterTwoList[i].constValue == e) {
  1350. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1351. }
  1352. }
  1353. },
  1354. selectunitList(e) {
  1355. for (var i = 0; i < this.unitList.length; i++) {
  1356. if (this.unitList[i].constValue == e) {
  1357. this.deptBudgetList.packingMethodKey = this.unitList[i].constKey
  1358. }
  1359. }
  1360. },
  1361. selectgrade(e) {
  1362. for (var i = 0; i < this.gradeList.length; i++) {
  1363. if (this.gradeList[i].constValue == e) {
  1364. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1365. }
  1366. }
  1367. },
  1368. selectgoodsName(e) {
  1369. for (var i = 0; i < this.goodnameList.length; i++) {
  1370. if (this.goodnameList[i].constValue == e) {
  1371. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1372. }
  1373. }
  1374. },
  1375. selectpackingMethod(e) {
  1376. for (var i = 0; i < this.packtypeList.length; i++) {
  1377. if (this.packtypeList[i].constValue == e) {
  1378. this.deptBudgetList.acceptanceMethodKey =
  1379. this.packtypeList[i].constKey
  1380. }
  1381. }
  1382. },
  1383. // 编辑
  1384. editClick(item, index) {
  1385. const map = JSON.parse(JSON.stringify(item))
  1386. if (Object.is(item.id, 1)) {
  1387. return
  1388. }
  1389. if (Object.is(this.unitList[index].flag, 'delete')) {
  1390. map.flag = 'check'
  1391. this.$set(this.unitList, index, map)
  1392. } else {
  1393. map.flag = 'delete'
  1394. this.$set(this.unitList, index, map)
  1395. }
  1396. },
  1397. // 删除
  1398. deleteClick(item, index) {
  1399. if (Object.is(item.constKey, 1)) {
  1400. return
  1401. }
  1402. if (!item.constValue) {
  1403. this.unitList.splice(index, 1)
  1404. return
  1405. }
  1406. delxiala({ id: this.unitList[index].id })
  1407. .toPromise()
  1408. .then((response) => {
  1409. this.getUnitList()
  1410. this.pleaseChoose = ''
  1411. })
  1412. },
  1413. },
  1414. }
  1415. </script>
  1416. <style lang="scss" scoped>
  1417. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1418. padding: 0 25px;
  1419. }
  1420. /deep/.ws-info-table .el-form-item {
  1421. border-right: 1px solid #cdd2dc;
  1422. border-bottom: 1px solid #cdd2dc;
  1423. }
  1424. .title {
  1425. position: relative;
  1426. }
  1427. .title::before {
  1428. content: '';
  1429. display: inline-block;
  1430. width: 5px;
  1431. height: 30px;
  1432. background: #5473e8;
  1433. position: absolute;
  1434. left: 0;
  1435. }
  1436. .el-button--primary {
  1437. background-color: #5878e8;
  1438. border-color: #5878e8;
  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. </style>