IncidentTicketModalDetail.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <template>
  2. <a-modal
  3. title="详情"
  4. width="85%"
  5. :visible="visible"
  6. :maskClosable="false"
  7. :confirmLoading="confirmLoading"
  8. @cancel="handleCancel"
  9. destroyOnClose
  10. >
  11. <template #footer>
  12. <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
  13. <a-button @click="handlePrint" style="margin-left: 8px;">打印</a-button>
  14. <a-button type="primary" @click="addNotice" style="margin-left: 8px;" :disabled="!(formState.state=='1')">通知</a-button>
  15. <a-popconfirm title="确定反馈通知吗?" ok-text="是" cancel-text="否" @confirm="feedbackNotice" @cancel="handleCancelPop('visibleFk')" :visible="visibleFk">
  16. <a-button type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='2')" @click="()=>visibleFk = true">反馈通知</a-button>
  17. </a-popconfirm>
  18. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push" @cancel="handleCancelPop('visibleTs')" :visible="visibleTs">
  19. <a-button type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='3'&&!confirmLoading)" @click="()=>visibleTs = true">推送</a-button>
  20. </a-popconfirm>
  21. <a-popconfirm title="确定完结吗?" ok-text="是" cancel-text="否" @confirm="end" @cancel="handleCancelPop('visibleWj')" :visible="visibleWj">
  22. <a-button type="primary" style="margin-left: 8px;" :disabled="!(formState.state=='3'|| formState.state=='4')" @click="()=>visibleWj = true">完结</a-button>
  23. </a-popconfirm>
  24. </template>
  25. <div class="col-md-6 column" style="display: none;" id="printBox">
  26. <h1 style="text-align: center;">质量事故处理单</h1>
  27. <table class="table table-bordered" style="border:2px solid #999">
  28. <thead>
  29. </thead>
  30. <tbody>
  31. <tr>
  32. <td class="tdOne">日期</td>
  33. <td class="tdTwo"> {{ formState.accidentData }}</td>
  34. <td class="tdOne">质量事故单号</td>
  35. <td class="tdTwo">{{ formState.accidentNumber }}</td>
  36. <td class="tdOne">质量事故主题</td>
  37. <td class="tdTwo">{{ formState.accidentTheme }}</td>
  38. </tr>
  39. <tr>
  40. <td class="tdOne">客户</td>
  41. <td class="tdTwo" >{{formState.customer }}</td>
  42. <td class="tdOne">工厂</td>
  43. <td class="tdTwo" >{{ formState.factory}}</td>
  44. <td class="tdOne">责任单位</td>
  45. <td class="tdTwo" >{{ formState.responsibilityCompany }}</td>
  46. </tr>
  47. <tr>
  48. <td class="tdOne">责任人1</td>
  49. <td class="tdOne">{{ formState.responsibilityPerson1 }}</td>
  50. <td class="tdOne">责任人2</td>
  51. <td class="tdOne">{{ formState.responsibilityPerson2 }}</td>
  52. <td class="tdOne">责任人3</td>
  53. <td class="tdOne">{{ formState.responsibilityPerson3 }}</td>
  54. </tr>
  55. <tr>
  56. <td class="tdOne">金额1</td>
  57. <td class="tdOne">{{ formState.sum1 }}</td>
  58. <td class="tdOne">金额2</td>
  59. <td class="tdOne">{{ formState.sum2 }}</td>
  60. <td class="tdOne">金额3</td>
  61. <td class="tdOne">{{ formState.sum3 }}</td>
  62. </tr>
  63. <tr>
  64. <td class="tdOne">总金额</td>
  65. <td class="tdOne">{{ formState.totalMoney }}</td>
  66. <td class="tdOne">业务类型</td>
  67. <td class="tdOne">{{ formState.businessType }}</td>
  68. <td class="tdOne"></td>
  69. <td class="tdOne"></td>
  70. </tr>
  71. <tr>
  72. <td class="tdOne">成衣销售订单号</td>
  73. <td class="tdOne">{{ formState.garmentSalesOrder }}</td>
  74. <td class="tdOne">款号</td>
  75. <td class="tdOne">{{ formState.styleNumber }}</td>
  76. <td class="tdOne">物料</td>
  77. <td class="tdOne">{{ formState.material }}</td>
  78. </tr>
  79. <tr>
  80. <td class="tdOne">计划员</td>
  81. <td class="tdOne">{{ formState.planPersonnel }}</td>
  82. <td class="tdOne">业务员</td>
  83. <td class="tdOne">{{ formState.businessPeople }}</td>
  84. <td class="tdOne">QC</td>
  85. <td class="tdOne">{{ formState.qualityControl }}</td>
  86. </tr>
  87. <tr style="height: 50px;">
  88. <td class="tdOne" rowspan="3">情况说明</td>
  89. <td class="tdOne" colspan="5" rowspan="3">{{ formState.presentationCondition }}</td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  94. <thead>
  95. <th>计划单号</th>
  96. <th>事故类型</th>
  97. <th>币种</th>
  98. <th>事故金额</th>
  99. <th>汇率</th>
  100. <th>实际事故金额</th>
  101. <th>U8生成运费发票号</th>
  102. <th>账套号</th>
  103. <th>备注</th>
  104. </thead>
  105. <tbody>
  106. <tr v-for="(item, key) in incidentTicketChildrenTable.dataSource">
  107. <td>{{item.planNumber}}</td>
  108. <td>{{item.accidentType}}</td>
  109. <td>{{item.moneyType}}</td>
  110. <td>{{item.accidentSum}}</td>
  111. <td>{{item.exchangeRate}}</td>
  112. <td>{{item.practicalSum}}</td>
  113. <td>{{item.u8Invoice}}</td>
  114. <td>{{item.zhanghaoId}}</td>
  115. <td>{{item.remark}}</td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. <table class="table table-bordered" style="margin-top: 2%;border:2px solid #999">
  120. <thead>
  121. </thead>
  122. <tbody>
  123. <tr style="height: 50px;">
  124. <td class="tdOne" style="width: 1%;">财务备注</td>
  125. <td class="tdOne" colspan="7" >{{formState.financeRemark}}</td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <div style="display: flex;justify-content: space-around;margin-top: 2%;">
  130. <span>填报人:{{ formState.informant }}</span>
  131. <span>通知人:{{ formState.Noticer }}</span>
  132. </div>
  133. </div>
  134. <a-spin :spinning="confirmLoading">
  135. <div class="table-page-search-wrapper" >
  136. <div>
  137. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules" labelAlign="right" class="kk">
  138. <a-row :gutter="24">
  139. <a-col :span="8" >
  140. <a-form-model-item label="日期" prop="accidentData" >
  141. <a-input v-model="formState.accidentData" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  142. <span v-show='showSelect==1'> {{ formState.accidentData }}</span>
  143. </a-form-model-item>
  144. </a-col>
  145. <a-col :span="8" >
  146. <a-form-model-item label="质量事故单主题" prop="accidentTheme">
  147. <a-input v-model="formState.accidentTheme" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  148. <span v-show='showSelect==1'>{{ formState.accidentTheme }}</span>
  149. </a-form-model-item>
  150. </a-col>
  151. <a-col :span="8">
  152. <a-form-model-item label="质量事故单号" prop="accidentNumber">
  153. <a-input v-model="formState.accidentNumber" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  154. <span v-show='showSelect==1'>{{ formState.accidentNumber }}</span>
  155. </a-form-model-item>
  156. </a-col>
  157. </a-row>
  158. <a-row :gutter="24">
  159. <a-col :span="8" >
  160. <a-form-model-item label="客户" prop="customer" >
  161. <a-input v-model="formState.customer" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  162. <span v-show='showSelect==1'> {{formState.customer }}</span>
  163. </a-form-model-item>
  164. </a-col>
  165. <a-col :span="8" >
  166. <a-form-model-item label="工厂(事故发生地)" prop="factory">
  167. <a-input v-model="formState.factory" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  168. <span v-show='showSelect==1'>{{ formState.factory}}</span>
  169. </a-form-model-item>
  170. </a-col>
  171. <a-col :span="8" >
  172. <a-form-model-item label="责任单位" prop="responsibilityCompany">
  173. <a-input v-model="formState.responsibilityCompany" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  174. <span v-show='showSelect==1'> {{ formState.responsibilityCompany }}</span>
  175. </a-form-model-item>
  176. </a-col>
  177. </a-row>
  178. <a-divider />
  179. <a-row :gutter="24">
  180. <a-col :span="6" >
  181. <a-form-model-item label="责任人1" prop="responsibilityPerson1" >
  182. <j-search-select-tag v-model="formState.responsibilityPerson1" placeholder=""
  183. dict="sys_user,realname,username" @search="searchName" :disabled="true" v-show='showSelect==0'/>
  184. <span v-show='showSelect==1'>{{ formState.responsibilityPerson1 }}</span>
  185. </a-form-model-item>
  186. </a-col>
  187. <a-col :span="6" >
  188. <a-form-model-item label="责任人2" prop="responsibilityPerson2" >
  189. <j-search-select-tag v-model="formState.responsibilityPerson2" placeholder=""
  190. dict="sys_user,realname,username" @search="searchName" :disabled="true" v-show='showSelect==0'/>
  191. <span v-show='showSelect==1'>{{ formState.responsibilityPerson2 }}</span>
  192. </a-form-model-item>
  193. </a-col>
  194. <a-col :span="6" >
  195. <a-form-model-item label="责任人3" prop="responsibilityPerson3">
  196. <j-search-select-tag v-model="formState.responsibilityPerson3" placeholder=""
  197. dict="sys_user,realname,username" @search="searchName" :disabled="true" v-show='showSelect==0'/>
  198. <span v-show='showSelect==1'>{{ formState.responsibilityPerson3 }}</span>
  199. </a-form-model-item>
  200. </a-col>
  201. <a-col :span="6" class="noprint">
  202. <a-form-model-item label="责任人4" prop="responsibilityPerson4">
  203. <j-search-select-tag v-model="formState.responsibilityPerson4" placeholder=""
  204. dict="sys_user,realname,username" @search="searchName" :disabled="true" />
  205. </a-form-model-item>
  206. </a-col>
  207. </a-row>
  208. <a-row :gutter="24">
  209. <a-col :span="6" >
  210. <a-form-model-item label="金额1" prop="sum1" >
  211. <a-input v-model="formState.sum1" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  212. <span v-show='showSelect==1'>{{ formState.sum1 }}</span>
  213. </a-form-model-item>
  214. </a-col>
  215. <a-col :span="6" >
  216. <a-form-model-item label="金额2" prop="sum2" >
  217. <a-input v-model="formState.sum2" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  218. <span v-show='showSelect==1'>{{ formState.sum2}}</span>
  219. </a-form-model-item>
  220. </a-col>
  221. <a-col :span="6" >
  222. <a-form-model-item label="金额3" prop="sum3">
  223. <a-input v-model="formState.sum3" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  224. <span v-show='showSelect==1'>{{ formState.sum3 }}</span>
  225. </a-form-model-item>
  226. </a-col>
  227. <a-col :span="6" class="noprint">
  228. <a-form-model-item label="金额4" prop="sum4" >
  229. <a-input v-model="formState.sum4" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  230. <span v-show='showSelect==1'>{{ formState.sum4 }}</span>
  231. </a-form-model-item>
  232. </a-col>
  233. </a-row>
  234. <a-divider />
  235. <a-row :gutter="24">
  236. <!-- <a-col :span="8" >
  237. <a-form-model-item label="币种" prop="moneyType">
  238. <a-input v-model="formState.moneyType" placeholder="请输入" readOnly></a-input>
  239. </a-form-model-item>
  240. </a-col> -->
  241. <a-col :span="8" >
  242. <a-form-model-item label="总金额" prop="totalMoney" >
  243. <a-input v-model="formState.totalMoney" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  244. <span v-show='showSelect==1'>{{ formState.totalMoney }}</span>
  245. </a-form-model-item>
  246. </a-col>
  247. <a-col :span="8" >
  248. <a-form-model-item label="业务类型" prop="businessType">
  249. <a-input v-model="formState.businessType" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  250. <span v-show='showSelect==1'>{{ formState.businessType }}</span>
  251. </a-form-model-item>
  252. </a-col>
  253. </a-row>
  254. <a-row :gutter="24">
  255. <a-col :span="8" >
  256. <a-form-model-item label="成衣销售订单号" prop="garmentSalesOrder">
  257. <a-input v-model="formState.garmentSalesOrder" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  258. <span v-show='showSelect==1'>{{ formState.garmentSalesOrder }}</span>
  259. </a-form-model-item>
  260. </a-col>
  261. <a-col :span="8" >
  262. <a-form-model-item label="款号" prop="styleNumber" >
  263. <a-input v-model="formState.styleNumber" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  264. <span v-show='showSelect==1'>{{ formState.styleNumber }}</span>
  265. </a-form-model-item>
  266. </a-col>
  267. <a-col :span="8" >
  268. <a-form-model-item label="物料" prop="material">
  269. <a-input v-model="formState.material" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  270. <span v-show='showSelect==1'>{{ formState.material }}</span>
  271. </a-form-model-item>
  272. </a-col>
  273. </a-row>
  274. <a-row :gutter="24">
  275. <a-col :span="8" >
  276. <a-form-model-item label="计划员" prop="planPersonnel">
  277. <a-input v-model="formState.planPersonnel" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  278. <span v-show='showSelect==1'>{{ formState.planPersonnel }}</span>
  279. </a-form-model-item>
  280. </a-col>
  281. <a-col :span="8" >
  282. <a-form-model-item label="业务员" prop="businessPeople" >
  283. <j-search-select-tag v-model="formState.businessPeople" placeholder=""
  284. dict="sys_user,realname,username" @search="searchName" :disabled="true" v-show='showSelect==0'/>
  285. <span v-show='showSelect==1'>{{ formState.businessPeople }}</span>
  286. </a-form-model-item>
  287. </a-col>
  288. <a-col :span="8" >
  289. <a-form-model-item label="QC" prop="qualityControl">
  290. <j-search-select-tag v-model="formState.qualityControl" placeholder=""
  291. dict="sys_user,realname,username" @search="searchName" :disabled="true" v-show='showSelect==0'/>
  292. <span v-show='showSelect==1'>{{ formState.qualityControl }}</span>
  293. </a-form-model-item>
  294. </a-col>
  295. </a-row>
  296. <a-row :gutter="24">
  297. <a-col :span="24" style="height: 290px;">
  298. <a-form-model-item label="情况说明" prop="presentationCondition" class="fff">
  299. <a-input v-model="formState.presentationCondition" type="textarea" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  300. <a-input v-text="formState.presentationCondition" type="textarea" placeholder="请输入" v-show='showSelect==1'></a-input>
  301. </a-form-model-item>
  302. </a-col>
  303. </a-row>
  304. </a-form-model>
  305. </div>
  306. <!-- 子表单区域 -->
  307. <!-- <a-button type="primary" @click="addList" style="margin-bottom: 1%;">增行</a-button> -->
  308. <a-table
  309. bordered
  310. :columns="incidentTicketChildrenTable.columns"
  311. :data-source="incidentTicketChildrenTable.dataSource"
  312. :loading="incidentTicketChildrenTable.loading"
  313. :scroll="{x: 1500,y:300 }"
  314. :pagination="false"
  315. >
  316. <!-- 汇率 -->
  317. <span slot="exchangeRate" slot-scope="text, record, index">
  318. <a-input placeholder="请输入" v-model="record.exchangeRate" />
  319. </span>
  320. <!-- 实际事故金额 -->
  321. <span slot="practicalSum" slot-scope="text, record, index">
  322. <a-input placeholder="请输入" v-model="record.practicalSum" />
  323. </span>
  324. <!-- U8生成运费发票号 -->
  325. <span slot="u8Invoice" slot-scope="text, record, index">
  326. <a-input placeholder="请输入" v-model="record.u8Invoice" />
  327. </span>
  328. <!-- 账套号 -->
  329. <span slot="zhanghaoId" slot-scope="text, record, index">
  330. <a-input placeholder="请输入" v-model="record.zhanghaoId" />
  331. </span>
  332. <!-- 备注 -->
  333. <span slot="remark" slot-scope="text, record, index">
  334. <a-input placeholder="请输入" v-model="record.remark" />
  335. </span>
  336. </a-table>
  337. <!-- 主表单区域 -->
  338. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  339. <a-row :gutter="24">
  340. <a-col :span="12" class="noprint" >
  341. <a-form-model-item label="附件上传" prop="accessory" class="ff">
  342. <j-upload v-model="accessory" :disabled="true"></j-upload>
  343. </a-form-model-item>
  344. </a-col>
  345. <a-col :span="12" class="noprint">
  346. <a-form-model-item label="工厂签章" prop="factorySignature" class="ff">
  347. <j-upload v-model="factorySignature" :disabled="true"></j-upload>
  348. </a-form-model-item>
  349. </a-col>
  350. </a-row>
  351. <a-row :gutter="24">
  352. <a-col :span="24" style="height: 230px;">
  353. <a-form-model-item label="财务备注" prop="financeRemark" class="caiwu">
  354. <a-input v-model="formState.financeRemark" type="textarea" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  355. <a-input v-text="formState.financeRemark" type="textarea" readOnly v-show='showSelect==1'></a-input>
  356. </a-form-model-item>
  357. </a-col>
  358. </a-row>
  359. <a-row :gutter="24">
  360. <a-col :span="12" class="noprint">
  361. <a-form-model-item label="财务添加附件" prop="accessory2" class="ff ">
  362. <j-upload v-model="accessory2" ></j-upload>
  363. <!-- <a-input v-model="formState.accessory2" placeholder="请输入"></a-input> -->
  364. </a-form-model-item>
  365. </a-col>
  366. <a-col :span="10">
  367. <a-form-model-item label="通知人" prop="Noticer">
  368. <a-input v-model="formState.Noticer" placeholder="请输入" v-show='showSelect==0'></a-input>
  369. <span v-show='showSelect==1'>{{ formState.Noticer }}</span>
  370. </a-form-model-item>
  371. </a-col>
  372. </a-row>
  373. <a-row :gutter="24">
  374. <a-col :span="8" >
  375. <a-form-model-item label="填报人" prop="informant">
  376. <a-input v-model="formState.informant" placeholder="请输入" readOnly v-show='showSelect==0'></a-input>
  377. <span v-show='showSelect==1'>{{ formState.informant}}</span>
  378. </a-form-model-item>
  379. </a-col>
  380. </a-row>
  381. </a-form-model>
  382. <j-select-biz-component ref="JSelectBizComponent" @send-notice="sendNotice" :multi="true" />
  383. </div>
  384. </a-spin>
  385. </a-modal>
  386. </template>
  387. <script>
  388. import JSelectBizComponent from './JSelectUserByDepModal'
  389. import pick from 'lodash.pick'
  390. import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
  391. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  392. import { validateDuplicateValue } from '@/utils/util'
  393. import JDictSelectTag from "@/components/dict/JDictSelectTag"
  394. import { putAction,getAction } from '@/api/manage'
  395. import JUpload from '@/components/jeecg/JUpload'
  396. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  397. import moment from 'moment'
  398. export default {
  399. name: 'IncidentTicketModalDetail',
  400. mixins: [JEditableTableMixin],
  401. components: {
  402. JDictSelectTag,
  403. JSelectBizComponent,
  404. JUpload,
  405. JSearchSelectTag,
  406. moment
  407. },
  408. data() {
  409. return {
  410. labelCol: {
  411. span: 8
  412. },
  413. wrapperCol: {
  414. span: 16
  415. },
  416. labelCol2: {
  417. span: 3
  418. },
  419. wrapperCol2: {
  420. span: 20
  421. },
  422. formState:{},
  423. showSelect:0,
  424. confirmLoading:false,
  425. visibleFk:false,
  426. visibleTs:false,
  427. visibleWj:false,
  428. accessory2:[],
  429. accessory:[],
  430. factorySignature:[],
  431. columns: [
  432. { title: '姓名', align: 'center', width: '20%', widthRight: '70%', dataIndex: 'realname' },
  433. { title: '账号', align: 'center', width: '20%', dataIndex: 'username' },
  434. { title: '电话', align: 'center', width: '23%', dataIndex: 'phone' },
  435. { title: '出生日期', align: 'center', width: '23%', dataIndex: 'birthday' }
  436. ],
  437. multi:true,
  438. // 新增时子表默认添加几行空数据
  439. addDefaultRowNum: 1,
  440. validatorRules: {
  441. accidentData: {rules: [
  442. ]},
  443. accidentTheme: {rules: [
  444. ]},
  445. accidentPersonLiable: {rules: [
  446. ]},
  447. supplier: {rules: [
  448. ]},
  449. personLiable: {rules: [
  450. ]},
  451. accidentNumber: {rules: [
  452. ]},
  453. customer: {rules: [
  454. ]},
  455. factory: {rules: [
  456. ]},
  457. responsibilityPerson1: {rules: [
  458. ]},
  459. responsibilityPerson2: {rules: [
  460. ]},
  461. responsibilityPerson3: {rules: [
  462. ]},
  463. responsibilityPerson4: {rules: [
  464. ]},
  465. responsibilityPerson5: {rules: [
  466. ]},
  467. sum1: {rules: [
  468. ]},
  469. sum2: {rules: [
  470. ]},
  471. sum3: {rules: [
  472. ]},
  473. sum4: {rules: [
  474. ]},
  475. sum5: {rules: [
  476. ]},
  477. responsibilityCompany: {rules: [
  478. ]},
  479. moneyType: {rules: [
  480. ]},
  481. totalMoney: {rules: [
  482. ]},
  483. businessType: {rules: [
  484. ]},
  485. garmentSalesOrder: {rules: [
  486. ]},
  487. styleNumber: {rules: [
  488. ]},
  489. material: {rules: [
  490. ]},
  491. planPersonnel: {rules: [
  492. ]},
  493. businessPeople: {rules: [
  494. ]},
  495. qualityControl: {rules: [
  496. ]},
  497. planNumber: {rules: [
  498. ]},
  499. accidentType: {rules: [
  500. ]},
  501. accidentSum: {rules: [
  502. ]},
  503. presentationCondition: {rules: [
  504. ]},
  505. accessory: {rules: [
  506. ]},
  507. informant: {rules: [
  508. ]},
  509. factorySignature: {rules: [
  510. ]},
  511. financeRemark: {rules: [
  512. ]},
  513. accessory2: {rules: [
  514. ]},
  515. isLeaders: {rules: [
  516. ]},
  517. incidentTicketId: {rules: [
  518. ]},
  519. tableNameChildren: {rules: [
  520. ]},
  521. },
  522. refKeys: ['incidentTicketChildren', ],
  523. tableKeys:['incidentTicketChildren', ],
  524. activeKey: 'incidentTicketChildren',
  525. // 森_工厂质量事故单-子表
  526. incidentTicketChildrenTable: {
  527. loading: false,
  528. dataSource: [],
  529. columns: [
  530. {
  531. title: '计划单号',
  532. align: "center",
  533. dataIndex: 'planNumber',
  534. width: 140,
  535. width: '7%',
  536. // scopedSlots: { customRender: 'planNumber' },
  537. },
  538. {
  539. title: '事故类型',
  540. align: "center",
  541. dataIndex: 'accidentType',
  542. width: 140,
  543. width: '7%',
  544. // scopedSlots: { customRender: 'accidentType' },
  545. },
  546. {
  547. title: '币种',
  548. align: "center",
  549. dataIndex: 'moneyType',
  550. width: '7%',
  551. // scopedSlots: { customRender: 'accidentType' },
  552. },
  553. {
  554. title: '事故金额',
  555. align: "center",
  556. dataIndex: 'accidentSum',
  557. width: 140,
  558. width: '7%',
  559. // scopedSlots: { customRender: 'accidentSum' },
  560. },
  561. {
  562. title: '汇率',
  563. align: "center",
  564. dataIndex: 'exchangeRate',
  565. width: 140,
  566. width: '9%',
  567. // scopedSlots: { customRender: 'exchangeRate' },
  568. },
  569. {
  570. title: '实际事故金额',
  571. align: "center",
  572. dataIndex: 'practicalSum',
  573. width: 140,
  574. width: '7%',
  575. // scopedSlots: { customRender: 'practicalSum' },
  576. },
  577. {
  578. title: 'U8生成运费发票号',
  579. align: "center",
  580. dataIndex: 'u8Invoice',
  581. width: '9%',
  582. // scopedSlots: { customRender: 'u8Invoice' },
  583. },
  584. {
  585. title: '账套号',
  586. align: "center",
  587. dataIndex: 'zhanghaoId',
  588. width: '9%',
  589. // scopedSlots: { customRender: 'zhanghaoId' },
  590. },
  591. {
  592. title: '备注',
  593. align: "center",
  594. dataIndex: 'remark',
  595. width: '20%',
  596. // scopedSlots: { customRender: 'remark' },
  597. },
  598. ]
  599. },
  600. url: {
  601. add: "/oa/incidentTicket/add",
  602. edit: "/oa/incidentTicket/edit",
  603. incidentTicketChildren: {
  604. list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
  605. },
  606. list:'/sys/user/list'
  607. }
  608. }
  609. },
  610. methods: {
  611. addNotice(){
  612. // this.$refs.JSelectBizComponent.visible = true
  613. this.$refs.JSelectBizComponent.showModal()
  614. },
  615. feedbackNotice(){
  616. this.visibleFk =false
  617. getAction('/oa/incidentTicket/noticeUserReturn', {headId:this.formState.id,title:this.formState.accidentTheme,code:this.formState.accidentNumber}).then((res) => {
  618. if(res.success){
  619. this.$message.success(res.message)
  620. this.getNotifier(this.formState.id)
  621. this.formState.state='3'
  622. this.$forceUpdate()
  623. }else{
  624. this.$message.warning(res.message)
  625. }
  626. })
  627. },
  628. push(){
  629. this.visibleTs = false
  630. var pushOk = 'yes'
  631. this.incidentTicketChildrenTable.dataSource.every(item=>{
  632. if(item.zhanghaoId==''||!item.zhanghaoId){
  633. this.$message.warning('请选择账套号!')
  634. pushOk = 'no'
  635. return false;
  636. }
  637. return true
  638. })
  639. if(pushOk=='yes'){
  640. this.confirmLoading = true
  641. getAction('/oa/incidentTicket/propelling', {headId:this.formState.id}).then((res) => {
  642. if(res.success){
  643. this.$message.success(res.message)
  644. this.handleCancel()
  645. this.confirmLoading = false
  646. }else{
  647. this.$message.warning(res.message)
  648. this.confirmLoading = false
  649. }
  650. })
  651. }
  652. },
  653. end(){
  654. this.visibleWj = false
  655. getAction('/oa/incidentTicket/endOrder', {headId:this.formState.id}).then((res) => {
  656. if(res.success){
  657. this.$message.success(res.message)
  658. this.handleCancel()
  659. }else{
  660. this.$message.warning(res.message)
  661. }
  662. })
  663. },
  664. sendNotice(ids){
  665. getAction('/oa/incidentTicket/noticeUser', {ids:ids,headId:this.formState.id,code:this.formState.accidentNumber,title:this.formState.accidentTheme}).then((res) => {
  666. if(res.success){
  667. this.$message.success(res.message)
  668. this.getNotifier(this.formState.id)
  669. this.formState.state='2'
  670. this.$forceUpdate()
  671. }else{
  672. this.$message.warning(res.message)
  673. }
  674. })
  675. },
  676. getHeaderList(id){
  677. getAction('/oa/incidentTicket/queryById', {id:id}).then((res) => {
  678. if(res.success){
  679. var zhuId = '' //主表id
  680. this.formState=res.result //详情
  681. this.formState=res.result //详情
  682. this.formState.accidentData = moment( this.formState.accidentData).format('YYYY-MM-DD');
  683. this.accessory2 = this.formState.accessory2?JSON.parse(this.formState.accessory2):[]
  684. var accessory2Z =[]
  685. this.accessory2.map(item=>{
  686. accessory2Z.push(item.url)
  687. })
  688. this.accessory2 = accessory2Z
  689. this.accessory = this.formState.accessory?JSON.parse(this.formState.accessory):[]
  690. var accessoryZ=[]
  691. this.accessory.map(item =>{
  692. accessoryZ.push(item.url)
  693. })
  694. this.accessory =accessoryZ
  695. this.factorySignature = this.formState.factorySignature?JSON.parse(this.formState.factorySignature):[]
  696. var factorySignatureZ=[]
  697. this.factorySignature.map(item =>{
  698. factorySignatureZ.push(item.url)
  699. })
  700. this.factorySignature =factorySignatureZ
  701. //
  702. zhuId = res.result.id
  703. this.getTable(zhuId)
  704. this.getNotifier(zhuId)
  705. }else{
  706. this.$message.warning(res.message)
  707. }
  708. })
  709. },
  710. getTable(id){
  711. getAction('/oa/incidentTicket/queryIncidentTicketChildrenByMainId', {id:id}).then((res) => {
  712. if(res.success){
  713. this.incidentTicketChildrenTable.dataSource = res.result
  714. }else{
  715. this.$message.warning(res.message)
  716. }
  717. })
  718. },
  719. getNotifier(id){
  720. getAction('/oa/incidentTicketMsg/queryByMainId', {id:id}).then((res) => {
  721. if(res.success){
  722. var noticeList =[]
  723. res.result.map(item=>{
  724. if(item.confirm != null && item.confirm != '' && item.confirm != '否'){
  725. noticeList.push(item.userName+'('+item.confirm+')')
  726. }else{
  727. noticeList.push(item.userName+'')
  728. }
  729. })
  730. this.formState.Noticer = noticeList.toString()
  731. this.$forceUpdate()
  732. }
  733. })
  734. },
  735. //关闭
  736. handleCancel(){
  737. this.incidentTicketChildrenTable.dataSource =[]
  738. this.formState = {}
  739. this.visible = false
  740. this.visibleWj = false
  741. this.visibleTs = false
  742. this.visibleFk = false
  743. this.$emit('close')
  744. },
  745. // 关闭提示框
  746. handleCancelPop(data){
  747. if(data=='visibleFk') this.visibleFk = false
  748. if(data=='visibleTs') this.visibleTs = false
  749. if(data=='visibleWj') this.visibleWj = false
  750. },
  751. handlePrint(){
  752. this.showSelect = 1
  753. this.$nextTick(() => {
  754. const html = window.document.getElementById('printBox').innerHTML
  755. const win = window.open();
  756. const style = '<style>\n'
  757. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  758. + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #333;max-width:2000px;text-align: center;}\n'
  759. + 'th{color: #333}\n'
  760. +'@media print{@page {size:landscape}}'
  761. + '</style>';;
  762. win.document.write(style+html);
  763. win.focus();
  764. win.print();
  765. this.showSelect = 0
  766. })
  767. },
  768. // getAllTable() {
  769. // let values = this.tableKeys.map(key => getRefPromise(this, key))
  770. // return Promise.all(values)
  771. // },
  772. /** 调用完edit()方法之后会自动调用此方法 */
  773. // editAfter() {
  774. // let fieldval = pick(this.model,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren')
  775. // this.$nextTick(() => {
  776. // this.form.setFieldsValue(fieldval)
  777. // })
  778. // // 加载子表数据
  779. // if (this.model.id) {
  780. // let params = { id: this.model.id }
  781. // this.requestSubTableData(this.url.incidentTicketChildren.list, params, this.incidentTicketChildrenTable)
  782. // }
  783. // },
  784. /** 整理成formData */
  785. classifyIntoFormData(allValues) {
  786. let main = Object.assign(this.model, allValues.formValue)
  787. return {
  788. ...main, // 展开
  789. incidentTicketChildrenList: allValues.tablesValue[0].values,
  790. }
  791. },
  792. validateError(msg){
  793. this.$message.error(msg)
  794. },
  795. popupCallback(row){
  796. this.form.setFieldsValue(pick(row,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren'))
  797. },
  798. }
  799. }
  800. </script>
  801. <style lang="less" scoped>
  802. /deep/ .ant-table-wrapper{
  803. margin-bottom: 2%;
  804. }
  805. /deep/ .nresume .ant-input{
  806. height: 100px !important;
  807. }
  808. /deep/ .fff .ant-input{
  809. height: 280px !important;
  810. }
  811. /deep/ .caiwu .ant-input{
  812. height: 226px !important;
  813. }
  814. /deep/ .ff .ant-form-item-control {
  815. display: contents;
  816. }
  817. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
  818. width: 118px;
  819. }
  820. /deep/ .ant-table td {
  821. white-space: break-spaces !important;
  822. word-break: break-word;
  823. }
  824. </style>