purchaseContractAdd.vue 76 KB

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