caiqiebaogong.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <div class="">
  6. <!-- 按钮部分-->
  7. <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
  8. <el-form-item>
  9. <el-input v-model="searchInfo" placeholder="搜索" clearable style="margin: 0px 5px 0px 0px;width: 180px;height:40px;border-radius: 5%;"></el-input>
  10. <el-button type="primary" icon="search" @click="onSubmit" style="margin: 0px 5px 0px 0px;width: 80px;height:40px;border-radius: 5%;">查询</el-button>
  11. <el-button type="primary" @click="onAttendance" style="margin: 0px 5px 0px 0px;width: 80px;height:40px;border-radius: 5%;">新增</el-button>
  12. <el-button type="primary" @click="baogong_del"
  13. style="margin: 0px 5px 0px 0px;width: 80px;height:40px;border-radius: 5%;float: right;background-color: red">删除</el-button>
  14. </el-form-item>
  15. </el-form>
  16. </div>
  17. </layout-header>
  18. <layout>
  19. <!--左侧树侧形结构-->
  20. <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
  21. <div class="JKWTree-tree" style="height: 200px">
  22. <h3>裁切完工报工</h3>
  23. <el-tree :data="treeData" class="treecolor" @node-click="handleNodeClick"></el-tree>
  24. </div>
  25. </layout-sider>
  26. <!-- 右侧区域 -->
  27. <layout-content >
  28. <el-main>
  29. <div class="gva-table-box">
  30. <!-- 表格数据 -->
  31. <el-table ref="multipleTable" style="width: 100%;height: 65vh" tooltip-effect="dark"
  32. :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
  33. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  34. :data="tableData" border row-key="ID"
  35. size="small"
  36. highlight-current-row="true" @row-dblclick="updateCompanyFunc"
  37. @row-click="tableRowClick" :show-overflow-tooltip="true"
  38. @selection-change="handleSelectionChange">
  39. <el-table-column type="selection" width="55" />
  40. <el-table-column sortable align="center" label="序号" prop="序号" width="80" />
  41. <el-table-column sortable align="left" label="订单子编号" prop="订单子编号" width="120"/>
  42. <el-table-column sortable align="center" label="订单号" prop="订单号" width="120"/>
  43. <el-table-column sortable align="left" label="生产款号" prop="生产款号" width="120" />
  44. <el-table-column sortable align="left" label="款式" prop="款式" width="110" />
  45. <el-table-column sortable align="left" label="颜色" prop="颜色" width="80" />
  46. <el-table-column sortable align="left" label="制单总数" prop="制单总数" width="100" />
  47. <el-table-column sortable align="left" label="实裁总数" prop="实裁总数" width="110" />
  48. <el-table-column sortable align="left" label="单位" prop="单位" width="80" />
  49. <el-table-column sortable align="left" label="工序" prop="工序" width="80" />
  50. <el-table-column sortable align="left" label="验片人" prop="验片人" width="90" />
  51. <el-table-column sortable align="left" label="日期" prop="日期" width="120" />
  52. </el-table>
  53. <!-- 分页 -->
  54. <div class="gva-pagination">
  55. <el-pagination layout="total" :current-page="page" :page-size="pageSize"
  56. :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
  57. <!-- <el-pagination layout="total, sizes, prev, pager, next, jumper" :current-page="page" :page-size="pageSize" :page-sizes="[10, 30, 50, 100]"-->
  58. <!-- :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />-->
  59. </div>
  60. </div>
  61. <!-- 修改弹窗 -->
  62. <el-dialog v-model="dialogFormVisible" :before-close="edit_closeDialog" destroy-on-close style="width: 60%; height: 70%;">
  63. <h1 style="margin: 0%;margin-bottom: 10px;">裁切报工修改</h1>
  64. <el-row :gutter="24" style="margin-bottom: 5px;">
  65. <el-col :span="10">
  66. <el-form-item label="订单号:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  67. <el-input v-model="edit_formData['订单号']" style="width: 70%; height: 40px;" id="订单号:" />
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="10">
  71. <el-form-item label="订单子编号:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  72. <el-input v-model="edit_formData['订单子编号']" style="width: 70%; height: 40px;" id="订单子编号" />
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. <el-row :gutter="24" style="margin-bottom: 5px;">
  77. <el-col :span="10">
  78. <el-form-item label="生产款号:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  79. <el-input v-model="edit_formData['生产款号']" style="width: 70%; height: 40px;" id="生产款号" />
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="10">
  83. <el-form-item label="款式:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  84. <el-input v-model="edit_formData['款式']" style="width: 70%; height: 40px;" id="款式" />
  85. </el-form-item>
  86. </el-col>
  87. </el-row>
  88. <el-row :gutter="24" style="margin-bottom: 5px;">
  89. <el-col :span="10">
  90. <el-form-item label="颜色:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  91. <el-input v-model="edit_formData['颜色']" style="width: 70%; height: 40px;" id="颜色" />
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="10">
  95. <el-form-item label="制单总数:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  96. <el-input v-model="edit_formData['制单总数']" style="width: 70%; height: 40px;" id="制单总数" />
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. <el-row :gutter="24" style="margin-bottom: 5px;">
  101. <el-col :span="10">
  102. <el-form-item label="实裁总数:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  103. <el-input v-model="edit_formData['实裁总数']" style="width: 70%; height: 40px;" id="实裁总数" />
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="10">
  107. <el-form-item label="单位:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  108. <el-input v-model="edit_formData['单位']" style="width: 70%; height: 40px;" id="单位" />
  109. </el-form-item>
  110. </el-col>
  111. </el-row>
  112. <el-row :gutter="24" style="margin-bottom: 5px;">
  113. <el-col :span="10">
  114. <el-form-item label="工序:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  115. <el-input v-model="edit_formData['工序']" style="width: 70%; height: 40px;" id="工序" />
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="10">
  119. <el-form-item label="验片人:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  120. <el-input v-model="edit_formData['验片人']" style="width: 70%; height: 40px;" id="验片人" />
  121. </el-form-item>
  122. </el-col>
  123. </el-row>
  124. <el-row :gutter="24" style="margin-bottom: 5px;">
  125. <el-col :span="10">
  126. <el-form-item label="日期:" prop="deliveryDate" class="mab" label-width="120px" style="font-size: 20px;">
  127. <el-input v-model="edit_formData['日期']" style="width: 70%; height: 40px;" id="日期" />
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. <template #footer>
  132. <div class="dialog-footer">
  133. <el-button @click="edit_closeDialog" style="width: 110px;height: 60px;font-size: 20px;">取消</el-button>
  134. <el-button type="primary" @click="edit_Dialog" style="width: 110px;height: 60px;font-size: 20px;">确认</el-button>
  135. </div>
  136. </template>
  137. </el-dialog>
  138. <!-- 新增弹窗 -->
  139. <el-dialog v-model="AttendanceVisible" destroy-on-close style="width: 100%;height: 100%;margin: 0px;">
  140. <h1 style="margin: 0%;margin-bottom: 10px;">新增</h1>
  141. <el-row :gutter="24" style="margin-bottom: 20px;">
  142. <el-input v-model="add_searchInfo" placeholder="扫描订单二维码获取订单信息"
  143. @keyup.enter="add_onSubmit"
  144. id="searchInput"
  145. style="width: 270px;margin: 5px;height: 50px;">
  146. </el-input>
  147. <el-button type="primary" icon="search" @click="add_onSubmit" style="margin: 5px;height: 50px;">查询</el-button>
  148. <el-form-item label="日期:" prop="deliveryDate" class="mab" label-width="100" style="font-size: 30px;margin: 10px;">
  149. <el-date-picker v-model="add_riqiformData['日期']" type="date" style="width: 150px;height: 40px;"/>
  150. </el-form-item>
  151. </el-row>
  152. <el-row :gutter="24" >
  153. <el-table ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
  154. :row-style="{ height: '50px' }" :header-cell-style="{ padding: '5px' }"
  155. :cell-style="{ padding: '10px' }" :header-row-style="{ height: '20px' }"
  156. :data="add_tableData" border row-key="ID"
  157. size="small" highlight-current-row="true" @row-dblclick="add_updateCompanyFunc"
  158. @row-click="add_tableRowClick" :show-overflow-tooltip="true"
  159. @selection-change="handleSelectionChange">
  160. <el-table-column sortable align="left" label="订单号" prop="订单号" width="140"/>
  161. <el-table-column sortable align="left" label="订单子编号" prop="订单子编号" width="140"/>
  162. <el-table-column sortable align="left" label="生产款号" prop="生产款号" width="140"/>
  163. <el-table-column sortable align="left" label="款式" prop="款式" width="140"/>
  164. <el-table-column sortable align="left" label="颜色" prop="颜色" width="140"/>
  165. <el-table-column sortable align="left" label="S" prop="S" width="140"/>
  166. <el-table-column sortable align="left" label="M" prop="M" width="140"/>
  167. <el-table-column sortable align="left" label="L" prop="L" width="140"/>
  168. <el-table-column sortable align="left" label="XL" prop="XL" width="140"/>
  169. <el-table-column sortable align="left" label="2XL" prop="2XL" width="140"/>
  170. </el-table>
  171. </el-row>
  172. <el-row :gutter="24">
  173. <el-form-item label="尺码:" class="mab" prop="keyOrder" label-width="120" style="font-size: 30px;margin: 10px;">
  174. <el-input v-model="cmformdata.cm1" disabled style="width: 90px;height: 40px;"/>
  175. <el-input v-model="cmformdata.cm2" disabled style="width: 90px;height: 40px;"/>
  176. <el-input v-model="cmformdata.cm3" disabled style="width: 90px;height: 40px;"/>
  177. <el-input v-model="cmformdata.cm4" disabled style="width: 90px;height: 40px;"/>
  178. <el-input v-model="cmformdata.cm5" disabled style="width: 90px;height: 40px;"/>
  179. <el-input v-model="cmformdata.cm6" disabled style="width: 90px;height: 40px;"/>
  180. <el-input v-model="cmformdata.cm7" disabled style="width: 90px;height: 40px;"/>
  181. <el-input v-model="cmformdata.cm8" disabled style="width: 90px;height: 40px;"/>
  182. <el-input v-model="cmformdata.cm9" disabled style="width: 90px;height: 40px;"/>
  183. </el-form-item>
  184. </el-row>
  185. <el-row :gutter="24">
  186. <el-form-item label="制单数" class="mab" prop="keyOrder" label-width="120" style="font-size: 30px;margin: 10px;">
  187. <el-input v-model="zdsformdata.zds1" disabled style="width: 90px;height: 40px;" id="zds1"/>
  188. <el-input v-model="zdsformdata.zds2" disabled style="width: 90px;height: 40px;" id="zds2"/>
  189. <el-input v-model="zdsformdata.zds3" disabled style="width: 90px;height: 40px;" id="zds3"/>
  190. <el-input v-model="zdsformdata.zds4" disabled style="width: 90px;height: 40px;" id="zds4"/>
  191. <el-input v-model="zdsformdata.zds5" disabled style="width: 90px;height: 40px;" id="zds5"/>
  192. <el-input v-model="zdsformdata.zds6" disabled style="width: 90px;height: 40px;" id="zds6"/>
  193. <el-input v-model="zdsformdata.zds7" disabled style="width: 90px;height: 40px;" id="zds7"/>
  194. <el-input v-model="zdsformdata.zds8" disabled style="width: 90px;height: 40px;" id="zds8"/>
  195. <el-input v-model="zdsformdata.zds9" disabled style="width: 90px;height: 40px;" id="zds9"/>
  196. </el-form-item>
  197. </el-row>
  198. <el-row :gutter="24">
  199. <el-form-item label="实裁数" class="mab" prop="keyOrder" label-width="120" style="font-size: 30px;margin: 10px;">
  200. <el-input v-model="scsformdata.scs1" style="width: 90px;height: 40px;" id="scs1"/>
  201. <el-input v-model="scsformdata.scs2" style="width: 90px;height: 40px;" id="scs2"/>
  202. <el-input v-model="scsformdata.scs3" style="width: 90px;height: 40px;" id="scs3"/>
  203. <el-input v-model="scsformdata.scs4" style="width: 90px;height: 40px;" id="scs4"/>
  204. <el-input v-model="scsformdata.scs5" style="width: 90px;height: 40px;" id="scs5"/>
  205. <el-input v-model="scsformdata.scs6" style="width: 90px;height: 40px;" id="scs6"/>
  206. <el-input v-model="scsformdata.scs7" style="width: 90px;height: 40px;" id="scs7"/>
  207. <el-input v-model="scsformdata.scs8" style="width: 90px;height: 40px;" id="scs8"/>
  208. <el-input v-model="scsformdata.scs9" style="width: 90px;height: 40px;" id="scs9"/>
  209. </el-form-item>
  210. </el-row>
  211. <template #footer>
  212. <div class="dialog-footer">
  213. <el-button @click="add_closeDialog" style="width: 110px;height: 60px;font-size: 20px;">取消</el-button>
  214. <el-button type="primary" @click="add_Dialog" style="width: 110px;height: 60px;font-size: 20px;">确认</el-button>
  215. </div>
  216. </template>
  217. </el-dialog>
  218. </el-main>
  219. </layout-content>
  220. </layout>
  221. </layout>
  222. </div>
  223. </template>
  224. <script>
  225. export default {
  226. data() {
  227. return {
  228. dialogFormVisible: false,
  229. formDataTest: {
  230. imageUrl: '' // 添加一个字段来保存上传的图片路径
  231. },
  232. rule: {} // 初始化rule对象
  233. };
  234. },
  235. methods: {
  236. handleKeyDown(event, currentId, prevId, nextId) {
  237. const currentElement = document.getElementById(currentId);
  238. const isEmpty = currentElement.value === '';
  239. const atStart = currentElement.selectionStart === 0;
  240. const atEnd = currentElement.selectionStart === currentElement.value.length;
  241. switch (event.keyCode) {
  242. case 13: // Enter
  243. case 40: // 向下箭头
  244. if (nextId) {
  245. document.getElementById(nextId).focus();
  246. }
  247. break;
  248. case 38: // 向上箭头
  249. if (prevId) {
  250. document.getElementById(prevId).focus();
  251. }
  252. break;
  253. case 8: // 删除键
  254. if (prevId && (isEmpty || atStart)) {
  255. document.getElementById(prevId).focus();
  256. }
  257. break;
  258. case 37: // 向左箭头
  259. if (prevId && atStart) {
  260. document.getElementById(prevId).focus();
  261. }
  262. break;
  263. case 39: // 向右箭头
  264. if (nextId && atEnd) {
  265. document.getElementById(nextId).focus();
  266. }
  267. break;
  268. default:
  269. break;
  270. }
  271. },
  272. closeDialog() {
  273. // 关闭对话框的逻辑
  274. this.dialogFormVisible = false;
  275. },
  276. enterDialog() {
  277. // 确定按钮的逻辑
  278. // 在这里可以执行提交表单的逻辑
  279. },
  280. handleFileUpload(event) {
  281. // 处理文件上传逻辑
  282. const file = event.target.files[0];
  283. console.log(file)
  284. // 模拟上传并保存文件路径
  285. // 在实际应用中,您需要将文件上传到服务器并保存路径
  286. this.formDataTest.imageUrl = URL.createObjectURL(file);
  287. // 手动触发Vue的更新
  288. this.$forceUpdate();
  289. }
  290. }
  291. };
  292. </script>
  293. <script setup>
  294. // 全量引入格式化工具 请按需保留
  295. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  296. import {ref, reactive} from 'vue'
  297. import {getCustom, getDepartment, getProductData,getStaffInfo, getStaffList, ygjbzledit,clockUpdate} from '@/api/yunyin/yunying'
  298. import {ElMessage} from "element-plus";
  299. defineOptions({name: 'Company'})
  300. // =========== 获取左侧树侧形结构 ===========
  301. const treeData = ref({})
  302. const DataListdata = async () => {
  303. try {
  304. const data =
  305. [
  306. {label : '2024.7.16'},
  307. {label : '2024.7.15'},
  308. {label : '2024.7.14'},
  309. {label : '2024.7.13'},
  310. {label : '2024.7.12'},
  311. {label : '2024.7.11'}
  312. ];
  313. treeData.value = data
  314. } catch (error) {
  315. console.error(error);
  316. }
  317. };
  318. DataListdata();
  319. //点击左侧树形 获取右侧table列表
  320. const tableData = reactive([]);
  321. const _u8 = ref(null); // U8系统的值
  322. const _mes = ref(null); // MES系统的值
  323. const handleNodeClick = async (node) => {
  324. _getStaffList(); // 执行获取员工列表的函数
  325. };
  326. //点击管理中心 显示部门的全部数据
  327. const handleNodeExpand = async (node) => {
  328. // _department_code.value = node['编号'];
  329. searchInfo.value = '';
  330. _getStaffList()
  331. }
  332. // =========== 搜索 ===========
  333. const searchInfo = ref('')
  334. const _department_code = ref(null)
  335. //点击【查询】按钮
  336. const onSubmit = () => {
  337. _department_code.value = '';
  338. if(searchInfo.value === ''){
  339. tableData.length = 0;
  340. }else{
  341. _getStaffList();
  342. }
  343. };
  344. //获取员工信息列表
  345. const _getStaffList = async ()=>{
  346. console.log(123)
  347. try {
  348. const WorkListdata = [
  349. {
  350. '序号':'1',
  351. '订单子编号':'2408001-1',
  352. '订单号':'2408001',
  353. '生产款号':'2401-1622款',
  354. '款式':'连衣裙',
  355. '颜色':'红色',
  356. '制单总数':'90',
  357. '组别':'车缝1组',
  358. '排产单数':'50',
  359. '尺码':'32',
  360. '报工数量':'10',
  361. '是否尾包':'否',
  362. '工序':'仓库出库',
  363. '验片人':'xxx',
  364. '日期':'2024-07-16'
  365. },
  366. {
  367. '序号':'2',
  368. '订单子编号':'2408001-2',
  369. '订单号':'2408001',
  370. '生产款号':'2402-1623款',
  371. '款式':'长袖',
  372. '颜色':'蓝色',
  373. '制单总数':'90',
  374. '组别':'车缝2组',
  375. '排产单数':'60',
  376. '尺码':'35',
  377. '报工数量':'58',
  378. '是否尾包':'否',
  379. '工序':'仓库出库',
  380. '验片人':'xxx',
  381. '日期':'2024-07-16'
  382. },
  383. {
  384. '序号':'3',
  385. '订单子编号':'2408002-2',
  386. '订单号':'2408002',
  387. '生产款号':'2403-1624款',
  388. '款式':'西服',
  389. '颜色':'白色',
  390. '制单总数':'90',
  391. '组别':'车缝3组',
  392. '排产单数':'60',
  393. '尺码':'35',
  394. '报工数量':'58',
  395. '是否尾包':'否',
  396. '工序':'仓库出库',
  397. '验片人':'xxx',
  398. '日期':'2024-07-16'
  399. },
  400. {
  401. '序号':'4',
  402. '订单子编号':'2408003-3',
  403. '订单号':'2408003',
  404. '生产款号':'2403-1625款',
  405. '款式':'裤子',
  406. '颜色':'黑色',
  407. '制单总数':'90',
  408. '组别':'车缝4组',
  409. '排产单数':'40',
  410. '尺码':'36',
  411. '报工数量':'37',
  412. '是否尾包':'是',
  413. '工序':'仓库出库',
  414. '验片人':'xxx',
  415. '日期':'2024-07-16'
  416. },
  417. ];
  418. console.log(WorkListdata)
  419. tableData.splice(0,tableData.length,...WorkListdata);//表格数据
  420. // total.value =WorkListdata.data.total;//共多少条
  421. } catch (error) {
  422. console.error(error);
  423. }
  424. }
  425. // =========== 新增按钮 ===========
  426. const AttendanceVisible=ref(false)
  427. const add_tableData = reactive([]);
  428. // 获取当前日期
  429. const today = new Date();
  430. const year = today.getFullYear();
  431. const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
  432. const day = String(today.getDate()).padStart(2, '0');
  433. const hours = String(today.getHours()).padStart(2, '0');
  434. const minutes = String(today.getMinutes()).padStart(2, '0');
  435. const seconds = String(today.getSeconds()).padStart(2, '0');
  436. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  437. //清空对象的属性值
  438. const gd_clearFormData = () => {
  439. Object.keys(add_formData).forEach(key => {
  440. add_formData[key] = '';
  441. });
  442. };
  443. //新增按钮
  444. const onAttendance = () => {
  445. AttendanceVisible.value=true
  446. add_riqiformData['日期'] = currentDate
  447. setTimeout(() => {
  448. const inputElement = document.querySelector('#searchInput');
  449. if (inputElement) {
  450. inputElement.focus();
  451. }
  452. }, 100); // 延迟100毫秒
  453. gd_clearFormData();
  454. add_searchInfo.value = ''
  455. const WorkListdata = [];
  456. add_tableData.splice(0,add_tableData.length,...WorkListdata);
  457. };
  458. // 尺码
  459. const cmformdata = reactive({
  460. cm1:'S',
  461. cm2:'M',
  462. cm3:'L',
  463. cm4:'XL',
  464. cm5:'2XL',
  465. cm6:'',
  466. cm7:'',
  467. cm8:'',
  468. cm9:'合计',
  469. });
  470. // 制单数
  471. const zdsformdata = reactive({
  472. zds1:'10',
  473. zds2:'10',
  474. zds3:'10',
  475. zds4:'10',
  476. zds5:'10',
  477. zds6:'',
  478. zds7:'',
  479. zds8:'',
  480. zds9:'50',
  481. });
  482. // 实裁数
  483. const scsformdata = reactive({
  484. scs1:'10',
  485. scs2:'10',
  486. scs3:'10',
  487. scs4:'10',
  488. scs5:'10',
  489. scs6:'',
  490. scs7:'',
  491. scs8:'',
  492. scs9:'50',
  493. });
  494. const add_riqiformData = reactive({
  495. 日期: '',
  496. });
  497. // 新增确定
  498. const add_Dialog = () => {
  499. };
  500. // 新增取消
  501. const add_closeDialog = () => {
  502. AttendanceVisible.value = false
  503. };
  504. // =========== 新增搜索 ===========
  505. const add_searchInfo = ref('')
  506. //点击【查询】按钮
  507. const add_onSubmit = async ()=>{
  508. if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
  509. const WorkListdata = [];
  510. add_tableData.splice(0,add_tableData.length,...WorkListdata);
  511. ElMessage({type: 'warning',message: '搜索内容不能为空' })
  512. }else{
  513. console.log(add_searchInfo.value)
  514. if(add_searchInfo.value === '2408001'){
  515. const WorkListdata = [
  516. {
  517. '订单子编号':'2408001-1',
  518. '订单号':'2408001',
  519. '生产款号':'2401-1622款',
  520. '款式':'连衣裙',
  521. '颜色':'红色',
  522. 'S':'34',
  523. 'M':'12',
  524. 'L':'53',
  525. 'XL':'44',
  526. '2XL':'15'
  527. },
  528. {
  529. '订单子编号':'2408001-2',
  530. '订单号':'2408001',
  531. '生产款号':'2401-1623款',
  532. '款式':'长袖',
  533. '颜色':'蓝色',
  534. 'S':'23',
  535. 'M':'26',
  536. 'L':'48',
  537. 'XL':'67',
  538. '2XL':'12'
  539. },
  540. ];
  541. add_tableData.splice(0,add_tableData.length,...WorkListdata);//表格数据
  542. }else if(add_searchInfo.value === '2408002'){
  543. const WorkListdata = [
  544. {
  545. '订单子编号':'2408002-2',
  546. '订单号':'2408002',
  547. '生产款号':'2402-1624款',
  548. '款式':'西服',
  549. '颜色':'白色'
  550. },
  551. ];
  552. add_tableData.splice(0,add_tableData.length,...WorkListdata);//表格数据
  553. }else if(add_searchInfo.value === '2408003'){
  554. const WorkListdata = [
  555. {
  556. '订单子编号':'2408003-3',
  557. '订单号':'2408003',
  558. '生产款号':'2403-1625款',
  559. '款式':'西服',
  560. '颜色':'白色'
  561. },
  562. ];
  563. add_tableData.splice(0,add_tableData.length,...WorkListdata);//表格数据
  564. }else if(add_searchInfo.value === '2408001-1'){
  565. const WorkListdata = [
  566. {
  567. '订单子编号':'2408001-1',
  568. '订单号':'2408001',
  569. '生产款号':'2401-1622款',
  570. '款式':'连衣裙',
  571. '颜色':'红色',
  572. 'S':'34',
  573. 'M':'12',
  574. 'L':'53',
  575. 'XL':'44',
  576. '2XL':'15'
  577. },
  578. ];
  579. add_tableData.splice(0,add_tableData.length,...WorkListdata);//表格数据
  580. }else if(add_searchInfo.value === '2408001-2'){
  581. const WorkListdata = [
  582. {
  583. '订单子编号':'2408001-2',
  584. '订单号':'2408001',
  585. '生产款号':'2401-1623款',
  586. '款式':'长袖',
  587. '颜色':'蓝色',
  588. 'S':'23',
  589. 'M':'26',
  590. 'L':'48',
  591. 'XL':'67',
  592. '2XL':'12'
  593. },
  594. ];
  595. add_tableData.splice(0,add_tableData.length,...WorkListdata);//表格数据
  596. }
  597. setTimeout(() => {
  598. const inputElement = document.querySelector('#searchInput');
  599. if (inputElement) {
  600. inputElement.focus();
  601. }
  602. }, 100); // 延迟100毫秒
  603. add_searchInfo.value = ''
  604. }
  605. };
  606. // =========== 删除按钮 ===========
  607. const bgSelection = ref(null)
  608. const baogong_del = () => {
  609. if(bgSelection.value === null || bgSelection.value === ''){
  610. ElMessage({type: 'warning',message: '请选择删除的数据' })
  611. }else{
  612. console.log(bgSelection.value)
  613. }
  614. }
  615. // 复选框
  616. const handleSelectionChange = (selection, type) => {
  617. const ids = selection.map(item => {
  618. return item.订单子编号
  619. })
  620. bgSelection.value = ids.join(',')
  621. }
  622. // =========== 修改 ===========
  623. const dialogFormVisible = ref(false)
  624. const edit_formData = ref({})
  625. // 双击修改
  626. const updateCompanyFunc = async (row) => {
  627. console.log(row)
  628. dialogFormVisible.value = true;
  629. Object.assign(edit_formData.value,row);
  630. // let code = row['员工编号'];
  631. // const getStaffInfo_data = await getStaffInfo({code:code});
  632. // formDataTest.value = getStaffInfo_data.data;
  633. };
  634. // 弹窗修改确定
  635. const edit_Dialog = async () => {
  636. _ygjbzledit();
  637. }
  638. // 弹窗修改关闭
  639. const edit_closeDialog = () => {
  640. dialogFormVisible.value = false
  641. }
  642. // =========== 分页 ===========
  643. // 分页相关的响应式变量
  644. const page = ref(1)
  645. const total = ref(0)
  646. const pageSize = ref(10)
  647. // 分页
  648. const handleCurrentChange = (val) => {
  649. page.value = val;
  650. _getStaffList();
  651. };
  652. // 修改页面容量 点击多少条/页
  653. const handleSizeChange = (val) => {
  654. page.value = 10;//默认显示
  655. pageSize.value = val;
  656. _getStaffList();
  657. };
  658. //修改
  659. const formDataTest = ref({})
  660. const Attendancevalue = ref({})
  661. //考勤建立弹窗确定
  662. const AttendanceDialog = async () => {
  663. _clockUpdate()
  664. }
  665. //设置法定天数
  666. const _clockUpdate = async ()=>{
  667. const formattedData = {
  668. month:Attendancevalue.value['month'],
  669. number:Attendancevalue.value['day'],
  670. typeA:Attendancevalue.value['typeA'],
  671. typeB:Attendancevalue.value['typeB'],
  672. typeC:Attendancevalue.value['typeC'],
  673. sys_id:'[1010/郑梅芳]'
  674. };
  675. console.log(formattedData)
  676. const response = await clockUpdate(formattedData);
  677. if (response.code === 0) {
  678. ElMessage({
  679. type: 'success',
  680. message: '成功'
  681. })
  682. AttendanceVisible.value=false
  683. }else{
  684. ElMessage({
  685. type: 'error',
  686. message: '失败'
  687. })
  688. }
  689. }
  690. //获取小时数
  691. const getdays = () => {
  692. console.log(Attendancevalue.value['day'])
  693. if(Attendancevalue.value['day']!=''){
  694. Attendancevalue.value['typeA']=Attendancevalue.value['day']*7.5
  695. Attendancevalue.value['typeB']=Attendancevalue.value['day']*8
  696. Attendancevalue.value['typeC']=Attendancevalue.value['day']*8
  697. }else{
  698. ElMessage({
  699. type: 'error',
  700. message: '请输入法定天数'
  701. })
  702. }
  703. }
  704. // 修改关闭弹窗
  705. const closeDialog = () => {dialogFormVisible.value = false,AttendanceVisible.value=false}
  706. // 弹窗确定
  707. const enterDialog = async () => {
  708. console.log(formDataTest.value['出生日期'])
  709. if(formDataTest.value['出生日期'] === '' || formDataTest.value['出生日期'] === null){
  710. ElMessage({
  711. type: 'error',
  712. message: '出生日期不能为空'
  713. })
  714. return false;
  715. }
  716. if(formDataTest.value['身份证号'] === '' || formDataTest.value['身份证号'] === null){
  717. ElMessage({
  718. type: 'error',
  719. message: '身份证号不能为空'
  720. })
  721. return false;
  722. }
  723. _ygjbzledit();
  724. }
  725. //修改员工资料
  726. const _ygjbzledit = async ()=>{
  727. const formattedData = {
  728. '员工编号': formDataTest.value['员工编号'],
  729. '员工姓名': formDataTest.value['员工姓名'],
  730. '性别': formDataTest.value['性别'],
  731. '出生日期': formDataTest.value['出生日期'],
  732. '身份证号': formDataTest.value['身份证号'],
  733. '职称职务': formDataTest.value['职称职务'],
  734. '所在部门': formDataTest.value['所在部门'],
  735. '聘用日期': formDataTest.value['聘用日期'],
  736. '转正日期': formDataTest.value['转正日期'],
  737. '扣减司龄': formDataTest.value['扣减司龄'] ? formDataTest.value['扣减司龄'] : '0',
  738. '人员类别': formDataTest.value['人员类别'],
  739. '人员性质': formDataTest.value['人员性质'],
  740. '班次类型': formDataTest.value['班次类型'],
  741. '薪酬核算分组': formDataTest.value['薪酬核算分组'],
  742. '工资表类别': formDataTest.value['工资表类别'],
  743. 'U8在职': formDataTest.value['U8在职'],
  744. '在职状态': formDataTest.value['在职状态'],
  745. '部门编码': formDataTest.value['部门编码'],
  746. };
  747. try {
  748. const ygjbzledit_eddt = await ygjbzledit(formattedData);
  749. if (ygjbzledit_eddt .code === 0) {
  750. dialogFormVisible.value = false;
  751. ElMessage({type: 'success',message: '更新成功'})
  752. } else {
  753. console.log(ygjbzledit_eddt);
  754. ElMessage({ type: 'error',message: '更新失败'})
  755. }
  756. } catch (error) {
  757. console.error(error);
  758. }
  759. }
  760. </script>
  761. <style scoped>
  762. .form-container {
  763. display: flex;
  764. flex-wrap: wrap;
  765. }
  766. .form-column {
  767. /*flex: 1;*/
  768. margin-right: 15px; /* 调整列之间的间距 */
  769. }
  770. /* 左侧输入框宽度调整 */
  771. .form-column .el-form-item .el-input {
  772. width: 150px; /* 调整左侧输入框的宽度 */
  773. }
  774. /* 媒体查询,根据需要调整断点 */
  775. @media screen and (max-width: 768px) {
  776. .form-column {
  777. flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
  778. margin-right: 0;
  779. }
  780. }
  781. /*:deep(.el-table td .cell) {*/
  782. /* line-height: 30px !important;*/
  783. /*}*/
  784. .JKWTree-container {
  785. display: flex;
  786. }
  787. .JKWTree-tree {
  788. /*width: 300px;*/
  789. background-color: #fff;
  790. padding: 10px;
  791. margin-right: 20px;
  792. }
  793. .JKWTree-tree h3 {
  794. font-size: 15px;
  795. font-weight: 700;
  796. margin: 10px 0;
  797. }
  798. .JKWTree-content {
  799. flex: 1;
  800. }
  801. /* 图片上传 */
  802. .upload-box {
  803. width: 200px;
  804. height: 200px;
  805. border: 2px dashed #e2e2e2;
  806. display: flex;
  807. justify-content: center;
  808. align-items: center;
  809. position: relative;
  810. cursor: pointer;
  811. }
  812. .uploaded-image {
  813. width: 100%;
  814. height: 100%;
  815. object-fit: cover;
  816. }
  817. .upload-icon {
  818. font-size: 40px;
  819. color: #c0c4cc;
  820. }
  821. .file-input {
  822. display: none;
  823. }
  824. .el-table .warning-row {
  825. background: oldlace;
  826. }
  827. /* 选中某行时的背景色 */
  828. :deep(.el-table__body tr.current-row) > td {
  829. background: #ff80ff !important;
  830. }
  831. </style>
  832. <style scoped>
  833. :deep(.el-table td .cell) {
  834. line-height: 20px !important;
  835. }
  836. :deep(.el-tabs__header){
  837. margin-bottom: 0;
  838. }
  839. .search{
  840. margin-left: 0px !important;
  841. margin-right: 10px !important;
  842. }
  843. .bt{
  844. margin-left: 2px !important;
  845. padding: 3px !important;
  846. font-size: 12px;
  847. }
  848. .el-tabs__header{
  849. margin: 0px !important;
  850. }
  851. .gva-table-box{
  852. padding: 0px !important;
  853. }
  854. .mab{
  855. margin-bottom: 5px;
  856. }
  857. </style>