purchaseContractAdd.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068
  1. <template>
  2. <div class="container">
  3. <el-row>
  4. <el-col :span="12" class="bg">
  5. <h2 class="bg-left title">创建采购合同</h2>
  6. </el-col>
  7. <el-col :span="12" class="bg-right bg">
  8. <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
  9. style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
  10. </el-button>
  11. </el-col>
  12. </el-row>
  13. <ws-form ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
  14. <div class="remark">
  15. <h3>基本信息</h3>
  16. <el-row>
  17. <el-col :span="12">
  18. <p style="color: #8890b1">
  19. 注:基本信息和货物信息均为必填项,“<span style="color:red">*</span>” 标记的条目提交后不可修改。
  20. </p>
  21. </el-col>
  22. <el-col :span="12" style='text-align:right;'>
  23. <el-select v-model="contractNo" placeholder="请选择要复制的合同" class="typeselect" filterable clearable
  24. @change="copySelect">
  25. <el-option v-for="(item,index) in outContractNo" :key="'hetong'+index" :label="item.contractNo"
  26. :value="item.contractNo" />
  27. </el-select>
  28. <el-button class="bg-bottom" type="primary" size="small" @click="cancelcopy()">取消复制
  29. </el-button>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. <ws-info-table>
  34. <!--合同类型-->
  35. <!-- <ws-form-item
  36. label="合同类型"
  37. span="1"
  38. prop="agreementType"
  39. >
  40. <ws-select
  41. v-model="deptBudgetList.agreementType"
  42. placeholder
  43. class="deal"
  44. @change="selectType"
  45. >
  46. <ws-option
  47. v-for="item in agreementList"
  48. :key="item.constKey"
  49. :label="item.constValue"
  50. :value="item.constValue"
  51. />
  52. </ws-select>
  53. </ws-form-item> -->
  54. <ws-form-item label="合同类型" span="1" prop="agreementType" class="readonly">
  55. <el-radio v-model="deptBudgetList.agreementType" label="采购合同">采购合同</el-radio>
  56. <el-radio v-model="deptBudgetList.agreementType" label="补充协议">补充协议</el-radio>
  57. </ws-form-item>
  58. <!--关联合同-->
  59. <ws-form-item prop="agreementNo" label="关联合同" span="1" v-show="deptBudgetList.agreementType =='补充协议'">
  60. <ws-select v-model="deptBudgetList.agreementNo" placeholder="请选择编号" @change="selectRelation">
  61. <ws-option v-for="item in contractNoList" :key="item.id" :label="item.contractNo"
  62. :value="item.contractNo"></ws-option>
  63. </ws-select>
  64. </ws-form-item>
  65. <!-- 补充协议编号 -->
  66. <ws-form-item v-show="deptBudgetList.agreementType == '补充协议'" label="补充协议编号" span="1" prop="contractNo">
  67. <ws-input v-model="deptBudgetList.contractNo" placeholder="请输入补充协议编号" maxlength="100" size="small" />
  68. </ws-form-item>
  69. <!--运输方式-->
  70. <ws-form-item label="运输方式" span="1" prop="shippingType">
  71. <ws-input v-model="deptBudgetList.shippingType" placeholder="请输入运输方式" maxlength="100" size="small" />
  72. </ws-form-item>
  73. <!--合同编号-->
  74. <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly" required v-show="deptBudgetList.agreementType =='采购合同'">
  75. <ws-input v-model="deptBudgetList.contractNo" placeholder="请输入合同编号" maxlength="50" size="small" />
  76. </ws-form-item>
  77. <!--结算方式-->
  78. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  79. <ws-input v-model="deptBudgetList.settlementMethod" placeholder="请输入结算方式" maxlength="100" size="small" />
  80. </ws-form-item>
  81. <ws-form-item label="买方" span="1" prop="buyer" class="readonly">
  82. <!-- <ws-input v-model="deptBudgetList.buyer" placeholder="请输入买方名称" maxlength="100" size="small" /> -->
  83. <el-autocomplete class="inline-input" v-model="deptBudgetList.buyer" :fetch-suggestions="querySearch1"
  84. placeholder="请输入买方名称" @select="handleSelect"></el-autocomplete>
  85. </ws-form-item>
  86. <ws-form-item label="交货方式" span="1" prop="seller" class="readonly">
  87. <el-radio v-model="deptBudgetList.deliverType" label="1">我方自提</el-radio>
  88. <el-radio v-model="deptBudgetList.deliverType" label="2">对方送货</el-radio>
  89. <!-- <el-radio v-model="deptBudgetList.deliverType" v-if="deptBudgetList.priceType == '随行就市'" disabled label="1">
  90. 我方自提</el-radio>
  91. <el-radio v-model="deptBudgetList.deliverType" v-else label="1">我方自提</el-radio>
  92. <el-radio v-model="deptBudgetList.deliverType" v-if="deptBudgetList.priceType == '随行就市'" disabled label="2">
  93. 对方送货</el-radio>
  94. <el-radio v-model="deptBudgetList.deliverType" v-else label="2">对方送货</el-radio> -->
  95. </ws-form-item>
  96. <!--卖方-->
  97. <ws-form-item label="卖方" span="1" prop="seller" class="readonly">
  98. <!-- <ws-input v-model="deptBudgetList.seller" placeholder="请输入卖方名称" maxlength="100" size="small" /> -->
  99. <!-- <el-autocomplete class="inline-input" v-model="deptBudgetList.seller" :fetch-suggestions="querySearch2"
  100. @select="handleSelect"></el-autocomplete>
  101. -->
  102. <el-select filterable v-model="deptBudgetList.seller" placeholder="请选择卖方名称" class="typeselect"
  103. @change="sellerSelect" filterable clearable>
  104. <el-option v-for="(item,index) in customerinfo" :key="index" :label="item.customerName"
  105. :value="item.customerName" />
  106. </el-select>
  107. </ws-form-item>
  108. <!-- 发货反馈负责人 -->
  109. <!-- <ws-form-item label="发货反馈负责人" span="1" prop="feedbackLeader" v-if="deptBudgetList.deliverType == '2'">
  110. <ws-select v-model="deptBudgetList.feedbackLeader" placeholder="请输入收货反馈负责人" class="typeselect" @change="feedbackLeaderChange">
  111. <ws-option v-for="(item,index1) in feedbackLeaders" :key="item.staffId" :label="item.staffName" :value="index1" />
  112. </ws-select>
  113. </ws-form-item> -->
  114. <!-- 发货反馈负责人(多选) -->
  115. <ws-form-item label="发货反馈负责人" span="1" prop="agent" v-if="deptBudgetList.deliverType == '2'">
  116. <el-select v-model="deptBudgetList.agent" multiple filterable clearable allow-create default-first-option placeholder="请选择经办人" @change="feedbackLeaderChange" >
  117. <el-option v-for="(item,index1) in feedbackLeaders" :key="index1" :label="item.staffName" :value="item.staffName"></el-option>
  118. </el-select>
  119. </ws-form-item>
  120. <!--包装方式-->
  121. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  122. <ws-select v-model="deptBudgetList.packingMethod" placeholder="" class="typeselect" :value="value1"
  123. @change="selectpackingMethod">
  124. <ws-option v-for="item in packtypeList" :key="item.constKey" :label="item.constValue"
  125. :value="item.constValue" />
  126. </ws-select>
  127. </ws-form-item>
  128. <!--买方电话-->
  129. <ws-form-item label="买方电话" span="1" prop="contractNo">
  130. <!-- <ws-input v-model.number="deptBudgetList.buyerPhone" placeholder="请输入买方电话" maxlength="100" size="small" /> -->
  131. <el-autocomplete class="inline-input" v-model="deptBudgetList.buyerPhone" :fetch-suggestions="querySearch3"
  132. placeholder="请输入买方电话" @select="handleSelect"></el-autocomplete>
  133. </ws-form-item>
  134. <!--验收方式-->
  135. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  136. <el-select v-model="deptBudgetList.acceptanceMethod" placeholder="请选择验收方式" style="width: 100%" filterable clearable
  137. @change="selectunitList">
  138. <el-option v-for="(item, index) in unitList" :key="item.constValue" :label="item.constValue"
  139. :value="item.constValue">
  140. <span class="unit-left" style="float: left">
  141. <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
  142. <!-- 新增文本框 -->
  143. <div style="width: 160px" v-if="item.flag !== 'delete'" @click.stop>
  144. <ws-input v-model="item.constValue" clearable maxlength="10" style="width: 100%"></ws-input>
  145. </div>
  146. </span>
  147. <span style="float: right; color: #8492a6; font-size: 13px">
  148. <!-- 对号 -->
  149. <i class="el-icon-check" style="line-height: 29px; margin-left: 10px" v-if="item.flag !== 'delete'"
  150. @click.stop="saveClick(item, index)"></i>
  151. <!-- 编辑 -->
  152. <i class="el-icon-edit" style="line-height: 29px; margin-left: 10px" v-if="item.flag == 'delete'"
  153. @click.stop="editClick(item, index)"></i>
  154. <!-- 删除 -->
  155. <i class="el-icon-delete" style="line-height: 29px" @click.stop="deleteClick(item, index)"></i>
  156. </span>
  157. </el-option>
  158. <!-- 新增按钮 -->
  159. <el-option value="" label="">
  160. <div style="
  161. text-align: right;
  162. border-top: 1px solid #dcdfe6;
  163. padding: 5px;
  164. ">
  165. <ws-button type="primary" @click.stop="addClick">{{
  166. $t('button.add')
  167. }}</ws-button>
  168. </div>
  169. </el-option>
  170. </el-select>
  171. </ws-form-item>
  172. <!--卖方电话-->
  173. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  174. <!-- <ws-input v-model="deptBudgetList.sellerPhone" placeholder="请输入卖方电话" maxlength="100" size="small" /> -->
  175. <el-autocomplete class="inline-input" v-model="deptBudgetList.sellerPhone" :fetch-suggestions="querySearch4"
  176. placeholder="请输入卖方电话" @select="handleSelect"></el-autocomplete>
  177. </ws-form-item>
  178. <!--重量(吨)-->
  179. <ws-form-item label="重量(吨)" span="1" prop="weight">
  180. <ws-input @input="weightchange" v-model="deptBudgetList.weight" placeholder="请输入重量(吨)" maxlength="100"
  181. size="small" />
  182. </ws-form-item>
  183. <!--交货日期(起)-->
  184. <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
  185. <ws-date-picker v-model="deptBudgetList.deliveryDateStart" type="date" placeholder="请选择交货日期(起)"
  186. value-format="yyyy-MM-dd" />
  187. </ws-form-item>
  188. <!--溢短装(%)-->
  189. <ws-form-item label="溢短装(%)" span="1" prop="overShort">
  190. <ws-input v-model="deptBudgetList.overShort" placeholder="请输入溢短装比例(%)" maxlength="100" size="small" />
  191. </ws-form-item>
  192. <!--交货日期(止)-->
  193. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  194. <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
  195. value-format="yyyy-MM-dd" />
  196. </ws-form-item>
  197. <!--价格类型-->
  198. <ws-form-item label="价格类型" span="1" prop="priceType">
  199. <ws-select v-model="deptBudgetList.priceType" placeholder="请选择价格类型" @change="selectpriceType">
  200. <ws-option v-for="item in priceTypeList" :key="item" :label="item" :value="item" />
  201. </ws-select>
  202. </ws-form-item>
  203. <!--合同单价(元/吨)-->
  204. <ws-form-item class="readonly" label="合同单价(元/吨)" span="1" prop="unitContractPrice" v-if="deptBudgetList.priceType == '定价采购'">
  205. <ws-input @input="pricechange" v-model="deptBudgetList.unitContractPrice" placeholder="请输入合同单价"
  206. maxlength="100" size="small" />
  207. </ws-form-item>
  208. <!--合同总价-->
  209. <ws-form-item label="合同总价" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价采购'">
  210. <ws-input v-model="deptBudgetList.totalContractPrice" placeholder="请输入合同总价" maxlength="100" size="small" />
  211. </ws-form-item>
  212. <!--签订日期-->
  213. <ws-form-item label="签订日期" span="1" prop="signingDate" v-show="deptBudgetList.agreementType =='采购合同'">
  214. <ws-date-picker v-model="deptBudgetList.signingDate" type="date" placeholder="请选择合同签订日期"
  215. value-format="yyyy-MM-dd" />
  216. </ws-form-item>
  217. <ws-form-item label="货源所在地区" span="1" prop="sourceGoods">
  218. <!-- <el-cascader
  219. :options="options_"
  220. v-model="selectedOptions"
  221. clearable
  222. size="large"
  223. placeholder="请选择货源所在地区"
  224. style="width: 200%"
  225. @change="handleChange"
  226. /> -->
  227. <el-button @click="mapInputClick('source')" class='address-btn'>
  228. {{newSelectedOptions}}
  229. </el-button>
  230. </ws-form-item>
  231. <ws-form-item label="货源详细地址" span="1" prop="sourceGoods">
  232. <ws-input v-model="deptBudgetList.sourceGoods" placeholder="请输入货源详细地址" maxlength="20" size="small" />
  233. </ws-form-item>
  234. <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
  235. <!-- <el-cascader
  236. :options="options_"
  237. v-model="selectedOptions1"
  238. clearable
  239. size="large"
  240. placeholder="请选择交货所在地区"
  241. style="width: 200%"
  242. @change="handleChange1"
  243. /> -->
  244. <el-button @click="mapInputClick('deliveryProv')" class='address-btn'>
  245. {{newSelectedOptions1}}
  246. </el-button>
  247. </ws-form-item>
  248. <ws-form-item label="交货详细地址" span="1" prop="placeDelivery">
  249. <ws-input v-model="deptBudgetList.placeDelivery" placeholder="请输入交货详细地址" maxlength="20" size="small" />
  250. </ws-form-item>
  251. <!--签订日期-->
  252. <ws-form-item label="签订日期" span="1" prop="signingDate" v-show="deptBudgetList.agreementType =='补充协议'">
  253. <ws-date-picker v-model="deptBudgetList.signingDate" type="date" placeholder="请选择合同签订日期"
  254. value-format="yyyy-MM-dd" />
  255. </ws-form-item>
  256. <ws-form-item label="最终实际成交量(吨)" span="1" prop="finalTradingVolume">
  257. <ws-input v-model="deptBudgetList.finalTradingVolume" placeholder="请输入最终实际成交量" maxlength="100" size="small" />
  258. </ws-form-item>
  259. <ws-form-item label="结算重量方式" span="1" prop="settlementWeightMethod" class="readonly"
  260. v-if="deptBudgetList.deliverType==1">
  261. <el-radio v-model="deptBudgetList.settlementWeightMethod" label="1">按出库重量结算</el-radio>
  262. <el-radio v-model="deptBudgetList.settlementWeightMethod" label="2">按入库重量结算</el-radio>
  263. </ws-form-item>
  264. <ws-form-item v-show="deptBudgetList.deliverType == 1" label="临时仓库负责人" span="1" prop="packingMethod">
  265. <el-select v-model="deptBudgetList.personPhone" multiple placeholder="请选择临时仓库负责人" filterable clearable
  266. @change="selectstaff">
  267. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffMobilePhone" />
  268. </el-select>
  269. </ws-form-item>
  270. </ws-info-table>
  271. <div class="wenzi">
  272. <h3>货物信息</h3>
  273. </div>
  274. <!--货物信息-->
  275. <ws-info-table>
  276. <!--货名-->
  277. <ws-form-item label="货名" span="1" prop="goodsName" class="readonly">
  278. <ws-select v-model="deptBudgetList.contractGoodsInfo.goodsName" placeholder="" class="typeselect"
  279. @change="selectgoodsName">
  280. <ws-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  281. :value="item.constValue" />
  282. </ws-select>
  283. </ws-form-item>
  284. <!--水分(%)<=-->
  285. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  286. <ws-input v-model="deptBudgetList.contractGoodsInfo.waterContent" placeholder="请输入水分占比" maxlength="100"
  287. size="small" />
  288. </ws-form-item>
  289. <!--品级-->
  290. <ws-form-item label="品级" span="1" prop="grade">
  291. <ws-select v-model="deptBudgetList.contractGoodsInfo.grade" placeholder="" class="typeselect"
  292. @change="selectgrade">
  293. <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  294. :value="item.constValue" />
  295. </ws-select>
  296. </ws-form-item>
  297. <!--杂质(%)<=-->
  298. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  299. <ws-input v-model="deptBudgetList.contractGoodsInfo.impurity" placeholder="请输入杂质占比(%)" maxlength="100"
  300. size="small" />
  301. </ws-form-item>
  302. <!--容重(克/升)>=-->
  303. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  304. <ws-input v-model="deptBudgetList.contractGoodsInfo.bulkDensity" placeholder="请输入容重" maxlength="100"
  305. size="small" />
  306. </ws-form-item>
  307. <!--霉变粒(%)<=-->
  308. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  309. <ws-input v-model="deptBudgetList.contractGoodsInfo.mildewGrain" placeholder="请输入霉变粒占比(%)" maxlength="100"
  310. size="small" />
  311. </ws-form-item>
  312. <!--热损伤(%)<=-->
  313. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  314. <ws-input v-model="deptBudgetList.contractGoodsInfo.jiaorenli" placeholder="请输入输入热损伤占比(%)" maxlength="100"
  315. size="small" />
  316. </ws-form-item>
  317. <!--不完善粒(%)<=-->
  318. <ws-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
  319. <ws-input v-model="deptBudgetList.contractGoodsInfo.imperfectGrain" placeholder="请输入不完善粒占比(%)" maxlength="100"
  320. size="small" />
  321. </ws-form-item>
  322. </ws-info-table>
  323. <div class="wenzi">
  324. <h3>流程信息</h3>
  325. </div>
  326. <!--流程信息-->
  327. <ws-info-table>
  328. <!--已付款(元)-->
  329. <ws-form-item label="已付款(元)" span="1" prop="mildewGrain">
  330. <ws-input v-model="deptBudgetList.contractProcessInfo.mildewGrain" placeholder="请输入已付款(元)" maxlength="100"
  331. size="small" />
  332. </ws-form-item>
  333. <!--已开发票(元)-->
  334. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  335. <ws-input v-model="deptBudgetList.contractProcessInfo.goodsName" placeholder="请输入已开发票(元)" maxlength="100"
  336. size="small" />
  337. </ws-form-item>
  338. <!--费用支出(元)-->
  339. <ws-form-item label="费用支出(元)" span="1" prop="waterContent">
  340. <ws-input v-model="deptBudgetList.contractProcessInfo.waterContent" placeholder="请输入费用支出(元)" maxlength="100"
  341. size="small" />
  342. </ws-form-item>
  343. <!--未开发票(元)-->
  344. <ws-form-item label="未开发票(元)" span="1" prop="impurity">
  345. <ws-input v-model="deptBudgetList.contractProcessInfo.impurity" placeholder="请输入未开发票(元)" maxlength="100"
  346. size="small" />
  347. </ws-form-item>
  348. <!--双章原件回收情况-->
  349. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  350. <ws-select v-model="deptBudgetList.contractProcessInfo.grade" placeholder="" class="typeselect"
  351. @change="selectChapterTwo">
  352. <ws-option v-for="item in ChapterTwoList" :key="item.constKey" :label="item.constValue"
  353. :value="item.constValue" />
  354. </ws-select>
  355. </ws-form-item>
  356. <!--已完成发货量(吨)-->
  357. <ws-form-item label="已完成发货量(吨)" span="1" prop="imperfectGrain">
  358. <ws-input v-model="deptBudgetList.contractProcessInfo.imperfectGrain" placeholder="请输入已完成发货量(吨)"
  359. maxlength="100" size="small" />
  360. </ws-form-item>
  361. </ws-info-table>
  362. <div class="wenzi">
  363. <h3>备注信息</h3>
  364. </div>
  365. <!--备注信息-->
  366. <ws-input v-model="deptBudgetList.remarks" type="textarea" row="3" placeholder="请输入备注信息,不超过3000字"
  367. maxlength="3000" />
  368. <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :size-limit="size"
  369. @onChange="onChange" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  370. v-hasPermission="`contractManagement.buyContract.buyContractInfo.appl`" />
  371. </ws-form>
  372. <div v-if="dialogVisible" class="map">
  373. <map-drag @marker="marker" :isShowaddress='true' v-on:addressListen='getAddress' :type="type"></map-drag>
  374. </div>
  375. <div style="text-align: right; padding: 10px" class="center">
  376. <el-button class="bg-bottom" type="primary" size="small" @click="submit(deptBudgetList)">提交</el-button>
  377. </div>
  378. </div>
  379. </template>
  380. <script>
  381. import {
  382. packList,
  383. addList,
  384. xiala,
  385. addxiala,
  386. editxiala,
  387. delxiala,
  388. getstafffind,
  389. getRelationContractNo,
  390. getcustomerinfo,
  391. examineList
  392. } from '@/model/contarct/index'
  393. import {
  394. getstaff,xialaNo,
  395. } from '@/model/warehouse/index'
  396. import {
  397. regionData,
  398. CodeToText,
  399. TextToCode
  400. } from 'element-china-area-data'
  401. import {
  402. dayjs,
  403. fmoney,
  404. EventBus
  405. } from 'base-core-lib'
  406. import WsUpload from '@/components/WsUpload'
  407. import mapDrag from '@/components/mapdrag/mapdrag'
  408. import { isUndefined } from 'xe-utils/methods'
  409. export default {
  410. name: 'viewSpareMoney',
  411. components: {
  412. WsUpload,
  413. mapDrag,
  414. },
  415. watch: {
  416. vesselId(val) {
  417. this.getVesselData()
  418. },
  419. isShow(val) {
  420. this.showType = val
  421. },
  422. },
  423. data() {
  424. return {
  425. restaurants1: [],
  426. restaurants2: [],
  427. restaurants3: [],
  428. restaurants4: [],
  429. customerinfo:[],
  430. type: '',
  431. dialogVisible: false,
  432. contractNo:'',
  433. outContractNo:[],
  434. //弹出框
  435. dialogViewSpareMoney: false,
  436. dialogApproveFormVisible: false,
  437. // 船舶类型
  438. monetaryKey: null,
  439. // 表格显示数据
  440. tableDate: [],
  441. // 是否显示
  442. showType: true,
  443. // 年
  444. year: '',
  445. options_: regionData,
  446. selectedOptions: [],
  447. newSelectedOptions: '请选择货源所在地',
  448. selectedOptions1: [],
  449. newSelectedOptions1: '请选择交货所在地区',
  450. // 提交类型
  451. submitType: true,
  452. tableData: [{
  453. date: '',
  454. name: '',
  455. address: ''
  456. }],
  457. packtypeList: [],
  458. compId: localStorage.getItem('ws-pf_compId'),
  459. rules: {
  460. // contractNo: [
  461. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  462. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  463. // ],
  464. },
  465. options: [],
  466. staffList: [],
  467. appendixIdsAdd: '',
  468. size: 10,
  469. unitList: [],
  470. agreementList: [{
  471. constValue: '采购合同',
  472. constKey: '1'
  473. },
  474. {
  475. constValue: '补充协议',
  476. constKey: '2'
  477. },
  478. ],
  479. contractNoList: [],
  480. priceTypeList: ['定价采购', '随行就市'],
  481. goodnameList: [],
  482. value1: '袋装',
  483. value2: '未回收',
  484. gradeList: [],
  485. ChapterTwoList: [],
  486. agreementType: '',
  487. deptBudgetList: {
  488. deliverType: '1',
  489. sourceGoods:'',
  490. placeDelivery:'',
  491. agreementType: '采购合同',
  492. addressUrl: '',
  493. sellerPhone:'',
  494. personPhone:'',
  495. personCharge:'',
  496. personChargeKey:'',
  497. finalTradingVolume: 0,
  498. totalContractPrice: 0,
  499. contractGoodsInfo: {
  500. goodsName: '',
  501. },
  502. contractProcessInfo: {},
  503. settlementWeightMethod: '1',
  504. },
  505. acceptanceCheck: {},
  506. pickerBeginDateBefore: {
  507. disabledDate: (time) => {
  508. return time.getTime() > Date.now()
  509. },
  510. },
  511. ruleDeptBudget: {
  512. contractNo: [{
  513. required: true,
  514. message: '请输入活动名称',
  515. trigger: 'blur'
  516. },
  517. {
  518. min: 6,
  519. max: 50,
  520. message: '长度在 6 到 50 个字符',
  521. trigger: 'blur',
  522. },
  523. ],
  524. },
  525. selectIntendedShip: {},
  526. interviewTypeList: {},
  527. feedbackLeaders:[],//发货反馈负责人
  528. }
  529. },
  530. activated() {
  531. this.selectedOptions = []
  532. this.selectedOptions1 = []
  533. this.newSelectedOptions = '请选择货源所在地'
  534. this.newSelectedOptions1 = '请选择交货所在地'
  535. this.deptBudgetList.packingMethod = '散装'
  536. this.deptBudgetList.packingMethodKey = 1
  537. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  538. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  539. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  540. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  541. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  542. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  543. getstafffind({
  544. roles: 'd6a5c8a52da544309259f91f75de1ec6'
  545. })
  546. .toPromise()
  547. .then((response) => {
  548. this.options = response
  549. this.staffList = response
  550. })
  551. this.loaddata()
  552. this.showType = this.isShow
  553. },
  554. mounted() {
  555. this.restaurants1 = JSON.parse(localStorage.getItem('deptBudgetList_data1'));
  556. this.restaurants2 = JSON.parse(localStorage.getItem('deptBudgetList_data2'));
  557. this.restaurants3 = JSON.parse(localStorage.getItem('deptBudgetList_data3'));
  558. this.restaurants4 = JSON.parse(localStorage.getItem('deptBudgetList_data4'));
  559. if (!this.restaurants1) this.restaurants1 = [];
  560. if (!this.restaurants2) this.restaurants2 = [];
  561. if (!this.restaurants3) this.restaurants3 = [];
  562. if (!this.restaurants4) this.restaurants4 = [];
  563. },
  564. methods: {
  565. copySelect(e){
  566. for (let i = 0; i < this.outContractNo.length; i++) {
  567. if(this.outContractNo[i].contractNo==e){
  568. examineList({
  569. id: this.outContractNo[i].id
  570. })
  571. .toPromise()
  572. .then((response) => {
  573. this.deptBudgetList = response
  574. if(this.deptBudgetList.personPhone){
  575. this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
  576. }
  577. if (this.deptBudgetList.deliverType == 1) {
  578. this.deptBudgetList.deliverType1 = '我方自提'
  579. } else if (this.deptBudgetList.deliverType == 2) {
  580. this.deptBudgetList.deliverType1 = '对方送货'
  581. }
  582. })
  583. }
  584. }
  585. },
  586. cancelcopy(){
  587. this.contractNo=''
  588. this.deptBudgetList={
  589. deliverType: '1',
  590. sourceGoods:'',
  591. placeDelivery:'',
  592. agreementType: '采购合同',
  593. addressUrl: '',
  594. sellerPhone:'',
  595. personPhone:'',
  596. personCharge:'',
  597. personChargeKey:'',
  598. finalTradingVolume: 0,
  599. totalContractPrice: 0,
  600. contractGoodsInfo: {
  601. goodsName: '',
  602. },
  603. contractProcessInfo: {},
  604. settlementWeightMethod: '1',
  605. }
  606. },
  607. selectpriceType(e) {
  608. if (e == '随行就市') {
  609. this.deptBudgetList.deliverType = '1'
  610. }
  611. },
  612. feedbackLeaderChange(e){
  613. this.deptBudgetList.feedbackLeaderPhone = ""
  614. for(var num = 0 ; num < e.length ; num++){
  615. for(var i = 0 ; i < this.feedbackLeaders.length ; i++){
  616. if(e[num] == this.feedbackLeaders[i].staffName){
  617. if(!this.deptBudgetList.feedbackLeaderPhone){
  618. this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[i].staffMobilePhone
  619. break
  620. }else{
  621. this.deptBudgetList.feedbackLeaderPhone += ","+this.feedbackLeaders[i].staffMobilePhone
  622. }
  623. }
  624. }
  625. }
  626. this.deptBudgetList.feedbackLeader = e.toString()
  627. // this.deptBudgetList.feedbackLeader = this.feedbackLeaders[e].staffName
  628. // this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[e].staffMobilePhone
  629. },
  630. querySearch1(queryString, cb) {
  631. var restaurants1 = this.restaurants1;
  632. var results = queryString ? restaurants1.filter(this.createFilter(queryString)) : restaurants1;
  633. // 调用 callback 返回建议列表的数据
  634. cb(results);
  635. },
  636. querySearch2(queryString, cb) {
  637. var restaurants2 = this.restaurants2;
  638. var results = queryString ? restaurants2.filter(this.createFilter(queryString)) : restaurants2;
  639. // 调用 callback 返回建议列表的数据
  640. cb(results);
  641. },
  642. querySearch3(queryString, cb) {
  643. var restaurants3 = this.restaurants3;
  644. var results = queryString ? restaurants3.filter(this.createFilter(queryString)) : restaurants3;
  645. // 调用 callback 返回建议列表的数据
  646. cb(results);
  647. },
  648. querySearch4(queryString, cb) {
  649. var restaurants4 = this.restaurants4;
  650. var results = queryString ? restaurants4.filter(this.createFilter(queryString)) : restaurants4;
  651. // 调用 callback 返回建议列表的数据
  652. cb(results);
  653. },
  654. createFilter(queryString) {
  655. return (restaurant) => {
  656. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  657. };
  658. },
  659. handleSelect(item) {
  660. console.log(item);
  661. },
  662. sellerSelect(item) {
  663. console.log(item)
  664. for (let i = 0; i < this.customerinfo.length; i++) {
  665. console.log(this.customerinfo[i].customerName,item)
  666. if(this.customerinfo[i].customerName==item){
  667. this.deptBudgetList.sellerPhone=this.customerinfo[i].customerPhone
  668. }
  669. }
  670. },
  671. getAddress(data) {
  672. console.log('getAddress', data)
  673. if (data[4] == 'source') {
  674. this.newSelectedOptions = data[0] + '/' + data[1] + '/' + data[2]
  675. this.deptBudgetList.sourceProvince = data[0]
  676. this.deptBudgetList.sourceCity = data[1]
  677. this.deptBudgetList.sourceArea = data[2]
  678. this.deptBudgetList.sourceGoods = data[3]
  679. console.log(data[4])
  680. this.deptBudgetList.sourceLocation=data[5].lat+','+data[5].lng
  681. } else {
  682. this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
  683. this.deptBudgetList.deliveryProvince = data[0]
  684. this.deptBudgetList.deliveryCity = data[1]
  685. this.deptBudgetList.deliveryArea = data[2]
  686. this.deptBudgetList.placeDelivery = data[3]
  687. this.deptBudgetList.deliveryLocation=data[5].lat+','+data[5].lng
  688. }
  689. },
  690. mapInputClick(type) {
  691. this.dialogVisible = true
  692. this.type = type
  693. },
  694. marker: function(item) {
  695. this.deptBudgetList.warehousePositioning =
  696. item.lnglat.lat + ',' + item.lnglat.lng
  697. },
  698. selectedAddress(e) {
  699. this.deptBudgetList.warehousePositioning =
  700. e.center.lat + ',' + e.center.lng
  701. },
  702. provinceChange(e) {
  703. console.log(CodeToText[e])
  704. },
  705. blurMap() {
  706. this.dialogVisible = false
  707. },
  708. focusMap() {
  709. this.dialogVisible = true
  710. },
  711. dataFilter(val) {
  712. this.deptBudgetList.personCharge = val
  713. if (val) {
  714. //val存在
  715. this.options = this.staffList.filter((item) => {
  716. if (
  717. !!~item.staffName.indexOf(val) ||
  718. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  719. ) {
  720. return true
  721. }
  722. })
  723. } else {
  724. //val为空时,还原数组
  725. this.options = this.staffList
  726. }
  727. },
  728. selectstaff(e) {
  729. // this.deptBudgetList.personPhone=''
  730. // this.deptBudgetList.personChargeKey=''
  731. // for (var i = 0; i < this.staffList.length; i++) {
  732. // if (e.indexOf(this.staffList[i].staffName)!=-1) {
  733. // if(this.deptBudgetList.personPhone){
  734. // this.deptBudgetList.personPhone= this.deptBudgetList.personPhone+','+ this.staffList[i].staffMobilePhone
  735. // }else{
  736. // this.deptBudgetList.personPhone=this.staffList[i].staffMobilePhone
  737. // }
  738. // if(this.deptBudgetList.personChargeKey){
  739. // this.deptBudgetList.personChargeKey= this.deptBudgetList.personChargeKey+','+ this.staffList[i].staffId
  740. // }else{
  741. // this.deptBudgetList.personChargeKey= this.staffList[i].staffId
  742. // }
  743. // }
  744. // }
  745. this.deptBudgetList.personCharge=''
  746. for (var i = 0; i < this.staffList.length; i++) {
  747. for (var j = 0; j < e.length; j++) {
  748. if (this.staffList[i].staffMobilePhone == e[j]) {
  749. this.deptBudgetList.personCharge += this.staffList[i].staffName + ' ' + this.staffList[i]
  750. .staffMobilePhone + ','
  751. }
  752. }
  753. }
  754. console.log(this.deptBudgetList)
  755. },
  756. // 关闭 dialog时 处理文件url 初始化upload组件
  757. handleClose() {
  758. this.dialogViewSpareMoney = false
  759. },
  760. handleChange(value) {
  761. this.selectedOptions = value
  762. },
  763. handleChange1(value) {
  764. this.selectedOptions1 = value
  765. },
  766. weightchange(e) {
  767. this.deptBudgetList.finalTradingVolume = e
  768. },
  769. pricechange(e) {
  770. this.deptBudgetList.totalContractPrice = e * this.deptBudgetList.weight
  771. },
  772. returnsales() {
  773. this.deptBudgetList = {
  774. deliverType: '1',
  775. sourceGoods:'',
  776. placeDelivery:'',
  777. agreementType: '采购合同',
  778. addressUrl: '',
  779. sellerPhone:'',
  780. personPhone:'',
  781. personCharge:'',
  782. personChargeKey:'',
  783. finalTradingVolume: 0,
  784. totalContractPrice: 0,
  785. contractGoodsInfo: {
  786. goodsName: '',
  787. },
  788. contractProcessInfo: {},
  789. settlementWeightMethod: '1',
  790. }
  791. this.$router.push({
  792. path: 'buyContract'
  793. })
  794. },
  795. loaddata() {
  796. // 合同编号
  797. xialaNo({
  798. compId: localStorage.getItem('ws-pf_compId'),
  799. flag: 0,
  800. })
  801. .toPromise()
  802. .then((response) => {
  803. this.outContractNo = response
  804. })
  805. // 包装方式
  806. packList({
  807. constId: 'CON1'
  808. })
  809. .toPromise()
  810. .then((response) => {
  811. this.packtypeList = response
  812. })
  813. // 验收方式
  814. this.getUnitList()
  815. // 货名
  816. packList({
  817. constId: 'CON2'
  818. })
  819. .toPromise()
  820. .then((response) => {
  821. this.goodnameList = response
  822. })
  823. // 品级
  824. packList({
  825. constId: 'CON3'
  826. })
  827. .toPromise()
  828. .then((response) => {
  829. this.gradeList = response
  830. })
  831. // 双章
  832. packList({
  833. constId: 'CON4'
  834. })
  835. .toPromise()
  836. .then((response) => {
  837. this.ChapterTwoList = response
  838. })
  839. // 发货反馈负责人
  840. getstaff({
  841. compId: localStorage.getItem('ws-pf_compId')
  842. })
  843. .toPromise()
  844. .then((response) => {
  845. this.feedbackLeaders = response
  846. let _obj = [] //发货反馈负责人下拉列表第一个添加 "无需发货反馈(默认)"
  847. _obj.staffName = "无需发货反馈(默认)"
  848. _obj.staffMobilePhone = "(默认)"
  849. this.feedbackLeaders.unshift(_obj)
  850. })
  851. //关联合同
  852. getRelationContractNo({
  853. agreementType: '采购合同',
  854. goodsType: 1
  855. })
  856. .toPromise()
  857. .then((response) => {
  858. this.contractNoList = response
  859. })
  860. getcustomerinfo({compId: localStorage.getItem('ws-pf_compId'),}).toPromise()
  861. .then((response) => {
  862. var arr=[]
  863. for (let i = 0; i < response.length; i++) {
  864. if(response[i].customerType=='个人客户'){
  865. arr.push({customerName:response[i].customerName,customerPhone:response[i].customerPhone})
  866. }else{
  867. arr.push({customerName:response[i].compName,customerPhone:response[i].customerPhone})
  868. }
  869. }
  870. this.customerinfo = arr
  871. })
  872. },
  873. selectRelation(e) {
  874. // console.log(this.contractNoList)
  875. for (var i = 0; i < this.contractNoList.length; i++) {
  876. if (this.contractNoList[i].contractNo == e) {
  877. this.deptBudgetList = this.contractNoList[i]
  878. this.deptBudgetList.agreementNo = this.contractNoList[i].contractNo
  879. this.deptBudgetList.contractNo = this.contractNoList[i].contractNo
  880. this.deptBudgetList.agreementType = '补充协议'
  881. this.newSelectedOptions = this.contractNoList[i].sourceProvince + this.contractNoList[i].sourceCity + this
  882. .contractNoList[i].sourceArea
  883. this.deptBudgetList.sourceGoods = this.contractNoList[i].sourceGoods
  884. this.newSelectedOptions1 = this.contractNoList[i].deliveryProvince + this.contractNoList[i].deliveryCity +
  885. this.contractNoList[i].deliveryArea
  886. this.deptBudgetList.placeDelivery = this.contractNoList[i].placeDelivery
  887. }
  888. }
  889. },
  890. onChange() {
  891. this.$refs.upload
  892. .handleSaveBill()
  893. .then(async response => {
  894. this.deptBudgetList.addressUrl = response
  895. })
  896. .catch(res => {
  897. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  898. this.$refs.upload.clearFiles()
  899. })
  900. },
  901. getUnitList() {
  902. xiala({
  903. compId: localStorage.getItem('ws-pf_compId'),
  904. constCode: 'TYPEYAN',
  905. })
  906. .toPromise()
  907. .then((response) => {
  908. this.unitList = response
  909. let currItem
  910. this.unitList.forEach((item, index, arr) => {
  911. item.flag = 'delete'
  912. if (this.vModel == item.constKey) {
  913. currItem = item
  914. }
  915. })
  916. //
  917. if (currItem) {
  918. this.selectContract(currItem.constValue)
  919. }
  920. })
  921. },
  922. submit() {
  923. if(this.deptBudgetList.placeDelivery.indexOf('省')>-1){
  924. this.$message({
  925. message: '请手动删除详细地址中省市区/市,避免重复显示省市区/市!',
  926. type: 'warning',
  927. })
  928. return
  929. }
  930. if(this.deptBudgetList.sourceGoods.indexOf('省')>-1){
  931. this.$message({
  932. message: '请手动删除详细地址中省市区/市,避免重复显示省市区/市!',
  933. type: 'warning',
  934. })
  935. return
  936. }
  937. if (!this.deptBudgetList.contractNo) {
  938. this.$message({
  939. message: '合同编号不能为空',
  940. type: 'warning',
  941. })
  942. return
  943. }
  944. if (
  945. this.deptBudgetList.contractNo.length < 6 ||
  946. this.deptBudgetList.contractNo.length > 50
  947. ) {
  948. this.$message({
  949. message: '合同编号长度不符合要求,请输入6到50个字符之内!',
  950. type: 'warning',
  951. })
  952. return
  953. }
  954. if (!this.deptBudgetList.shippingType) {
  955. this.$message({
  956. message: '运输方式不能为空',
  957. type: 'warning',
  958. })
  959. return
  960. }
  961. if (
  962. this.deptBudgetList.shippingType.length < 1 ||
  963. this.deptBudgetList.shippingType.length > 20
  964. ) {
  965. this.$message({
  966. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  967. type: 'warning',
  968. })
  969. return
  970. }
  971. if (!this.deptBudgetList.buyer) {
  972. this.$message({
  973. message: '买方名称不能为空',
  974. type: 'warning',
  975. })
  976. return
  977. }
  978. if (this.deptBudgetList.buyer.length > 30) {
  979. this.$message({
  980. message: '买方名称长度不符合要求,请输入30个字符之内!',
  981. type: 'warning',
  982. })
  983. return
  984. }
  985. if (!this.deptBudgetList.settlementMethod) {
  986. this.$message({
  987. message: '结算方式不能为空',
  988. type: 'warning',
  989. })
  990. return
  991. }
  992. if (
  993. this.deptBudgetList.settlementMethod.length < 1 ||
  994. this.deptBudgetList.settlementMethod.length > 20
  995. ) {
  996. this.$message({
  997. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  998. type: 'warning',
  999. })
  1000. return
  1001. }
  1002. if (!this.deptBudgetList.seller) {
  1003. this.$message({
  1004. message: '请输入卖方名称!',
  1005. type: 'warning',
  1006. })
  1007. return
  1008. }
  1009. if (this.deptBudgetList.seller.length > 30) {
  1010. this.$message({
  1011. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  1012. type: 'warning',
  1013. })
  1014. return
  1015. }
  1016. if (!this.deptBudgetList.buyerPhone) {
  1017. this.$message({
  1018. message: '请输入买方电话!',
  1019. type: 'warning',
  1020. })
  1021. return
  1022. }
  1023. if (isNaN(this.deptBudgetList.buyerPhone)) {
  1024. this.$message({
  1025. message: '输入买方电话有误!',
  1026. type: 'warning',
  1027. })
  1028. return
  1029. }
  1030. if (!this.deptBudgetList.sellerPhone) {
  1031. this.$message({
  1032. message: '请输入卖方电话!',
  1033. type: 'warning',
  1034. })
  1035. return
  1036. }
  1037. // if (isNaN(this.deptBudgetList.sellerPhone)) {
  1038. // this.$message({
  1039. // message: '输入卖方电话有误!',
  1040. // type: 'warning',
  1041. // })
  1042. // return
  1043. // }
  1044. if (!this.deptBudgetList.acceptanceMethod) {
  1045. this.$message({
  1046. message: '请选择验收方式',
  1047. type: 'warning',
  1048. })
  1049. return
  1050. }
  1051. if (!this.deptBudgetList.weight) {
  1052. this.$message({
  1053. message: '请输入重量!',
  1054. type: 'warning',
  1055. })
  1056. return
  1057. }
  1058. if (
  1059. isNaN(this.deptBudgetList.weight) ||
  1060. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  1061. String(this.deptBudgetList.weight).length -
  1062. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  1063. 3) ||
  1064. this.deptBudgetList.weight < 0 ||
  1065. this.deptBudgetList.weight > 200000
  1066. ) {
  1067. this.$message({
  1068. message: '输入重量有误!',
  1069. type: 'warning',
  1070. })
  1071. return
  1072. }
  1073. if (!this.deptBudgetList.deliveryDateStart) {
  1074. this.$message({
  1075. message: '请选择交货日期(起)',
  1076. type: 'warning',
  1077. })
  1078. return
  1079. }
  1080. if (!this.deptBudgetList.overShort) {
  1081. this.$message({
  1082. message: '请输入溢短装!',
  1083. type: 'warning',
  1084. })
  1085. return
  1086. }
  1087. if (
  1088. isNaN(this.deptBudgetList.overShort) ||
  1089. (String(this.deptBudgetList.overShort).indexOf('.') != -1 &&
  1090. String(this.deptBudgetList.overShort).length -
  1091. (String(this.deptBudgetList.overShort).indexOf('.') + 1) >
  1092. 2) ||
  1093. this.deptBudgetList.overShort < 0 ||
  1094. this.deptBudgetList.overShort > 50
  1095. ) {
  1096. this.$message({
  1097. message: '溢短装输入有误!',
  1098. type: 'warning',
  1099. })
  1100. return
  1101. }
  1102. if (!this.deptBudgetList.deliveryDateEnd) {
  1103. this.$message({
  1104. message: '请选择交货日期(止)',
  1105. type: 'warning',
  1106. })
  1107. return
  1108. }
  1109. //时间
  1110. if (
  1111. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1112. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1113. ) {
  1114. this.$message({
  1115. message: '交货日期(止)选择错误',
  1116. type: 'warning',
  1117. })
  1118. return
  1119. }
  1120. if (!this.deptBudgetList.priceType) {
  1121. this.$message({
  1122. message: '请选择价格类型',
  1123. type: 'warning',
  1124. })
  1125. return
  1126. }
  1127. if (this.deptBudgetList.priceType == '定价采购') {
  1128. if (!this.deptBudgetList.unitContractPrice) {
  1129. this.$message({
  1130. message: '请输入合同单价!',
  1131. type: 'warning',
  1132. })
  1133. return
  1134. }
  1135. if (
  1136. isNaN(this.deptBudgetList.unitContractPrice) ||
  1137. (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
  1138. String(this.deptBudgetList.unitContractPrice).length -
  1139. (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
  1140. 2) ||
  1141. this.deptBudgetList.unitContractPrice <= 0 ||
  1142. this.deptBudgetList.unitContractPrice > 10000
  1143. ) {
  1144. this.$message({
  1145. message: '合同单价输入有误!',
  1146. type: 'warning',
  1147. })
  1148. return
  1149. }
  1150. if (!this.deptBudgetList.totalContractPrice) {
  1151. this.$message({
  1152. message: '请输入合同总价!',
  1153. type: 'warning',
  1154. })
  1155. return
  1156. }
  1157. if (
  1158. isNaN(this.deptBudgetList.totalContractPrice) ||
  1159. (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
  1160. String(this.deptBudgetList.totalContractPrice).length -
  1161. (String(this.deptBudgetList.totalContractPrice).indexOf('.') +
  1162. 1) >
  1163. 2) ||
  1164. this.deptBudgetList.totalContractPrice <= 0 ||
  1165. this.deptBudgetList.totalContractPrice > 1000000000
  1166. ) {
  1167. this.$message({
  1168. message: '合同总价输入有误!',
  1169. type: 'warning',
  1170. })
  1171. return
  1172. }
  1173. }
  1174. if (!this.newSelectedOptions) {
  1175. this.$message({
  1176. message: '请选择货源所在地区!',
  1177. type: 'warning',
  1178. })
  1179. return
  1180. }
  1181. if (!this.deptBudgetList.sourceGoods) {
  1182. this.$message({
  1183. message: '请输入货源详细地址!',
  1184. type: 'warning',
  1185. })
  1186. return
  1187. }
  1188. if (!this.newSelectedOptions1) {
  1189. this.$message({
  1190. message: '请选择交货所在地区!',
  1191. type: 'warning',
  1192. })
  1193. return
  1194. }
  1195. if (!this.deptBudgetList.placeDelivery) {
  1196. this.$message({
  1197. message: '请输入交货详细地址!',
  1198. type: 'warning',
  1199. })
  1200. return
  1201. }
  1202. if (!this.deptBudgetList.signingDate) {
  1203. this.$message({
  1204. message: '请选择签订日期',
  1205. type: 'warning',
  1206. })
  1207. return
  1208. }
  1209. if (
  1210. isNaN(this.deptBudgetList.finalTradingVolume) ||
  1211. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') != -1 &&
  1212. String(this.deptBudgetList.finalTradingVolume).length -
  1213. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') + 1) >
  1214. 3) ||
  1215. this.deptBudgetList.finalTradingVolume < 0 ||
  1216. this.deptBudgetList.finalTradingVolume > 200000
  1217. ) {
  1218. this.$message({
  1219. message: '最终实际成交量有误!',
  1220. type: 'warning',
  1221. })
  1222. return
  1223. }
  1224. //货物信息
  1225. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1226. this.$message({
  1227. message: '请选择货名',
  1228. type: 'warning',
  1229. })
  1230. return
  1231. }
  1232. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1233. this.$message({
  1234. message: '请输入水分',
  1235. type: 'warning',
  1236. })
  1237. return
  1238. }
  1239. if (
  1240. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1241. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1242. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1243. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1244. 2 || this.deptBudgetList.contractGoodsInfo.waterContent > 40 || this.deptBudgetList.contractGoodsInfo
  1245. .waterContent < 0
  1246. ) {
  1247. this.$message({
  1248. message: '水分输入错误',
  1249. type: 'warning',
  1250. })
  1251. return
  1252. }
  1253. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1254. this.$message({
  1255. message: '请选择品级',
  1256. type: 'warning',
  1257. })
  1258. return
  1259. }
  1260. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1261. this.$message({
  1262. message: '请输入杂质',
  1263. type: 'warning',
  1264. })
  1265. return
  1266. }
  1267. if (
  1268. this.deptBudgetList.contractGoodsInfo.impurity &&
  1269. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1270. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1271. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1272. 2 || this.deptBudgetList.contractGoodsInfo.impurity > 40 || this.deptBudgetList.contractGoodsInfo.impurity < 0
  1273. ) {
  1274. this.$message({
  1275. message: '杂质输入错误',
  1276. type: 'warning',
  1277. })
  1278. return
  1279. }
  1280. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1281. this.$message({
  1282. message: '请输入容重',
  1283. type: 'warning',
  1284. })
  1285. return
  1286. }
  1287. if (
  1288. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1289. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1290. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1291. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1292. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo
  1293. .bulkDensity < 0
  1294. ) {
  1295. this.$message({
  1296. message: '容重输入错误',
  1297. type: 'warning',
  1298. })
  1299. return
  1300. }
  1301. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1302. this.$message({
  1303. message: '请输入霉变粒',
  1304. type: 'warning',
  1305. })
  1306. return
  1307. }
  1308. if (
  1309. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1310. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1311. '.'
  1312. ) != -1 &&
  1313. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1314. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1315. '.'
  1316. ) +
  1317. 1) >
  1318. 2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1319. .mildewGrain < 0)
  1320. ) {
  1321. this.$message({
  1322. message: '霉变粒输入错误',
  1323. type: 'warning',
  1324. })
  1325. return
  1326. }
  1327. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1328. this.$message({
  1329. message: '请输入热损伤',
  1330. type: 'warning',
  1331. })
  1332. return
  1333. }
  1334. if (
  1335. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1336. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1337. -1 &&
  1338. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1339. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1340. '.'
  1341. ) +
  1342. 1) >
  1343. 2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
  1344. .jiaorenli < 0)
  1345. ) {
  1346. this.$message({
  1347. message: '热损伤输入错误',
  1348. type: 'warning',
  1349. })
  1350. return
  1351. }
  1352. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1353. this.$message({
  1354. message: '请输入不完善粒',
  1355. type: 'warning',
  1356. })
  1357. return
  1358. }
  1359. if (
  1360. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1361. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1362. '.'
  1363. ) != -1 &&
  1364. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1365. (String(
  1366. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1367. ).indexOf('.') +
  1368. 1) >
  1369. 2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1370. .imperfectGrain < 0)
  1371. ) {
  1372. this.$message({
  1373. message: '不完善粒输入错误',
  1374. type: 'warning',
  1375. })
  1376. return
  1377. }
  1378. // if (
  1379. // (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) ||
  1380. // (this.deptBudgetList.contractProcessInfo.goodsNameKey < 100) ||
  1381. // (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1382. // '.'
  1383. // ) != -1 &&
  1384. // String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1385. // (String(
  1386. // this.deptBudgetList.contractProcessInfo.goodsNameKey
  1387. // ).indexOf('.') +
  1388. // 1) >
  1389. // 2)
  1390. // ) {
  1391. // this.$message({
  1392. // message: '合同收入金额输入错误',
  1393. // type: 'warning',
  1394. // })
  1395. // return
  1396. // }
  1397. if (
  1398. (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) ||
  1399. (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
  1400. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1401. '.'
  1402. ) != -1 &&
  1403. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1404. (String(
  1405. this.deptBudgetList.contractProcessInfo.waterContent
  1406. ).indexOf('.') +
  1407. 1) >
  1408. 2)
  1409. ) {
  1410. this.$message({
  1411. message: '费用支出输入错误',
  1412. type: 'warning',
  1413. })
  1414. return
  1415. }
  1416. if (
  1417. (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
  1418. (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
  1419. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1420. '.'
  1421. ) != -1 &&
  1422. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1423. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1424. '.'
  1425. ) +
  1426. 1) >
  1427. 2)
  1428. ) {
  1429. this.$message({
  1430. message: '已开发票金额输入错误',
  1431. type: 'warning',
  1432. })
  1433. return
  1434. }
  1435. if (
  1436. (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
  1437. (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
  1438. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1439. '.'
  1440. ) != -1 &&
  1441. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1442. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1443. '.'
  1444. ) +
  1445. 1) >
  1446. 2)
  1447. ) {
  1448. this.$message({
  1449. message: '未开发票金额输入错误',
  1450. type: 'warning',
  1451. })
  1452. return
  1453. }
  1454. if (
  1455. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
  1456. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1457. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1458. '.'
  1459. ) != -1 &&
  1460. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1461. (String(
  1462. this.deptBudgetList.contractProcessInfo.mildewGrain
  1463. ).indexOf('.') +
  1464. 1) >
  1465. 2)
  1466. ) {
  1467. this.$message({
  1468. message: '未回款金额输入错误',
  1469. type: 'warning',
  1470. })
  1471. return
  1472. }
  1473. this.$refs.deptBudgetList.validate((valid) => {
  1474. if (valid) {
  1475. if(this.deptBudgetList.personPhone){
  1476. this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.toString()
  1477. }
  1478. this.deptBudgetList.compId = this.compId
  1479. this.deptBudgetList.contractType = 2
  1480. this.deptBudgetList.goodsType = 1
  1481. addList(this.deptBudgetList)
  1482. .toPromise()
  1483. .then((response) => {
  1484. // 存储买方、卖方、买方电话、卖方电话
  1485. let _data = {
  1486. byer: this.deptBudgetList.buyer,
  1487. seller: this.deptBudgetList.seller,
  1488. buyerPhone: this.deptBudgetList.buyerPhone,
  1489. sellerPhone: this.deptBudgetList.sellerPhone
  1490. }
  1491. if (this.restaurants1.length <= 20) {
  1492. this.restaurants1 = this.restaurants1.filter(function(val) {
  1493. if (val.value != _data.byer) {
  1494. return val
  1495. }
  1496. })
  1497. this.restaurants1.unshift({
  1498. value: _data.byer
  1499. })
  1500. } else {
  1501. this.restaurants1.unshift({
  1502. value: _data.byer
  1503. }).pop({
  1504. value: _data.byer
  1505. })
  1506. }
  1507. localStorage.setItem('deptBudgetList_data1', JSON.stringify(this.restaurants1));
  1508. if (this.restaurants2.length <= 20) {
  1509. this.restaurants2 = this.restaurants2.filter(function(val) {
  1510. if (val.value != _data.seller) {
  1511. return val
  1512. }
  1513. })
  1514. this.restaurants2.unshift({
  1515. value: _data.seller
  1516. })
  1517. } else {
  1518. this.restaurants2.unshift({
  1519. value: _data.seller
  1520. }).pop({
  1521. value: _data.seller
  1522. })
  1523. }
  1524. localStorage.setItem('deptBudgetList_data2', JSON.stringify(this.restaurants2));
  1525. if (this.restaurants2.length <= 20) {
  1526. this.restaurants3 = this.restaurants3.filter(function(val) {
  1527. if (val.value != _data.buyerPhone) {
  1528. return val
  1529. }
  1530. })
  1531. this.restaurants3.unshift({
  1532. value: _data.buyerPhone
  1533. })
  1534. } else {
  1535. this.restaurants3.unshift({
  1536. value: _data.buyerPhone
  1537. }).pop({
  1538. value: _data.buyerPhone
  1539. })
  1540. }
  1541. localStorage.setItem('deptBudgetList_data3', JSON.stringify(this.restaurants3));
  1542. if (this.restaurants4.length <= 20) {
  1543. this.restaurants4 = this.restaurants3.filter(function(val) {
  1544. if (val.value != _data.sellerPhone) {
  1545. return val
  1546. }
  1547. })
  1548. this.restaurants4.unshift({
  1549. value: _data.sellerPhone
  1550. })
  1551. } else {
  1552. this.restaurants4.unshift({
  1553. value: _data.sellerPhone
  1554. }).pop({
  1555. value: _data.sellerPhone
  1556. })
  1557. }
  1558. localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
  1559. this.$message.success('添加成功')
  1560. this.deptBudgetList = {
  1561. deliverType: '1',
  1562. sourceGoods:'',
  1563. placeDelivery:'',
  1564. agreementType: '采购合同',
  1565. addressUrl: '',
  1566. sellerPhone:'',
  1567. personPhone:'',
  1568. personCharge:'',
  1569. personChargeKey:'',
  1570. finalTradingVolume: 0,
  1571. totalContractPrice: 0,
  1572. contractGoodsInfo: {
  1573. goodsName: '',
  1574. },
  1575. contractProcessInfo: {},
  1576. settlementWeightMethod: '1',
  1577. }
  1578. this.$router.push({
  1579. path: 'buyContract'
  1580. })
  1581. })
  1582. } else {
  1583. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1584. return false
  1585. }
  1586. })
  1587. },
  1588. resetForm(deptBudgetList) {
  1589. this.$refs[deptBudgetList].resetFields()
  1590. },
  1591. //选择合同类型
  1592. selectType(e) {
  1593. for (var i = 0; i < this.invoiceList.length; i++) {
  1594. if (this.agreementList[i].constValue == e) {
  1595. this.deptBudgetList.agreementType = this.agreementList[i].constValue
  1596. }
  1597. }
  1598. },
  1599. addClick() {
  1600. this.unitList.push({
  1601. flag: 'add',
  1602. constValue: '',
  1603. constKey: '',
  1604. })
  1605. },
  1606. saveClick(item, index) {
  1607. if (Object.is(item.id, 1)) {
  1608. return
  1609. }
  1610. if (Object.is(this.unitList[index].flag, 'delete')) {
  1611. this.$set(this.unitList, index, {
  1612. flag: 'check'
  1613. })
  1614. } else {
  1615. this.$set(this.unitList, index, {
  1616. flag: 'delete'
  1617. })
  1618. }
  1619. if (!item.constValue) {
  1620. this.unitList.splice(index, 1)
  1621. return
  1622. }
  1623. if (item.flag == 'add') {
  1624. item.constKey = Math.random() * 20
  1625. this.acceptanceCheck.compId = this.compId
  1626. this.acceptanceCheck.constKey = item.constKey
  1627. this.acceptanceCheck.constCode = 'TYPEYAN'
  1628. this.acceptanceCheck.constValue = item.constValue
  1629. this.acceptanceCheck.id = item.id
  1630. addxiala(this.acceptanceCheck)
  1631. .toPromise()
  1632. .then((response) => {
  1633. this.getUnitList()
  1634. })
  1635. } else if (item.flag == 'check') {
  1636. this.acceptanceCheck.compId = this.compId
  1637. this.acceptanceCheck.constKey = item.constKey
  1638. this.acceptanceCheck.constCode = 'TYPEYAN'
  1639. this.acceptanceCheck.constValue = item.constValue
  1640. this.acceptanceCheck.id = item.id
  1641. editxiala(this.acceptanceCheck)
  1642. .toPromise()
  1643. .then((response) => {
  1644. this.getUnitList()
  1645. })
  1646. }
  1647. },
  1648. selectChapterTwo(e) {
  1649. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1650. if (this.ChapterTwoList[i].constValue == e) {
  1651. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1652. }
  1653. }
  1654. },
  1655. selectunitList(e) {
  1656. for (var i = 0; i < this.unitList.length; i++) {
  1657. if (this.unitList[i].constValue == e) {
  1658. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1659. }
  1660. }
  1661. },
  1662. selectgrade(e) {
  1663. for (var i = 0; i < this.gradeList.length; i++) {
  1664. if (this.gradeList[i].constValue == e) {
  1665. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1666. this.deptBudgetList.contractGoodsInfo.gradeKey =
  1667. this.gradeList[i].constKey
  1668. }
  1669. }
  1670. },
  1671. selectgoodsName(e) {
  1672. for (var i = 0; i < this.goodnameList.length; i++) {
  1673. if (this.goodnameList[i].constValue == e) {
  1674. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1675. this.deptBudgetList.contractGoodsInfo.goodsNameKey = this.goodnameList[i].constKey
  1676. }
  1677. }
  1678. },
  1679. selectpackingMethod(e) {
  1680. for (var i = 0; i < this.packtypeList.length; i++) {
  1681. if (this.packtypeList[i].constValue == e) {
  1682. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1683. }
  1684. }
  1685. },
  1686. // 编辑
  1687. editClick(item, index) {
  1688. const map = JSON.parse(JSON.stringify(item))
  1689. if (Object.is(item.id, 1)) {
  1690. return
  1691. }
  1692. if (Object.is(this.unitList[index].flag, 'delete')) {
  1693. map.flag = 'check'
  1694. this.$set(this.unitList, index, map)
  1695. } else {
  1696. map.flag = 'delete'
  1697. this.$set(this.unitList, index, map)
  1698. }
  1699. },
  1700. // 删除
  1701. deleteClick(item, index) {
  1702. if (Object.is(item.constKey, 1)) {
  1703. return
  1704. }
  1705. if (!item.constValue) {
  1706. this.unitList.splice(index, 1)
  1707. return
  1708. }
  1709. delxiala({
  1710. id: this.unitList[index].id
  1711. })
  1712. .toPromise()
  1713. .then((response) => {
  1714. this.getUnitList()
  1715. this.pleaseChoose = ''
  1716. })
  1717. },
  1718. },
  1719. }
  1720. </script>
  1721. <style lang="scss" scoped>
  1722. .el-form {
  1723. padding: 0 15%;
  1724. }
  1725. /deep/.ws-info-table .el-form-item {
  1726. border-right: 1px solid #cdd2dc;
  1727. border-bottom: 1px solid #cdd2dc;
  1728. }
  1729. .readonly {
  1730. position: relative;
  1731. }
  1732. .readonly:after {
  1733. content: '*';
  1734. color: #ff2727;
  1735. position: absolute;
  1736. right: 8px;
  1737. z-index: 10;
  1738. top: 21%;
  1739. font-size: 20px;
  1740. }
  1741. .title {
  1742. position: relative;
  1743. }
  1744. .title::before {
  1745. content: '';
  1746. display: inline-block;
  1747. width: 5px;
  1748. height: 30px;
  1749. background: #5473e8;
  1750. position: absolute;
  1751. left: 0;
  1752. }
  1753. .el-button--primary {
  1754. background-color: #5878e8;
  1755. border-color: #5878e8;
  1756. }
  1757. .bg {
  1758. background: #f6f7fc;
  1759. }
  1760. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1761. padding: 0 25px;
  1762. border-left: 1px solid #cdd2dc;
  1763. background: #fafbfc;
  1764. }
  1765. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1766. width: 140px;
  1767. text-align: center;
  1768. background: #f0f2f6;
  1769. // border: 1px solid #cdd2dc;
  1770. }
  1771. // .button-container {
  1772. // display: flex;
  1773. // flex-wrap: nowrap;
  1774. // justify-content: space-between;
  1775. // align-items: center;
  1776. // background-color: #fff;
  1777. // width: 100%;
  1778. // height: 50px;
  1779. // padding: 0 10px;
  1780. // &>div {
  1781. // margin-left: 10px;
  1782. // display: flex;
  1783. // flex-wrap: nowrap;
  1784. // flex-direction: row;
  1785. // &>span {
  1786. // line-height: 50px;
  1787. // }
  1788. // }
  1789. // /deep/.auditFlow-box {
  1790. // position: unset;
  1791. // margin-left: 10px;
  1792. // &/deep/.auditFlow-icon {
  1793. // width: auto;
  1794. // padding-right: 30px;
  1795. // }
  1796. // &/deep/.auditFlow-main {
  1797. // position: absolute;
  1798. // }
  1799. // }
  1800. // }
  1801. // .box-app {
  1802. // display: inline-block;
  1803. // float: left;
  1804. // margin-left: 30px;
  1805. // line-height: 50px;
  1806. // }
  1807. /deep/.el-dialog {
  1808. .el-form-item {
  1809. margin-bottom: 0 !important;
  1810. .el-input--medium {
  1811. textarea {
  1812. min-height: 100px !important;
  1813. }
  1814. }
  1815. }
  1816. }
  1817. .collapse-bottom {
  1818. margin-bottom: 20px;
  1819. }
  1820. .input-main .textarea .el-textarea__inner {
  1821. width: 100%;
  1822. z-index: 1;
  1823. }
  1824. .bg-left {
  1825. padding-left: 30px;
  1826. }
  1827. .bg-right {
  1828. padding-right: 10px;
  1829. text-align: right;
  1830. }
  1831. .bg-bottom {
  1832. margin: 15px 0px;
  1833. }
  1834. .wenzi h3 {
  1835. display: inline-block;
  1836. left: 10px;
  1837. }
  1838. .wenzi p {
  1839. display: inline-block;
  1840. }
  1841. .upload-demo {
  1842. margin-top: 10px;
  1843. }
  1844. .center {
  1845. width: 70%;
  1846. margin: 0 auto;
  1847. }
  1848. .el-form-item {
  1849. width: 50%;
  1850. }
  1851. .el-form-item__label {
  1852. text-align: center;
  1853. }
  1854. .ce {
  1855. width: 900px;
  1856. margin: 0 auto;
  1857. }
  1858. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1859. /* height: 82px;*/
  1860. /*}*/
  1861. // 控制select为只读的时候显示样式
  1862. // .hide-sel {
  1863. // .el-input__inner {
  1864. // border: 0px;
  1865. // }
  1866. // .el-icon-arrow-up {
  1867. // display: none;
  1868. // }
  1869. // .el-textarea__inner {
  1870. // background-color: #fff !important;
  1871. // border: 0;
  1872. // }
  1873. // .el-date-editor {
  1874. // i {
  1875. // display: none;
  1876. // }
  1877. // }
  1878. // .is-disabled {
  1879. // .el-input__inner:hover {
  1880. // background-color: #fff !important;
  1881. // border: 0;
  1882. // }
  1883. // color: #606266;
  1884. // .el-input__inner {
  1885. // background-color: #fff !important;
  1886. // border: 0;
  1887. // color: #606266;
  1888. // }
  1889. // .el-textarea__inner {
  1890. // background-color: #fff !important;
  1891. // border: 0;
  1892. // color: #606266;
  1893. // }
  1894. // }
  1895. // }
  1896. // 控制select为只读的时候显示样式
  1897. /deep/.ws-class-table-col {
  1898. height: auto;
  1899. padding: 0px 2px;
  1900. /deep/.el-input__inner {
  1901. padding: 0px 2px;
  1902. }
  1903. }
  1904. /deep/.is-disabled {
  1905. .el-input__prefix,
  1906. .el-input__suffix {
  1907. display: none;
  1908. }
  1909. .el-input__inner {
  1910. background-color: #fff;
  1911. border-color: #fff !important;
  1912. color: #000 !important;
  1913. font-size: 14px;
  1914. cursor: text;
  1915. padding: 0 !important;
  1916. }
  1917. }
  1918. .winseaview-view {
  1919. padding: 0 0 20px;
  1920. }
  1921. .container {
  1922. overflow: scroll;
  1923. height: 93vh;
  1924. }
  1925. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1926. width: 130px;
  1927. }
  1928. .el-textarea {
  1929. width: 101%;
  1930. }
  1931. // .addressUrls {
  1932. // width: 100%;
  1933. // display: flex;
  1934. // margin-top: 10px;
  1935. // }
  1936. // .addressUrls-item {
  1937. // position: relative;
  1938. // display: flex;
  1939. // }
  1940. .icon-guanbi {
  1941. position: absolute;
  1942. right: 8px;
  1943. }
  1944. .addressUrl {
  1945. margin: 0px 10px;
  1946. border-radius: 3px;
  1947. }
  1948. //上传文件成功标识
  1949. /deep/.el-upload-list__item-status-label {
  1950. position: absolute;
  1951. right: 22px;
  1952. top: -1px;
  1953. line-height: inherit;
  1954. display: none;
  1955. }
  1956. .map {
  1957. position: fixed;
  1958. top: 0;
  1959. bottom: 0;
  1960. left: 0;
  1961. right: 0;
  1962. margin: auto;
  1963. width: 850px;
  1964. height: 400px;
  1965. background: gainsboro;
  1966. border-radius: 20px;
  1967. padding: 10px;
  1968. box-sizing: border-box;
  1969. z-index: 99;
  1970. }
  1971. .amap-container {
  1972. width: 100% !important;
  1973. }
  1974. .address-btn {
  1975. width: 100%;
  1976. text-align: left;
  1977. color:#000;
  1978. border:1px solid #ccc;
  1979. }
  1980. .inline-input {
  1981. width: 100%;
  1982. }
  1983. </style>