purchaseContractEdit.vue 53 KB

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