purchaseContractAdd.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067
  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. //弹出框
  433. dialogViewSpareMoney: false,
  434. dialogApproveFormVisible: false,
  435. // 船舶类型
  436. monetaryKey: null,
  437. contractNo:'',
  438. // 表格显示数据
  439. tableDate: [],
  440. // 是否显示
  441. showType: true,
  442. // 年
  443. year: '',
  444. options_: regionData,
  445. selectedOptions: [],
  446. newSelectedOptions: '请选择货源所在地',
  447. selectedOptions1: [],
  448. newSelectedOptions1: '请选择交货所在地区',
  449. // 提交类型
  450. submitType: true,
  451. tableData: [{
  452. date: '',
  453. name: '',
  454. address: ''
  455. }],
  456. packtypeList: [],
  457. compId: localStorage.getItem('ws-pf_compId'),
  458. rules: {
  459. // contractNo: [
  460. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  461. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  462. // ],
  463. },
  464. options: [],
  465. staffList: [],
  466. appendixIdsAdd: '',
  467. size: 10,
  468. unitList: [],
  469. agreementList: [{
  470. constValue: '采购合同',
  471. constKey: '1'
  472. },
  473. {
  474. constValue: '补充协议',
  475. constKey: '2'
  476. },
  477. ],
  478. contractNoList: [],
  479. priceTypeList: ['定价采购', '随行就市'],
  480. goodnameList: [],
  481. value1: '袋装',
  482. value2: '未回收',
  483. gradeList: [],
  484. ChapterTwoList: [],
  485. agreementType: '',
  486. deptBudgetList: {
  487. deliverType: '1',
  488. sourceGoods:'',
  489. placeDelivery:'',
  490. agreementType: '采购合同',
  491. addressUrl: '',
  492. sellerPhone:'',
  493. personPhone:'',
  494. personCharge:'',
  495. personChargeKey:'',
  496. finalTradingVolume: 0,
  497. totalContractPrice: 0,
  498. contractGoodsInfo: {
  499. goodsName: '',
  500. },
  501. contractProcessInfo: {},
  502. settlementWeightMethod: '1',
  503. },
  504. acceptanceCheck: {},
  505. pickerBeginDateBefore: {
  506. disabledDate: (time) => {
  507. return time.getTime() > Date.now()
  508. },
  509. },
  510. ruleDeptBudget: {
  511. contractNo: [{
  512. required: true,
  513. message: '请输入活动名称',
  514. trigger: 'blur'
  515. },
  516. {
  517. min: 6,
  518. max: 50,
  519. message: '长度在 6 到 50 个字符',
  520. trigger: 'blur',
  521. },
  522. ],
  523. },
  524. selectIntendedShip: {},
  525. interviewTypeList: {},
  526. feedbackLeaders:[],//发货反馈负责人
  527. }
  528. },
  529. activated() {
  530. this.selectedOptions = []
  531. this.selectedOptions1 = []
  532. this.newSelectedOptions = '请选择货源所在地'
  533. this.newSelectedOptions1 = '请选择交货所在地'
  534. this.deptBudgetList.packingMethod = '散装'
  535. this.deptBudgetList.packingMethodKey = 1
  536. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  537. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  538. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  539. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  540. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  541. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  542. getstafffind({
  543. roles: 'd6a5c8a52da544309259f91f75de1ec6'
  544. })
  545. .toPromise()
  546. .then((response) => {
  547. this.options = response
  548. this.staffList = response
  549. })
  550. this.loaddata()
  551. this.showType = this.isShow
  552. },
  553. mounted() {
  554. this.restaurants1 = JSON.parse(localStorage.getItem('deptBudgetList_data1'));
  555. this.restaurants2 = JSON.parse(localStorage.getItem('deptBudgetList_data2'));
  556. this.restaurants3 = JSON.parse(localStorage.getItem('deptBudgetList_data3'));
  557. this.restaurants4 = JSON.parse(localStorage.getItem('deptBudgetList_data4'));
  558. if (!this.restaurants1) this.restaurants1 = [];
  559. if (!this.restaurants2) this.restaurants2 = [];
  560. if (!this.restaurants3) this.restaurants3 = [];
  561. if (!this.restaurants4) this.restaurants4 = [];
  562. },
  563. methods: {
  564. selectpriceType(e) {
  565. if (e == '随行就市') {
  566. this.deptBudgetList.deliverType = '1'
  567. }
  568. },
  569. copySelect(e){
  570. for (let i = 0; i < this.outContractNo.length; i++) {
  571. if(this.outContractNo[i].contractNo==e){
  572. examineList({
  573. id: this.outContractNo[i].id
  574. })
  575. .toPromise()
  576. .then((response) => {
  577. this.deptBudgetList = response
  578. if(this.deptBudgetList.personPhone){
  579. this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.split(',')
  580. }
  581. if (this.deptBudgetList.deliverType == 1) {
  582. this.deptBudgetList.deliverType1 = '我方自提'
  583. } else if (this.deptBudgetList.deliverType == 2) {
  584. this.deptBudgetList.deliverType1 = '对方送货'
  585. }
  586. })
  587. }
  588. }
  589. },
  590. cancelcopy(){
  591. this.contractNo=''
  592. this.deptBudgetList={
  593. deliverType: '1',
  594. sourceGoods:'',
  595. placeDelivery:'',
  596. agreementType: '采购合同',
  597. addressUrl: '',
  598. sellerPhone:'',
  599. personPhone:'',
  600. personCharge:'',
  601. personChargeKey:'',
  602. finalTradingVolume: 0,
  603. totalContractPrice: 0,
  604. contractGoodsInfo: {
  605. goodsName: '',
  606. },
  607. contractProcessInfo: {},
  608. settlementWeightMethod: '1',
  609. }
  610. },
  611. feedbackLeaderChange(e){
  612. this.deptBudgetList.feedbackLeaderPhone = ""
  613. for(var num = 0 ; num < e.length ; num++){
  614. for(var i = 0 ; i < this.feedbackLeaders.length ; i++){
  615. if(e[num] == this.feedbackLeaders[i].staffName){
  616. if(!this.deptBudgetList.feedbackLeaderPhone){
  617. this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[i].staffMobilePhone
  618. break
  619. }else{
  620. this.deptBudgetList.feedbackLeaderPhone += ","+this.feedbackLeaders[i].staffMobilePhone
  621. }
  622. }
  623. }
  624. }
  625. this.deptBudgetList.feedbackLeader = e.toString()
  626. // this.deptBudgetList.feedbackLeader = this.feedbackLeaders[e].staffName
  627. // this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[e].staffMobilePhone
  628. },
  629. querySearch1(queryString, cb) {
  630. var restaurants1 = this.restaurants1;
  631. var results = queryString ? restaurants1.filter(this.createFilter(queryString)) : restaurants1;
  632. // 调用 callback 返回建议列表的数据
  633. cb(results);
  634. },
  635. querySearch2(queryString, cb) {
  636. var restaurants2 = this.restaurants2;
  637. var results = queryString ? restaurants2.filter(this.createFilter(queryString)) : restaurants2;
  638. // 调用 callback 返回建议列表的数据
  639. cb(results);
  640. },
  641. querySearch3(queryString, cb) {
  642. var restaurants3 = this.restaurants3;
  643. var results = queryString ? restaurants3.filter(this.createFilter(queryString)) : restaurants3;
  644. // 调用 callback 返回建议列表的数据
  645. cb(results);
  646. },
  647. querySearch4(queryString, cb) {
  648. var restaurants4 = this.restaurants4;
  649. var results = queryString ? restaurants4.filter(this.createFilter(queryString)) : restaurants4;
  650. // 调用 callback 返回建议列表的数据
  651. cb(results);
  652. },
  653. createFilter(queryString) {
  654. return (restaurant) => {
  655. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  656. };
  657. },
  658. handleSelect(item) {
  659. console.log(item);
  660. },
  661. sellerSelect(item) {
  662. console.log(item)
  663. for (let i = 0; i < this.customerinfo.length; i++) {
  664. console.log(this.customerinfo[i].customerName,item)
  665. if(this.customerinfo[i].customerName==item){
  666. this.deptBudgetList.sellerPhone=this.customerinfo[i].customerPhone
  667. }
  668. }
  669. },
  670. getAddress(data) {
  671. console.log('getAddress', data)
  672. if (data[4] == 'source') {
  673. this.newSelectedOptions = data[0] + '/' + data[1] + '/' + data[2]
  674. this.deptBudgetList.sourceProvince = data[0]
  675. this.deptBudgetList.sourceCity = data[1]
  676. this.deptBudgetList.sourceArea = data[2]
  677. this.deptBudgetList.sourceGoods = data[3]
  678. console.log(data[4])
  679. this.deptBudgetList.sourceLocation=data[5].lat+','+data[5].lng
  680. } else {
  681. this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
  682. this.deptBudgetList.deliveryProvince = data[0]
  683. this.deptBudgetList.deliveryCity = data[1]
  684. this.deptBudgetList.deliveryArea = data[2]
  685. this.deptBudgetList.placeDelivery = data[3]
  686. this.deptBudgetList.deliveryLocation=data[5].lat+','+data[5].lng
  687. }
  688. },
  689. mapInputClick(type) {
  690. this.dialogVisible = true
  691. this.type = type
  692. },
  693. marker: function(item) {
  694. this.deptBudgetList.warehousePositioning =
  695. item.lnglat.lat + ',' + item.lnglat.lng
  696. },
  697. selectedAddress(e) {
  698. this.deptBudgetList.warehousePositioning =
  699. e.center.lat + ',' + e.center.lng
  700. },
  701. provinceChange(e) {
  702. console.log(CodeToText[e])
  703. },
  704. blurMap() {
  705. this.dialogVisible = false
  706. },
  707. focusMap() {
  708. this.dialogVisible = true
  709. },
  710. dataFilter(val) {
  711. this.deptBudgetList.personCharge = val
  712. if (val) {
  713. //val存在
  714. this.options = this.staffList.filter((item) => {
  715. if (
  716. !!~item.staffName.indexOf(val) ||
  717. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  718. ) {
  719. return true
  720. }
  721. })
  722. } else {
  723. //val为空时,还原数组
  724. this.options = this.staffList
  725. }
  726. },
  727. selectstaff(e) {
  728. // this.deptBudgetList.personPhone=''
  729. // this.deptBudgetList.personChargeKey=''
  730. // for (var i = 0; i < this.staffList.length; i++) {
  731. // if (e.indexOf(this.staffList[i].staffName)!=-1) {
  732. // if(this.deptBudgetList.personPhone){
  733. // this.deptBudgetList.personPhone= this.deptBudgetList.personPhone+','+ this.staffList[i].staffMobilePhone
  734. // }else{
  735. // this.deptBudgetList.personPhone=this.staffList[i].staffMobilePhone
  736. // }
  737. // if(this.deptBudgetList.personChargeKey){
  738. // this.deptBudgetList.personChargeKey= this.deptBudgetList.personChargeKey+','+ this.staffList[i].staffId
  739. // }else{
  740. // this.deptBudgetList.personChargeKey= this.staffList[i].staffId
  741. // }
  742. // }
  743. // }
  744. this.deptBudgetList.personCharge=''
  745. for (var i = 0; i < this.staffList.length; i++) {
  746. for (var j = 0; j < e.length; j++) {
  747. if (this.staffList[i].staffMobilePhone == e[j]) {
  748. this.deptBudgetList.personCharge += this.staffList[i].staffName + ' ' + this.staffList[i]
  749. .staffMobilePhone + ','
  750. }
  751. }
  752. }
  753. console.log(this.deptBudgetList)
  754. },
  755. // 关闭 dialog时 处理文件url 初始化upload组件
  756. handleClose() {
  757. this.dialogViewSpareMoney = false
  758. },
  759. handleChange(value) {
  760. this.selectedOptions = value
  761. },
  762. handleChange1(value) {
  763. this.selectedOptions1 = value
  764. },
  765. weightchange(e) {
  766. this.deptBudgetList.finalTradingVolume = e
  767. },
  768. pricechange(e) {
  769. this.deptBudgetList.totalContractPrice = e * this.deptBudgetList.weight
  770. },
  771. returnsales() {
  772. this.deptBudgetList = {
  773. deliverType: '1',
  774. sourceGoods:'',
  775. placeDelivery:'',
  776. agreementType: '采购合同',
  777. addressUrl: '',
  778. sellerPhone:'',
  779. personPhone:'',
  780. personCharge:'',
  781. personChargeKey:'',
  782. finalTradingVolume: 0,
  783. totalContractPrice: 0,
  784. contractGoodsInfo: {
  785. goodsName: '',
  786. },
  787. contractProcessInfo: {},
  788. settlementWeightMethod: '1',
  789. }
  790. this.$router.push({
  791. path: 'buyContract'
  792. })
  793. },
  794. loaddata() {
  795. // 合同编号
  796. xialaNo({
  797. compId: localStorage.getItem('ws-pf_compId'),
  798. flag: 0,
  799. })
  800. .toPromise()
  801. .then((response) => {
  802. this.outContractNo = response
  803. })
  804. // 包装方式
  805. packList({
  806. constId: 'CON1'
  807. })
  808. .toPromise()
  809. .then((response) => {
  810. this.packtypeList = response
  811. })
  812. // 验收方式
  813. this.getUnitList()
  814. // 货名
  815. packList({
  816. constId: 'CON2'
  817. })
  818. .toPromise()
  819. .then((response) => {
  820. this.goodnameList = response
  821. })
  822. // 品级
  823. packList({
  824. constId: 'CON3'
  825. })
  826. .toPromise()
  827. .then((response) => {
  828. this.gradeList = response
  829. })
  830. // 双章
  831. packList({
  832. constId: 'CON4'
  833. })
  834. .toPromise()
  835. .then((response) => {
  836. this.ChapterTwoList = response
  837. })
  838. // 发货反馈负责人
  839. getstaff({
  840. compId: localStorage.getItem('ws-pf_compId')
  841. })
  842. .toPromise()
  843. .then((response) => {
  844. this.feedbackLeaders = response
  845. let _obj = [] //发货反馈负责人下拉列表第一个添加 "无需发货反馈(默认)"
  846. _obj.staffName = "无需发货反馈(默认)"
  847. _obj.staffMobilePhone = "(默认)"
  848. this.feedbackLeaders.unshift(_obj)
  849. })
  850. //关联合同
  851. getRelationContractNo({
  852. agreementType: '采购合同',
  853. goodsType: 1
  854. })
  855. .toPromise()
  856. .then((response) => {
  857. this.contractNoList = response
  858. })
  859. getcustomerinfo({compId: localStorage.getItem('ws-pf_compId'),}).toPromise()
  860. .then((response) => {
  861. var arr=[]
  862. for (let i = 0; i < response.length; i++) {
  863. if(response[i].customerType=='个人客户'){
  864. arr.push({customerName:response[i].customerName,customerPhone:response[i].customerPhone})
  865. }else{
  866. arr.push({customerName:response[i].compName,customerPhone:response[i].customerPhone})
  867. }
  868. }
  869. this.customerinfo = arr
  870. })
  871. },
  872. selectRelation(e) {
  873. // console.log(this.contractNoList)
  874. for (var i = 0; i < this.contractNoList.length; i++) {
  875. if (this.contractNoList[i].contractNo == e) {
  876. this.deptBudgetList = this.contractNoList[i]
  877. this.deptBudgetList.agreementNo = this.contractNoList[i].contractNo
  878. this.deptBudgetList.contractNo = this.contractNoList[i].contractNo
  879. this.deptBudgetList.agreementType = '补充协议'
  880. this.newSelectedOptions = this.contractNoList[i].sourceProvince + this.contractNoList[i].sourceCity + this
  881. .contractNoList[i].sourceArea
  882. this.deptBudgetList.sourceGoods = this.contractNoList[i].sourceGoods
  883. this.newSelectedOptions1 = this.contractNoList[i].deliveryProvince + this.contractNoList[i].deliveryCity +
  884. this.contractNoList[i].deliveryArea
  885. this.deptBudgetList.placeDelivery = this.contractNoList[i].placeDelivery
  886. }
  887. }
  888. },
  889. onChange() {
  890. this.$refs.upload
  891. .handleSaveBill()
  892. .then(async response => {
  893. this.deptBudgetList.addressUrl = response
  894. })
  895. .catch(res => {
  896. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  897. this.$refs.upload.clearFiles()
  898. })
  899. },
  900. getUnitList() {
  901. xiala({
  902. compId: localStorage.getItem('ws-pf_compId'),
  903. constCode: 'TYPEYAN',
  904. })
  905. .toPromise()
  906. .then((response) => {
  907. this.unitList = response
  908. let currItem
  909. this.unitList.forEach((item, index, arr) => {
  910. item.flag = 'delete'
  911. if (this.vModel == item.constKey) {
  912. currItem = item
  913. }
  914. })
  915. //
  916. if (currItem) {
  917. this.selectContract(currItem.constValue)
  918. }
  919. })
  920. },
  921. submit() {
  922. if(this.deptBudgetList.placeDelivery.indexOf('省')>-1){
  923. this.$message({
  924. message: '请手动删除详细地址中省市区/市,避免重复显示省市区/市!',
  925. type: 'warning',
  926. })
  927. return
  928. }
  929. if(this.deptBudgetList.sourceGoods.indexOf('省')>-1){
  930. this.$message({
  931. message: '请手动删除详细地址中省市区/市,避免重复显示省市区/市!',
  932. type: 'warning',
  933. })
  934. return
  935. }
  936. if (!this.deptBudgetList.contractNo) {
  937. this.$message({
  938. message: '合同编号不能为空',
  939. type: 'warning',
  940. })
  941. return
  942. }
  943. if (
  944. this.deptBudgetList.contractNo.length < 6 ||
  945. this.deptBudgetList.contractNo.length > 50
  946. ) {
  947. this.$message({
  948. message: '合同编号长度不符合要求,请输入6到50个字符之内!',
  949. type: 'warning',
  950. })
  951. return
  952. }
  953. if (!this.deptBudgetList.shippingType) {
  954. this.$message({
  955. message: '运输方式不能为空',
  956. type: 'warning',
  957. })
  958. return
  959. }
  960. if (
  961. this.deptBudgetList.shippingType.length < 1 ||
  962. this.deptBudgetList.shippingType.length > 20
  963. ) {
  964. this.$message({
  965. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  966. type: 'warning',
  967. })
  968. return
  969. }
  970. if (!this.deptBudgetList.buyer) {
  971. this.$message({
  972. message: '买方名称不能为空',
  973. type: 'warning',
  974. })
  975. return
  976. }
  977. if (this.deptBudgetList.buyer.length > 30) {
  978. this.$message({
  979. message: '买方名称长度不符合要求,请输入30个字符之内!',
  980. type: 'warning',
  981. })
  982. return
  983. }
  984. if (!this.deptBudgetList.settlementMethod) {
  985. this.$message({
  986. message: '结算方式不能为空',
  987. type: 'warning',
  988. })
  989. return
  990. }
  991. if (
  992. this.deptBudgetList.settlementMethod.length < 1 ||
  993. this.deptBudgetList.settlementMethod.length > 20
  994. ) {
  995. this.$message({
  996. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  997. type: 'warning',
  998. })
  999. return
  1000. }
  1001. if (!this.deptBudgetList.seller) {
  1002. this.$message({
  1003. message: '请输入卖方名称!',
  1004. type: 'warning',
  1005. })
  1006. return
  1007. }
  1008. if (this.deptBudgetList.seller.length > 30) {
  1009. this.$message({
  1010. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  1011. type: 'warning',
  1012. })
  1013. return
  1014. }
  1015. if (!this.deptBudgetList.buyerPhone) {
  1016. this.$message({
  1017. message: '请输入买方电话!',
  1018. type: 'warning',
  1019. })
  1020. return
  1021. }
  1022. if (isNaN(this.deptBudgetList.buyerPhone)) {
  1023. this.$message({
  1024. message: '输入买方电话有误!',
  1025. type: 'warning',
  1026. })
  1027. return
  1028. }
  1029. if (!this.deptBudgetList.sellerPhone) {
  1030. this.$message({
  1031. message: '请输入卖方电话!',
  1032. type: 'warning',
  1033. })
  1034. return
  1035. }
  1036. // if (isNaN(this.deptBudgetList.sellerPhone)) {
  1037. // this.$message({
  1038. // message: '输入卖方电话有误!',
  1039. // type: 'warning',
  1040. // })
  1041. // return
  1042. // }
  1043. if (!this.deptBudgetList.acceptanceMethod) {
  1044. this.$message({
  1045. message: '请选择验收方式',
  1046. type: 'warning',
  1047. })
  1048. return
  1049. }
  1050. if (!this.deptBudgetList.weight) {
  1051. this.$message({
  1052. message: '请输入重量!',
  1053. type: 'warning',
  1054. })
  1055. return
  1056. }
  1057. if (
  1058. isNaN(this.deptBudgetList.weight) ||
  1059. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  1060. String(this.deptBudgetList.weight).length -
  1061. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  1062. 3) ||
  1063. this.deptBudgetList.weight < 0 ||
  1064. this.deptBudgetList.weight > 200000
  1065. ) {
  1066. this.$message({
  1067. message: '输入重量有误!',
  1068. type: 'warning',
  1069. })
  1070. return
  1071. }
  1072. if (!this.deptBudgetList.deliveryDateStart) {
  1073. this.$message({
  1074. message: '请选择交货日期(起)',
  1075. type: 'warning',
  1076. })
  1077. return
  1078. }
  1079. if (!this.deptBudgetList.overShort) {
  1080. this.$message({
  1081. message: '请输入溢短装!',
  1082. type: 'warning',
  1083. })
  1084. return
  1085. }
  1086. if (
  1087. isNaN(this.deptBudgetList.overShort) ||
  1088. (String(this.deptBudgetList.overShort).indexOf('.') != -1 &&
  1089. String(this.deptBudgetList.overShort).length -
  1090. (String(this.deptBudgetList.overShort).indexOf('.') + 1) >
  1091. 2) ||
  1092. this.deptBudgetList.overShort < 0 ||
  1093. this.deptBudgetList.overShort > 50
  1094. ) {
  1095. this.$message({
  1096. message: '溢短装输入有误!',
  1097. type: 'warning',
  1098. })
  1099. return
  1100. }
  1101. if (!this.deptBudgetList.deliveryDateEnd) {
  1102. this.$message({
  1103. message: '请选择交货日期(止)',
  1104. type: 'warning',
  1105. })
  1106. return
  1107. }
  1108. //时间
  1109. if (
  1110. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1111. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1112. ) {
  1113. this.$message({
  1114. message: '交货日期(止)选择错误',
  1115. type: 'warning',
  1116. })
  1117. return
  1118. }
  1119. if (!this.deptBudgetList.priceType) {
  1120. this.$message({
  1121. message: '请选择价格类型',
  1122. type: 'warning',
  1123. })
  1124. return
  1125. }
  1126. if (this.deptBudgetList.priceType == '定价采购') {
  1127. if (!this.deptBudgetList.unitContractPrice) {
  1128. this.$message({
  1129. message: '请输入合同单价!',
  1130. type: 'warning',
  1131. })
  1132. return
  1133. }
  1134. if (
  1135. isNaN(this.deptBudgetList.unitContractPrice) ||
  1136. (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
  1137. String(this.deptBudgetList.unitContractPrice).length -
  1138. (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
  1139. 2) ||
  1140. this.deptBudgetList.unitContractPrice <= 0 ||
  1141. this.deptBudgetList.unitContractPrice > 10000
  1142. ) {
  1143. this.$message({
  1144. message: '合同单价输入有误!',
  1145. type: 'warning',
  1146. })
  1147. return
  1148. }
  1149. if (!this.deptBudgetList.totalContractPrice) {
  1150. this.$message({
  1151. message: '请输入合同总价!',
  1152. type: 'warning',
  1153. })
  1154. return
  1155. }
  1156. if (
  1157. isNaN(this.deptBudgetList.totalContractPrice) ||
  1158. (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
  1159. String(this.deptBudgetList.totalContractPrice).length -
  1160. (String(this.deptBudgetList.totalContractPrice).indexOf('.') +
  1161. 1) >
  1162. 2) ||
  1163. this.deptBudgetList.totalContractPrice <= 0 ||
  1164. this.deptBudgetList.totalContractPrice > 1000000000
  1165. ) {
  1166. this.$message({
  1167. message: '合同总价输入有误!',
  1168. type: 'warning',
  1169. })
  1170. return
  1171. }
  1172. }
  1173. if (!this.newSelectedOptions) {
  1174. this.$message({
  1175. message: '请选择货源所在地区!',
  1176. type: 'warning',
  1177. })
  1178. return
  1179. }
  1180. if (!this.deptBudgetList.sourceGoods) {
  1181. this.$message({
  1182. message: '请输入货源详细地址!',
  1183. type: 'warning',
  1184. })
  1185. return
  1186. }
  1187. if (!this.newSelectedOptions1) {
  1188. this.$message({
  1189. message: '请选择交货所在地区!',
  1190. type: 'warning',
  1191. })
  1192. return
  1193. }
  1194. if (!this.deptBudgetList.placeDelivery) {
  1195. this.$message({
  1196. message: '请输入交货详细地址!',
  1197. type: 'warning',
  1198. })
  1199. return
  1200. }
  1201. if (!this.deptBudgetList.signingDate) {
  1202. this.$message({
  1203. message: '请选择签订日期',
  1204. type: 'warning',
  1205. })
  1206. return
  1207. }
  1208. if (
  1209. isNaN(this.deptBudgetList.finalTradingVolume) ||
  1210. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') != -1 &&
  1211. String(this.deptBudgetList.finalTradingVolume).length -
  1212. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') + 1) >
  1213. 3) ||
  1214. this.deptBudgetList.finalTradingVolume < 0 ||
  1215. this.deptBudgetList.finalTradingVolume > 200000
  1216. ) {
  1217. this.$message({
  1218. message: '最终实际成交量有误!',
  1219. type: 'warning',
  1220. })
  1221. return
  1222. }
  1223. //货物信息
  1224. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1225. this.$message({
  1226. message: '请选择货名',
  1227. type: 'warning',
  1228. })
  1229. return
  1230. }
  1231. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1232. this.$message({
  1233. message: '请输入水分',
  1234. type: 'warning',
  1235. })
  1236. return
  1237. }
  1238. if (
  1239. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1240. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1241. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1242. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1243. 2 || this.deptBudgetList.contractGoodsInfo.waterContent > 40 || this.deptBudgetList.contractGoodsInfo
  1244. .waterContent < 0
  1245. ) {
  1246. this.$message({
  1247. message: '水分输入错误',
  1248. type: 'warning',
  1249. })
  1250. return
  1251. }
  1252. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1253. this.$message({
  1254. message: '请选择品级',
  1255. type: 'warning',
  1256. })
  1257. return
  1258. }
  1259. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1260. this.$message({
  1261. message: '请输入杂质',
  1262. type: 'warning',
  1263. })
  1264. return
  1265. }
  1266. if (
  1267. this.deptBudgetList.contractGoodsInfo.impurity &&
  1268. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1269. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1270. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1271. 2 || this.deptBudgetList.contractGoodsInfo.impurity > 40 || this.deptBudgetList.contractGoodsInfo.impurity < 0
  1272. ) {
  1273. this.$message({
  1274. message: '杂质输入错误',
  1275. type: 'warning',
  1276. })
  1277. return
  1278. }
  1279. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1280. this.$message({
  1281. message: '请输入容重',
  1282. type: 'warning',
  1283. })
  1284. return
  1285. }
  1286. if (
  1287. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1288. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1289. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1290. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1291. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo
  1292. .bulkDensity < 0
  1293. ) {
  1294. this.$message({
  1295. message: '容重输入错误',
  1296. type: 'warning',
  1297. })
  1298. return
  1299. }
  1300. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1301. this.$message({
  1302. message: '请输入霉变粒',
  1303. type: 'warning',
  1304. })
  1305. return
  1306. }
  1307. if (
  1308. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1309. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1310. '.'
  1311. ) != -1 &&
  1312. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1313. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1314. '.'
  1315. ) +
  1316. 1) >
  1317. 2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1318. .mildewGrain < 0)
  1319. ) {
  1320. this.$message({
  1321. message: '霉变粒输入错误',
  1322. type: 'warning',
  1323. })
  1324. return
  1325. }
  1326. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1327. this.$message({
  1328. message: '请输入热损伤',
  1329. type: 'warning',
  1330. })
  1331. return
  1332. }
  1333. if (
  1334. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1335. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1336. -1 &&
  1337. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1338. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1339. '.'
  1340. ) +
  1341. 1) >
  1342. 2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
  1343. .jiaorenli < 0)
  1344. ) {
  1345. this.$message({
  1346. message: '热损伤输入错误',
  1347. type: 'warning',
  1348. })
  1349. return
  1350. }
  1351. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1352. this.$message({
  1353. message: '请输入不完善粒',
  1354. type: 'warning',
  1355. })
  1356. return
  1357. }
  1358. if (
  1359. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1360. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1361. '.'
  1362. ) != -1 &&
  1363. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1364. (String(
  1365. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1366. ).indexOf('.') +
  1367. 1) >
  1368. 2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1369. .imperfectGrain < 0)
  1370. ) {
  1371. this.$message({
  1372. message: '不完善粒输入错误',
  1373. type: 'warning',
  1374. })
  1375. return
  1376. }
  1377. // if (
  1378. // (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) ||
  1379. // (this.deptBudgetList.contractProcessInfo.goodsNameKey < 100) ||
  1380. // (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1381. // '.'
  1382. // ) != -1 &&
  1383. // String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1384. // (String(
  1385. // this.deptBudgetList.contractProcessInfo.goodsNameKey
  1386. // ).indexOf('.') +
  1387. // 1) >
  1388. // 2)
  1389. // ) {
  1390. // this.$message({
  1391. // message: '合同收入金额输入错误',
  1392. // type: 'warning',
  1393. // })
  1394. // return
  1395. // }
  1396. if (
  1397. (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) ||
  1398. (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
  1399. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1400. '.'
  1401. ) != -1 &&
  1402. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1403. (String(
  1404. this.deptBudgetList.contractProcessInfo.waterContent
  1405. ).indexOf('.') +
  1406. 1) >
  1407. 2)
  1408. ) {
  1409. this.$message({
  1410. message: '费用支出输入错误',
  1411. type: 'warning',
  1412. })
  1413. return
  1414. }
  1415. if (
  1416. (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
  1417. (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
  1418. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1419. '.'
  1420. ) != -1 &&
  1421. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1422. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1423. '.'
  1424. ) +
  1425. 1) >
  1426. 2)
  1427. ) {
  1428. this.$message({
  1429. message: '已开发票金额输入错误',
  1430. type: 'warning',
  1431. })
  1432. return
  1433. }
  1434. if (
  1435. (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
  1436. (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
  1437. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1438. '.'
  1439. ) != -1 &&
  1440. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1441. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1442. '.'
  1443. ) +
  1444. 1) >
  1445. 2)
  1446. ) {
  1447. this.$message({
  1448. message: '未开发票金额输入错误',
  1449. type: 'warning',
  1450. })
  1451. return
  1452. }
  1453. if (
  1454. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
  1455. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1456. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1457. '.'
  1458. ) != -1 &&
  1459. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1460. (String(
  1461. this.deptBudgetList.contractProcessInfo.mildewGrain
  1462. ).indexOf('.') +
  1463. 1) >
  1464. 2)
  1465. ) {
  1466. this.$message({
  1467. message: '未回款金额输入错误',
  1468. type: 'warning',
  1469. })
  1470. return
  1471. }
  1472. this.$refs.deptBudgetList.validate((valid) => {
  1473. if (valid) {
  1474. if(this.deptBudgetList.personPhone){
  1475. this.deptBudgetList.personPhone=this.deptBudgetList.personPhone.toString()
  1476. }
  1477. this.deptBudgetList.compId = this.compId
  1478. this.deptBudgetList.contractType = 2
  1479. this.deptBudgetList.goodsType = 1
  1480. addList(this.deptBudgetList)
  1481. .toPromise()
  1482. .then((response) => {
  1483. // 存储买方、卖方、买方电话、卖方电话
  1484. let _data = {
  1485. byer: this.deptBudgetList.buyer,
  1486. seller: this.deptBudgetList.seller,
  1487. buyerPhone: this.deptBudgetList.buyerPhone,
  1488. sellerPhone: this.deptBudgetList.sellerPhone
  1489. }
  1490. if (this.restaurants1.length <= 20) {
  1491. this.restaurants1 = this.restaurants1.filter(function(val) {
  1492. if (val.value != _data.byer) {
  1493. return val
  1494. }
  1495. })
  1496. this.restaurants1.unshift({
  1497. value: _data.byer
  1498. })
  1499. } else {
  1500. this.restaurants1.unshift({
  1501. value: _data.byer
  1502. }).pop({
  1503. value: _data.byer
  1504. })
  1505. }
  1506. localStorage.setItem('deptBudgetList_data1', JSON.stringify(this.restaurants1));
  1507. if (this.restaurants2.length <= 20) {
  1508. this.restaurants2 = this.restaurants2.filter(function(val) {
  1509. if (val.value != _data.seller) {
  1510. return val
  1511. }
  1512. })
  1513. this.restaurants2.unshift({
  1514. value: _data.seller
  1515. })
  1516. } else {
  1517. this.restaurants2.unshift({
  1518. value: _data.seller
  1519. }).pop({
  1520. value: _data.seller
  1521. })
  1522. }
  1523. localStorage.setItem('deptBudgetList_data2', JSON.stringify(this.restaurants2));
  1524. if (this.restaurants2.length <= 20) {
  1525. this.restaurants3 = this.restaurants3.filter(function(val) {
  1526. if (val.value != _data.buyerPhone) {
  1527. return val
  1528. }
  1529. })
  1530. this.restaurants3.unshift({
  1531. value: _data.buyerPhone
  1532. })
  1533. } else {
  1534. this.restaurants3.unshift({
  1535. value: _data.buyerPhone
  1536. }).pop({
  1537. value: _data.buyerPhone
  1538. })
  1539. }
  1540. localStorage.setItem('deptBudgetList_data3', JSON.stringify(this.restaurants3));
  1541. if (this.restaurants4.length <= 20) {
  1542. this.restaurants4 = this.restaurants3.filter(function(val) {
  1543. if (val.value != _data.sellerPhone) {
  1544. return val
  1545. }
  1546. })
  1547. this.restaurants4.unshift({
  1548. value: _data.sellerPhone
  1549. })
  1550. } else {
  1551. this.restaurants4.unshift({
  1552. value: _data.sellerPhone
  1553. }).pop({
  1554. value: _data.sellerPhone
  1555. })
  1556. }
  1557. localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
  1558. this.$message.success('添加成功')
  1559. this.deptBudgetList = {
  1560. deliverType: '1',
  1561. sourceGoods:'',
  1562. placeDelivery:'',
  1563. agreementType: '采购合同',
  1564. addressUrl: '',
  1565. sellerPhone:'',
  1566. personPhone:'',
  1567. personCharge:'',
  1568. personChargeKey:'',
  1569. finalTradingVolume: 0,
  1570. totalContractPrice: 0,
  1571. contractGoodsInfo: {
  1572. goodsName: '',
  1573. },
  1574. contractProcessInfo: {},
  1575. settlementWeightMethod: '1',
  1576. }
  1577. this.$router.push({
  1578. path: 'buyContract'
  1579. })
  1580. })
  1581. } else {
  1582. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1583. return false
  1584. }
  1585. })
  1586. },
  1587. resetForm(deptBudgetList) {
  1588. this.$refs[deptBudgetList].resetFields()
  1589. },
  1590. //选择合同类型
  1591. selectType(e) {
  1592. for (var i = 0; i < this.invoiceList.length; i++) {
  1593. if (this.agreementList[i].constValue == e) {
  1594. this.deptBudgetList.agreementType = this.agreementList[i].constValue
  1595. }
  1596. }
  1597. },
  1598. addClick() {
  1599. this.unitList.push({
  1600. flag: 'add',
  1601. constValue: '',
  1602. constKey: '',
  1603. })
  1604. },
  1605. saveClick(item, index) {
  1606. if (Object.is(item.id, 1)) {
  1607. return
  1608. }
  1609. if (Object.is(this.unitList[index].flag, 'delete')) {
  1610. this.$set(this.unitList, index, {
  1611. flag: 'check'
  1612. })
  1613. } else {
  1614. this.$set(this.unitList, index, {
  1615. flag: 'delete'
  1616. })
  1617. }
  1618. if (!item.constValue) {
  1619. this.unitList.splice(index, 1)
  1620. return
  1621. }
  1622. if (item.flag == 'add') {
  1623. item.constKey = Math.random() * 20
  1624. this.acceptanceCheck.compId = this.compId
  1625. this.acceptanceCheck.constKey = item.constKey
  1626. this.acceptanceCheck.constCode = 'TYPEYAN'
  1627. this.acceptanceCheck.constValue = item.constValue
  1628. this.acceptanceCheck.id = item.id
  1629. addxiala(this.acceptanceCheck)
  1630. .toPromise()
  1631. .then((response) => {
  1632. this.getUnitList()
  1633. })
  1634. } else if (item.flag == 'check') {
  1635. this.acceptanceCheck.compId = this.compId
  1636. this.acceptanceCheck.constKey = item.constKey
  1637. this.acceptanceCheck.constCode = 'TYPEYAN'
  1638. this.acceptanceCheck.constValue = item.constValue
  1639. this.acceptanceCheck.id = item.id
  1640. editxiala(this.acceptanceCheck)
  1641. .toPromise()
  1642. .then((response) => {
  1643. this.getUnitList()
  1644. })
  1645. }
  1646. },
  1647. selectChapterTwo(e) {
  1648. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1649. if (this.ChapterTwoList[i].constValue == e) {
  1650. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1651. }
  1652. }
  1653. },
  1654. selectunitList(e) {
  1655. for (var i = 0; i < this.unitList.length; i++) {
  1656. if (this.unitList[i].constValue == e) {
  1657. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1658. }
  1659. }
  1660. },
  1661. selectgrade(e) {
  1662. for (var i = 0; i < this.gradeList.length; i++) {
  1663. if (this.gradeList[i].constValue == e) {
  1664. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1665. this.deptBudgetList.contractGoodsInfo.gradeKey =
  1666. this.gradeList[i].constKey
  1667. }
  1668. }
  1669. },
  1670. selectgoodsName(e) {
  1671. for (var i = 0; i < this.goodnameList.length; i++) {
  1672. if (this.goodnameList[i].constValue == e) {
  1673. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1674. this.deptBudgetList.contractGoodsInfo.goodsNameKey = this.goodnameList[i].constKey
  1675. }
  1676. }
  1677. },
  1678. selectpackingMethod(e) {
  1679. for (var i = 0; i < this.packtypeList.length; i++) {
  1680. if (this.packtypeList[i].constValue == e) {
  1681. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1682. }
  1683. }
  1684. },
  1685. // 编辑
  1686. editClick(item, index) {
  1687. const map = JSON.parse(JSON.stringify(item))
  1688. if (Object.is(item.id, 1)) {
  1689. return
  1690. }
  1691. if (Object.is(this.unitList[index].flag, 'delete')) {
  1692. map.flag = 'check'
  1693. this.$set(this.unitList, index, map)
  1694. } else {
  1695. map.flag = 'delete'
  1696. this.$set(this.unitList, index, map)
  1697. }
  1698. },
  1699. // 删除
  1700. deleteClick(item, index) {
  1701. if (Object.is(item.constKey, 1)) {
  1702. return
  1703. }
  1704. if (!item.constValue) {
  1705. this.unitList.splice(index, 1)
  1706. return
  1707. }
  1708. delxiala({
  1709. id: this.unitList[index].id
  1710. })
  1711. .toPromise()
  1712. .then((response) => {
  1713. this.getUnitList()
  1714. this.pleaseChoose = ''
  1715. })
  1716. },
  1717. },
  1718. }
  1719. </script>
  1720. <style lang="scss" scoped>
  1721. .el-form {
  1722. padding: 0 15%;
  1723. }
  1724. /deep/.ws-info-table .el-form-item {
  1725. border-right: 1px solid #cdd2dc;
  1726. border-bottom: 1px solid #cdd2dc;
  1727. }
  1728. .readonly {
  1729. position: relative;
  1730. }
  1731. .readonly:after {
  1732. content: '*';
  1733. color: #ff2727;
  1734. position: absolute;
  1735. right: 8px;
  1736. z-index: 10;
  1737. top: 21%;
  1738. font-size: 20px;
  1739. }
  1740. .title {
  1741. position: relative;
  1742. }
  1743. .title::before {
  1744. content: '';
  1745. display: inline-block;
  1746. width: 5px;
  1747. height: 30px;
  1748. background: #5473e8;
  1749. position: absolute;
  1750. left: 0;
  1751. }
  1752. .el-button--primary {
  1753. background-color: #5878e8;
  1754. border-color: #5878e8;
  1755. }
  1756. .bg {
  1757. background: #f6f7fc;
  1758. }
  1759. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1760. padding: 0 25px;
  1761. border-left: 1px solid #cdd2dc;
  1762. background: #fafbfc;
  1763. }
  1764. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1765. width: 140px;
  1766. text-align: center;
  1767. background: #f0f2f6;
  1768. // border: 1px solid #cdd2dc;
  1769. }
  1770. .button-container {
  1771. display: flex;
  1772. flex-wrap: nowrap;
  1773. justify-content: space-between;
  1774. align-items: center;
  1775. background-color: #fff;
  1776. width: 100%;
  1777. height: 50px;
  1778. padding: 0 10px;
  1779. &>div {
  1780. margin-left: 10px;
  1781. display: flex;
  1782. flex-wrap: nowrap;
  1783. flex-direction: row;
  1784. &>span {
  1785. line-height: 50px;
  1786. }
  1787. }
  1788. /deep/.auditFlow-box {
  1789. position: unset;
  1790. margin-left: 10px;
  1791. &/deep/.auditFlow-icon {
  1792. width: auto;
  1793. padding-right: 30px;
  1794. }
  1795. &/deep/.auditFlow-main {
  1796. position: absolute;
  1797. }
  1798. }
  1799. }
  1800. .box-app {
  1801. display: inline-block;
  1802. float: left;
  1803. margin-left: 30px;
  1804. line-height: 50px;
  1805. }
  1806. /deep/.el-dialog {
  1807. .el-form-item {
  1808. margin-bottom: 0 !important;
  1809. .el-input--medium {
  1810. textarea {
  1811. min-height: 100px !important;
  1812. }
  1813. }
  1814. }
  1815. }
  1816. .collapse-bottom {
  1817. margin-bottom: 20px;
  1818. }
  1819. .input-main .textarea .el-textarea__inner {
  1820. width: 100%;
  1821. z-index: 1;
  1822. }
  1823. .bg-left {
  1824. padding-left: 30px;
  1825. }
  1826. .bg-right {
  1827. padding-right: 10px;
  1828. text-align: right;
  1829. }
  1830. .bg-bottom {
  1831. margin: 15px 0px;
  1832. }
  1833. .wenzi h3 {
  1834. display: inline-block;
  1835. left: 10px;
  1836. }
  1837. .wenzi p {
  1838. display: inline-block;
  1839. }
  1840. .upload-demo {
  1841. margin-top: 10px;
  1842. }
  1843. .center {
  1844. width: 70%;
  1845. margin: 0 auto;
  1846. }
  1847. .el-form-item {
  1848. width: 50%;
  1849. }
  1850. .el-form-item__label {
  1851. text-align: center;
  1852. }
  1853. .ce {
  1854. width: 900px;
  1855. margin: 0 auto;
  1856. }
  1857. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1858. /* height: 82px;*/
  1859. /*}*/
  1860. // 控制select为只读的时候显示样式
  1861. .hide-sel {
  1862. .el-input__inner {
  1863. border: 0px;
  1864. }
  1865. .el-icon-arrow-up {
  1866. display: none;
  1867. }
  1868. .el-textarea__inner {
  1869. background-color: #fff !important;
  1870. border: 0;
  1871. }
  1872. .el-date-editor {
  1873. i {
  1874. display: none;
  1875. }
  1876. }
  1877. .is-disabled {
  1878. .el-input__inner:hover {
  1879. background-color: #fff !important;
  1880. border: 0;
  1881. }
  1882. color: #606266;
  1883. .el-input__inner {
  1884. background-color: #fff !important;
  1885. border: 0;
  1886. color: #606266;
  1887. }
  1888. .el-textarea__inner {
  1889. background-color: #fff !important;
  1890. border: 0;
  1891. color: #606266;
  1892. }
  1893. }
  1894. }
  1895. // 控制select为只读的时候显示样式
  1896. /deep/.ws-class-table-col {
  1897. height: auto;
  1898. padding: 0px 2px;
  1899. /deep/.el-input__inner {
  1900. padding: 0px 2px;
  1901. }
  1902. }
  1903. /deep/.is-disabled {
  1904. .el-input__prefix,
  1905. .el-input__suffix {
  1906. display: none;
  1907. }
  1908. .el-input__inner {
  1909. background-color: #fff;
  1910. border-color: #fff !important;
  1911. color: #000 !important;
  1912. font-size: 14px;
  1913. cursor: text;
  1914. padding: 0 !important;
  1915. }
  1916. }
  1917. .winseaview-view {
  1918. padding: 0 0 20px;
  1919. }
  1920. .container {
  1921. overflow: scroll;
  1922. height: 93vh;
  1923. }
  1924. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1925. width: 130px;
  1926. }
  1927. .el-textarea {
  1928. width: 101%;
  1929. }
  1930. .addressUrls {
  1931. width: 100%;
  1932. display: flex;
  1933. margin-top: 10px;
  1934. }
  1935. .addressUrls-item {
  1936. position: relative;
  1937. display: flex;
  1938. }
  1939. .icon-guanbi {
  1940. position: absolute;
  1941. right: 8px;
  1942. }
  1943. .addressUrl {
  1944. margin: 0px 10px;
  1945. border-radius: 3px;
  1946. }
  1947. //上传文件成功标识
  1948. /deep/.el-upload-list__item-status-label {
  1949. position: absolute;
  1950. right: 22px;
  1951. top: -1px;
  1952. line-height: inherit;
  1953. display: none;
  1954. }
  1955. .map {
  1956. position: fixed;
  1957. top: 0;
  1958. bottom: 0;
  1959. left: 0;
  1960. right: 0;
  1961. margin: auto;
  1962. width: 850px;
  1963. height: 400px;
  1964. background: gainsboro;
  1965. border-radius: 20px;
  1966. padding: 10px;
  1967. box-sizing: border-box;
  1968. z-index: 99;
  1969. }
  1970. .amap-container {
  1971. width: 100% !important;
  1972. }
  1973. .address-btn {
  1974. width: 100%;
  1975. text-align: left;
  1976. color:#000;
  1977. border:1px solid #ccc;
  1978. }
  1979. .inline-input {
  1980. width: 100%;
  1981. }
  1982. </style>