purchaseContractAdd.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614
  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. </ws-form>
  519. <div style="text-align: right; padding: 10px" class="center">
  520. <el-button
  521. class="bg-bottom"
  522. type="primary"
  523. size="small"
  524. @click="submit(deptBudgetList)"
  525. >提交</el-button
  526. >
  527. </div>
  528. </div>
  529. </template>
  530. <script>
  531. // import { getVesselOne } from '@/model/procurement/basic'
  532. // import { dayjs } from 'base-core-lib'
  533. import {
  534. packList,
  535. addList,
  536. xiala,
  537. addxiala,
  538. editxiala,
  539. delxiala,
  540. getstaff,
  541. } from '@/model/contarct/index'
  542. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  543. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  544. import WsUpload from '@/components/WsUpload'
  545. export default {
  546. name: 'viewSpareMoney',
  547. components: {
  548. WsUpload,
  549. },
  550. watch: {
  551. vesselId(val) {
  552. this.getVesselData()
  553. },
  554. isShow(val) {
  555. this.showType = val
  556. },
  557. },
  558. data() {
  559. return {
  560. //弹出框
  561. dialogViewSpareMoney: false,
  562. dialogApproveFormVisible: false,
  563. // 船舶类型
  564. monetaryKey: null,
  565. // 表格显示数据
  566. tableDate: [],
  567. // 是否显示
  568. showType: true,
  569. // 年
  570. year: '',
  571. options_: regionData,
  572. selectedOptions: [],
  573. selectedOptions1: [],
  574. // 提交类型
  575. submitType: true,
  576. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  577. packtypeList: [],
  578. compId: sessionStorage.getItem('ws-pf_compId'),
  579. rules: {
  580. // contractNo: [
  581. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  582. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  583. // ],
  584. },
  585. options: [],
  586. staffList: [],
  587. appendixIdsAdd: '',
  588. size: 10,
  589. // uploadSuccess: {},
  590. // onChange:{},
  591. unitList: [],
  592. goodnameList: [],
  593. value1: '袋装',
  594. value2: '未回收',
  595. gradeList: [],
  596. ChapterTwoList: [],
  597. deptBudgetList: {
  598. deliverType: '1',
  599. finalTradingVolume: 0,
  600. contractGoodsInfo: {
  601. goodsName: '',
  602. },
  603. contractProcessInfo: {},
  604. },
  605. acceptanceCheck: {},
  606. pickerBeginDateBefore: {
  607. disabledDate: (time) => {
  608. return time.getTime() > Date.now()
  609. },
  610. },
  611. // selectpackingMethod: {},
  612. // selectgrade: {},
  613. // selectunitList: {},
  614. // selectDuty: {},
  615. // isEdited: false,
  616. // registered: {},
  617. // selectCrtDuty: {},
  618. // dutyList: {},
  619. // sexList: {},
  620. ruleDeptBudget: {
  621. contractNo: [
  622. { required: true, message: '请输入活动名称', trigger: 'blur' },
  623. {
  624. min: 6,
  625. max: 20,
  626. message: '长度在 6 到 20 个字符',
  627. trigger: 'blur',
  628. },
  629. ],
  630. },
  631. selectIntendedShip: {},
  632. interviewTypeList: {},
  633. }
  634. },
  635. activated() {
  636. //cg.viewBudget
  637. //cg.viewSpareMoney
  638. // this.getVesselData();
  639. this.deptBudgetList.packingMethod = '散装'
  640. this.deptBudgetList.packingMethodKey = 1
  641. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  642. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  643. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  644. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  645. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  646. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  647. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  648. .toPromise()
  649. .then((response) => {
  650. this.options = response
  651. this.staffList = response
  652. })
  653. this.loaddata()
  654. this.showType = this.isShow
  655. },
  656. methods: {
  657. dataFilter(val) {
  658. this.deptBudgetList.personCharge = val
  659. if (val) {
  660. //val存在
  661. this.options = this.staffList.filter((item) => {
  662. if (
  663. !!~item.staffName.indexOf(val) ||
  664. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  665. ) {
  666. return true
  667. }
  668. })
  669. } else {
  670. //val为空时,还原数组
  671. this.options = this.staffList
  672. }
  673. },
  674. selectstaff(e) {
  675. for (var i = 0; i < this.staffList.length; i++) {
  676. if (this.staffList[i].staffName == e) {
  677. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  678. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  679. }
  680. }
  681. },
  682. // 关闭 dialog时 处理文件url 初始化upload组件
  683. handleClose() {
  684. this.dialogViewSpareMoney = false
  685. },
  686. handleChange(value) {
  687. this.selectedOptions = value
  688. },
  689. handleChange1(value) {
  690. this.selectedOptions1 = value
  691. },
  692. weightchange(e) {
  693. this.deptBudgetList.finalTradingVolume = e
  694. },
  695. returnsales() {
  696. this.$router.push({ path: 'buyContract' })
  697. },
  698. loaddata() {
  699. // 包装方式
  700. packList({ constId: 'CON1' })
  701. .toPromise()
  702. .then((response) => {
  703. this.packtypeList = response
  704. })
  705. // 验收方式
  706. this.getUnitList()
  707. // 货名
  708. packList({ constId: 'CON2' })
  709. .toPromise()
  710. .then((response) => {
  711. this.goodnameList = response
  712. })
  713. // 品级
  714. packList({ constId: 'CON3' })
  715. .toPromise()
  716. .then((response) => {
  717. this.gradeList = response
  718. })
  719. // 双章
  720. packList({ constId: 'CON4' })
  721. .toPromise()
  722. .then((response) => {
  723. this.ChapterTwoList = response
  724. })
  725. },
  726. // 上传附件
  727. uploadSuccess(data, files, url) {
  728. console.log(data, files, url)
  729. // this.deptBudgetList.
  730. // this.formData.append('files', files)
  731. // this.feedbackObj.uploadNameAttachment = data.appendixName
  732. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  733. // // this.newAppendixs = files
  734. // this.onChangeFlag = true
  735. },
  736. onChange(files) {
  737. this.fileNum = files
  738. this.$refs.upload.handleSaveBill().then((res) => {
  739. console.log(files)
  740. })
  741. },
  742. getUnitList() {
  743. xiala({
  744. compId: sessionStorage.getItem('ws-pf_compId'),
  745. constCode: 'TYPEYAN',
  746. })
  747. .toPromise()
  748. .then((response) => {
  749. this.unitList = response
  750. let currItem
  751. this.unitList.forEach((item, index, arr) => {
  752. item.flag = 'delete'
  753. if (this.vModel == item.constKey) {
  754. currItem = item
  755. }
  756. })
  757. //
  758. if (currItem) {
  759. this.selectContract(currItem.constValue)
  760. }
  761. })
  762. },
  763. submit() {
  764. if (!this.deptBudgetList.contractNo) {
  765. this.$message({
  766. message: '请输入合同编号',
  767. type: 'warning',
  768. })
  769. return
  770. }
  771. if (
  772. this.deptBudgetList.contractNo.length < 6 ||
  773. this.deptBudgetList.contractNo.length > 20
  774. ) {
  775. this.$message({
  776. message: '合同编号长度不符合要求,请输入6到20个字符之内!',
  777. type: 'warning',
  778. })
  779. return
  780. }
  781. if (!this.deptBudgetList.shippingType) {
  782. this.$message({
  783. message: '请输入运输方式!',
  784. type: 'warning',
  785. })
  786. return
  787. }
  788. if (
  789. this.deptBudgetList.shippingType.length < 1 ||
  790. this.deptBudgetList.shippingType.length > 20
  791. ) {
  792. this.$message({
  793. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  794. type: 'warning',
  795. })
  796. return
  797. }
  798. if (!this.deptBudgetList.buyer) {
  799. this.$message({
  800. message: '请输入买方名称!',
  801. type: 'warning',
  802. })
  803. return
  804. }
  805. if (this.deptBudgetList.buyer.length > 30) {
  806. this.$message({
  807. message: '买方名称长度不符合要求,请输入30个字符之内!',
  808. type: 'warning',
  809. })
  810. return
  811. }
  812. if (!this.deptBudgetList.seller) {
  813. this.$message({
  814. message: '请输入卖方名称!',
  815. type: 'warning',
  816. })
  817. return
  818. }
  819. if (this.deptBudgetList.seller.length > 30) {
  820. this.$message({
  821. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  822. type: 'warning',
  823. })
  824. return
  825. }
  826. if (!this.deptBudgetList.buyerPhone) {
  827. this.$message({
  828. message: '请输入买方电话!',
  829. type: 'warning',
  830. })
  831. return
  832. }
  833. if (isNaN(this.deptBudgetList.buyerPhone)) {
  834. this.$message({
  835. message: '输入买方电话有误!',
  836. type: 'warning',
  837. })
  838. return
  839. }
  840. if (
  841. this.deptBudgetList.buyerPhone.length < 7 ||
  842. this.deptBudgetList.buyerPhone.length > 20
  843. ) {
  844. this.$message({
  845. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  846. type: 'warning',
  847. })
  848. return
  849. }
  850. if (!this.deptBudgetList.sellerPhone) {
  851. this.$message({
  852. message: '请输入卖方电话!',
  853. type: 'warning',
  854. })
  855. return
  856. }
  857. if (isNaN(this.deptBudgetList.sellerPhone)) {
  858. this.$message({
  859. message: '输入卖方电话有误!',
  860. type: 'warning',
  861. })
  862. return
  863. }
  864. if (
  865. this.deptBudgetList.buyerPhone.length < 7 ||
  866. this.deptBudgetList.buyerPhone.length > 20
  867. ) {
  868. this.$message({
  869. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  870. type: 'warning',
  871. })
  872. return
  873. }
  874. if (!this.deptBudgetList.settlementMethod) {
  875. this.$message({
  876. message: '请输入结算方式!',
  877. type: 'warning',
  878. })
  879. return
  880. }
  881. if (!this.deptBudgetList.sourceGoods) {
  882. this.$message({
  883. message: '请输入货源详细地址!',
  884. type: 'warning',
  885. })
  886. return
  887. }
  888. if (!this.deptBudgetList.placeDelivery) {
  889. this.$message({
  890. message: '请输入交货详细地址!',
  891. type: 'warning',
  892. })
  893. return
  894. }
  895. if (this.selectedOptions.length == 0) {
  896. this.$message({
  897. message: '请选择货源所在地区!',
  898. type: 'warning',
  899. })
  900. return
  901. }
  902. if (this.selectedOptions1.length == 0) {
  903. this.$message({
  904. message: '请选择交货所在地区!',
  905. type: 'warning',
  906. })
  907. return
  908. }
  909. if (!this.deptBudgetList.weight) {
  910. this.$message({
  911. message: '请输入重量!',
  912. type: 'warning',
  913. })
  914. return
  915. }
  916. if (
  917. isNaN(this.deptBudgetList.weight) ||
  918. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  919. String(this.deptBudgetList.weight).length -
  920. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  921. 3) ||
  922. this.deptBudgetList.weight < 0 ||
  923. this.deptBudgetList.weight > 200000
  924. ) {
  925. this.$message({
  926. message: '输入重量有误!',
  927. type: 'warning',
  928. })
  929. return
  930. }
  931. if (
  932. !this.deptBudgetList.overShort &&
  933. isNaN(this.deptBudgetList.overShort)
  934. ) {
  935. this.$message({
  936. message: '溢短装输入有误!',
  937. type: 'warning',
  938. })
  939. return
  940. }
  941. if (
  942. !this.deptBudgetList.unitContractPrice &&
  943. isNaN(this.deptBudgetList.unitContractPrice)
  944. ) {
  945. this.$message({
  946. message: '合同单价输入有误!',
  947. type: 'warning',
  948. })
  949. return
  950. }
  951. if (
  952. !this.deptBudgetList.totalContractPrice &&
  953. isNaN(this.deptBudgetList.totalContractPrice)
  954. ) {
  955. this.$message({
  956. message: '合同总价输入有误!',
  957. type: 'warning',
  958. })
  959. return
  960. }
  961. if (!this.deptBudgetList.deliveryDateStart) {
  962. this.$message({
  963. message: '请选择交货日期(起)',
  964. type: 'warning',
  965. })
  966. return
  967. }
  968. if (!this.deptBudgetList.deliveryDateEnd) {
  969. this.$message({
  970. message: '请选择交货日期(止)',
  971. type: 'warning',
  972. })
  973. return
  974. }
  975. //时间
  976. if (
  977. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  978. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  979. ) {
  980. this.$message({
  981. message: '交货日期(止)选择错误',
  982. type: 'warning',
  983. })
  984. return
  985. }
  986. if (!this.deptBudgetList.signingDate) {
  987. this.$message({
  988. message: '请选择签订日期',
  989. type: 'warning',
  990. })
  991. return
  992. }
  993. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  994. this.$message({
  995. message: '请选择货名',
  996. type: 'warning',
  997. })
  998. return
  999. }
  1000. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1001. this.$message({
  1002. message: '请选择水分',
  1003. type: 'warning',
  1004. })
  1005. return
  1006. }
  1007. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1008. this.$message({
  1009. message: '请选择品级',
  1010. type: 'warning',
  1011. })
  1012. return
  1013. }
  1014. if (
  1015. !this.deptBudgetList.contractGoodsInfo.impurity ||
  1016. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
  1017. -1 &&
  1018. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1019. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
  1020. '.'
  1021. ) +
  1022. 1) >
  1023. 2)
  1024. ) {
  1025. this.$message({
  1026. message: '杂质输入错误',
  1027. type: 'warning',
  1028. })
  1029. return
  1030. }
  1031. if (
  1032. !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
  1033. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1034. '.'
  1035. ) != -1 &&
  1036. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1037. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1038. '.'
  1039. ) +
  1040. 1) >
  1041. 2)
  1042. ) {
  1043. this.$message({
  1044. message: '容重输入错误',
  1045. type: 'warning',
  1046. })
  1047. return
  1048. }
  1049. if (
  1050. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1051. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1052. '.'
  1053. ) != -1 &&
  1054. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1055. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1056. '.'
  1057. ) +
  1058. 1) >
  1059. 2)
  1060. ) {
  1061. this.$message({
  1062. message: '霉变粒输入错误',
  1063. type: 'warning',
  1064. })
  1065. return
  1066. }
  1067. if (
  1068. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1069. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1070. -1 &&
  1071. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1072. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1073. '.'
  1074. ) +
  1075. 1) >
  1076. 2)
  1077. ) {
  1078. this.$message({
  1079. message: '热损伤输入错误',
  1080. type: 'warning',
  1081. })
  1082. return
  1083. }
  1084. if (
  1085. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1086. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1087. '.'
  1088. ) != -1 &&
  1089. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1090. (String(
  1091. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1092. ).indexOf('.') +
  1093. 1) >
  1094. 2)
  1095. ) {
  1096. this.$message({
  1097. message: '不完整粒输入错误',
  1098. type: 'warning',
  1099. })
  1100. return
  1101. }
  1102. if (
  1103. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1104. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1105. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1106. '.'
  1107. ) != -1 &&
  1108. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1109. (String(
  1110. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1111. ).indexOf('.') +
  1112. 1) >
  1113. 2)
  1114. ) {
  1115. this.$message({
  1116. message: '合同收入金额输入错误',
  1117. type: 'warning',
  1118. })
  1119. return
  1120. }
  1121. if (
  1122. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1123. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1124. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1125. '.'
  1126. ) != -1 &&
  1127. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1128. (String(
  1129. this.deptBudgetList.contractProcessInfo.waterContent
  1130. ).indexOf('.') +
  1131. 1) >
  1132. 2)
  1133. ) {
  1134. this.$message({
  1135. message: '费用金额输入错误',
  1136. type: 'warning',
  1137. })
  1138. return
  1139. }
  1140. if (
  1141. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1142. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1143. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1144. '.'
  1145. ) != -1 &&
  1146. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1147. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1148. '.'
  1149. ) +
  1150. 1) >
  1151. 2)
  1152. ) {
  1153. this.$message({
  1154. message: '已开发票金额输入错误',
  1155. type: 'warning',
  1156. })
  1157. return
  1158. }
  1159. if (
  1160. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1161. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1162. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1163. '.'
  1164. ) != -1 &&
  1165. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1166. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1167. '.'
  1168. ) +
  1169. 1) >
  1170. 2)
  1171. ) {
  1172. this.$message({
  1173. message: '未开发票金额输入错误',
  1174. type: 'warning',
  1175. })
  1176. return
  1177. }
  1178. if (
  1179. this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000 ||
  1180. this.deptBudgetList.contractProcessInfo.imperfectGrain < 0 ||
  1181. (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
  1182. '.'
  1183. ) != -1 &&
  1184. String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
  1185. .length -
  1186. (String(
  1187. this.deptBudgetList.contractProcessInfo.imperfectGrain
  1188. ).indexOf('.') +
  1189. 1) >
  1190. 2)
  1191. ) {
  1192. this.$message({
  1193. message: '已完成发运量输入错误',
  1194. type: 'warning',
  1195. })
  1196. return
  1197. }
  1198. var that = this
  1199. this.$refs.deptBudgetList.validate((valid) => {
  1200. if (valid) {
  1201. this.deptBudgetList.sourceProvince = CodeToText[this.selectedOptions[0]]
  1202. this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
  1203. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions1[0]]
  1204. this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions1[1]]
  1205. this.deptBudgetList.compId = this.compId
  1206. this.deptBudgetList.contractType = 2
  1207. if(this.deptBudgetList.deliveryProvince =="澳门特别行政区" || this.deptBudgetList.deliveryProvince == "澳门特别行政区"){
  1208. this.deptBudgetList.deliveryArea = "特别行政区"
  1209. }else{
  1210. this.deptBudgetList.deliveryArea = CodeToText[this.selectedOptions1[2]]
  1211. }
  1212. if(this.deptBudgetList.sourceProvince =="澳门特别行政区" || this.deptBudgetList.sourceProvince == "澳门特别行政区"){
  1213. this.deptBudgetList.sourceArea = "特别行政区"
  1214. }else{
  1215. this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
  1216. }
  1217. addList(this.deptBudgetList)
  1218. .toPromise()
  1219. .then((response) => {
  1220. this.$message.success('添加成功')
  1221. this.deptBudgetList = {
  1222. deliverType: '1',
  1223. finalTradingVolume: 0,
  1224. contractGoodsInfo: {
  1225. goodsName: '',
  1226. },
  1227. contractProcessInfo: {},
  1228. }
  1229. this.$router.push({ path: 'buyContract' })
  1230. })
  1231. .catch((req) => {
  1232. EventBus.$emit('error', req.message)
  1233. })
  1234. } else {
  1235. // for (let key in that.rules) {
  1236. // EventBus.$emit('error', that.rules[key][0].message)
  1237. // return false
  1238. // }
  1239. return false
  1240. }
  1241. })
  1242. },
  1243. resetForm(deptBudgetList) {
  1244. this.$refs[deptBudgetList].resetFields()
  1245. },
  1246. addClick() {
  1247. // let [flag, constValue, constKey] = ['check', '', '']
  1248. // let obj = { flag, constValue, constKey }
  1249. // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
  1250. // let result = this.unitList.filter((item, val, arr) => {
  1251. // return item.id != '1'
  1252. // })
  1253. // result.push(obj)
  1254. // result.push(objAdd)
  1255. // this.unitList = result
  1256. this.unitList.push({
  1257. flag: 'add',
  1258. constValue: '',
  1259. constKey: '',
  1260. })
  1261. },
  1262. saveClick(item, index) {
  1263. console.log(item)
  1264. if (Object.is(item.id, 1)) {
  1265. return
  1266. }
  1267. if (Object.is(this.unitList[index].flag, 'delete')) {
  1268. this.$set(this.unitList, index, { flag: 'check' })
  1269. } else {
  1270. this.$set(this.unitList, index, { flag: 'delete' })
  1271. }
  1272. if (!item.constValue) {
  1273. this.unitList.splice(index, 1)
  1274. return
  1275. }
  1276. if (item.flag == 'add') {
  1277. item.constKey = Math.random() * 20
  1278. this.acceptanceCheck.compId = this.compId
  1279. this.acceptanceCheck.constKey = item.constKey
  1280. this.acceptanceCheck.constCode = 'TYPEYAN'
  1281. this.acceptanceCheck.constValue = item.constValue
  1282. this.acceptanceCheck.id = item.id
  1283. addxiala(this.acceptanceCheck)
  1284. .toPromise()
  1285. .then((response) => {
  1286. this.getUnitList()
  1287. })
  1288. } else if (item.flag == 'check') {
  1289. this.acceptanceCheck.compId = this.compId
  1290. this.acceptanceCheck.constKey = item.constKey
  1291. this.acceptanceCheck.constCode = 'TYPEYAN'
  1292. this.acceptanceCheck.constValue = item.constValue
  1293. this.acceptanceCheck.id = item.id
  1294. editxiala(this.acceptanceCheck)
  1295. .toPromise()
  1296. .then((response) => {
  1297. this.getUnitList()
  1298. })
  1299. }
  1300. },
  1301. // selectContract(val) {
  1302. // let key = this.unitList.find((item) => item.constValue === val).constKey
  1303. // this.pleaseChoose = val
  1304. // },
  1305. handleExamine() {},
  1306. approve() {},
  1307. // returnsales() {
  1308. // this.$router.push({ path: 'purchaseContract' })
  1309. // },
  1310. selectChapterTwo(e) {
  1311. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1312. if (this.ChapterTwoList[i].constValue == e) {
  1313. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1314. }
  1315. }
  1316. },
  1317. selectunitList(e) {
  1318. for (var i = 0; i < this.unitList.length; i++) {
  1319. if (this.unitList[i].constValue == e) {
  1320. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1321. }
  1322. }
  1323. },
  1324. selectgrade(e) {
  1325. for (var i = 0; i < this.gradeList.length; i++) {
  1326. if (this.gradeList[i].constValue == e) {
  1327. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1328. }
  1329. }
  1330. },
  1331. selectgoodsName(e) {
  1332. for (var i = 0; i < this.goodnameList.length; i++) {
  1333. if (this.goodnameList[i].constValue == e) {
  1334. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1335. }
  1336. }
  1337. },
  1338. selectpackingMethod(e) {
  1339. for (var i = 0; i < this.packtypeList.length; i++) {
  1340. if (this.packtypeList[i].constValue == e) {
  1341. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1342. }
  1343. }
  1344. },
  1345. // 编辑
  1346. editClick(item, index) {
  1347. const map = JSON.parse(JSON.stringify(item))
  1348. if (Object.is(item.id, 1)) {
  1349. return
  1350. }
  1351. if (Object.is(this.unitList[index].flag, 'delete')) {
  1352. map.flag = 'check'
  1353. this.$set(this.unitList, index, map)
  1354. } else {
  1355. map.flag = 'delete'
  1356. this.$set(this.unitList, index, map)
  1357. }
  1358. },
  1359. // 删除
  1360. deleteClick(item, index) {
  1361. if (Object.is(item.constKey, 1)) {
  1362. return
  1363. }
  1364. if (!item.constValue) {
  1365. this.unitList.splice(index, 1)
  1366. return
  1367. }
  1368. delxiala({ id: this.unitList[index].id })
  1369. .toPromise()
  1370. .then((response) => {
  1371. this.getUnitList()
  1372. this.pleaseChoose = ''
  1373. })
  1374. },
  1375. },
  1376. }
  1377. </script>
  1378. <style lang="scss" scoped>
  1379. .el-form {
  1380. padding: 0 15%;
  1381. }
  1382. /deep/.ws-info-table .el-form-item {
  1383. border-right: 1px solid #cdd2dc;
  1384. border-bottom: 1px solid #cdd2dc;
  1385. }
  1386. .readonly {
  1387. position: relative;
  1388. }
  1389. .readonly:after {
  1390. content: '*';
  1391. color: #ff2727;
  1392. position: absolute;
  1393. right: 8px;
  1394. z-index: 10;
  1395. top: 21%;
  1396. font-size: 20px;
  1397. }
  1398. .title {
  1399. position: relative;
  1400. }
  1401. .title::before {
  1402. content: '';
  1403. display: inline-block;
  1404. width: 5px;
  1405. height: 30px;
  1406. background: #5473e8;
  1407. position: absolute;
  1408. left: 0;
  1409. }
  1410. .el-button--primary {
  1411. background-color: #5878e8;
  1412. border-color: #5878e8;
  1413. }
  1414. .el-col {
  1415. background: #f6f7fc;
  1416. }
  1417. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1418. padding: 0 25px;
  1419. border-left: 1px solid #cdd2dc;
  1420. background: #fafbfc;
  1421. }
  1422. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1423. width: 140px;
  1424. text-align: center;
  1425. background: #f0f2f6;
  1426. // border: 1px solid #cdd2dc;
  1427. }
  1428. .button-container {
  1429. display: flex;
  1430. flex-wrap: nowrap;
  1431. justify-content: space-between;
  1432. align-items: center;
  1433. background-color: #fff;
  1434. width: 100%;
  1435. height: 50px;
  1436. padding: 0 10px;
  1437. & > div {
  1438. margin-left: 10px;
  1439. display: flex;
  1440. flex-wrap: nowrap;
  1441. flex-direction: row;
  1442. & > span {
  1443. line-height: 50px;
  1444. }
  1445. }
  1446. /deep/.auditFlow-box {
  1447. position: unset;
  1448. margin-left: 10px;
  1449. &/deep/.auditFlow-icon {
  1450. width: auto;
  1451. padding-right: 30px;
  1452. }
  1453. &/deep/.auditFlow-main {
  1454. position: absolute;
  1455. }
  1456. }
  1457. }
  1458. .box-app {
  1459. display: inline-block;
  1460. float: left;
  1461. margin-left: 30px;
  1462. line-height: 50px;
  1463. }
  1464. /deep/.el-dialog {
  1465. .el-form-item {
  1466. margin-bottom: 0 !important;
  1467. .el-input--medium {
  1468. textarea {
  1469. min-height: 100px !important;
  1470. }
  1471. }
  1472. }
  1473. }
  1474. .collapse-bottom {
  1475. margin-bottom: 20px;
  1476. }
  1477. .input-main .textarea .el-textarea__inner {
  1478. width: 100%;
  1479. z-index: 1;
  1480. }
  1481. .bg-left {
  1482. padding-left: 30px;
  1483. }
  1484. .bg-right {
  1485. padding-right: 10px;
  1486. text-align: right;
  1487. }
  1488. .bg-bottom {
  1489. margin: 15px 0px;
  1490. }
  1491. .wenzi h3 {
  1492. display: inline-block;
  1493. left: 10px;
  1494. }
  1495. .wenzi p {
  1496. display: inline-block;
  1497. }
  1498. .center {
  1499. width: 70%;
  1500. margin: 0 auto;
  1501. }
  1502. .el-form-item {
  1503. width: 50%;
  1504. }
  1505. .el-form-item__label {
  1506. text-align: center;
  1507. }
  1508. .ce {
  1509. width: 900px;
  1510. margin: 0 auto;
  1511. }
  1512. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1513. /* height: 82px;*/
  1514. /*}*/
  1515. // 控制select为只读的时候显示样式
  1516. .hide-sel {
  1517. .el-input__inner {
  1518. border: 0px;
  1519. }
  1520. .el-icon-arrow-up {
  1521. display: none;
  1522. }
  1523. .el-textarea__inner {
  1524. background-color: #fff !important;
  1525. border: 0;
  1526. }
  1527. .el-date-editor {
  1528. i {
  1529. display: none;
  1530. }
  1531. }
  1532. .is-disabled {
  1533. .el-input__inner:hover {
  1534. background-color: #fff !important;
  1535. border: 0;
  1536. }
  1537. color: #606266;
  1538. .el-input__inner {
  1539. background-color: #fff !important;
  1540. border: 0;
  1541. color: #606266;
  1542. }
  1543. .el-textarea__inner {
  1544. background-color: #fff !important;
  1545. border: 0;
  1546. color: #606266;
  1547. }
  1548. }
  1549. }
  1550. // 控制select为只读的时候显示样式
  1551. /deep/.ws-class-table-col {
  1552. height: auto;
  1553. padding: 0px 2px;
  1554. /deep/.el-input__inner {
  1555. padding: 0px 2px;
  1556. }
  1557. }
  1558. /deep/.is-disabled {
  1559. .el-input__prefix,
  1560. .el-input__suffix {
  1561. display: none;
  1562. }
  1563. .el-input__inner {
  1564. background-color: #fff;
  1565. border-color: #fff !important;
  1566. color: #000 !important;
  1567. font-size: 14px;
  1568. cursor: text;
  1569. padding: 0 !important;
  1570. }
  1571. }
  1572. .winseaview-view {
  1573. padding: 0 0 20px;
  1574. }
  1575. .container {
  1576. overflow: scroll;
  1577. height: 93vh;
  1578. }
  1579. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1580. width: 130px;
  1581. }
  1582. </style>