IncidentTicketModalDetail.vue 35 KB

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