tranManagementWarehouseInOutTaskAdd.vue 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845
  1. // 创建出入库任务
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">创建出入库任务</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">
  10. <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
  11. src="../../../public/img/lujing.png" alt />返回
  12. </el-button>
  13. </el-col>
  14. </el-row>
  15. <div class="basicInformation">
  16. <div class="annu">
  17. <el-radio-group @change="tasktypechange" v-model="dataList.taskTypeKey">
  18. <el-radio label="1" class="a">出库</el-radio>
  19. <el-radio label="2" class="a">入库</el-radio>
  20. <el-radio label="3" class="a">移库</el-radio>
  21. <el-radio label="4" class="a">退库并出库</el-radio>
  22. </el-radio-group>
  23. </div>
  24. <div class="ding"></div>
  25. <div v-if="dataList.taskTypeKey != 2 && dataList.taskTypeKey != 4" class="center1">
  26. <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
  27. src="../../../public/img/cangku.png" alt />
  28. <!--出库=-->
  29. <div class="small-title">
  30. <h3>出库任务({{ inOutTaskNo }})</h3>
  31. </div>
  32. <el-form ref="dataList" :model="dataList" label-width="140px" input-width="300px">
  33. <!-- 仓库名 -->
  34. <el-form-item label="仓库名">
  35. <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect"
  36. @change="selectwarehouseName">
  37. <el-option v-for="item in warehouseNameList" :key="item.constKey" :label="item.warehouseName"
  38. :value="item.id" />
  39. </el-select>
  40. </el-form-item>
  41. <!-- 出库类型 -->
  42. <el-form-item label="出库类型">
  43. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.inOutType"
  44. placeholder="请选择出库类型" class="typeselect" @change="selectstorageType">
  45. <el-option v-for="item in storageType" :key="item.constKey" v-if="
  46. (dataList.taskTypeKey == 1 &&
  47. item.constValue != '移库出库') ||
  48. (dataList.taskTypeKey == 3 &&
  49. item.constValue == '移库出库') ||
  50. (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
  51. " :label="item.constValue" :value="item.constValue" />
  52. </el-select>
  53. </el-form-item>
  54. <!-- 合同编号 -->
  55. <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
  56. <el-select @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号" class="typeselect">
  57. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  58. :value="item.contractNo"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
  62. <el-input @input="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
  63. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  64. :value="item.contractNo"></el-option>
  65. </el-input>
  66. </el-form-item>
  67. <!-- 货名 -->
  68. <el-form-item label="货名" class="huom">
  69. <el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名" class="huom"
  70. @change="selectgoodsName">
  71. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  72. :value="item.constValue"></el-option>
  73. </el-select>
  74. </el-form-item>
  75. <!--重量(吨)-->
  76. <el-form-item label="重量(吨)" span="1" style="margin-left: 350px; margin-top: -40px">
  77. <el-input @input="weightchange1" v-model="dataList.weight" placeholder="请输入重量" maxlength="120" size="small"
  78. class="huom" />
  79. </el-form-item>
  80. <!-- 品级 -->
  81. <el-form-item label="品级">
  82. <el-select v-model="dataList.grade" placeholder class="typeselect" @change="selectpackingMethod">
  83. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  84. :value="item.constValue" />
  85. </el-select>
  86. </el-form-item>
  87. <!--容重(克/升)>=-->
  88. <el-form-item label="容重(克/升)>=">
  89. <el-input @input="bulkDensitychange" v-model="dataList.bulkDensity" placeholder="请输入容重" maxlength="120"
  90. size="small" class="huom" />
  91. </el-form-item>
  92. <!--水分(%)<=-->
  93. <el-form-item label="水分(%)<=" span="1" style="margin-left: 350px; margin-top: -40px">
  94. <el-input @input="waterContentchange" v-model="dataList.waterContent" placeholder="请输入水分占比" maxlength="120"
  95. size="small" class="huom" />
  96. </el-form-item>
  97. <!--单价(元/吨)-->
  98. <el-form-item label="单价(元/吨)" span="1" style="margin-left: 650px; margin-top: -40px">
  99. <el-input @input="unitPricechange" v-model="dataList.unitPrice" placeholder="请输入单价" maxlength="120"
  100. size="small" class="huom" />
  101. </el-form-item>
  102. <!--预计出库日期-->
  103. <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
  104. <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
  105. value-format="yyyy-MM-dd" />
  106. </el-form-item>
  107. <!--经办人-->
  108. <el-form-item label="出库经办人">
  109. <el-select v-model="dataList.agent" placeholder="请选择经办人" filterable :filter-method="dataFilter"
  110. @change="selectstaff">
  111. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
  112. </el-select>
  113. </el-form-item>
  114. <!--业务描述=-->
  115. <el-form-item v-if="dataList.taskTypeKey != 3" label="业务描述" span="20">
  116. <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述,不超过150字" maxlength="150" size="large" />
  117. </el-form-item>
  118. </el-form>
  119. </div>
  120. <div v-show="dataList.taskTypeKey != 1" class="center1">
  121. <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
  122. src="../../../public/img/cangku.png" alt />
  123. <div class="small-title">
  124. <h3>入库任务({{ inOutTaskNo1 }} )</h3>
  125. </div>
  126. <el-form v-if="!deletetask" ref="form" :model="form" label-width="140px">
  127. <!-- 仓库名 -->
  128. <el-form-item label="仓库名">
  129. <el-select v-model="dataList1.warehouseName" placeholder="请选择仓库名" class="typeselect"
  130. @change="selectwarehouseName1">
  131. <el-option v-for="item in warehouseNameList" :key="item.constKey" :label="item.warehouseName"
  132. :value="item.id" />
  133. </el-select>
  134. </el-form-item>
  135. <!-- 入库类型 -->
  136. <el-form-item label="入库类型">
  137. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList1.inOutType"
  138. placeholder="请选择入库类型" class="typeselect" @change="selectstorageType1">
  139. <el-option v-for="item in storageType1" :key="item.constKey" v-if="
  140. (dataList1.taskTypeKey == 2 &&
  141. item.constValue != '移库入库') ||
  142. (dataList1.taskTypeKey == 3 &&
  143. item.constValue == '移库入库') ||
  144. (dataList1.taskTypeKey == 4 && item.constValue == '退库')
  145. " :label="item.constValue" :value="item.constValue" />
  146. </el-select>
  147. </el-form-item>
  148. <!-- 合同编号 -->
  149. <el-form-item v-if="dataList1.taskTypeKey != 3" label="合同编号">
  150. <el-select @change="changecontract1" v-model="dataList1.contractNo" placeholder="请输入合同编号"
  151. class="typeselect">
  152. <el-option v-for="item in contractNoList1" :key="item.constKey" :label="item.contractNo"
  153. :value="item.contractNo"></el-option>
  154. </el-select>
  155. </el-form-item>
  156. <el-form-item v-if="dataList1.taskTypeKey == 3" label="移库任务编号">
  157. <el-input disabled v-model="dataList1.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
  158. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  159. :value="item.contractNo"></el-option>
  160. </el-input>
  161. </el-form-item>
  162. <!-- 货名 -->
  163. <el-form-item label="货名" class="huom">
  164. <el-select :disabled="dataList.taskTypeKey != 3 || dataList.taskTypeKey == 3" v-model="dataList.goodsName"
  165. placeholder="货名" class="huom" @change="selectgoodsName1">
  166. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  167. :value="item.constValue"></el-option>
  168. </el-select>
  169. </el-form-item>
  170. <!--重量(吨)-->
  171. <el-form-item label="重量(吨)" span="1" style="margin-left: 350px; margin-top: -40px">
  172. <el-input @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量" maxlength="120" size="small"
  173. class="huom" />
  174. </el-form-item>
  175. <!-- 品级 -->
  176. <el-form-item label="品级">
  177. <el-select :disabled="dataList.taskTypeKey == 3" v-model="dataList1.grade" placeholder class="typeselect"
  178. @change="selectpackingMethod1">
  179. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  180. :value="item.constValue" />
  181. </el-select>
  182. </el-form-item>
  183. <!--容重(克/升)>=-->
  184. <el-form-item label="容重(克/升)>=">
  185. <el-input @input="bulkDensitychange" :disabled="dataList.taskTypeKey == 3" v-model="dataList1.bulkDensity"
  186. placeholder="请输入容重" maxlength="120" size="small" class="huom" />
  187. </el-form-item>
  188. <!--水分(%)<=-->
  189. <el-form-item label="水分(%)<=" span="1" style="margin-left: 350px; margin-top: -40px">
  190. <el-input @input="waterContentchange" :disabled="dataList.taskTypeKey == 3" v-model="dataList1.waterContent"
  191. placeholder="请输入水分占比" maxlength="120" size="small" class="huom" />
  192. </el-form-item>
  193. <!--单价(元/吨)-->
  194. <el-form-item label="单价(元/吨)" span="1" style="margin-left: 650px; margin-top: -40px">
  195. <el-input @input="unitPricechange" :disabled="dataList.taskTypeKey == 3" v-model="dataList1.unitPrice"
  196. placeholder="请输入单价" maxlength="120" size="small" class="huom" />
  197. </el-form-item>
  198. <!--预计出库日期-->
  199. <el-form-item label="预计入库日期" span="1" prop="predictDate" class="deliverydate">
  200. <el-date-picker v-model="dataList1.predictDate" type="date" placeholder="请选择预计入库日期"
  201. value-format="yyyy-MM-dd" />
  202. </el-form-item>
  203. <!--经办人-->
  204. <el-form-item label="入库经办人">
  205. <el-select v-model="dataList1.agent" placeholder="请选择经办人" filterable :filter-method="dataFilter1"
  206. @change="selectstaff1">
  207. <el-option v-for="item in options1" :key="item.value" :label="item.staffName" :value="item.staffName" />
  208. </el-select>
  209. </el-form-item>
  210. <!--业务描述=-->
  211. <el-form-item v-if="dataList.taskTypeKey != 4" label="业务描述">
  212. <el-input v-model="dataList1.businessDescribe" placeholder="请输入业务描述,不超过150字" maxlength="150" size="large" />
  213. </el-form-item>
  214. </el-form>
  215. </div>
  216. <div v-if="dataList.taskTypeKey == 4" class="center1">
  217. <!--出库=-->
  218. <div class="small-title">
  219. <img style="position: relative; top: 40px; left: -22px" width="19" height="19"
  220. src="../../../public/img/cangku.png" alt />
  221. <h3>出库任务({{ inOutTaskNo }})</h3>
  222. </div>
  223. <el-form ref="dataList" :model="dataList" label-width="140px">
  224. <!-- 仓库名 -->
  225. <el-form-item label="仓库名">
  226. <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect"
  227. @change="selectwarehouseName">
  228. <el-option v-for="item in warehouseNameList" :key="item.constKey" :label="item.warehouseName"
  229. :value="item.id" />
  230. </el-select>
  231. </el-form-item>
  232. <!-- 出库类型 -->
  233. <el-form-item label="出库类型">
  234. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.inOutType"
  235. placeholder="请选择出库类型" class="typeselect" @change="selectstorageType">
  236. <el-option v-for="item in storageType" :key="item.constKey" v-if="
  237. (dataList.taskTypeKey == 1 &&
  238. item.constValue != '移库出库') ||
  239. (dataList.taskTypeKey == 3 &&
  240. item.constValue == '移库出库') ||
  241. (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
  242. " :label="item.constValue" :value="item.constValue" />
  243. </el-select>
  244. </el-form-item>
  245. <!-- 合同编号 -->
  246. <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
  247. <el-select @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号" class="typeselect">
  248. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  249. :value="item.contractNo"></el-option>
  250. </el-select>
  251. </el-form-item>
  252. <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
  253. <el-select @change="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
  254. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  255. :value="item.contractNo"></el-option>
  256. </el-select>
  257. </el-form-item>
  258. <!-- 货名 -->
  259. <el-form-item label="货名" class="huom">
  260. <el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名" class="huom"
  261. @change="selectgoodsName">
  262. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  263. :value="item.constValue"></el-option>
  264. </el-select>
  265. </el-form-item>
  266. <!--重量(吨)-->
  267. <el-form-item label="重量(吨)" span="1" style="margin-left: 350px; margin-top: -40px">
  268. <el-input :disabled="dataList.taskTypeKey == 4" v-model="dataList.weight" placeholder="请输入重量"
  269. maxlength="120" size="small" class="huom" />
  270. </el-form-item>
  271. <!-- 品级 -->
  272. <el-form-item label="品级">
  273. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.grade"
  274. placeholder class="typeselect" @change="selectpackingMethod">
  275. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  276. :value="item.constValue" />
  277. </el-select>
  278. </el-form-item>
  279. <!--容重(克/升)>=-->
  280. <el-form-item label="容重(克/升)>=">
  281. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.bulkDensity"
  282. placeholder="请输入容重" maxlength="120" size="small" class="huom" />
  283. </el-form-item>
  284. <!--水分(%)<=-->
  285. <el-form-item label="水分(%)<=" span="1" style="margin-left: 350px; margin-top: -40px">
  286. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.waterContent"
  287. placeholder="请输入水分占比" maxlength="120" size="small" class="huom" />
  288. </el-form-item>
  289. <!--单价(元/吨)-->
  290. <el-form-item label="单价(元/吨)" span="1" style="margin-left: 650px; margin-top: -40px">
  291. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4" v-model="dataList.unitPrice"
  292. placeholder="请输入单价" maxlength="120" size="small" class="huom" />
  293. </el-form-item>
  294. <!--预计出库日期-->
  295. <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
  296. <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
  297. value-format="yyyy-MM-dd" />
  298. </el-form-item>
  299. <!--经办人-->
  300. <el-form-item label="出库经办人">
  301. <el-select v-model="dataList.agent" placeholder="请选择经办人" filterable :filter-method="dataFilter"
  302. @change="selectstaff">
  303. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
  304. </el-select>
  305. </el-form-item>
  306. <!--业务描述=-->
  307. <el-form-item label="业务描述">
  308. <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述,不超过150字" maxlength="150" size="large" />
  309. </el-form-item>
  310. </el-form>
  311. </div>
  312. </div>
  313. <!-- 提交 -->
  314. <div style="text-align: right; padding: 10px" class="center">
  315. <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交</el-button>
  316. </div>
  317. </div>
  318. </template>
  319. <script>
  320. import {
  321. getwarehousename,
  322. xialaNo,
  323. addoreditoutput,
  324. getGoodsName
  325. } from '@/model/tasksport/index'
  326. import {
  327. mapGetters
  328. } from 'vuex'
  329. import {
  330. pullDown,
  331. getstaff
  332. } from '@/model/warehouse/index'
  333. import Pagination from '@/components/Pagination'
  334. import WsUpload from '@/components/WsUpload'
  335. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  336. import {
  337. dayjs,
  338. EventBus
  339. } from 'base-core-lib'
  340. export default {
  341. name: 'viewSpareMoney',
  342. components: {
  343. WsUpload,
  344. Pagination
  345. },
  346. watch: {
  347. // vesselId(val) {
  348. // this.getList()
  349. // },
  350. isShow(val) {
  351. this.showType = val
  352. },
  353. flag(val) {
  354. xialaNo({
  355. compId: this.compId,
  356. flag: val
  357. })
  358. .toPromise()
  359. .then(response => {
  360. if (
  361. this.dataList1.taskTypeKey == 2 ||
  362. this.dataList1.taskTypeKey == 4
  363. ) {
  364. this.contractNoList1 = response
  365. if (this.dataList1.taskTypeKey == 2) {
  366. this.contractNoList = response
  367. }
  368. } else {
  369. this.contractNoList = response
  370. }
  371. })
  372. }
  373. },
  374. computed: {
  375. ...mapGetters(['deptBudgetList'])
  376. },
  377. data() {
  378. return {
  379. flag: 1,
  380. //弹出框
  381. dialogViewSpareMoney: false,
  382. dialogApproveFormVisible: false,
  383. // 船舶类型
  384. monetaryKey: null,
  385. // 表格显示数据
  386. tableDate: [],
  387. // 是否显示
  388. showType: true,
  389. disabled: false,
  390. // 年
  391. year: '',
  392. contractNoList: [],
  393. contractNoList1: [],
  394. deptBudgetTotal: 0,
  395. readonly: true,
  396. currentPage: 1,
  397. pageSize: 10,
  398. searchType: 1,
  399. searchKeyWord: '',
  400. radio: '1',
  401. contractType: 2,
  402. startDate: null,
  403. endDate: null,
  404. goodnameList: [],
  405. checked: true,
  406. form: {},
  407. staffList: [],
  408. staffList1: [],
  409. options: [],
  410. options1: [],
  411. storageType: [],
  412. storageType1: [],
  413. outContractNo: [],
  414. // 提交类型
  415. submitType: true,
  416. status: [],
  417. warehouseNameList: [],
  418. warehouseNameList1: [],
  419. appendixIdsAdd: '',
  420. uploadSuccess: {},
  421. deletetask: false,
  422. warehouseInOutDetail: {},
  423. onChange: {},
  424. deptBudgetList1: [],
  425. gradeList: [],
  426. rules: {
  427. netWeight: [{
  428. required: true,
  429. type: 'number',
  430. message: '请输入活动名称',
  431. trigger: 'blur'
  432. }]
  433. },
  434. size: 10,
  435. compId: sessionStorage.getItem('ws-pf_compId'),
  436. deptCircularPage: {},
  437. packtypeList: {},
  438. date: {
  439. year: dayjs().format('YYYY'),
  440. month: dayjs().format('MM')
  441. },
  442. contractList: [],
  443. inOutTaskNo: '',
  444. inOutTaskNo1: '',
  445. dataList: {
  446. taskTypeKey: '1'
  447. },
  448. dataList1: {
  449. taskTypeKey: '1'
  450. },
  451. historyList: [],
  452. pickerBeginDateBefore: {
  453. disabledDate: time => {
  454. return time.getTime() > Date.now()
  455. }
  456. },
  457. accessoryTFs: false
  458. }
  459. },
  460. activated() {
  461. this.getList()
  462. },
  463. methods: {
  464. //返回按钮
  465. revert() {
  466. this.$router.go(-1)
  467. },
  468. returnsales() {
  469. this.$router.push({
  470. path: 'tranManagementWarehouseInOuttask'
  471. })
  472. },
  473. // 获取当前年月日
  474. getdate() {
  475. var date = new Date()
  476. var year = date.getFullYear() //获取完整的年份(4位)
  477. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  478. var datetime = date.getDate() //获取当前日(1-31)
  479. var hour = date.getHours()
  480. var minutes = date.getMinutes()
  481. var seconds = date.getSeconds()
  482. if (mouth < 10) {
  483. mouth = '0' + mouth
  484. }
  485. if (datetime < 10) {
  486. datetime = '0' + datetime
  487. }
  488. if (hour < 10) {
  489. hour = '0' + hour
  490. }
  491. if (minutes < 10) {
  492. minutes = '0' + minutes
  493. }
  494. if (seconds < 10) {
  495. seconds = '0' + seconds
  496. }
  497. return year + '' + mouth + datetime + hour + minutes + seconds
  498. },
  499. // 随机验证码
  500. verifyinit() {
  501. var arr = []
  502. for (var i = 48; i < 57; i++) {
  503. arr.push(String.fromCharCode(i))
  504. }
  505. arr.sort(function() {
  506. return Math.random() - 0.5
  507. })
  508. arr.length = 4
  509. return arr.join('')
  510. },
  511. MathRand() {
  512. var Num = ''
  513. for (var i = 0; i < 4; i++) {
  514. Num += Math.floor(Math.random() * 10)
  515. }
  516. return Num
  517. },
  518. selectTaskNo(e) {
  519. if (this.dataList.taskTypeKey == 3) {
  520. this.$set(this.dataList1, 'moveTaskNo', e)
  521. }
  522. },
  523. dataFilter(val) {
  524. // console.log(val,"名")
  525. this.deptBudgetList.staffList = val
  526. if (val) {
  527. //val存在
  528. this.options = this.staffList.filter(item => {
  529. if (
  530. !!~item.staffName.indexOf(val) ||
  531. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  532. ) {
  533. return true
  534. }
  535. })
  536. } else {
  537. //val为空时,还原数组
  538. this.options = this.staffList
  539. }
  540. },
  541. dataFilter1(val) {
  542. // console.log(val,"名")
  543. this.deptBudgetList.staffList1 = val
  544. if (val) {
  545. //val存在
  546. this.options = this.staffList1.filter(item => {
  547. if (
  548. !!~item.staffName.indexOf(val) ||
  549. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  550. ) {
  551. return true
  552. }
  553. })
  554. } else {
  555. //val为空时,还原数组
  556. this.options1 = this.staffList1
  557. }
  558. },
  559. weightchange(e) {
  560. if (this.dataList.taskTypeKey == 4) {
  561. this.$set(this.dataList, 'weight', e)
  562. }
  563. },
  564. weightchange1(e) {
  565. if (this.dataList.taskTypeKey == 3) {
  566. this.$set(this.dataList1, 'weight', e)
  567. }
  568. },
  569. bulkDensitychange(e) {
  570. if (this.dataList.taskTypeKey == 4) {
  571. this.$set(this.dataList, 'bulkDensity', e)
  572. } else if (this.dataList1.taskTypeKey == 3) {
  573. this.$set(this.dataList1, 'bulkDensity', e)
  574. }
  575. },
  576. waterContentchange(e) {
  577. if (this.dataList.taskTypeKey == 4) {
  578. this.$set(this.dataList, 'waterContent', e)
  579. } else if (this.dataList1.taskTypeKey == 3) {
  580. this.$set(this.dataList1, 'waterContent', e)
  581. }
  582. },
  583. unitPricechange(e) {
  584. if (this.dataList.taskTypeKey == 4) {
  585. this.$set(this.dataList, 'unitPrice', e)
  586. } else if (this.dataList1.taskTypeKey == 3) {
  587. this.$set(this.dataList1, 'unitPrice', e)
  588. }
  589. },
  590. changecontract(e) {
  591. if (this.dataList.taskTypeKey != 3) {
  592. for (let i = 0; i < this.contractNoList.length; i++) {
  593. if (this.contractNoList[i].contractNo == e) {
  594. getGoodsName({
  595. contractId: this.contractNoList[i].id,
  596. contractNo: this.contractNoList[i].contractNo
  597. })
  598. .toPromise()
  599. .then(response => {
  600. this.$set(this.dataList, 'goodsName', response.goodsName)
  601. this.$set(this.dataList, 'goodsNameKey', response.goodsNameKey)
  602. this.$set(this.dataList, 'grade', response.grade)
  603. this.$set(this.dataList, 'gradeKey', response.gradeKey)
  604. this.$set(this.dataList, 'waterContent', response.waterContent)
  605. this.$set(this.dataList, 'bulkDensity', response.bulkDensity)
  606. this.$set(this.dataList, 'weight', response.weight)
  607. this.$set(
  608. this.dataList,
  609. 'unitPrice',
  610. response.unitContractPrice
  611. )
  612. })
  613. }
  614. }
  615. }
  616. },
  617. selectwarehouseName(e) {
  618. for (var i = 0; i < this.warehouseNameList.length; i++) {
  619. if (this.warehouseNameList[i].id == e) {
  620. this.dataList.warehouseName = this.warehouseNameList[i].warehouseName
  621. //经办人
  622. getstaff({
  623. compId: sessionStorage.getItem('ws-pf_compId'),
  624. warehouseId: e
  625. })
  626. .toPromise()
  627. .then(response => {
  628. this.options = response
  629. this.staffList = response
  630. // this.agent = response
  631. })
  632. }
  633. }
  634. },
  635. selectwarehouseName1(e) {
  636. for (var i = 0; i < this.warehouseNameList.length; i++) {
  637. if (this.warehouseNameList[i].id == e) {
  638. this.dataList1.warehouseName = this.warehouseNameList[i].warehouseName
  639. //经办人
  640. getstaff({
  641. compId: sessionStorage.getItem('ws-pf_compId'),
  642. warehouseId: e
  643. })
  644. .toPromise()
  645. .then(response => {
  646. this.options1 = response
  647. this.staffList1 = response
  648. // this.agent = response
  649. })
  650. }
  651. }
  652. },
  653. changecontract1(e) {
  654. if (this.dataList1.taskTypeKey != 3) {
  655. for (let i = 0; i < this.contractNoList.length; i++) {
  656. if (this.contractNoList[i].contractNo == e) {
  657. getGoodsName({
  658. contractId: this.contractNoList[i].id,
  659. contractNo: this.contractNoList[i].contractNo
  660. })
  661. .toPromise()
  662. .then(response => {
  663. this.$set(this.dataList1, 'goodsName', response.goodsName)
  664. this.$set(this.dataList1, 'goodsNameKey', response.goodsNameKey)
  665. this.$set(this.dataList1, 'grade', response.grade)
  666. this.$set(this.dataList1, 'gradeKey', response.gradeKey)
  667. this.$set(this.dataList1, 'waterContent', response.waterContent)
  668. this.$set(this.dataList1, 'bulkDensity', response.bulkDensity)
  669. this.$set(this.dataList1, 'weight', response.weight)
  670. this.$set(
  671. this.dataList1,
  672. 'unitPrice',
  673. response.unitContractPrice
  674. )
  675. })
  676. }
  677. }
  678. }
  679. },
  680. selectstaff(e) {
  681. for (var i = 0; i < this.staffList.length; i++) {
  682. if (this.staffList[i].staffName == e) {
  683. this.dataList.agentKey = this.staffList[i].staffId
  684. }
  685. }
  686. },
  687. selectstaff1(e) {
  688. for (var i = 0; i < this.staffList.length; i++) {
  689. if (this.staffList[i].staffName == e) {
  690. this.dataList1.agentKey = this.staffList[i].staffId
  691. }
  692. }
  693. },
  694. requestadd(list, status) {
  695. list.compId = sessionStorage.getItem('ws-pf_compId')
  696. list.publisher =
  697. sessionStorage.getItem('ws-pf_roleName') +
  698. sessionStorage.getItem('ws-pf_staffName')
  699. addoreditoutput(list)
  700. .toPromise()
  701. .then(response => {
  702. var that = this
  703. this.$message.success('添加成功')
  704. setTimeout(function() {
  705. that.dataList = {
  706. taskTypeKey: 1
  707. }
  708. that.dataList1 = {}
  709. that.$router.push({
  710. path: 'tranManagementWarehouseInOuttask'
  711. })
  712. }, 2000)
  713. })
  714. },
  715. //提交按钮
  716. submit() {
  717. if (this.dataList.taskTypeKey == 1) {
  718. if (!this.dataList.warehouseName) {
  719. this.$message({
  720. message: '仓库名不能为空!',
  721. type: 'warning'
  722. })
  723. return
  724. }
  725. if (!this.dataList.contractNo) {
  726. this.$message({
  727. message: '合同编号不能为空!',
  728. type: 'warning'
  729. })
  730. return
  731. }
  732. if (!this.dataList.weight) {
  733. this.$message({
  734. message: '重量(吨)不能为空!',
  735. type: 'warning'
  736. })
  737. return
  738. }
  739. if (
  740. isNaN(this.dataList.weight) ||
  741. (String(this.dataList.weight).indexOf('.') != -1 &&
  742. String(this.dataList.weight).length -
  743. (String(this.dataList.weight).indexOf('.') + 1) >
  744. 2) ||
  745. this.dataList.weight < 0 ||
  746. this.dataList.weight > 200000
  747. ) {
  748. this.$message({
  749. message: '重量输入有误!',
  750. type: 'warning'
  751. })
  752. return
  753. }
  754. if (!this.dataList.bulkDensity) {
  755. this.$message({
  756. message: '容重不能为空!',
  757. type: 'warning'
  758. })
  759. return
  760. }
  761. if (
  762. this.dataList.bulkDensity < 500 ||
  763. this.dataList.bulkDensity > 1000
  764. ) {
  765. this.$message({
  766. message: '容重输入错误',
  767. type: 'warning'
  768. })
  769. return
  770. }
  771. if (
  772. String(this.dataList.bulkDensity).indexOf('.') != -1 &&
  773. String(this.dataList.bulkDensity).length -
  774. (String(this.dataList.bulkDensity).indexOf('.') + 1) >
  775. 0
  776. ) {
  777. this.$message({
  778. message: '容重需输入整数',
  779. type: 'warning'
  780. })
  781. return
  782. }
  783. if (!this.dataList.waterContent) {
  784. this.$message({
  785. message: '水分不能为空!',
  786. type: 'warning'
  787. })
  788. return
  789. }
  790. if (this.dataList.waterContent < 0 || this.dataList.waterContent > 40) {
  791. this.$message({
  792. message: '水分输入错误',
  793. type: 'warning'
  794. })
  795. return
  796. }
  797. if (
  798. String(this.dataList.waterContent).indexOf('.') != -1 &&
  799. String(this.dataList.waterContent).length -
  800. (String(this.dataList.waterContent).indexOf('.') + 1) >
  801. 1
  802. ) {
  803. this.$message({
  804. message: '水分输入错误',
  805. type: 'warning'
  806. })
  807. return
  808. }
  809. if (!this.dataList.unitPrice) {
  810. this.$message({
  811. message: '单价不能为空!',
  812. type: 'warning'
  813. })
  814. return
  815. }
  816. if (
  817. (this.dataList.unitPrice &&
  818. String(this.dataList.unitPrice).indexOf('.') != -1 &&
  819. String(this.dataList.unitPrice).length -
  820. (String(this.dataList.unitPrice).indexOf('.') + 1) >
  821. 2) ||
  822. this.dataList.unitPrice > 100000 ||
  823. this.dataList.unitPrice < 1
  824. ) {
  825. this.$message({
  826. message: '单价输入错误',
  827. type: 'warning'
  828. })
  829. return
  830. }
  831. if (!this.dataList.predictDate) {
  832. this.$message({
  833. message: '预计出库日期不能为空!',
  834. type: 'warning'
  835. })
  836. return
  837. }
  838. if (!this.dataList.agent) {
  839. this.$message({
  840. message: '出库经办人不能为空!',
  841. type: 'warning'
  842. })
  843. return
  844. }
  845. if (!this.dataList.businessDescribe) {
  846. this.$message({
  847. message: '业务描述不能为空!',
  848. type: 'warning'
  849. })
  850. return
  851. }
  852. }
  853. if (this.dataList.taskTypeKey == 2) {
  854. if (!this.dataList1.warehouseName) {
  855. this.$message({
  856. message: '仓库名不能为空!',
  857. type: 'warning'
  858. })
  859. return
  860. }
  861. if (!this.dataList1.contractNo) {
  862. this.$message({
  863. message: '合同编号不能为空!',
  864. type: 'warning'
  865. })
  866. return
  867. }
  868. if (!this.dataList1.weight) {
  869. this.$message({
  870. message: '重量(吨)不能为空!',
  871. type: 'warning'
  872. })
  873. return
  874. }
  875. if (
  876. isNaN(this.dataList1.weight) ||
  877. (String(this.dataList1.weight).indexOf('.') != -1 &&
  878. String(this.dataList1.weight).length -
  879. (String(this.dataList1.weight).indexOf('.') + 1) >
  880. 2) ||
  881. this.dataList1.weight < 0 ||
  882. this.dataList1.weight > 200000
  883. ) {
  884. this.$message({
  885. message: '重量输入有误!',
  886. type: 'warning'
  887. })
  888. return
  889. }
  890. if (!this.dataList1.bulkDensity) {
  891. this.$message({
  892. message: '容重不能为空!',
  893. type: 'warning'
  894. })
  895. return
  896. }
  897. if (
  898. this.dataList1.bulkDensity < 500 ||
  899. this.dataList1.bulkDensity > 1000
  900. ) {
  901. this.$message({
  902. message: '容重输入错误',
  903. type: 'warning'
  904. })
  905. return
  906. }
  907. if (
  908. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  909. String(this.dataList1.bulkDensity).length -
  910. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  911. 0
  912. ) {
  913. this.$message({
  914. message: '容重需输入整数',
  915. type: 'warning'
  916. })
  917. return
  918. }
  919. if (!this.dataList1.waterContent) {
  920. this.$message({
  921. message: '水分不能为空!',
  922. type: 'warning'
  923. })
  924. return
  925. }
  926. if (
  927. this.dataList1.waterContent < 0 ||
  928. this.dataList1.waterContent > 40
  929. ) {
  930. this.$message({
  931. message: '水分输入错误',
  932. type: 'warning'
  933. })
  934. return
  935. }
  936. if (
  937. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  938. String(this.dataList1.waterContent).length -
  939. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  940. 1
  941. ) {
  942. this.$message({
  943. message: '水分输入错误',
  944. type: 'warning'
  945. })
  946. return
  947. }
  948. if (!this.dataList1.unitPrice) {
  949. this.$message({
  950. message: '单价不能为空!',
  951. type: 'warning'
  952. })
  953. return
  954. }
  955. if (
  956. (this.dataList1.unitPrice &&
  957. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  958. String(this.dataList1.unitPrice).length -
  959. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  960. 2) ||
  961. this.dataList1.unitPrice > 100000 ||
  962. this.dataList1.unitPrice < 1
  963. ) {
  964. this.$message({
  965. message: '单价输入错误',
  966. type: 'warning'
  967. })
  968. return
  969. }
  970. if (!this.dataList1.predictDate) {
  971. this.$message({
  972. message: '预计入库日期不能为空!',
  973. type: 'warning'
  974. })
  975. return
  976. }
  977. if (!this.dataList1.agent) {
  978. this.$message({
  979. message: '入库经办人不能为空!',
  980. type: 'warning'
  981. })
  982. return
  983. }
  984. if (!this.dataList1.businessDescribe) {
  985. this.$message({
  986. message: '业务描述不能为空!',
  987. type: 'warning'
  988. })
  989. return
  990. }
  991. }
  992. if (this.dataList.taskTypeKey == 3) {
  993. if (!this.dataList.warehouseName) {
  994. this.$message({
  995. message: '出库仓库名不能为空!',
  996. type: 'warning'
  997. })
  998. return
  999. }
  1000. if (!this.dataList1.warehouseName) {
  1001. this.$message({
  1002. message: '入库仓库名不能为空!',
  1003. type: 'warning'
  1004. })
  1005. return
  1006. }
  1007. if (!this.dataList1.moveTaskNo) {
  1008. this.$message({
  1009. message: '移库任务编号不能为空!',
  1010. type: 'warning'
  1011. })
  1012. return
  1013. }
  1014. if (!this.dataList1.weight) {
  1015. this.$message({
  1016. message: '重量(吨)不能为空!',
  1017. type: 'warning'
  1018. })
  1019. return
  1020. }
  1021. if (
  1022. isNaN(this.dataList1.weight) ||
  1023. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1024. String(this.dataList1.weight).length -
  1025. (String(this.dataList1.weight).indexOf('.') + 1) >
  1026. 2) ||
  1027. this.dataList1.weight < 0 ||
  1028. this.dataList1.weight > 200000
  1029. ) {
  1030. this.$message({
  1031. message: '重量输入有误!',
  1032. type: 'warning'
  1033. })
  1034. return
  1035. }
  1036. if (!this.dataList1.bulkDensity) {
  1037. this.$message({
  1038. message: '容重不能为空!',
  1039. type: 'warning'
  1040. })
  1041. return
  1042. }
  1043. if (
  1044. this.dataList1.bulkDensity < 500 ||
  1045. this.dataList1.bulkDensity > 1000
  1046. ) {
  1047. this.$message({
  1048. message: '容重输入错误',
  1049. type: 'warning'
  1050. })
  1051. return
  1052. }
  1053. if (
  1054. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  1055. String(this.dataList1.bulkDensity).length -
  1056. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  1057. 0
  1058. ) {
  1059. this.$message({
  1060. message: '容重需输入整数',
  1061. type: 'warning'
  1062. })
  1063. return
  1064. }
  1065. if (!this.dataList1.waterContent) {
  1066. this.$message({
  1067. message: '水分不能为空!',
  1068. type: 'warning'
  1069. })
  1070. return
  1071. }
  1072. if (
  1073. this.dataList1.waterContent < 0 ||
  1074. this.dataList1.waterContent > 40
  1075. ) {
  1076. this.$message({
  1077. message: '水分输入错误',
  1078. type: 'warning'
  1079. })
  1080. return
  1081. }
  1082. if (
  1083. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  1084. String(this.dataList1.waterContent).length -
  1085. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1086. 1
  1087. ) {
  1088. this.$message({
  1089. message: '水分输入错误',
  1090. type: 'warning'
  1091. })
  1092. return
  1093. }
  1094. if (!this.dataList1.unitPrice) {
  1095. this.$message({
  1096. message: '单价不能为空!',
  1097. type: 'warning'
  1098. })
  1099. return
  1100. }
  1101. if (
  1102. (this.dataList1.unitPrice &&
  1103. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1104. String(this.dataList1.unitPrice).length -
  1105. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1106. 2) ||
  1107. this.dataList1.unitPrice > 100000 ||
  1108. this.dataList1.unitPrice < 1
  1109. ) {
  1110. this.$message({
  1111. message: '单价输入错误',
  1112. type: 'warning'
  1113. })
  1114. return
  1115. }
  1116. if (!this.dataList.predictDate) {
  1117. this.$message({
  1118. message: '预计出库日期不能为空!',
  1119. type: 'warning'
  1120. })
  1121. return
  1122. }
  1123. if (!this.dataList1.predictDate) {
  1124. this.$message({
  1125. message: '预计入库日期不能为空!',
  1126. type: 'warning'
  1127. })
  1128. return
  1129. }
  1130. if (!this.dataList.agent) {
  1131. this.$message({
  1132. message: '出库经办人不能为空!',
  1133. type: 'warning'
  1134. })
  1135. return
  1136. }
  1137. if (!this.dataList1.agent) {
  1138. this.$message({
  1139. message: '入库经办人不能为空!',
  1140. type: 'warning'
  1141. })
  1142. return
  1143. }
  1144. if (!this.dataList1.businessDescribe) {
  1145. this.$message({
  1146. message: '业务描述不能为空!',
  1147. type: 'warning'
  1148. })
  1149. return
  1150. }
  1151. }
  1152. if (this.dataList1.taskTypeKey == 4) {
  1153. if (!this.dataList.warehouseName) {
  1154. this.$message({
  1155. message: '出库仓库名不能为空!',
  1156. type: 'warning'
  1157. })
  1158. return
  1159. }
  1160. if (!this.dataList1.warehouseName) {
  1161. this.$message({
  1162. message: '入库仓库名不能为空!',
  1163. type: 'warning'
  1164. })
  1165. return
  1166. }
  1167. if (!this.dataList1.contractNo) {
  1168. this.$message({
  1169. message: '合同编号不能为空!',
  1170. type: 'warning'
  1171. })
  1172. return
  1173. }
  1174. if (!this.dataList.contractNo) {
  1175. this.$message({
  1176. message: '合同编号不能为空!',
  1177. type: 'warning'
  1178. })
  1179. return
  1180. }
  1181. if (!this.dataList1.weight) {
  1182. this.$message({
  1183. message: '重量(吨)不能为空!',
  1184. type: 'warning'
  1185. })
  1186. return
  1187. }
  1188. if (
  1189. isNaN(this.dataList1.weight) ||
  1190. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1191. String(this.dataList1.weight).length -
  1192. (String(this.dataList1.weight).indexOf('.') + 1) >
  1193. 2) ||
  1194. this.dataList1.weight < 0 ||
  1195. this.dataList1.weight > 200000
  1196. ) {
  1197. this.$message({
  1198. message: '重量输入有误!',
  1199. type: 'warning'
  1200. })
  1201. return
  1202. }
  1203. if (!this.dataList1.bulkDensity) {
  1204. this.$message({
  1205. message: '容重不能为空!',
  1206. type: 'warning'
  1207. })
  1208. return
  1209. }
  1210. if (
  1211. this.dataList1.bulkDensity < 500 ||
  1212. this.dataList1.bulkDensity > 1000
  1213. ) {
  1214. this.$message({
  1215. message: '容重输入错误',
  1216. type: 'warning'
  1217. })
  1218. return
  1219. }
  1220. if (
  1221. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  1222. String(this.dataList1.bulkDensity).length -
  1223. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  1224. 0
  1225. ) {
  1226. this.$message({
  1227. message: '容重需输入整数',
  1228. type: 'warning'
  1229. })
  1230. return
  1231. }
  1232. if (!this.dataList1.waterContent) {
  1233. this.$message({
  1234. message: '水分不能为空!',
  1235. type: 'warning'
  1236. })
  1237. return
  1238. }
  1239. if (
  1240. this.dataList1.waterContent < 0 ||
  1241. this.dataList1.waterContent > 40
  1242. ) {
  1243. this.$message({
  1244. message: '水分输入错误',
  1245. type: 'warning'
  1246. })
  1247. return
  1248. }
  1249. if (
  1250. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  1251. String(this.dataList1.waterContent).length -
  1252. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1253. 1
  1254. ) {
  1255. this.$message({
  1256. message: '水分输入错误',
  1257. type: 'warning'
  1258. })
  1259. return
  1260. }
  1261. if (!this.dataList1.unitPrice) {
  1262. this.$message({
  1263. message: '单价不能为空!',
  1264. type: 'warning'
  1265. })
  1266. return
  1267. }
  1268. if (
  1269. (this.dataList1.unitPrice &&
  1270. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1271. String(this.dataList1.unitPrice).length -
  1272. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1273. 2) ||
  1274. this.dataList1.unitPrice > 100000 ||
  1275. this.dataList1.unitPrice < 1
  1276. ) {
  1277. this.$message({
  1278. message: '单价输入错误',
  1279. type: 'warning'
  1280. })
  1281. return
  1282. }
  1283. if (!this.dataList.predictDate) {
  1284. this.$message({
  1285. message: '预计出库日期不能为空!',
  1286. type: 'warning'
  1287. })
  1288. return
  1289. }
  1290. if (!this.dataList1.predictDate) {
  1291. this.$message({
  1292. message: '预计入库日期不能为空!',
  1293. type: 'warning'
  1294. })
  1295. return
  1296. }
  1297. if (!this.dataList.agent) {
  1298. this.$message({
  1299. message: '出库经办人不能为空!',
  1300. type: 'warning'
  1301. })
  1302. return
  1303. }
  1304. if (!this.dataList1.agent) {
  1305. this.$message({
  1306. message: '入库经办人不能为空!',
  1307. type: 'warning'
  1308. })
  1309. return
  1310. }
  1311. if (!this.dataList.businessDescribe) {
  1312. this.$message({
  1313. message: '业务描述不能为空!',
  1314. type: 'warning'
  1315. })
  1316. return
  1317. }
  1318. }
  1319. // this.dataList.goodsNameKey =
  1320. // this.dataList.positionId =
  1321. // this.dataList.baseId =
  1322. this.dataList.inOutFlag = 1
  1323. this.dataList1.inOutFlag = 2
  1324. if (this.dataList.taskTypeKey == 1) {
  1325. this.dataList.inOutTaskNo = this.inOutTaskNo
  1326. this.requestadd(this.dataList)
  1327. } else if (this.dataList1.taskTypeKey == 2) {
  1328. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1329. this.requestadd(this.dataList1)
  1330. } else if (
  1331. this.dataList.taskTypeKey == 3 ||
  1332. this.dataList.taskTypeKey == 4
  1333. ) {
  1334. this.dataList.inOutTaskNo = this.inOutTaskNo
  1335. this.dataList.relevanceId = this.GetRandomNum(100000, 999999)
  1336. if (this.dataList.taskTypeKey == 3) {
  1337. this.dataList.businessDescribe = this.dataList1.businessDescribe
  1338. } else {
  1339. this.dataList1.businessDescribe = this.dataList.businessDescribe
  1340. }
  1341. this.requestadd(this.dataList, 'repetition')
  1342. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1343. this.dataList1.relevanceId = this.dataList.relevanceId
  1344. this.dataList1.goodsName = this.dataList.goodsName
  1345. this.requestadd(this.dataList1, 'repetition')
  1346. }
  1347. },
  1348. tarechange(e) {
  1349. if (this.dataList.grossWeight && this.dataList.tare) {
  1350. this.dataList.netWeight = Number(
  1351. this.dataList.grossWeight - this.dataList.tare
  1352. )
  1353. }
  1354. },
  1355. grossWeightchange(e) {
  1356. if (this.dataList.grossWeight && this.dataList.tare) {
  1357. this.dataList.netWeight = Number(
  1358. this.dataList.grossWeight - this.dataList.tare
  1359. )
  1360. }
  1361. },
  1362. selectgoodsName(e) {
  1363. for (var i = 0; i < this.goodnameList.length; i++) {
  1364. if (this.goodnameList[i].constValue == e) {
  1365. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1366. }
  1367. }
  1368. },
  1369. selectgoodsName1(e) {
  1370. for (var i = 0; i < this.goodnameList.length; i++) {
  1371. if (this.goodnameList[i].constValue == e) {
  1372. this.dataList1.goodsNameKey = this.goodnameList[i].constKey
  1373. }
  1374. }
  1375. },
  1376. selectpackingMethod(e) {
  1377. for (var i = 0; i < this.gradeList.length; i++) {
  1378. if (this.gradeList[i].constValue == e) {
  1379. this.dataList.gradeKey = this.gradeList[i].constKey
  1380. if (this.dataList.taskTypeKey == 3) {
  1381. this.$set(this.dataList1, 'grade', e)
  1382. this.$set(this.dataList1, 'gradeKey', this.gradeList[i].constKey)
  1383. }
  1384. }
  1385. }
  1386. },
  1387. selectpackingMethod1(e) {
  1388. for (var i = 0; i < this.gradeList.length; i++) {
  1389. if (this.gradeList[i].constValue == e) {
  1390. this.dataList1.packingMethodKey = this.gradeList[i].constKey
  1391. if (this.dataList1.taskTypeKey == 4) {
  1392. this.$set(this.dataList, 'grade', e)
  1393. this.$set(this.dataList, 'gradeKey', this.gradeList[i].constKey)
  1394. }
  1395. }
  1396. }
  1397. },
  1398. selectstorageType(e) {
  1399. switch (e) {
  1400. case '采购出库':
  1401. this.flag = 0
  1402. break
  1403. case '销售出库':
  1404. this.flag = 1
  1405. break
  1406. }
  1407. for (var i = 0; i < this.storageType.length; i++) {
  1408. if (this.storageType[i].constValue == e) {
  1409. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1410. }
  1411. }
  1412. },
  1413. selectstorageType1(e) {debugger
  1414. switch (e) {
  1415. case '采购入库':
  1416. this.flag = 0
  1417. break
  1418. case '退库':
  1419. this.flag = 2
  1420. break
  1421. }
  1422. for (var i = 0; i < this.storageType1.length; i++) {
  1423. if (this.storageType1[i].constValue == e) {
  1424. this.dataList1.inOutTypeKey = this.storageType1[i].constKey
  1425. }
  1426. }
  1427. },
  1428. handleClose() {
  1429. this.accessoryTFs = false
  1430. },
  1431. handleSizeChange(val) {
  1432. console.log(`每页 ${val} 条`)
  1433. this.pageSize = val
  1434. this.getList()
  1435. },
  1436. businessDescriptionchange(e) {
  1437. console.log(e)
  1438. },
  1439. handleCurrentChange(val) {
  1440. this.currentPage = val
  1441. console.log(`当前页: ${val}`)
  1442. this.getList()
  1443. },
  1444. tasknumber() {
  1445. if (this.dataList.taskTypeKey == 1) {
  1446. this.inOutTaskNo = 'CK' + this.getdate() + this.MathRand()
  1447. } else if (this.dataList.taskTypeKey == 2) {
  1448. this.inOutTaskNo1 = 'RK' + this.getdate() + this.MathRand()
  1449. } else if (this.dataList.taskTypeKey == 3) {
  1450. var random = this.getdate() + this.MathRand()
  1451. this.inOutTaskNo = 'YKC' + random
  1452. this.inOutTaskNo1 = 'YKR' + random
  1453. } else if (this.dataList.taskTypeKey == 4) {
  1454. var random = this.getdate() + this.MathRand()
  1455. this.inOutTaskNo = 'TCC' + random
  1456. this.inOutTaskNo1 = 'TCR' + random
  1457. }
  1458. },
  1459. tasktypechange(e) {
  1460. if (!this.$route.query.relevanceId) {
  1461. this.tasknumber()
  1462. }
  1463. this.dataList1.taskTypeKey = e
  1464. if (this.dataList.taskTypeKey == 1) {
  1465. this.dataList.inOutType = '销售出库'
  1466. this.dataList.inOutTypeKey = '1'
  1467. this.flag = 1
  1468. }
  1469. if (this.dataList1.taskTypeKey == 2) {
  1470. this.dataList1.inOutType = '采购入库'
  1471. this.dataList1.inOutTypeKey = '1'
  1472. this.flag = 0
  1473. } else if (this.dataList1.taskTypeKey == 3) {
  1474. this.disabled = true
  1475. this.dataList1.inOutType = '移库入库'
  1476. this.dataList1.inOutTypeKey = '3'
  1477. this.dataList.inOutType = '移库出库'
  1478. this.dataList.inOutTypeKey = '3'
  1479. } else if (this.dataList1.taskTypeKey == 4) {
  1480. this.disabled = true
  1481. this.dataList1.inOutType = '退库'
  1482. this.dataList1.inOutTypeKey = '6'
  1483. this.dataList.inOutType = '销售出库'
  1484. this.flag = 2
  1485. this.dataList.inOutTypeKey = '1'
  1486. }
  1487. },
  1488. GetRandomNum(Min, Max) {
  1489. var Range = Max - Min
  1490. var Rand = Math.random()
  1491. return Min + Math.round(Rand * Range)
  1492. },
  1493. getList() {
  1494. this.tasknumber()
  1495. this.$set(this.dataList, 'inOutType', '销售出库')
  1496. this.$set(this.dataList, 'inOutTypeKey', '1')
  1497. this.$set(this.dataList, 'goodsName', '玉米')
  1498. this.$set(this.dataList, 'goodsNameKey', '1')
  1499. this.$set(this.dataList, 'grade', '一等品')
  1500. this.$set(this.dataList, 'gradeKey', '1')
  1501. this.$set(this.dataList1, 'goodsName', '玉米')
  1502. this.$set(this.dataList1, 'goodsNameKey', '1')
  1503. this.$set(this.dataList1, 'grade', '一等品')
  1504. this.$set(this.dataList1, 'gradeKey', '1')
  1505. // 货名
  1506. pullDown({
  1507. constId: 'CON2'
  1508. })
  1509. .toPromise()
  1510. .then(response => {
  1511. this.goodnameList = response
  1512. })
  1513. // 品级
  1514. pullDown({
  1515. constId: 'CON3'
  1516. })
  1517. .toPromise()
  1518. .then(response => {
  1519. this.gradeList = response
  1520. })
  1521. pullDown({
  1522. constId: 'CON6'
  1523. })
  1524. .toPromise()
  1525. .then(response => {
  1526. this.storageType = response
  1527. })
  1528. pullDown({
  1529. constId: 'CON5'
  1530. })
  1531. .toPromise()
  1532. .then(response => {
  1533. this.storageType1 = response
  1534. })
  1535. xialaNo({
  1536. compId: this.compId,
  1537. flag: this.flag
  1538. })
  1539. .toPromise()
  1540. .then(response => {
  1541. this.contractNoList = response
  1542. // this.contractNoList1 = response
  1543. })
  1544. // //临时仓库入库类型
  1545. // pullDown({ constId: 'WARE1' })
  1546. // .toPromise()
  1547. // .then((response) => {
  1548. // this.storageType = respons
  1549. // })
  1550. // //临时仓库出库类型
  1551. // pullDown({ constId: 'WARE2' })
  1552. // .toPromise()
  1553. // .then((response) => {
  1554. // this.deliveryType = response
  1555. // })
  1556. //仓库名
  1557. getwarehousename({
  1558. compId: this.compId,
  1559. warehouseType: 1
  1560. })
  1561. .toPromise()
  1562. .then(response => {
  1563. this.warehouseNameList = response
  1564. getwarehousename({
  1565. compId: this.compId,
  1566. warehouseType: 2
  1567. })
  1568. .toPromise()
  1569. .then(response => {
  1570. for (var i = 0; i < response.length; i++) {
  1571. this.warehouseNameList.push(response[i])
  1572. }
  1573. })
  1574. })
  1575. },
  1576. selecttaskType(e) {
  1577. for (var i = 0; i < this.taskTypeList.length; i++) {
  1578. if (this.taskTypeList[i].value == e) {
  1579. this.searchType = this.taskTypeList[i].type
  1580. }
  1581. }
  1582. },
  1583. fujian(row) {
  1584. if (
  1585. row.receiveAttachmentPath === null ||
  1586. row.receiveAttachmentPath === ''
  1587. ) {
  1588. EventBus.$emit(
  1589. 'warning',
  1590. this.$t('system.noticeCircular.NoInformation')
  1591. )
  1592. } else {
  1593. this.accessoryTFs = true
  1594. }
  1595. this.appendixIdss = row.receiveAttachmentPath
  1596. },
  1597. handleExamine(row) {
  1598. this.$router.push({
  1599. name: 'salesContractExamine',
  1600. query: {
  1601. id: row.id
  1602. }
  1603. })
  1604. },
  1605. // 关闭 dialog时 处理文件url 初始化upload组件
  1606. handleCloe() {
  1607. this.dialogViewSpareMoney = false
  1608. },
  1609. history(row) {
  1610. console.log(row)
  1611. billoperatehis({
  1612. id: row.id
  1613. })
  1614. .toPromise()
  1615. .then(response => {
  1616. this.historyList = response
  1617. })
  1618. }
  1619. }
  1620. }
  1621. </script>
  1622. <style lang="scss" scoped>
  1623. /deep/.basicInformation {
  1624. .el-info-table {
  1625. border: none;
  1626. position: relative;
  1627. }
  1628. .el-form-item {
  1629. width: 33.3333%;
  1630. border: none;
  1631. margin: 0;
  1632. .el-form-item__label {
  1633. text-align: left;
  1634. font-size: 14px;
  1635. font-family: PingFangSC-Regular, PingFang SC;
  1636. font-weight: 400;
  1637. color: #8890b1;
  1638. }
  1639. .el-form-item__content {
  1640. padding-left: 0px;
  1641. padding-right: 10px;
  1642. // background: #fff;
  1643. white-space: nowrap;
  1644. height: 40px;
  1645. display: flex;
  1646. -webkit-box-align: center;
  1647. align-items: center;
  1648. text-align: left;
  1649. overflow: hidden;
  1650. }
  1651. }
  1652. }
  1653. /deep/.el-radio {
  1654. color: #606266;
  1655. font-weight: 500;
  1656. line-height: 1;
  1657. cursor: pointer;
  1658. white-space: nowrap;
  1659. outline: 0;
  1660. margin-right: 30px;
  1661. margin-top: 15px;
  1662. }
  1663. /deep/.el-radio__inner {
  1664. border: 1px solid #dcdfe6;
  1665. border-radius: 100%;
  1666. width: 14px;
  1667. height: 14px;
  1668. background-color: #fff;
  1669. cursor: pointer;
  1670. -webkit-box-sizing: border-box;
  1671. box-sizing: border-box;
  1672. margin-left: 100px;
  1673. }
  1674. /deep/.el-radio__input {
  1675. white-space: nowrap;
  1676. cursor: pointer;
  1677. outline: 0;
  1678. line-height: 1;
  1679. vertical-align: middle;
  1680. margin-top: -1px;
  1681. }
  1682. .title {
  1683. position: relative;
  1684. padding-left: 10px;
  1685. }
  1686. .title::before {
  1687. content: '';
  1688. display: inline-block;
  1689. width: 5px;
  1690. height: 30px;
  1691. background: #5473e8;
  1692. position: absolute;
  1693. left: 0;
  1694. }
  1695. .el-form {
  1696. padding: 0 15%;
  1697. display: flex;
  1698. flex-wrap: wrap;
  1699. margin-left: -50px;
  1700. margin-top: 15px;
  1701. width: 110%;
  1702. }
  1703. .el-button--primary {
  1704. background-color: #5878e8;
  1705. border-color: #5878e8;
  1706. }
  1707. .el-col {
  1708. background: #f6f7fc;
  1709. }
  1710. .bg-right {
  1711. text-align: right;
  1712. padding: 16px 20px;
  1713. }
  1714. .center {
  1715. position: relative;
  1716. top: 50px;
  1717. width: 40%;
  1718. height: 2000px;
  1719. margin: 0 auto;
  1720. margin-right: 180px;
  1721. }
  1722. /deep/.el-form-item__label {
  1723. width: 160px;
  1724. }
  1725. .inspector {
  1726. width: 50%;
  1727. }
  1728. /deep/.el-form-item--small .el-form-item__label,
  1729. .el-form-item--small .el-form-item__content {
  1730. text-align: left;
  1731. }
  1732. /deep/.el-input--small {
  1733. font-size: 13px;
  1734. position: relative;
  1735. display: inline-block;
  1736. }
  1737. .center1 .small-title {
  1738. margin-left: 323px;
  1739. }
  1740. .center1 {
  1741. width: 90%;
  1742. margin: 0 auto;
  1743. margin-left: 10px;
  1744. margin-top: 25px;
  1745. }
  1746. /deep/.el-input--small .el-input__inner {
  1747. height: 32px;
  1748. line-height: 32px;
  1749. }
  1750. /deep/.el-select {
  1751. display: inline-block;
  1752. position: relative;
  1753. width: 100%;
  1754. }
  1755. .annu {
  1756. height: 81px;
  1757. background: #ffffff;
  1758. border-radius: 4px;
  1759. }
  1760. .basicInformation .el-form-item {
  1761. width: 50.3333%;
  1762. border: none;
  1763. margin: 0;
  1764. }
  1765. .huom {
  1766. width: 100px;
  1767. }
  1768. .el-form {
  1769. font-size: 14px;
  1770. font-family: PingFangSC-Regular, PingFang SC;
  1771. font-weight: 400;
  1772. color: #8890b1;
  1773. line-height: 16px;
  1774. }
  1775. .a {
  1776. margin-left: -32px;
  1777. }
  1778. .el-radio-group {
  1779. margin-left: 251px;
  1780. }
  1781. .ding {
  1782. height: 23px;
  1783. background: #e8ecf6;
  1784. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  1785. }
  1786. .winseaview-view {
  1787. padding: 0 0 20px;
  1788. }
  1789. .container {
  1790. overflow: scroll;
  1791. height: 93vh;
  1792. }
  1793. .el-radio-group {
  1794. font-size: 0;
  1795. margin-top: 20px;
  1796. }
  1797. /deep/.el-form {
  1798. padding: 0 15%;
  1799. display: -webkit-box;
  1800. display: -ms-flexbox;
  1801. display: flex;
  1802. -ms-flex-wrap: wrap;
  1803. flex-wrap: wrap;
  1804. margin-left: 130px;
  1805. margin-top: 15px;
  1806. width: 110%;
  1807. }
  1808. </style>