purchaseContractAdd.vue 47 KB

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