purchaseContractEdit.vue 54 KB

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