purchaseContractAdd.vue 75 KB

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