salesContractEdit.vue 53 KB

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