confirm.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div>
  3. <Toptitle title="包装单详情">
  4. <Button style="margin-right:10px" @click="$router.go(-1)">返回</Button>
  5. <Button style="margin-right:10px" type="primary">批量包装完成</Button>
  6. <Button type="primary">批量发货指令</Button>
  7. </Toptitle>
  8. <Form style="display:flex;flex-wrap:wrap;margin-top:10px" :label-width='100'>
  9. <FormItem label='图号:'>
  10. <Input clearable placeholder="请输入图号" style="width:200px"/>
  11. </FormItem>
  12. <FormItem label='产品名称:'>
  13. <Input clearable placeholder="请输入产品名称" style="width:200px"/>
  14. </FormItem>
  15. <FormItem label='产品组件:'>
  16. <Input clearable placeholder="请输入产品组件" style="width:200px"/>
  17. </FormItem>
  18. <FormItem label='房号:'>
  19. <Input clearable placeholder="请输入房号" style="width:200px"/>
  20. </FormItem>
  21. <FormItem label='包装状态:'>
  22. <Select filterable clearable style="width:200px">
  23. <Option label='未包装完成' :value="0"/>
  24. <Option label='已包装完成' :value="1"/>
  25. </Select>
  26. </FormItem>
  27. <FormItem label='发货指令状态'>
  28. <Select filterable clearable style="width:200px">
  29. <Option label='未下发货指令' :value="0"/>
  30. <Option label='已下发货指令' :value="1"/>
  31. </Select>
  32. </FormItem>
  33. <FormItem label='包装日期:'>
  34. <DatePicker type='daterange' placeholder='选择日期'></DatePicker>
  35. </FormItem>
  36. <FormItem :label-width='40'>
  37. <Button type="primary" @click="handleSearch">搜索</Button>
  38. </FormItem>
  39. </Form>
  40. <Table border :data='tableData' :columns='tableColumns' max-height='550' @on-selection-change='handleSelect'>
  41. <template slot="img" slot-scope="{row}">
  42. <img v-for="(item,index) in row.url_img" :key="index" :src="$store.state.ip+item" alt="">
  43. </template>
  44. <template slot="set" slot-scope="{row}">
  45. <a @click="goPage(row)" style="margin-right:10px">详情</a>
  46. <a @click="handleIn(row)" v-show="row.sub_state==2">包装完成</a>
  47. <a @click="handleOut(row)" v-show="row.sub_state!=2&&row.overdue_state==0">发货指令</a>
  48. </template>
  49. </Table>
  50. <Page
  51. style="text-align:center;margin-top:10px"
  52. :page-size-opts="[10, 20, 30, 40, 100]"
  53. @on-page-size-change="changeSize"
  54. @on-change="changePage"
  55. :current="pageIndex"
  56. show-total
  57. show-elevator
  58. :total="total"
  59. show-sizer
  60. :page-size="pageSize"
  61. />
  62. <Modal
  63. class-name="vertical-center-modal"
  64. width="400"
  65. title="发货指令"
  66. v-model="showStock"
  67. @on-ok="confirmOutStock"
  68. >
  69. <Form :label-width="100">
  70. <FormItem label="选择班组">
  71. <Select clearable v-model="info.user_id">
  72. <Option
  73. v-for="item of band_list"
  74. :key="item.id"
  75. :value="item.id"
  76. :label="item.nickname"
  77. ></Option>
  78. </Select>
  79. </FormItem>
  80. <FormItem label="发货日期">
  81. <DatePicker
  82. v-model="time"
  83. clearable
  84. type="daterange"
  85. placeholder="请选择日期"
  86. ></DatePicker>
  87. </FormItem>
  88. <FormItem label="点工单形式">
  89. <RadioGroup v-model="info.work_type">
  90. <Radio :label="1">是</Radio>
  91. <Radio :label="2">否</Radio>
  92. </RadioGroup>
  93. </FormItem>
  94. <FormItem label="日薪" v-if="info.work_type == 1">
  95. <Input v-model="info.user_salary">
  96. <span slot="append">元</span>
  97. </Input>
  98. </FormItem>
  99. </Form>
  100. </Modal>
  101. </div>
  102. </template>
  103. <script>
  104. export default {
  105. data(){
  106. return{
  107. searchData:{
  108. },
  109. time:[],
  110. band_list:[],
  111. outData:[],
  112. showStock:false,
  113. info: {
  114. user_id: "",
  115. work_type: 2,
  116. order_in_no: "",
  117. start_time: "",
  118. end_time: "",
  119. user_salary: "",
  120. },
  121. modalData:[
  122. {title:"选择班组:",value:'',list:[],is_select:true}
  123. // {title:"垛码:",value:'',is_select:false},
  124. ],
  125. selectData:[],
  126. total:0,
  127. pageSize:10,
  128. pageIndex:1,
  129. tableData:[{
  130. order_no:'订单',
  131. url_number:'01',
  132. assembly:'产品组件',
  133. house_number:'房号',
  134. url_img:[],
  135. }],
  136. tableColumns:[
  137. {type:'selection',align:'center',minWidth:100},
  138. {title:'订单号',key:'order_no',align:'center',minWidth:120},
  139. {title:'图号',key:'url_number',align:'center',minWidth:120},
  140. {title:'产品名称',key:'product_title',align:'center',minWidth:120},
  141. {title:'产品组件',key:'compose_name',align:'center',minWidth:120},
  142. {title:'房号',key:'house_title',align:'center',minWidth:120},
  143. {title:'包装日期',key:'',align:'center',minWidth:120},
  144. {title:'图纸',key:'url_img',align:'center',minWidth:120,slot:'img'},
  145. {title:'包装状态',align:'center',minWidth:120,key:'sub_state',render:(h,params)=>{
  146. const {row} = params;
  147. return h('span',{}, row.sub_state==2?"未包装完成":'已包装完成')
  148. }},
  149. {title:"发货状态",align:'center',minWidth:120,key:'overdue_state',render:(h,params)=>{
  150. const {row} = params;
  151. return h('span',{},row.overdue_state==0?'未下指令':'已下指令')
  152. }},
  153. {title:'操作',key:'set',align:'center',minWidth:150,slot:'set'},
  154. ],
  155. proxyData:{}
  156. }
  157. },
  158. created(){
  159. this.axios("/api/employee_list").then((res) => (this.band_list = res.data.data));
  160. //获取包装班组
  161. this.axios.post('/api/orders_in_employee',{title:'包装'}).then(res=>{
  162. this.modalData[0].list = res.data;
  163. });
  164. },
  165. mounted(){
  166. this.initData();
  167. },
  168. methods:{
  169. handleSearch(){
  170. this.proxyData = JSON.parse(JSON.stringify(this.searchData));
  171. this.pageIndex = 1;
  172. this.initData(this.proxyData)
  173. },
  174. confirmOutStock(){
  175. if (this.time) {
  176. this.info.start_time = new Date(this.time[0])
  177. .toLocaleDateString()
  178. .replace(/\//g, "-");
  179. this.info.end_time = new Date(this.time[1])
  180. .toLocaleDateString()
  181. .replace(/\//g, "-");
  182. }
  183. this.axios.post("/api/orders_out", {...this.info,...this.outData}).then((res) => {
  184. if (res.code == 200) {
  185. this.$Message.success(res.msg);
  186. this.initData(this.proxyObj);
  187. // setTimeout(()=>this.back(),500)
  188. }
  189. });
  190. },
  191. handleOut(row){
  192. this.showStock = true;
  193. this.outData = JSON.parse(JSON.stringify(row));
  194. },
  195. handleIn(row){
  196. this.confirmDelete({
  197. title: "包装完成",
  198. content: "是否确认包装完成",
  199. type: "primary",
  200. formData:this.modalData,
  201. then: () => {
  202. this.axios
  203. .post("/api/orders_in", { ...row,team_id:this.modalData[0].value})
  204. .then((res) => {
  205. if (res.code == 200) {
  206. this.modalData[0].value = '';
  207. this.$Message.success(res.msg);
  208. this.initData(this.proxyObj);
  209. }
  210. });
  211. },
  212. cancel: () => {
  213. this.$Message.warning("您取消了包装完成操作");
  214. },
  215. });
  216. },
  217. handleSelect(e){
  218. this.selectData = e;
  219. },
  220. goPage(row){
  221. this.$router.push({path:'/cms/productionorderlist/inboundform/details',query:{...this.$route.query,house_id:row.house_id,url_number:row.url_number,compose_name:row.compose_name}})
  222. },
  223. initData(obj){
  224. this.axios.post('/api/new_product_box_list',{order_no:this.$route.query.order_no,...obj,page_size:this.pageSize,page_index:this.pageIndex}).then(res=>{
  225. this.tableData = res.data.data;
  226. this.total = res.data.total;
  227. })
  228. },
  229. changeSize(e){
  230. this.pageSize = e;
  231. this.pageIndex = 1;
  232. this.initData(this.proxyData);
  233. },
  234. changePage(e){
  235. this.pageIndex = e;
  236. this.initData(this.proxyData);
  237. }
  238. }
  239. }
  240. </script>
  241. <style lang="scss" scoped>
  242. </style>